Be greeted,
This seems a bug to me. If I run example code from pytorch, but move the model to the GPU before tracing I get the same problem in C++.
 model = torchvision.models.resnet18()

# An example input you would normally provide to your model's forward() method.
example = torch.rand(1, 3, 224, 224)
model.cuda()
device  = torch.device("cuda")
# Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing.
traced_script_module = torch.jit.trace(model, example.to(device))
traced_script_module.save("d:\\tmp\\model.pt")

Greetings,
Roos