__init__.py 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. from .modules import * # noqa: F403
  2. from .modules.fused import _FusedModule # noqa: F403
  3. # # Subpackages
  4. # from . import qat # noqa: F403
  5. # from . import quantized # noqa: F403
  6. __all__ = [
  7. 'ConvBn1d',
  8. 'ConvBn2d',
  9. 'ConvBn3d',
  10. 'ConvBnReLU1d',
  11. 'ConvBnReLU2d',
  12. 'ConvBnReLU3d',
  13. 'ConvReLU1d',
  14. 'ConvReLU2d',
  15. 'ConvReLU3d',
  16. 'LinearReLU',
  17. 'BNReLU2d',
  18. 'BNReLU3d',
  19. 'LinearBn1d',
  20. 'LinearLeakyReLU',
  21. 'LinearTanh',
  22. 'ConvAdd2d',
  23. 'ConvAddReLU2d',
  24. ]
  25. # We are exposing all subpackages to the end-user.
  26. # Because of possible inter-dependency, we want to avoid
  27. # the cyclic imports, thus implementing lazy version
  28. # as per https://peps.python.org/pep-0562/
  29. def __getattr__(name):
  30. if name in __all__:
  31. import importlib
  32. return importlib.import_module("." + name, __name__)
  33. raise AttributeError(f"module {__name__!r} has no attribute {name!r}")