pytorch/torch/csrc/jit/python
Michael Suo c357f8b826 [package] make torch.package produce unified format (#51826)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51826

Looks like this:
```
resnet.pt
├── .data  # Data folder named so it can't clash with torch.package codemodules.
│   │      # Names/extensions automatically added to avoid namingconflicts.
│   ├── 94286146172688.storage   # tensor data
│   ├── 94286146172784.storage
│   ├── extern_modules           # torch.package metadata
│   ├── version                  # version metadata
│   └── ...
├── model  # package pickled model created w/
│   │      # exporter.save_pickel('model','model.pkl', resnet_model)
│   └── model.pkl
└── torchvision  # all code dependencies for packaged picked
    └── models   # models are captured as source files
            ├── resnet.py
                    └── utils.py
```

Since `version` is hardcoded in our zip reader/writer implementation,
add it as an option that defaults to "version" but accepts other
locations for putting the version metadata.

Test Plan: Imported from OSS

Reviewed By: zdevito

Differential Revision: D26295649

Pulled By: suo

fbshipit-source-id: 2d75feeb7de0f78196b4d0b6e2b814a7d58bd1dd
2021-02-09 07:45:59 -08:00
..
init.cpp [package] make torch.package produce unified format (#51826) 2021-02-09 07:45:59 -08:00
init.h
module_python.h
pybind_utils.cpp Graceful invalidation of Python Node/Value/Block when C++ object is deleted (#50326) 2021-02-04 01:34:46 -08:00
pybind_utils.h [JIT/Futures] support set_exception api (#50983) 2021-02-04 20:22:19 -08:00
pybind.h Graceful invalidation of Python Node/Value/Block when C++ object is deleted (#50326) 2021-02-04 01:34:46 -08:00
python_arg_flatten.cpp [ONNX] ONNX dev branch merge 01-06-2021 (#50163) 2021-01-13 13:51:21 -08:00
python_arg_flatten.h Move torch/csrc/utils/hash.h to c10/util/hash.h. (#42503) 2020-08-29 17:47:00 -07:00
python_custom_class.cpp [PyTorch][codemod] Replace immediately-dereferenced expect calls w/expectRef (#50228) 2021-01-13 16:13:55 -08:00
python_custom_class.h
python_interpreter.cpp Unify boxed function signature between jit and c10 (#37034) 2020-06-29 19:24:26 -07:00
python_ir.cpp Graceful invalidation of Python Node/Value/Block when C++ object is deleted (#50326) 2021-02-04 01:34:46 -08:00
python_ir.h
python_ivalue.h Remove DataPtr extractor from CUDAFuture (#48840) 2020-12-19 11:03:45 -08:00
python_sugared_value.cpp Fix clang-tidy warnings in python_sugared_value.{h,cpp} (#51703) 2021-02-04 21:29:40 -08:00
python_sugared_value.h Fix clang-tidy warnings in python_sugared_value.{h,cpp} (#51703) 2021-02-04 21:29:40 -08:00
python_tracer.cpp [JIT] Fix clang-tidy warnings in jit/python (#47985) 2020-12-02 12:35:36 -08:00
python_tracer.h Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
python_tree_views.cpp Add dict comprehension (#47774) 2020-12-17 15:25:30 -08:00
python_tree_views.h
script_init.cpp [Pytorch Mobile] Expose _export_operator_list to python (#51312) 2021-02-01 12:09:02 -08:00
script_init.h
update_graph_executor_opt.cpp Canonicalize includes in torch, and add tests for it (#36303) 2020-04-23 08:09:21 -07:00
update_graph_executor_opt.h