:rtype: `np.ndarray`
// Convert the inputs to Tensors
x = torch.from_numpy(inputs)
x.requires_grad = True
// Compute the gradient and return
// Run prediction
preds = self._forward_at(x, self._logit_layer)
if not logits:
preds = torch.nn.Softmax()(preds)
// Compute the gradient
grds = []
self._model.zero_grad()
for i in range(self.nb_classes):
x.grad.data.zero_()
torch.autograd.backward(preds[:, i], torch.FloatTensor([1] * len(preds[:, 0])), retain_graph=True)
grds.append(x.grad.numpy().copy())
grds = np.swapaxes(np.array(grds), 0, 1)