Pytorch during training, when the input data tensor, and the model needs to .cuda, but in doing loss function when you do not need to Loss Function is set to form a cuda, because the loss of data has been sent to the type of cuda the loss will be calculated directly in it.
pytorch training model training with gpu loss function does not need to migrate to the gpu
Guess you like
Origin blog.csdn.net/t20134297/article/details/104937971
Recommended
Ranking