Error when loading on another device

I am getting the following error on a torch.script.load("file.pth", "cuda"):

RuntimeError:
Unknown type name 'NoneType':
Serialized   File "code/__torch__/classification/models/multi_output/model.py", line 9
  channels_fc : int
  learning_rate : float
  scheduler : NoneType
              ~~~~~~~~ <--- HERE
  _torchscript_attributes : Dict[str, List[str]]
  features : __torch__.torch.nn.modules.container.Sequential

What does it mean? Is it looking for python code? I thought that torchscript models would not require the original python code to be run.

Could you explain your use case a bit more, i.e. how did you save the model and what is the model definition? Also, where does torch.script.load come from? Are you using torch.jit.load?