TensorPlay
API symbolsautograd
Copy
View MarkdownDownload .md

tensorplay.autograd.gradcheck.get_numerical_jacobian

tensorplay.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.

Warning

get_numerical_jacobian was part of PyTorch’s private API and is kept only for backward compatibility.

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.

Ask DeepWiki