Yeak I chesked, gradient returns None, and I don’t know how to make it returning value.
gradient function is defined with:
torch.autograd.grad (outputs , inputs , grad_outputs=None , retain_graph=None , create_graph=False , only_inputs=True ):