Skip to content

Commit 7e55632

Browse files
committed
Improve exception in BaseMCRTensor if multiple block_sizes
- Raise ValueError instead of RuntimeError
1 parent 0290270 commit 7e55632

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchhd/tensors/basemcr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ def _parse_container_for_attr(container, attr):
373373
block_sizes = _parse_container_for_attr(args, "block_size")
374374

375375
if len(block_sizes) != 1:
376-
raise RuntimeError(
377-
f"Call to {func} must contain exactly one block size, got {list(block_sizes)}"
376+
raise ValueError(
377+
f"Call to {func} must contain exactly one block size, got {block_sizes}"
378378
)
379379

380380
# Call with super to avoid infinite recursion

0 commit comments

Comments
 (0)