code: def jacobian(model, x, output_class):
      """
      Compute the output_class'th row of a Jacobian matrix. In other words,
      compute the gradient wrt to the output_class.
  
      :param model: forward pass function.
      :param x: input tensor.
      :param output_class: the output class we want to compute the gradients.
      :return: output_class'th row of the Jacobian matrix wrt x.
      """
      xvar = replicate_input_withgrad(x)
      scores = model(xvar)
  
      # compute gradients for the class output_class wrt the input x
      # using backpropagation
      torch.sum(scores[:, output_class]).backward()
  
      return xvar.grad.detach().clone()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 23 for calling a global function with example usage: jacobian(model, x, output_class) and returns: xvar