I am testing a project.
There is a function
def tensor2var(self,tensor,volatile=False):
Some code…
var=torch.autograd.Variable(tensor,volatile=volatile)
When I run this I get warning
Volatile is depricated.use with torch.no_grad():
Can u please elaborate how to use torch.no_grad(): here in this function.