Skip to content

Commit ed8d6ef

Browse files
Merge pull request #646 from IntelPython/feature/asarray
Feature/asarray
2 parents 755b6b5 + 12d6693 commit ed8d6ef

File tree

6 files changed

+667
-4
lines changed

6 files changed

+667
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Next Release] - TBD
88

9+
### Added
10+
- `dpctl.tensor.asarray`, `dpctl.tensor.empty` implemented (#646).
11+
12+
### Changed
913
- dpctl-capi is now renamed to `libsyclinterface` (#666).
1014

1115
## [0.11.1] - 11/10/2021

dpctl/tensor/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@
3333
from dpctl.tensor._copy_utils import copy_from_numpy as from_numpy
3434
from dpctl.tensor._copy_utils import copy_to_numpy as asnumpy
3535
from dpctl.tensor._copy_utils import copy_to_numpy as to_numpy
36+
from dpctl.tensor._ctors import asarray, empty
3637
from dpctl.tensor._reshape import reshape
3738
from dpctl.tensor._usmarray import usm_ndarray
3839

3940
__all__ = [
4041
"usm_ndarray",
42+
"asarray",
4143
"astype",
4244
"copy",
45+
"empty",
4346
"reshape",
4447
"from_numpy",
4548
"to_numpy",

dpctl/tensor/_copy_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def copy_to_numpy(ary):
9393
)
9494

9595

96-
def copy_from_numpy(np_ary, usm_type="device", queue=None):
96+
def copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
9797
"Copies numpy array `np_ary` into a new usm_ndarray"
9898
# This may peform a copy to meet stated requirements
9999
Xnp = np.require(np_ary, requirements=["A", "O", "C", "E"])
100-
if queue:
101-
ctor_kwargs = {"queue": queue}
100+
if sycl_queue:
101+
ctor_kwargs = {"queue": sycl_queue}
102102
else:
103103
ctor_kwargs = dict()
104104
Xusm = dpt.usm_ndarray(

0 commit comments

Comments
 (0)