Currently I’m using the workaround where I once again load the TorchScript into Python, but map it onto the cpu, then save it. The new model can successfully be used in C++
import torch

# load TorchScript model on cpu
torchmodel = torch.jit.load("path/to/model.pt", map_location='cpu')

# save, but with no CUDA code
torch.jit.save(torchmodel, "path/to/model_cpu.pt")

Still I would like to avoid this workaround if possible.