Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
yitongh committed Aug 26, 2024
1 parent bad3ee8 commit 0be6d23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchacc/core/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def mark_dynamic(x: torch.Tensor, dims: Union[List[int], int],
bounds = [bounds]
assert isinstance(dims, list), "dims should be of int or list type"
assert isinstance(bounds, list), "bounds should be of int or list type"
assert len(dims) == len(
bounds), "dims and bounds should have the same length"
for i, dim in enumerate(dims):
if dim < (-x.dim()) or dim >= x.dim():
raise ValueError(f"Dimension out of range (expected to be in range" \
Expand Down

0 comments on commit 0be6d23

Please sign in to comment.