Actually you’re supposed to always give it. It’s just that when the tensor contains a single element, it is natural to give a gradient of 1 for it as the backward will then give you gradients.
If your tensor contains more than one element, then it will fail asking you for the gradient (see the doc 12).