pytorch/test/cpp
Dhruv Matani 755c60bffc [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
2021-02-23 21:57:13 -08:00
..
api Fix autograd when inputs contains tensors without materialized grad_fn (#51940) 2021-02-11 09:22:15 -08:00
common Trim libshm deps, move tempfile.h to c10 (#17019) 2019-02-13 19:38:35 -08:00
dist_autograd Fix Windows build failure after DDP PR merged (#45335) 2020-09-25 12:37:50 -07:00
jit [PyTorch Mobile] Allow loading of all extra files using the extra_file argument (#52635) 2021-02-23 21:57:13 -08:00
lite_interpreter_runtime [PyTorch] update CMake to build libtorch lite (#51419) 2021-02-21 01:43:54 -08:00
rpc [RPC] Refactor rref_context to not use utils::Future (#51697) 2021-02-19 00:59:38 -08:00
tensorexpr [TensorExpr] Properly handle ExternalCalls in LoadStore analysis and Inliner. (#52628) 2021-02-22 21:50:48 -08:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00