benchmark
3bb81e57 - Enable package import from torchbenchmark and torchbenchmark.models. (#2200)

Commit
2 years ago
Enable package import from torchbenchmark and torchbenchmark.models. (#2200) Summary: More intuitive module import when installed as a package. This PR adds LazyImport to all torchbenchmark models so that they will be loaded only when being used. Pull Request resolved: https://github.com/pytorch/benchmark/pull/2200 Test Plan: Run the following commands: ``` python install.py pip install -e . $ python -c "import torchbenchmark.models; print(torchbenchmark.models.densenet121.Model)" <class 'torchbenchmark.models.densenet121.Model'> $ python -c "import torchbenchmark; print(torchbenchmark.models.densenet121.Model)" <class 'torchbenchmark.models.densenet121.Model'> ``` Fixes https://github.com/pytorch/benchmark/issues/2193 Reviewed By: drisspg Differential Revision: D55024068 Pulled By: xuzhao9 fbshipit-source-id: c9572308d202afaf8e528adb6585b5db80936cbd
Author
Parents
Loading