There’s no such thing as torch.CudaFloatTensor, only torch.cuda.FloatTensor.
Also, as @albanD said, you can’t return a closure from the __res_block and expect the modules inside it to be recognized as part of the model. Just create a new nn.Module subclass. You can see how ResNets are implemented in torchvision 47.