Solved by tom in post #2 
              
              
                There used to be a warning about this, but torch.tensor is bad here as it’ll treat the inputs as numbers rather than connecting them through autograd (and maybe needing the requires_grad=True should have given you a hint  ). Edit: Let me emphasize, that it’s a common enough thing to get this wrong, …