Hello,
I noticed that a custom Function can be built in two different ways:
(1)
class Test(torch.autograd.Function):
    def __init__(self):
        super(Test,self).__init__()

    def forward(self, x1, x2):
        self.state = state(x1)
        return torch.arange(8)

    def backward(self, grad_out):
        grad_input = grad_out.clone()
        return torch.arange(10,18),torch.arange(20,28)

# then use function = Test()

or
(2)
class Test(torch.autograd.Function):
    @staticmethod
    def forward(ctx, x1, x2):
        ctx.state = state(x1)
        return torch.arange(8)

    @staticmethod
    def backward(ctx, grad_out):
        grad_input = grad_out.clone()
        return torch.arange(10,18),torch.arange(20,28)

# then use function = Test.apply

The second option is the only to be referred in the official documentation, but it can be burdensome because if there are options as to how the function should be implemented, they must be initialized globally.
I prefer option (1) since I can save an intermediate variable (state) by myself and also initialize the function with some options, but it is not present in the official documentation
Am I safe in using option (1)?