diff --git a/chex/_src/asserts.py b/chex/_src/asserts.py index 3ab07e7..42efb10 100644 --- a/chex/_src/asserts.py +++ b/chex/_src/asserts.py @@ -642,7 +642,7 @@ def assert_shape( # Shapes are always lists or tuples, not scalars. if (not expected_shapes or not isinstance(expected_shapes[0], (list, tuple))): - expected_shapes = [expected_shapes] * len(inputs) + expected_shapes = [expected_shapes] * len(inputs) # pyrefly: ignore[bad-argument-type, bad-assignment] # pyrefly: ignore[bad-argument-type, bad-assignment] if len(inputs) != len(expected_shapes): # pyrefly: ignore[bad-argument-type] raise AssertionError( @@ -755,7 +755,7 @@ def assert_rank( inputs = [inputs] # pyrefly: ignore[bad-assignment] if (not isinstance(expected_ranks, collections.abc.Sequence) or isinstance(expected_ranks, collections.abc.Set)): - expected_ranks = [expected_ranks] * len(inputs) + expected_ranks = [expected_ranks] * len(inputs) # pyrefly: ignore[bad-argument-type] # pyrefly: ignore[bad-argument-type] if len(inputs) != len(expected_ranks): # pyrefly: ignore[bad-argument-type] raise AssertionError(