Thanks for reply, I wonder if I use torch.autograd.backward(pool1_output, grad_tensors=pool1_gradient) , gradients of all layers w.r.t the input can be computed or just the gradient of pool1 is computed?