Skip to content

Commit d9cbd62

Browse files
Drop pyproject.toml entries, start windows fix
1 parent c4fa1fd commit d9cbd62

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

ndonnx/_funcs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,12 @@ def roll(x, shift, axis=None):
694694
shift_single = opx.add(opx.const(-sh), len_single)
695695
# Find the needed element index and then gather from it
696696
range = opx.cast(
697-
opx.range(opx.const(0), len_single, opx.const(1)), to=dtypes.int64
697+
opx.range(
698+
opx.const(0, dtype=len_single.dtype),
699+
len_single,
700+
opx.const(1, dtype=len_single.dtype),
701+
),
702+
to=dtypes.int64,
698703
)
699704
new_indices = opx.mod(opx.add(range, shift_single), len_single)
700705
x = take(x, _from_corearray(new_indices), axis=ax)

ndonnx/_opset_extensions.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,14 +640,19 @@ def ndindex(shape: _CoreArray, to_reverse=None, axes_permutation=None) -> _CoreA
640640
axes_indices = [axes_permutation.index(i) for i in builtins.range(rank)]
641641

642642
shape_var = shape.var
643+
dtype = shape_var.unwrap_tensor().dtype
643644
ranges = [
644645
(
645-
op.range(op.const(0), op.gather(shape_var, op.const(i)), op.const(1))
646+
op.range(
647+
op.const(0, dtype=dtype),
648+
op.gather(shape_var, op.const(i)),
649+
op.const(1, dtype=dtype),
650+
)
646651
if i not in to_reverse
647652
else op.range(
648-
op.sub(op.gather(shape_var, op.const(i)), op.const(1)),
649-
op.const(-1),
650-
op.const(-1),
653+
op.sub(op.gather(shape_var, op.const(i)), op.const(1, dtype=dtype)),
654+
op.const(-1, dtype=dtype),
655+
op.const(-1, dtype=dtype),
651656
)
652657
)
653658
for i in builtins.range(rank)

pyproject.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,3 @@ exclude = ["docs/"]
8282

8383
[tool.typos.default]
8484
extend-ignore-identifiers-re = ["scatter_nd", "arange"]
85-
86-
[tool.pixi.project]
87-
channels = ["conda-forge"]
88-
platforms = ["osx-arm64"]
89-
90-
[tool.pixi.pypi-dependencies]
91-
ndonnx = { path = ".", editable = true }
92-
93-
[tool.pixi.tasks]

tests/ndonnx/test_constant_propagation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ def dynamic_masking_model(mode: Literal["lazy", "constant"]):
6767

6868
def constant_indexing_model(mode: Literal["lazy", "constant"]):
6969
if mode == "constant":
70-
a = ndx.asarray([0, 1, 2, 3])
70+
a = ndx.asarray([0, 1, 2, 3], dtype=ndx.int64)
7171
else:
7272
a = ndx.array(
7373
shape=("N",),
7474
dtype=ndx.int64,
7575
)
76-
b = ndx.asarray([5, 7, 8, 8, 9, 9, 234])
76+
b = ndx.asarray([5, 7, 8, 8, 9, 9, 234], dtype=ndx.int64)
7777
idx = ndx.asarray([1, 3, 5, 0])
7878
result = a * b[idx]
7979
return ndx.build({"a": a} if mode == "lazy" else {}, {"y": result})

tests/ndonnx/test_core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ def test_null_promotion():
8181

8282

8383
def test_asarray():
84-
a = ndx.asarray([1, 2, 3])
84+
a = ndx.asarray([1, 2, 3], dtype=ndx.int64)
8585
assert a.dtype == ndx.int64
86-
np.testing.assert_array_equal(np.array([1, 2, 3]), a.to_numpy(), strict=True)
86+
np.testing.assert_array_equal(
87+
np.array([1, 2, 3], np.int64), a.to_numpy(), strict=True
88+
)
8789

8890

8991
def test_asarray_masked():

0 commit comments

Comments
 (0)