I’m glad you figured it out by yourself @lui.bonati.
So backward default settings is for a single value tensor.
c.backward() == c.backward(torch.ones(1))

If you want to apply it to a vector you might want to pass a parameter in your backward function.
Let’s say x is a tensor correctly setup and with the data you want to use.
ones = torch.ones_like(x)  # create a tensor full of one with the shape of x
x.backward(ones)

The ones vector is actually the variable w.r.t you differentiate. So it can be anything else than this.