Skip to content

Commit 4b7eddf

Browse files
committed
fix: aligning depth None with internal FlopCounterMode.
1 parent 81a08ec commit 4b7eddf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lightning/pytorch/utilities/model_summary/model_summary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def __init__(self, model: "pl.LightningModule", max_depth: int = 1) -> None:
220220
self._flop_counter = FlopCounterMode(
221221
mods=None if _TORCH_GREATER_EQUAL_2_4 else self._model,
222222
display=False,
223-
depth=max_depth + 1,
223+
depth=max_depth + 1 if max_depth >= 0 else None,
224224
)
225225

226226
self._max_depth = max_depth

0 commit comments

Comments
 (0)