Hi, I need to calculate backward derivative of output tensor with respect to a batch of input tensor.
Here is the details:
Input shape is 64x1x28x28 (batch of mnist images) output shape is 64x1.Output is calculated based on some logic using the outputs of feedforward operation.
So actually, for each image of shape 1x1x28x28,I have a scalar value in output.
I can do it when using only one image tensor but batch operations are more efficient to handle and faster so I need to implement it.
The point is backward derivative of each element’s in the output should correspond to the related image tensor in the input tensor.
I know that backward operation is done based ona scalar value. So when I apply backward method on output tensor , I got error. And, I couldn’t handle this in Pytorch.
Can you please help me on this?
BR,
jarvico