2020-02-01 23:24:56 +00:00
|
|
|
"""Root package info."""
|
2019-10-28 22:41:13 +00:00
|
|
|
|
2021-03-02 09:47:55 +00:00
|
|
|
import logging
|
2022-01-12 00:22:48 +00:00
|
|
|
from typing import Any
|
2021-01-12 12:56:20 +00:00
|
|
|
|
2021-08-02 16:05:56 +00:00
|
|
|
from pytorch_lightning.__about__ import * # noqa: F401, F403
|
2020-04-20 21:36:26 +00:00
|
|
|
|
2022-01-12 00:22:48 +00:00
|
|
|
_DETAIL = 15 # between logging.INFO and logging.DEBUG, used for logging in production use cases
|
|
|
|
|
|
|
|
|
|
|
|
def _detail(self: Any, message: str, *args: Any, **kwargs: Any) -> None:
|
|
|
|
if self.isEnabledFor(_DETAIL):
|
|
|
|
# logger takes its '*args' as 'args'
|
|
|
|
self._log(_DETAIL, message, args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
logging.addLevelName(_DETAIL, "DETAIL")
|
|
|
|
logging.detail = _detail
|
|
|
|
logging.Logger.detail = _detail
|
|
|
|
|
2021-03-02 09:47:55 +00:00
|
|
|
_root_logger = logging.getLogger()
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
_logger.setLevel(logging.INFO)
|
2019-10-28 22:41:13 +00:00
|
|
|
|
2021-03-02 09:47:55 +00:00
|
|
|
# if root logger has handlers, propagate messages up and let root logger process them
|
|
|
|
if not _root_logger.hasHandlers():
|
|
|
|
_logger.addHandler(logging.StreamHandler())
|
|
|
|
_logger.propagate = False
|
2020-03-20 19:49:01 +00:00
|
|
|
|
2021-03-22 12:39:19 +00:00
|
|
|
from pytorch_lightning.callbacks import Callback # noqa: E402
|
|
|
|
from pytorch_lightning.core import LightningDataModule, LightningModule # noqa: E402
|
|
|
|
from pytorch_lightning.trainer import Trainer # noqa: E402
|
|
|
|
from pytorch_lightning.utilities.seed import seed_everything # noqa: E402
|
|
|
|
|
2021-07-28 16:57:31 +00:00
|
|
|
__all__ = ["Trainer", "LightningDataModule", "LightningModule", "Callback", "seed_everything"]
|
2020-04-21 11:12:02 +00:00
|
|
|
|
|
|
|
# for compatibility with namespace packages
|
2021-07-26 11:37:35 +00:00
|
|
|
__import__("pkg_resources").declare_namespace(__name__)
|