Here’s the source code for nn.Module.cuda():
http://pytorch.org/docs/_modules/torch/nn/modules/module.html#Module.cuda 209
In short, it iterates all the sub-modules and nn.Parameters, and calls the .cuda() method recursively.
To make .cuda() work correctly, you should declare the variable in your Module like that:
self.weight = Parameter(torch.Tensor(out_features, in_features))

Ref:
http://pytorch.org/docs/nn.html?highlight=linear#parameters 93