Hi,
The thing is that the input that you give to the gradcheck should be a Variable for which you want gradients: either a leaf Variable with requires_grad=True or call .retain_grad() in the input Variable before giving it to gradcheck so that it’s gradients are computed.