pytorch
1ecfa1d6 - Load zip file in deploy interpreter (#71072)

Commit
3 years ago
Load zip file in deploy interpreter (#71072) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71072 This PR replaces the old logic of loading frozen torch through cpython by directly loading zipped torch modules directly onto deploy interpreter. We use elf file to load the zip file as its' section and load it back in the interpreter executable. Then, we directly insert the zip file into sys.path of the each initialized interpreter. Python has implicit ZipImporter module that can load modules from zip file as long as they are inside sys.path. Test Plan: buck test //caffe2/torch/csrc/deploy:test_deploy Reviewed By: shunting314 Differential Revision: D32442552 fbshipit-source-id: 627f0e91e40e72217f3ceac79002e1d8308735d5
Parents
Loading