Traced a model and saved it using pytorch 1.3.1 with the following code.
class TestModule(torch.nn.Module):
    
    def forward(self, W):
        g = 2 * W
        return g

W = torch.rand(10)

test_model = torch.jit.trace(test_model, [W])
test_model.save("test_model.pt")

and loaded the model into iOS (libtorch 1.3.1) using the following code
torch::jit::script::Module testModel = torch::jit::load(filePath.UTF8String);

torch::IValue w = torch::IValue(torch::rand({10}));

testModel.forward({w});

and it gives the following error on forward
libc++abi.dylib: terminating with uncaught exception of type c10::Error: false CHECK FAILED at /Users/distiller/project/c10/core/Backend.h (tensorTypeIdToBackend at /Users/distiller/project/c10/core/Backend.h:106)