Skip to content

Commit 44db6af

Browse files
committed
Update docstrings of other interface functions
1 parent ed38d67 commit 44db6af

File tree

1 file changed

+46
-25
lines changed

1 file changed

+46
-25
lines changed

dpnp/dpnp_iface.py

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,13 @@ def asnumpy(a, order="C"):
181181
----------
182182
a : {array_like}
183183
Arbitrary object that can be converted to :obj:`numpy.ndarray`.
184-
order : {'C', 'F', 'A', 'K'}
184+
order : {None, 'C', 'F', 'A', 'K'}, optional
185185
The desired memory layout of the converted array.
186-
When `order` is ``A``, it uses ``F`` if `a` is column-major and uses
187-
``C`` otherwise. And when `order` is ``K``, it keeps strides as closely
188-
as possible.
186+
When `order` is ``'A'``, it uses ``'F'`` if `a` is column-major and
187+
uses ``'C'`` otherwise. And when `order` is ``'K'``, it keeps strides
188+
as closely as possible.
189+
190+
Default: ``'C'``.
189191
190192
Returns
191193
-------
@@ -306,22 +308,24 @@ def as_usm_ndarray(a, dtype=None, device=None, usm_type=None, sycl_queue=None):
306308
The desired dtype for the result array if new array is creating. If not
307309
given, a default dtype will be used that can represent the values (by
308310
considering Promotion Type Rule and device capabilities when necessary).
311+
309312
Default: ``None``.
310313
device : {None, string, SyclDevice, SyclQueue}, optional
311-
An array API concept of device where the result array is created if
312-
required.
313-
The `device` can be ``None`` (the default), an OneAPI filter selector
314-
string, an instance of :class:`dpctl.SyclDevice` corresponding to
315-
a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
316-
or a `Device` object returned by
317-
:obj:`dpnp.dpnp_array.dpnp_array.device` property.
314+
An array API specification of device where the output array is created.
315+
Device can be specified by a filter selector string, an instance of
316+
:class:`dpctl.SyclDevice`, an instance of :class:`dpctl.SyclQueue`, or
317+
an instance of :class:`dpctl.tensor.Device`. If the value is ``None``,
318+
returned array is created on the same device as `a`.
319+
318320
Default: ``None``.
319321
usm_type : {None, "device", "shared", "host"}, optional
320322
The type of SYCL USM allocation for the result array if new array
321323
is created.
324+
322325
Default: ``None``.
323326
sycl_queue : {None, SyclQueue}, optional
324327
A SYCL queue to use for result array allocation if required.
328+
325329
Default: ``None``.
326330
327331
Returns
@@ -412,11 +416,15 @@ def check_supported_arrays_type(*arrays, scalar_type=False, all_scalars=False):
412416
----------
413417
arrays : {dpnp.ndarray, usm_ndarray}
414418
Input arrays to check for supported types.
415-
scalar_type : {bool}, optional
419+
scalar_type : bool, optional
416420
A scalar type is also considered as supported if flag is ``True``.
417-
all_scalars : {bool}, optional
421+
422+
Default: ``False``.
423+
all_scalars : bool, optional
418424
All the input arrays can be scalar if flag is ``True``.
419425
426+
Default: ``False``.
427+
420428
Returns
421429
-------
422430
out : bool
@@ -459,19 +467,21 @@ def default_float_type(device=None, sycl_queue=None):
459467
Parameters
460468
----------
461469
device : {None, string, SyclDevice, SyclQueue}, optional
462-
An array API concept of device where an array of default floating type
463-
might be created. The `device` can be ``None`` (the default), an OneAPI
464-
filter selector string, an instance of :class:`dpctl.SyclDevice`
465-
corresponding to a non-partitioned SYCL device, an instance of
466-
:class:`dpctl.SyclQueue`, or a `Device` object returned by
467-
:obj:`dpnp.dpnp_array.dpnp_array.device` property.
468-
The value ``None`` is interpreted as to use a default device.
470+
An array API specification of device where the output array is created.
471+
Device can be specified by a filter selector string, an instance of
472+
:class:`dpctl.SyclDevice`, an instance of :class:`dpctl.SyclQueue`, or
473+
an instance of :class:`dpctl.tensor.Device`. The value ``None`` is
474+
interpreted as to use a default device.
475+
476+
Default: ``None``.
469477
sycl_queue : {None, SyclQueue}, optional
470478
A SYCL queue which might be used to create an array of default floating
471479
type. The `sycl_queue` can be ``None`` (the default), which is
472480
interpreted as to get the SYCL queue from `device` keyword if present
473481
or to use a default queue.
474482
483+
Default: ``None``.
484+
475485
Returns
476486
-------
477487
dt : dtype
@@ -590,16 +600,22 @@ def get_normalized_queue_device(obj=None, device=None, sycl_queue=None):
590600
and implementing `__sycl_usm_array_interface__` protocol, an instance
591601
of `numpy.ndarray`, an object supporting Python buffer protocol,
592602
a Python scalar, or a (possibly nested) sequence of Python scalars.
593-
sycl_queue : class:`dpctl.SyclQueue`, optional
603+
sycl_queue : {None, class:`dpctl.SyclQueue`}, optional
594604
A queue which explicitly indicates where USM allocation is done
595605
and the population code (if any) is executed.
596606
Value ``None`` is interpreted as to get the SYCL queue from either
597607
`obj` parameter if not ``None`` or from `device` keyword,
598608
or to use default queue.
599-
device : {string, :class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue,
600-
:class:`dpctl.tensor.Device`}, optional
601-
An array-API keyword indicating non-partitioned SYCL device
602-
where array is allocated.
609+
610+
Default: ``None``.
611+
device : {None, string, SyclDevice, SyclQueue}, optional
612+
An array API specification of device where the output array is created.
613+
Device can be specified by a filter selector string, an instance of
614+
:class:`dpctl.SyclDevice`, an instance of :class:`dpctl.SyclQueue`, or
615+
an instance of :class:`dpctl.tensor.Device`. The value ``None`` is
616+
interpreted as to use the same device as `obj`.
617+
618+
Default: ``None``.
603619
604620
Returns
605621
-------
@@ -637,9 +653,13 @@ def get_result_array(a, out=None, casting="safe"):
637653
If provided, value of `a` array will be copied into it
638654
according to ``safe`` casting rule.
639655
It should be of the appropriate shape.
656+
657+
Default: ``None``.
640658
casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
641659
Controls what kind of data casting may occur.
642660
661+
Default: ``'safe'``.
662+
643663
Returns
644664
-------
645665
out : {dpnp_array}
@@ -735,6 +755,7 @@ def is_cuda_backend(obj=None):
735755
An input object with sycl_device property to check device backend.
736756
If `obj` is ``None``, device backend will be checked for the default
737757
queue.
758+
738759
Default: ``None``.
739760
740761
Returns

0 commit comments

Comments
 (0)