Some code is as follows:
#loss_l1 = criterionL1(output, gt)
loss_l1 = 0
#with torch.no_grad():
H_gt = gt
H_gt = get_H(gt, H_gt)
H_output =  output
H_output = get_H(output, H_output)
H_loss_l1 = criterionL1(H_output, H_gt)
if i use loss_l1 = criterionL1(output, gt),  the error is:   one of the variables needed for gradient computation has been modified by an inplace operation…
but i just set  loss_l1 = 0, it is ok.
why could it be so, what is the problem?