How to get gradients with respect to the inputs in pytorch

NoSuchKey