Skip to content

Commit fc317cb

Browse files
authored
Implemented dpnp.fromfunction, dpnp.fromiter and dpnp.loadtxt (#1728)
* Implemented dpnp.fromfunction * Added dpnp.fromiter * Added dpnp.loadtxt * Aligned array creation page with numpy content * Alligned usm_type description across all aray creation functions * Change usm_type to None default value for function with input array as argument * Updated to use dpnp.check_limitations * Rollbacked changed default usm_type for linspace, logspace and geomspace * Added handling of usm_type=None to array creation functions
1 parent 3e251c8 commit fc317cb

File tree

7 files changed

+405
-87
lines changed

7 files changed

+405
-87
lines changed

doc/reference/creation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. _routines.creation:
22

3-
Array Creation Routines
3+
Array creation routines
44
=======================
55

66
.. https://docs.scipy.org/doc/numpy/reference/routines.array-creation.html
77
8-
Basic creation routines
8+
From shape or value
99
-----------------------
1010

1111
.. autosummary::
@@ -24,7 +24,7 @@ Basic creation routines
2424
dpnp.full_like
2525

2626

27-
Creation from other data
27+
From existing data
2828
------------------------
2929

3030
.. autosummary::
@@ -35,6 +35,7 @@ Creation from other data
3535
dpnp.asarray
3636
dpnp.asanyarray
3737
dpnp.ascontiguousarray
38+
dpnp.astype
3839
dpnp.copy
3940
dpnp.frombuffer
4041
dpnp.from_dlpack
@@ -61,7 +62,7 @@ Numerical ranges
6162
dpnp.ogrid
6263

6364

64-
Matrix creation
65+
Building matrices
6566
---------------
6667

6768
.. autosummary::
@@ -82,5 +83,4 @@ The Matrix class
8283
:toctree: generated/
8384
:nosignatures:
8485

85-
dpnp.mat
8686
dpnp.bmat

dpnp/dpnp_algo/dpnp_arraycreation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ class dpnp_nd_grid:
289289
def __init__(
290290
self, sparse=False, device=None, usm_type="device", sycl_queue=None
291291
):
292-
dpu.validate_usm_type(usm_type, allow_none=False)
292+
dpu.validate_usm_type(usm_type, allow_none=True)
293293
self.sparse = sparse
294-
self.usm_type = usm_type
294+
self.usm_type = "device" if usm_type is None else usm_type
295295
self.sycl_queue_normalized = dpnp.get_normalized_queue_device(
296296
sycl_queue=sycl_queue, device=device
297297
)

0 commit comments

Comments
 (0)