Pytorch1.8中报错:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
将:
ctx.save_for_backward(input, offset, mask, weight, bias)
修改为:
ctx.save_for_backward(input.clone(), offset.clone(), mask.clone(), weight.clone(), bias.clone())