Solved by JuanFMontesinos in post #2 
              
              
                It asks for a sequence of tensors, not for a tensor. 
autograd.backward(tensors=[ys.sum()], inputs=[xt], create_graph=True)

The system is probably iterating over the tensor and the exception is not handled.