Skip to content

Commit

Permalink
renamed keyword in dpctl.tensor.from_numpy, and its alias asnumpy fro…
Browse files Browse the repository at this point in the history
…m queue to sycl_queue
  • Loading branch information
oleksandr-pavlyk committed Nov 20, 2021
1 parent 1626363 commit 12d6693
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dpctl/tensor/_copy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def copy_to_numpy(ary):
)


def copy_from_numpy(np_ary, usm_type="device", queue=None):
def copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
"Copies numpy array `np_ary` into a new usm_ndarray"
# This may peform a copy to meet stated requirements
Xnp = np.require(np_ary, requirements=["A", "O", "C", "E"])
if queue:
ctor_kwargs = {"queue": queue}
if sycl_queue:
ctor_kwargs = {"queue": sycl_queue}
else:
ctor_kwargs = dict()
Xusm = dpt.usm_ndarray(
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tests/test_tensor_asarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_asarray_copy_false():
q = dpctl.SyclQueue()
except dpctl.SyclQueueCreationError:
pytest.skip("Could not create a queue")
X = dpt.from_numpy(np.random.randn(10, 4), usm_type="device", queue=q)
X = dpt.from_numpy(np.random.randn(10, 4), usm_type="device", sycl_queue=q)
Y1 = dpt.asarray(X, copy=False, order="K")
assert Y1 is X
Y1c = dpt.asarray(X, copy=True, order="K")
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tests/test_usm_ndarray_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def test_pyx_capi_check_constants():
def test_tofrom_numpy(shape, dtype, usm_type):
q = dpctl.SyclQueue()
Xnp = np.zeros(shape, dtype=dtype)
Xusm = dpt.from_numpy(Xnp, usm_type=usm_type, queue=q)
Xusm = dpt.from_numpy(Xnp, usm_type=usm_type, sycl_queue=q)
Ynp = np.ones(shape, dtype=dtype)
ind = (slice(None, None, None),) * Ynp.ndim
Xusm[ind] = Ynp
Expand Down

0 comments on commit 12d6693

Please sign in to comment.