Skip to content

Commit 5e8920c

Browse files
committed
switch from xp.asarray(list(range to nx.arange
1 parent 6ba1c51 commit 5e8920c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_funcs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def test_1D_shapes(
311311
xp: ModuleType,
312312
):
313313
n = math.prod(input_shape)
314-
x = xp.reshape(xp.asarray(list(range(n))), input_shape)
314+
x = xp.reshape(xp.arange(n), input_shape)
315315
y = atleast_nd(x, ndim=ndim)
316316

317317
assert y.shape == expected_shape
@@ -350,7 +350,7 @@ def test_2D_shapes(
350350
xp: ModuleType,
351351
):
352352
n = math.prod(input_shape)
353-
x = xp.reshape(xp.asarray(list(range(n))), input_shape)
353+
x = xp.reshape(xp.arange(n), input_shape)
354354
y = atleast_nd(x, ndim=ndim)
355355

356356
assert y.shape == expected_shape
@@ -389,7 +389,7 @@ def test_3D_shapes(
389389
xp: ModuleType,
390390
):
391391
n = math.prod(input_shape)
392-
x = xp.reshape(xp.asarray(list(range(n))), input_shape)
392+
x = xp.reshape(xp.arange(n), input_shape)
393393
y = atleast_nd(x, ndim=ndim)
394394

395395
assert y.shape == expected_shape
@@ -428,7 +428,7 @@ def test_5D_shapes(
428428
xp: ModuleType,
429429
):
430430
n = math.prod(input_shape)
431-
x = xp.reshape(xp.asarray(list(range(n))), input_shape)
431+
x = xp.reshape(xp.arange(n), input_shape)
432432
y = atleast_nd(x, ndim=ndim)
433433

434434
assert y.shape == expected_shape

0 commit comments

Comments
 (0)