Oh indeed, that’s different.
In that case, the example proposed in the doc works for a single Tensor (with several values), but may not work if you have multiple tensors with different dimensions.
But it’s a matter of how you design your function. If you want a function that outputs different things, you can create one function for each output, and one backward method for each of them. Then, you combine all the ‘sub-functions’ together in a Module:
class Function_1(Function):
    def forward(self, input):
        #...

    def backward(self, grad_output):
        #...

class Function_2(Function):
     def forward(self, input):
         #...

     def backward(self, grad_ouput):
         #...

class Module_12(nn.Module):
     def __init__(self):
     #...
     
     def forward(self, input):
         output1 = Function_1(input)
         output2 = Function_2(input)
         return output1, output2