pytorch
0bc57f47 - torch.Package zipfile debugging printer (#52176)

Commit
3 years ago
torch.Package zipfile debugging printer (#52176) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/52176 Added tooling to print out zipfile structure for PackageExporter and PackageImporter. API looks like: ``` exporter.print_file_structure("sss" /*only include files with this in the path*/) importer3.print_file_structure(False /*don't print storage*/, "sss" /*only include files with this in the path*/) ``` The output looks like this with the storage hidden by default: ``` ─── resnet.zip ├── .data │ ├── extern_modules │ └── version ├── models │ └── models1.pkl └── torchvision └── models ├── resnet.py └── utils.py ``` The output looks like this with the storage being printed out: ``` ─── resnet_added_attr_test.zip ├── .data │ ├── 94574437434544.storage │ ├── 94574468343696.storage │ ├── 94574470147744.storage │ ├── 94574470198784.storage │ ├── 94574470267968.storage │ ├── 94574474917984.storage │ ├── extern_modules │ └── version ├── models │ └── models1.pkl └── torchvision └── models ├── resnet.py └── utils.py ``` If the output is filtered with the string 'utils' it'd looks like this: ``` ─── resnet_added_attr_test.zip └── torchvision └── models └── utils.py ``` Test Plan: Imported from OSS Reviewed By: suo Differential Revision: D26429795 Pulled By: Lilyjjo fbshipit-source-id: 4fa25b0426912f939c7b52cedd6e217672891f21
Author
Parents
Loading