# Compute finite difference gradient of input variable

**URL:** <https://discuss.pytorch.org/t/compute-finite-difference-gradient-of-input-variable/16272>\
**Category:** autograd\
**Created:** [April 11, 2018, 3:32pm UTC](https://discuss.pytorch.org/t/compute-finite-difference-gradient-of-input-variable/16272 "2018-04-11T15:32:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Ruhe](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/david_ruhe/32/16334_2.png) [@David\_Ruhe](https://discuss.pytorch.org/u/David_Ruhe)\
**Post date:** [April 11, 2018, 3:32pm UTC](https://discuss.pytorch.org/t/compute-finite-difference-gradient-of-input-variable/16272/1 "2018-04-11T15:32:33Z")

</div>

For the implementation of a paper I need a finite differences approximation of the real gradient with respect to the input variable.

I’ve been trying to use the gradcheck.py ‘get\_numerical\_jacobian’ function but I think it is not possible to make it compute the gradient of a single Variable, is it?

What would be a good approach to do this?

Many thanks,  
David
