Then I am a bit confused as to what grad actually does.
My problem is this: I want to update the weights of the network manually, using a part of the loss function derived in respect to the weights itself.
Now I am confused what it uses as a loss function to do backpropagation, when using grad. Probably just the output function?