thanks for reply.
I dont understand how to use tensor instead of Variable ? how to define ( requires_grad=True) for input?
I have another question, when I want gradient with respect to input and not change W and B, do I set param.requires_grad = False or True.
(for param in model.parameters():
param.requires_grad = False )
when I update w and b is true, but I dont know here.