pytorch
7f056e99 - [fbcode] Make model reader utilities.

Commit
4 years ago
[fbcode] Make model reader utilities. Summary: For some of the end to end flow projects, we will need the capabilities to read module information during model validation or model publishing. Creating this model_reader.py for utilities for model content reading, this diff we included the following functionalities: 1. read the model bytecode version; 2. check if a model is lite PyTorch script module; 3. check if a model is PyTorch script module. Test Plan: ``` [xcheng16@devvm1099]/data/users/xcheng16/fbsource/fbcode% buck test pytorch_mobile/utils/tests:mobile_model_reader_tests Processing filesystem changes: finished in 1.5 sec Parsing buck files: finished in 1.6 sec Building: finished in 4.9 sec (100%) 9249/43504 jobs, 2 updated Total time: 6.5 sec More details at https://www.internalfb.com/intern/buck/build/6d0e2c23-d86d-4248-811f-31cb1aa7eab3 Tpx test run coordinator for Facebook. See https://fburl.com/tpx for details. Running with tpx session id: 2ffccd62-ece5-44b5-8350-3a292243fad9 Trace available for this run at /tmp/tpx-20201030-122220.664763/trace.log Started reporting to test run: https://our.intern.facebook.com/intern/testinfra/testrun/3940649711969390 ✓ ListingSuccess: pytorch_mobile/utils/tests:mobile_model_reader_tests - main (10.234) ✓ Pass: pytorch_mobile/utils/tests:mobile_model_reader_tests - test_is_pytorch_lite_module (pytorch_mobile.utils.tests.test_model_reader.TestModelLoader) (7.039) ✓ Pass: pytorch_mobile/utils/tests:mobile_model_reader_tests - test_is_pytorch_script_module (pytorch_mobile.utils.tests.test_model_reader.TestModelLoader) (7.205) ✓ Pass: pytorch_mobile/utils/tests:mobile_model_reader_tests - test_read_module_bytecode_version (pytorch_mobile.utils.tests.test_model_reader.TestModelLoader) (7.223) Summary Pass: 3 ListingSuccess: 1 Finished test run: https://our.intern.facebook.com/intern/testinfra/testrun/3940649711969390 Reviewed By: husthyc Differential Revision: D24655999 fbshipit-source-id: 5095ca158d89231fb17285d445548f91ddb89bab
Author
Parents
Loading