Previous code:
return n_vals
I added one line:
n_vals[:,1,:] = n_vals[:,1,:] * torch.tensor(2)
And now get:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
I don’t understand this error because the line I added is not in place.
Another potential cause of the error is because I am preloading the model’s weights from disk and changing the model (with the above line) after preloading the weights. Still, doesnt seem like it should cause this error…