[Here[(https://github.com/pytorch/pytorch/blob/ebcacd5e878f3f8e84c941d6b9567c88f50a2f10/torch/nn/modules/module.py#L367 1) you can find the module.to() implementation, which calls convert recursively on all parameters and buffers.