References
tensorflow와 다르게 기본 데이터 구조인 tensor가 cpu tensor(torch.Tensor)와 gput tensor(torch.cuda.Tensor)로 나뉜다.
Dynamic Computational Graph???
dynamic computational graphs are valuable for situations where you cannot determine the computation. One clear example of this are recursive computations that are based on variable data.
#============================ Save and load the model ============================#
# Save and load the entire model.
torch.save(resnet, 'model.pkl')
model = torch.load('model.pkl')
# Save and load only the model parameters(recommended).
torch.save(resnet.state_dict(), 'params.pkl')
resnet.load_state_dict(torch.load('params.pkl'))