pytorch/android/pytorch_android
Linbin Yu 91ef3c8261 add model test for Android
This pr

moved some model generation scripts to a central place (mobile net v2, android test model)
updated scripts so these models can run on Android (Java doesn't support certain scalar types as return value)
updated model generation script to take arguments (generate models for android/ios, checked-in model or on-the-fly model)
add Android instrumentation tests for these new models
After this change, the Android instrumentation test will run 35 models which covered 91% of production ops. The coverage information can be found in this file: https://github.com/pytorch/pytorch/blob/master/test/mobile/model_test/coverage.yaml

Note that these models are checked-in for back compatibility check (to ensure they can run with newer pytorch versions).

The script generates models for mobile test. For each model we have a "checked-in" version
and an "on-the-fly" version. The "on-the-fly" version will be generated during test, and
should not be committed to the repo. The "checked-in" version is used for back compatibility check.

Note that Android only support checked-in model right now. iOS can test both (in another pr).

use 'gen_test_model.py android-test' to generate on the fly models for android
use 'gen_test_model.py ios-test' to generate on the fly models for ios
use 'python gen_test_model.py android' to generate checked-in models for android
use 'python gen_test_model.py ios' to generate on-the-fly models for ios
use 'gen_test_model.py <model_name_no_suffix>' to update the given checked-in model

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74793
Approved by: https://github.com/kit1980
2022-03-29 04:46:14 +00:00
..
host improve android instrumentation test and update README 2022-02-22 08:05:33 +00:00
src add model test for Android 2022-03-29 04:46:14 +00:00
build.gradle improve android instrumentation test and update README 2022-02-22 08:05:33 +00:00
CMakeLists.txt [Pytorch] Build lite interpreter as default for Android 2021-05-17 14:12:48 -07:00
generate_test_asset.cpp [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746) 2021-11-03 12:23:14 -07:00
gradle.properties [android] Lite interpreter naming for android nightly publishing (#68651) 2021-11-19 10:56:13 -08:00
test_asset.jit Clean up some type annotations in android (#49944) 2021-01-07 15:42:55 -08:00