Shashank_Shekhar:


all my weights and biases tensors are in net.parameters with device (cuda:0) , but i want to convert those tensors to cpu so that i can use it for inferencing.
prediction snippet…
prediction=network_instance(test)



You should use the model’s state_dict for saving and loading. Take a look at this tutorial 9. You can send all of your network’s parameters to the cpu just by doing model = model.cpu().



 Shashank_Shekhar:


when we do optimizer.step() does it keep on updating the weights till the prediction is correct or it updates the weights for only a single backward pass.



optimizer.step() only does a single backward pass.