aihwkit.simulator.tiles.array module

Implements analog tile module array .

class aihwkit.simulator.tiles.array.TileModuleArray(out_size, in_size, rpu_config, bias=False, **kwargs)[source]

Bases: Module, TileModuleBase

Logical array of tile modules.

Note

The bias in the RPUConfig does not have any effect since the bias is always concatenated for the logical array and added at the end in digital

Parameters:
  • out_size (int) –

  • in_size (int) –

  • rpu_config (MappableRPU) –

  • bias (bool) –

  • kwargs (Any) –

forward(x_input, tensor_view=None)[source]

Compute the forward pass.

Parameters:
  • x_input (Tensor) –

  • tensor_view (Tuple | None) –

Return type:

Tensor

get_split_sizes(size, split_max_size)[source]

Computed the split sizes.

Parameters:
  • size (int) – number of elements of the layer in one dimension

  • split_max_size (int) – max size of the split

Returns:

List of split sizes

Return type:

List[int]

get_weights(**kwargs)[source]

Get the (combined) weight (and bias) tensors from the analog crossbar(s).

Parameters:

kwargs (Any) – see tile level, e.g. get_weights()

Returns:

weight matrix, bias vector

Return type:

tuple

set_weights(weight, bias=None, **kwargs)[source]

Set the weight (and bias) values with given tensors to the analog crossbar(s).

Parameters:
  • weight (Tensor) – weight matrix

  • bias (Tensor | None) – bias vector

  • **kwargs (Any) – see tile level, e.g. set_weights()

Return type:

None

supports_indexed = False