Assuming you use new style Function (your backward functions is defined with @staticmethod), then there are two cases:

If you use the @oncedifferentiable (not sure if that is the exact naming, there is possibly an _ in it) decorator, you will get grad_output as a Tensor as the backward cannot be differentiated anyway.
If you don’t use this decorator, then you will get a Variable and you need to make sure that your backward is building a proper graph in case you will backpropagate through your backward pass. (If you don’t need the double backward feature, just add the above-mentionned decorator to just work with Tensors).