I got this warning:
volatile was removed and now has no effect. Usewith torch.no_grad():instead. inputs = Variable(inputs, volatile=True)
So I started to investigate :torch.no_grad(), and I have 2 small question about her:
1.In the validation file I had those lines:

inputs = Variable(inputs, volatile=True)
targets = Variable(targets, volatile=True)

Now with the new command it’s should be like this(???):

with torch.no_grad():
inputs = Variable(inputs,&#32) #Idont know why the indent is not showing 
targets = Variable(targets,&#32)





let’s say I have a resnet and then a lstm,  my resnet is alredy trained, and I want to train only the lstm, can I use this command? like this?
maybe other ways to freeze some part from training?
Declaring

self.cnn = resnet.resnet50()
self.lstm = lstm()

Calling

with torch.no_grad():
    x = self.cnn(x)


x=self.lstm(x)

Thanks a lot!