What does the requires_grad_(False) do

If I don’t set requires_grad_(False)

#STEP 1 initizle parameters
def init_params(size, variance=1.0): return (torch.randn(size)*variance).requires_grad_(False)

I get the following error when I leave


anyone could shed some light on this?

It’s a pytortch error message. This is nice post about it: Understanding the Error:- A leaf Variable that requires grad is being used in an in-place operation. | by Mrityu | Medium