# Different output between server and android after using static quantization fx

**URL:** <https://discuss.pytorch.org/t/different-output-between-server-and-android-after-using-static-quantization-fx/174328>\
**Category:** quantization\
**Created:** [March 8, 2023, 7:29am UTC](https://discuss.pytorch.org/t/different-output-between-server-and-android-after-using-static-quantization-fx/174328 "2023-03-08T07:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BillyGun27](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/billygun27/32/57799_2.png) [@BillyGun27](https://discuss.pytorch.org/u/BillyGun27)\
**Post date:** [March 8, 2023, 7:29am UTC](https://discuss.pytorch.org/t/different-output-between-server-and-android-after-using-static-quantization-fx/174328/1 "2023-03-08T07:29:50Z")

</div>

I tried static quantization on deeplabv3 image segmentation model

> **[PyTorch](https://pytorch.org/hub/pytorch_vision_deeplabv3_resnet101/)**
>
> An open source machine learning framework that accelerates the path from research prototyping to production deployment.

> **[android-demo-app/ImageSegmentation at master · pytorch/android-demo-app](https://github.com/pytorch/android-demo-app/tree/master/ImageSegmentation)**
>
> master/ImageSegmentation

the quantization that I use refer to this method  
[https://pytorch.org/tutorials/prototype/fx\_graph\_mode\_ptq\_static.html](https://pytorch.org/tutorials/prototype/fx_graph_mode_ptq_static.html)

the output is similar to before quantization when performed on server, but on android it is defferent.

Does any one idea what cause this?

---

<div class="post-metadata">

**Author:** ![BillyGun27](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/billygun27/32/57799_2.png) [@BillyGun27](https://discuss.pytorch.org/u/BillyGun27)\
**Post date:** [March 13, 2023, 9:22am UTC](https://discuss.pytorch.org/t/different-output-between-server-and-android-after-using-static-quantization-fx/174328/2 "2023-03-13T09:22:48Z")

</div>

After further checking, the output is actually the same, but since in android the output is only one dimension, the order is incorrect and output need to be transposed first to get the correct dimension shape as before quantized.

what make me curious now why the order change? and can it be prevented?
