onnx_diagnostic.helpers.config_helper

onnx_diagnostic.helpers.config_helper.check_hasattr(config: Any, *args: str | Tuple[Any, ...])[source][source]

Checks the confiugation has all the attributes in args. Raises an exception otherwise.

onnx_diagnostic.helpers.config_helper.config_class_from_architecture(arch: str, exc: bool = False) type | None[source][source]

Retrieves the configuration class for a given architecture.

Parameters:
  • arch – architecture (clas name)

  • exc – raise an exception if not found

Returns:

type

onnx_diagnostic.helpers.config_helper.pick(config, name: str, default_value: Any) Any[source][source]

Returns the value of a attribute if config has it otherwise the default value.

onnx_diagnostic.helpers.config_helper.update_config(config: Any, mkwargs: Dict[str, Any])[source][source]

Updates a configuration with different values.