I’m wondering if the following could be problematic…
for(auto& sample : batch) {
    . . .
    output = classifier->forward(sample.data);
    loss = torch::mse_loss(output, sample.data.detach());
    . . .				

input and target for the network are the same tensor. So if I detach sample.data do I also implicitly detach output? Or does this in some other way mess up gradients / learning?
Edit: Sorry, forget this. The example prog does just the same and is working…