Hi, the target (or label) value shouldn’t be a variable with the feature of requires_grad = True.  The target in your codes is the part of the computation graph which make cause the requires_grad = True.  If the target value is a the part of the computation graph, you can use detach() or detach_() function to disable the relation between the target tensor and the computation graph. For example, your may need something like this:
y = l(x)
y.detach_()
loss = criterion_mse( x , y )
Good luck.