Solved by albanD in post #2 
              
              
                Hi, 
The problem here is that your function takes a single Tensor as input. The autograd works with Tensors as a unit and so it does not recognize X[:,0] as being a subset of X, but as a different Tensor. So for him, this new Tensor was not used during the backward. 
You will have to either give eac…