hi
i want to use vector loss. i.e output of loss function is be a vector as follow:
def my_loss(y_pred, y_val):
    return (y_pred - y_val)**2

but in train step i (loss.backward()) I got this error:
grad can be implicitly created only for scalar outputs
that mean output of loss function can not be vector!!!
Is there a solution to this problem?
i want loss be a vector