allennlp.common.checks

Functions and exceptions for checking that AllenNLP and its models are configured correctly.

exception allennlp.common.checks.ConfigurationError(message)[source]

Bases: Exception

The exception raised by any AllenNLP object when it’s misconfigured (e.g. missing properties, invalid properties, unknown properties).

exception allennlp.common.checks.ExperimentalFeatureWarning[source]

Bases: RuntimeWarning

A warning that you are using an experimental feature that may change or be deleted.

allennlp.common.checks.check_dimensions_match(dimension_1: int, dimension_2: int, dim_1_name: str, dim_2_name: str) → None[source]
allennlp.common.checks.check_for_gpu(device_id: Union[int, list])[source]
allennlp.common.checks.check_for_java() → bool[source]
allennlp.common.checks.log_pytorch_version_info()[source]
allennlp.common.checks.parse_cuda_device(cuda_device: Union[str, int, List[int]]) → Union[int, List[int]][source]

Disambiguates single GPU and multiple GPU settings for cuda_device param.