def backward(self, gradient, image=None, strict=True):
assert self.has_gradient()<EOL>assert gradient.ndim == <NUM_LIT:1><EOL>if image is None:<EOL><INDENT>image = self.__original_image<EOL><DEDENT>assert not strict or self.in_bounds(image)<EOL>self._total_gradient_calls += <NUM_LIT:1><EOL>gradient = self.__model.backward(gradient, image)<EOL>assert gradient.shape == image.shape<EOL>return gradient<EOL>
Interface to model.backward for attacks.

        Parameters
        ----------
        gradient : `numpy.ndarray`
            Gradient of some loss w.r.t. the logits.
        image : `numpy.ndarray`
            Single input with shape as expected by the model
            (without the batch dimension).

        Returns
        -------
        gradient : `numpy.ndarray`
            The gradient w.r.t the image.

        See Also
        --------
        :meth:`gradient`