(self, trigger)
Normal forward pass, synthetic backward pass.

        Convenience method combining `backward` and `make_trigger`. Can be
        used when we want to backpropagate synthetic gradients from and
        intercept real gradients at the same `Variable`, for example for
        update decoupling feed-forward networks.

        Backpropagates synthetic gradient from `trigger` and returns a copy of
        `trigger` with a synthetic gradient update operation attached.

        Works only in `training` mode, otherwise just returns the input
        `trigger`.

        Args:
            trigger: `trigger` to backpropagate synthetic gradient from and
                intercept real gradient at.

        Returns:
            A copy of `trigger` with a synthetic gradient update operation
            attached.
Normal forward pass, synthetic backward pass.
Normal forward pass synthetic backward pass .
def forward(self, trigger):
        """Normal forward pass, synthetic backward pass.

        Convenience method combining `backward` and `make_trigger`. Can be
        used when we want to backpropagate synthetic gradients from and
        intercept real gradients at the same `Variable`, for example for
        update decoupling feed-forward networks.

        Backpropagates synthetic gradient from `trigger` and returns a copy of
        `trigger` with a synthetic gradient update operation attached.

        Works only in `training` mode, otherwise just returns the input
        `trigger`.

        Args:
            trigger: `trigger` to backpropagate synthetic gradient from and
                intercept real gradient at.

        Returns:
            A copy of `trigger` with a synthetic gradient update operation
            attached.
        """
        if self.training:
            self.backward(trigger)
            return self.make_trigger(trigger.detach())
        else:
            return trigger
def forward ( self , trigger ) : if self . training : self . backward ( trigger ) return self . make_trigger ( trigger . detach ( ) ) else : return trigger