Skip to content

Commit

Permalink
Merge pull request #326 from understandable-machine-intelligence-lab/…
Browse files Browse the repository at this point in the history
…bugfix-assert-statement

Update asserts.py
  • Loading branch information
annahedstroem authored Jan 23, 2024
2 parents 0ef57b6 + 2dd6324 commit a3e1042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quantus/helpers/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ def assert_value_smaller_than_input_size(
-------
None
"""
if len(x.shape) == 2:
if value >= np.prod(x.shape[1:]):
raise ValueError(
f"'{value_name}' must be smaller than input size."
f" [{value} >= {np.prod(x.shape[1:])}]"
)
if value >= np.prod(x.shape[2:]):
raise ValueError(
f"'{value_name}' must be smaller than input size."
Expand Down

0 comments on commit a3e1042

Please sign in to comment.