Torch
About calcuration of gradient
How not to calculate gradient
Use no_grad
For example;
with torch.no_grad():
y = x*2
We can use as decorator
@torch.no_grad()
def doubler(x):
return x*2
For example;
with torch.no_grad():
y = x*2
We can use as decorator
@torch.no_grad()
def doubler(x):
return x*2