Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d28a06e

Browse files
committed
Merge branch 'jg/fix-arange' into 'main'
Avoid typecast for arange when dtype is int See merge request dl/tileir/cutile-python!51
2 parents 9dda5de + 21de18a commit d28a06e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cuda/tile/_ir/ops.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3229,7 +3229,10 @@ def generate_bytecode(self, ctx: BytecodeContext) -> bc.Value:
32293229

32303230

32313231
def arange(size: int, dtype: DType) -> Var:
3232-
res_ty = make_tile_ty(datatype.default_int_type, (size,))
3232+
if datatype.is_integral(dtype):
3233+
res_ty = make_tile_ty(dtype, (size,))
3234+
else:
3235+
res_ty = make_tile_ty(datatype.default_int_type, (size,))
32333236
res = add_operation(TileArange, res_ty)
32343237
return astype(res, dtype)
32353238

0 commit comments

Comments
 (0)