what is the scope of with torch.no_grad:
in function1() I need to set [with torch.no_grad] again or it is not needed because calling function1 is in with torch.no_grad scope
… some code…
with torch.no_grad():
%%%%%%… some code…
%%%%%%self.function1() # disable gradient
%%%%%%… some code…
… some code …
self.function1() # gradient calculation done
… some code …
def function1(self):
… some code …