From f245a01ff9f59d961a80dd9e5f0db5db3ad82ca9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:50:43 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.4...v0.8.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11a6a33..2810dea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: skip: [mypy, pytest] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.0 hooks: - id: ruff args: [--fix] From 9b7662dbea11a16679617fb2efd709c76bfd91f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:51:15 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- torchinfo/__init__.py | 2 +- torchinfo/formatting.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/torchinfo/__init__.py b/torchinfo/__init__.py index 4758d89..65d1432 100644 --- a/torchinfo/__init__.py +++ b/torchinfo/__init__.py @@ -3,12 +3,12 @@ from .torchinfo import summary __all__ = ( - "summary", "ColumnSettings", "Mode", "ModelStatistics", "RowSettings", "Units", "Verbosity", + "summary", ) __version__ = "1.8.0" diff --git a/torchinfo/formatting.py b/torchinfo/formatting.py index ce96b85..a1064c6 100644 --- a/torchinfo/formatting.py +++ b/torchinfo/formatting.py @@ -135,10 +135,8 @@ def layers_to_str(self, summary_list: list[LayerInfo], total_params: int) -> str """ new_str = "" for layer_info in summary_list: - if ( - layer_info.depth > self.max_depth - or self.hide_recursive_layers - and layer_info.is_recursive + if layer_info.depth > self.max_depth or ( + self.hide_recursive_layers and layer_info.is_recursive ): continue