analogvnn.backward.BackwardIdentity#

Module Contents#

Classes#

BackwardIdentity

The backward module that returns the output gradients as the input gradients.

class analogvnn.backward.BackwardIdentity.BackwardIdentity(layer: torch.nn.Module = None)[source]#

Bases: analogvnn.backward.BackwardModule.BackwardModule, abc.ABC

The backward module that returns the output gradients as the input gradients.

backward(*grad_output: torch.Tensor, **grad_output_kwarg: torch.Tensor) analogvnn.utils.common_types.TENSORS[source]#

Returns the output gradients as the input gradients.

Parameters:
  • *grad_output (Tensor) – The gradients of the output of the layer.

  • **grad_output_kwarg (Tensor) – The gradients of the output of the layer.

Returns:

The gradients of the input of the layer.

Return type:

TENSORS