aihwkit.simulator.tiles.functions module

Autograd functions for aihwkit.

class aihwkit.simulator.tiles.functions.AnalogFunction(*args, **kwargs)[source]

Bases: Function

Function for analog functions.

static backward(ctx, grad_output)[source]

Execute the backward pass in the analog tile.

Parameters:
  • ctx (Any)

  • grad_output (Tensor)

Return type:

Tuple[Tensor | None, Tensor | None, Tensor | None, Tensor | None, Tensor | None]

static forward(ctx, analog_ctx, analog_tile, input_, shared_weights=None, is_test=False)[source]

Execute the forward pass in the analog tile. Note: Indexed versions can used when analog_ctx.use_indexed is set to True.

Parameters:
  • ctx (Any)

  • analog_ctx (AnalogContext)

  • analog_tile (Any)

  • input_ (Tensor)

  • shared_weights (Tensor | None)

  • is_test (bool)

Return type:

Tensor