Skip to content

Commit

Permalink
Remove default input shape (#21)
Browse files Browse the repository at this point in the history
* remove default input shape

* add input shape to the tests
  • Loading branch information
willyfh authored Feb 24, 2024
1 parent aee21c0 commit 534bb3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/test_layered.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ def forward(self, x):

def test_sequential_model_layered_view_runs(sequential_model):
try:
_ = layered_view(sequential_model)
_ = layered_view(sequential_model, input_shape=(1, 3, 224, 224))
except Exception as e:
pytest.fail(f"layered_view raised an exception with Sequential model: {e}")


def test_module_list_model_layered_view_runs(module_list_model):
try:
_ = layered_view(module_list_model)
_ = layered_view(module_list_model, input_shape=(1, 3, 224, 224))
except Exception as e:
pytest.fail(f"layered_view raised an exception with ModuleList model: {e}")


def test_custom_model_layered_view_runs(custom_model):
try:
_ = layered_view(custom_model)
_ = layered_view(custom_model, input_shape=(1, 3, 224, 224))
except Exception as e:
pytest.fail(f"layered_view raised an exception with Custom model: {e}")
2 changes: 1 addition & 1 deletion visualtorch/layered.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def layered_view(
model,
input_shape=(1, 3, 224, 224),
input_shape,
to_file: str | None = None,
min_z: int = 10,
min_xy: int = 10,
Expand Down

0 comments on commit 534bb3e

Please sign in to comment.