pytorch
755c60bf - [PyTorch Mobile] Allow loading of all extra files using the extra_file argument (#52635)

Commit
3 years ago
[PyTorch Mobile] Allow loading of all extra files using the extra_file argument (#52635) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/52635 Currently, the method `_load_for_mobile()` accepts an extra files map named `extra_files` which serves as an in-out parameter. i.e. the call fills in the keys of this map with all files under the `extra/` folder that they wish to extract, and the method fills in the `extra_files` map with the contents of those files. In a specific case we have encountered, it is desirable to extract all the extra files so that they can be forwarded in an opaque manner into a `save_for_mobile()` call with the same set of extra files as during load. This change adds a method `_get_all_archive_file_names()` which returns the names of all files in the `.ptl` archive. The caller can then extract the ones within the `extra/` directory and pass them in to the `extra_files` map argument. ghstack-source-id: 122356928 Test Plan: Added additional test + `buck test //xplat/caffe2:test_lite_interpreter` Reviewed By: iseeyuan Differential Revision: D26590027 fbshipit-source-id: 4dc30997929e132f319c32cb9435d8a40fe0db5e
Author
Parents
Loading