Hi, I have a question,
class MyFunc(torch.autograd.Function):
    @staticmethod
    def forward(ctx, input):
        # return input.detach()
        return torch.tensor([1.0], requires_grad=False)

    @staticmethod
    def backward(ctx, grad_input):
        return grad_input

input = torch.tensor([2.], requires_grad=True)
output = MyFunc.apply(input)

print(output.requires_grad)  # True

I don’t understand why output.requires_grad is True while the result of  forward  is False
I am new to pytorch and hope I don’t bother you.
Thanks