aihwkit.simulator.parameters.helpers module

Utilities for resistive processing units configurations.

aihwkit.simulator.parameters.helpers.get_bindings_class(params, data_type)[source]

Return the data class from the param binding fields.

Parameters:
  • params (Any) – parameter dataclass

  • data_type (RPUDataType) – RPUDataType to use

Returns:

the C++ binding class

Raises:

ConfigError – if the class is not found

Return type:

Type | None

aihwkit.simulator.parameters.helpers.parameters_to_bindings(params, data_type, check_fields=True)[source]

Convert a dataclass parameter into a bindings class.

Parameters:
  • params (Any) – parameter dataclass

  • data_type (RPUDataType) – RPUDataType to use

  • check_fields (bool) – whether to check for the correct attributes

Returns:

the C++ bindings

Raises:

ConfigError – if the field type mismatches (int to float conversion is ignored)

Return type:

Any

aihwkit.simulator.parameters.helpers.tile_parameters_to_bindings(params, data_type)[source]

Convert a tile dataclass parameter into a bindings class.

Ignores fields that do not have metadata with bindings_include key.

Parameters:
  • params (Any) – parameter dataclass

  • data_type (RPUDataType) – RPUDataType to use

Returns:

the C++ bindings

Return type:

Any