Autograd for function with multiple outputs

I want to write my own class with forward and backward functions, where forward has multiple outputs.
How can I implement it?

You can have the forward function return multiple arguments as one big tuple.