Skip to content

Commit 7e3992b

Browse files
authored
Fix pow triton 3.5 error (#1271)
1 parent 055c2c0 commit 7e3992b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/flag_gems/ops/pow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@pointwise_dynamic(promotion_methods=[(0, 1, "BOOL_TO_LONG")])
1313
@triton.jit
1414
def pow_func(x, exponent):
15-
return _pow(x.to(tl.float32), exponent)
15+
return _pow(x.to(tl.float32), exponent.to(tl.float32))
1616

1717

1818
def pow_tensor_tensor(A, exponent):
@@ -28,7 +28,7 @@ def pow_tensor_tensor_(A, exponent):
2828
@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, 1, "BOOL_TO_LONG")])
2929
@triton.jit
3030
def pow_func_tensor_scalar(x, exponent):
31-
return _pow(x.to(tl.float32), exponent)
31+
return _pow(x.to(tl.float32), exponent.to(tl.float32))
3232

3333

3434
def pow_tensor_scalar(A, exponent):
@@ -44,7 +44,7 @@ def pow_tensor_scalar_(A, exponent):
4444
@pointwise_dynamic(is_tensor=[False, True], promotion_methods=[(0, 1, "BOOL_TO_LONG")])
4545
@triton.jit
4646
def pow_func_scalar_tensor(x, exponent):
47-
return _pow(x.to(tl.float32), exponent)
47+
return _pow(x.to(tl.float32), exponent.to(tl.float32))
4848

4949

5050
def pow_scalar(A, exponent):

0 commit comments

Comments
 (0)