How to get the device of a torch::jit::script::Module?

I want to know if to(at::kCUDA) has been called on the module

script::Modules don’t track their device since the device only affects the Tensor parameters stored in the module. The only way to check the device would be to check one of the Tensor parameters on the module and view its device.

We definitely need to have a more accessible documentation page, but you can see the definition of script::Module here for a complete list of its methods.