Solved by ptrblck in post #2 
              
              
                The warning points to wrapping a tensor in torch.tensor, which is not recommended. 
Instead of torch.tensor(outputs) use outputs.clone().detach() or the same with .requires_grad_(True), if necessary.