Hi,
I might not explain my problem clearly. So please let me state again:
You may assume that I take a batch of mnist image as input x (64x1x28x28) and again you may assume that my model outputs a tensor (Out) of shape 64 x 1 which contains 64 scalar value that is obtained from each 1x28x28 image.
So what I need to implement is for example compute the backward derivative first output of my model with respect to first input in the batch. Ofcourse this is valid for each element in the batch.
And I would expect to get a tensor (Batch_Backward) of shape (64x1x28x28) after this batch backward derivative operation.  The important thing here Batch_Backward[0] should be calculated based on the backward derivative Out[0] which is actually the output for X[0].