Rate this Page

torch.autograd.gradcheck.get_numerical_jacobian#

torch.autograd.gradcheck.get_numerical_jacobian(fn, inputs, target=None, eps=0.001, grad_out=1.0)[source]#

Compute the numerical Jacobian for a given fn and its inputs.

This is a Deprecated API.

Parameters:
  • fn – the function to compute the Jacobian for (must take inputs as a tuple)

  • inputs – input to fn

  • target – the Tensors wrt whom Jacobians are calculated (default=`input`)

  • eps – the magnitude of the perturbation during finite differencing (default=`1e-3`)

  • grad_out – defaults to 1.0.

Returns:

A list of Jacobians of fn (restricted to its first output) with respect to each input or target, if provided.

Note that target may not even be part of input to fn, so please be very careful in this to not clone target.