1# mypy: allow-untyped-defs 2# We are exposing all subpackages to the end-user. 3# Because of possible inter-dependency, we want to avoid 4# the cyclic imports, thus implementing lazy version 5# as per https://peps.python.org/pep-0562/ 6 7import importlib 8 9 10__all__ = [ 11 "intrinsic", 12 "qat", 13 "quantizable", 14 "quantized", 15 "sparse", 16] 17 18 19def __getattr__(name): 20 if name in __all__: 21 return importlib.import_module("." + name, __name__) 22 raise AttributeError(f"module {__name__!r} has no attribute {name!r}") 23