I have this autograd function.
class raw(autograd.Function):
    @staticmethod
    def forward(ctx, inp):
        ctx.a = inp * inp + 1
        print(inp.requires_grad, ctx.a.requires_grad)
        return inp * ctx.a.pow(-0.5)

    @staticmethod
    def backward(ctx, grad_output):
        return grad_output * ctx.a.pow(-1.5)

when I ran this function like raw.apply(tc.randn(1, requires_grad=True)), the output is True False. In this case, ctx.a does not require grad. But don’t tensors that require grad produce tensors that also requires grad? For example
>>> a=tc.randn(1,requires_grad=True)
>>> b=a*a+1
>>> b.requires_grad
True

I’m quite confused about what is happening during the process of calling raw.apply(I don’t know where to find the implementation of .apply either).
Can someone explain this process to me?
Thank u very much.