Hi, @ptrblck here x is a 2d tensor, say 1000*1 dim. I think we can only backward from a 1x1 tensor right?
My use case looks somewhat like
input = cv2.imread()
fc = nn.Linear()
x = fc(input)

Then the package calculates x’s grad for me.  But I wish to optimize the parameters of the fc layer as well. I can currently think of something like
loss = x*x.grad
loss = loss.sum()
loss.backward()

But I’m not sure this is the correct way.