I convert fastai to torchscript then run same converted model on both Android and PC(Macbook).
Result is different.
Code convert:
import torch
example = torch.rand(1, 3, 64, 64)
traced_script_module = torch.jit.trace(torch_model, example)
traced_script_module.save("model.pt")

Run on PC:
img = cv2.imread('aaanx_7.jpg')
img = img/255.0
img = np.moveaxis(img, -1, 0)
img = np.array(np.expand_dims(img, axis=0))
traced_script_module.forward(torch.from_numpy(img).float())

Run on Android:
bitmap = BitmapFactory.decodeStream(getAssets().open("aaanx_7.jpg"));
Tensor inputTensor = TensorImageUtils.bitmapToFloat32Tensor(bitmap,
              new float[]{0.0f, 0.0f, 0.0f}, new float[]{1.0f, 1.0f, 1.0f});
Tensor outputTensor = module.forward(IValue.from(inputTensor)).toTensor();

Tensor output is different.
Please help me understand that.
Thanks