__init__.py 398 B

12345678910111213141516
  1. # torch.ao is a package with a lot of interdependencies.
  2. # We will use lazy import to avoid cyclic dependencies here.
  3. __all__ = [
  4. "nn",
  5. "ns",
  6. "quantization",
  7. "pruning",
  8. ]
  9. def __getattr__(name):
  10. if name in __all__:
  11. import importlib
  12. return importlib.import_module("." + name, __name__)
  13. raise AttributeError(f"module {__name__!r} has no attribute {name!r}")