aihwkit.nn.functions module¶
Autograd functions for aihwkit.
-
class
aihwkit.nn.functions.
AnalogFunction
¶ Bases:
torch.autograd.function.Function
Function that delegates into a RPU unit.
-
static
backward
(ctx, grad_output)¶ Execute the backward pass in the analog tile.
- Parameters
ctx (Any) –
grad_output (torch.Tensor) –
- Return type
Tuple[Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]]
-
static
forward
(ctx, analog_tile, input_, weights, _=None)¶ Execute the forward pass in the analog tile.
- Parameters
ctx (Any) –
analog_tile (aihwkit.simulator.tiles.FloatingPointTile) –
input_ (torch.Tensor) –
weights (torch.Tensor) –
_ (Optional[torch.Tensor]) –
- Return type
torch.Tensor
-
static