Relative Content

Tag Archive for pythondeep-learningpytorchneural-networkautograd

PyTorch Gradient Computation Fails When Not Using Entire Input Tensor

I have a model that takes an input tensor , along with other inputs k and D. The model outputs several tensors, including cs_hat. When I compute gradients of cs_hat with respect to the first slice of inputs (inputs[:,:,0]), the gradient computation only succeeds if I compute it with respect to the entire tensor inputs instead of just the slice.