Dynamic parameter declaration in forward function

In this way, model.cuda() which is usually called before forward() might not work properly. if one more if_else is added to check use_cuda, the code can be unnecessarily long.

3 Likes