sad_robot:

but wouldn’t that just be a tensor of all ones?


In the default use case, yes. If your loss is a scalar value, you don’t need to pass the gradient and it will be set to 1 by default.
However, if your loss is a tensor with more than a single value, you have to pass the gradient manually. If you want to use 1s, you could just use loss.backward(torch.ones_like(loss)).