Thanks for the line of code!
The .module attribute is added, when you wrap your model into e.g. nn.DataParallel as seen in this line of code 14.
However, based on the condition it seems this line will only be called, if you are using the GPU (or rather if opt_.cuda is True).
Is this the case or are you using the CPU?
In the latter case, just remove the .module attribute and use dtype = model.opt.dataset_name directly.