hi, when inherit autograd.Function to define an op e.g.
class MyFunc(autograd.Function):
    @staticmethod
    def forward(ctx, x):
        ctx.save_for_backward(x)
        some_inplace_operation1(x)
        return x
   @staticmethod
    @once_differentiable
    def backward(ctx, dy):
        some_inplace_operation2(dy)
        return dy

in some cases, there will be total error gradient (depend on the followed op). What’s the reason? A concrete example is here 9.