Skip to content

Remove experiment property from logger base class. #11603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed `Strategy.on_tpu` property ([#11536](https://github.com/PyTorchLightning/pytorch-lightning/pull/11536))


- Removed the abstract property `LightningLoggerBase.experiment` ([#11603](https://github.com/PyTorchLightning/pytorch-lightning/pull/11603))


- Removed `FitLoop.current_epoch` getter and setter ([#11562](https://github.com/PyTorchLightning/pytorch-lightning/pull/11562))


Expand Down
6 changes: 0 additions & 6 deletions docs/source/extensions/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ Use the :func:`~pytorch_lightning.loggers.base.rank_zero_experiment` and :func:`
def name(self):
return "MyLogger"

@property
@rank_zero_experiment
def experiment(self):
# Return the experiment object associated with this logger.
pass

@property
def version(self):
# Return the experiment version, int or str.
Expand Down
5 changes: 0 additions & 5 deletions pytorch_lightning/loggers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ def update_agg_funcs(
if agg_default_func:
self._agg_default_func = agg_default_func

@property
@abstractmethod
def experiment(self) -> Any:
"""Return the experiment object associated with this logger."""

def _aggregate_metrics(
self, metrics: Dict[str, float], step: Optional[int] = None
) -> Tuple[int, Optional[Dict[str, float]]]:
Expand Down