analogvnn.nn.Linear
#
Module Contents#
Classes#
The backpropagation module of a linear layer. |
|
A linear layer. |
- class analogvnn.nn.Linear.LinearBackpropagation(layer: torch.nn.Module = None)[source]#
Bases:
analogvnn.backward.BackwardModule.BackwardModule
The backpropagation module of a linear layer.
- forward(x: torch.Tensor)[source]#
Forward pass of the linear layer.
- Parameters:
x (Tensor) – The input of the linear layer.
- Returns:
The output of the linear layer.
- Return type:
Tensor
- backward(grad_output: Optional[torch.Tensor]) Optional[torch.Tensor] [source]#
Backward pass of the linear layer.
- Parameters:
grad_output (Optional[Tensor]) – The gradient of the output.
- Returns:
The gradient of the input.
- Return type:
Optional[Tensor]