Skip to content

Commit

Permalink
[FRONTEND] Add check for the axis of reduction op (triton-lang#1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
wejoncy authored Mar 7, 2023
1 parent a89586f commit e100f8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/triton/language/semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,10 @@ def reduce_impl(input: tl.tensor, axis: int, builder: ir.builder, name: str,

# get result type
shape = input.type.shape

rank = len(shape)
assert 0 <= axis < rank, f"axis (v={axis}) is out of range, should be within [0, {rank})"

ret_shape = []
for i, s in enumerate(shape):
if i != axis:
Expand Down

0 comments on commit e100f8d

Please sign in to comment.