Doubts in Charecter level RNN tutorial

Hi I am going through PyTorch tutorial at

Inside the train() function the network parameters are updated with gradients using the below line.,

the add function I saw in the source code accepts only one argument. How does the function accepts 2 arguments and multiplies the learning rate with gradients and add that to the tensor data.

1 Like

See the second signature of torch.add (there are two):

it does: y = y + alpha * x

1 Like