I am kind of new to PyTorch and training on GPU. When I define a model (a network) myself, I can move all tensor I define in the model to cuda using xx.to(device). However, if I want to use the model defined by others, for example, cloning from others’ github repo, I cannot modify the model.
In this case, if I just move the network to cuda, it won’t work. I wonder how I can move all tesnors they define in the model to cuda?