Hi,
I am updating one of my older PyTorch scripts and I have a generative model with a noise input and my previous implementation was like this:
noise = Variable(noise, volatile=True) # total freeze netG
y = Variable(netG(noise).data)
f_enc_Y_D, f_dec_Y_D = netD(y)
So, with the new torch.no_grad(), which one below is the correct implementation?
with torch.no_grad():
noise = Variable(noise)
y = Variable(netG(noise))
f_enc_Y_D, f_dec_Y_D = netD(y)
or
with torch.no_grad():
noise = Variable(noise)
y = Variable(netG(noise))
f_enc_Y_D, f_dec_Y_D = netD(y)
Or both result in the same graph?
Thanks!!!