Skip to content

Commit

Permalink
compact deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Jun 30, 2021
1 parent 30f2bb7 commit 4d638ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,8 +1651,7 @@ def summarize(self, mode: Optional[str] = "top", max_depth: Optional[int] = None
max_depth = ModelSummary.MODES[mode]
rank_zero_deprecation(
f"Argument `mode` in `LightningModule.summarize` is deprecated in v1.4"
f" and will be removed in v1.5. Use `max_depth` with a value of {max_depth} "
f"to replicate `mode={mode}` behaviour."
f" and will be removed in v1.6. Use `{max_depth=}` to replicate the `{mode=}` behavior."
)
model_summary = ModelSummary(self, max_depth=max_depth)
log.info("\n" + str(model_summary))
Expand Down
3 changes: 1 addition & 2 deletions pytorch_lightning/core/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ def __init__(self, model, mode: Optional[str] = None, max_depth: Optional[int] =
from pytorch_lightning.utilities import rank_zero_deprecation
rank_zero_deprecation(
f"Argument `mode` in `ModelSummary` is deprecated in v1.4 "
f"and will be removed in v1.5. Use `max_depth` with a value "
f"of {max_depth} to replicate `mode={mode}` behaviour."
f" and will be removed in v1.6. Use `{max_depth=}` to replicate the `{mode=}` behavior."
)
else:
from pytorch_lightning.utilities.exceptions import MisconfigurationException
Expand Down

0 comments on commit 4d638ec

Please sign in to comment.