@ptrblck
Thank you for your reply.
However, unfortunately, outputs are different. I tried with below three environments.

Colab
Android Emulator (Pixel XL API 30)
Actual Android Device (Samsung Galaxy S8)



Colab

// colab code snippet for testing
model = torch.jit.load(MYPATH, map_location='cpu')
model.eval()
one = torch.ones([1,3,224,224])
model(one)

// output of colab
tensor([[ 2.7785,  1.4376, -0.8041, -1.5155, -0.8308]])



Android Emulator & Actual Device

// android code snippet for testing
mModule = Module.load(MYPATH);

...

// Initialize input to one
for(int i=0;i<3*224*224;i++){
    mInputTensorBuffer.put(i,1);
}

// Get output
final Tensor outputTensor = mModule.forward(IValue.from(mInputTensor)).toTensor();
final float[] scores = outputTensor.getDataAsFloatArray();
Log.d("DEBUG", Arrays.toString(scores));


// Output of Emulator
2020-11-29 12:56:51.328 3030-3030/org.pytorch.demo D/DEBUG: [2.778521, 1.4375764, -0.80405545, -1.5155371, -0.83080786]

// Output of Actual Device
2020-11-29 12:58:08.625 725-725/org.pytorch.demo D/DEBUG: [1.224158, -0.65208256, -0.3742584, -0.123134516, -0.085230656]


Emulator’s output is same with colab’s one, but android’s output is not.
I could not figure out why this happened…
I tried with very latest release of pytorch & pytorch-android.