From 78e9b3b3ad185066f348fc74d68c6dada2e5e195 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 12:32:00 +0200 Subject: [PATCH 1/3] Fix build and test commands in the quick start guide There is no top-level tests directory, so pytest -s tests found nothing; point to dpnp/tests and to --pyargs dpnp.tests instead. Pass --no-build-isolation to the editable install, as build_locally.py does, mention that build_locally.py also works on Windows, and add the blank line a code-block needs to render. --- doc/quick_start_guide.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/quick_start_guide.rst b/doc/quick_start_guide.rst index abc57a2ff603..2ea318411996 100644 --- a/doc/quick_start_guide.rst +++ b/doc/quick_start_guide.rst @@ -113,16 +113,16 @@ To build and install the package on Linux OS, run: .. code-block:: bash python setup.py build_ext --inplace -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx - python -m pip install -e . + python -m pip install -e . --no-build-isolation To build and install the package on Windows OS, run: .. code-block:: bash python setup.py build_ext --inplace -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx - python -m pip install -e . + python -m pip install -e . --no-build-isolation -Alternatively, to develop on Linux OS, you can use the driver script: +Alternatively, to develop on Linux or Windows OS, you can use the driver script: .. code-block:: bash @@ -200,6 +200,7 @@ You can then use one of them as the argument to ``--target-hip``. For example: .. code-block:: bash + python scripts/build_locally.py --target-hip=gfx90a Multi-target build @@ -235,12 +236,18 @@ These options are useful when building pybind11 extensions that use Testing ======= -If you want to execute the scope of Python test suites which are available -by the source, you will need to run a command as below: +To run the test suite from the source tree, after building the package as +described above, run: + +.. code-block:: bash + + python -m pytest dpnp/tests + +To run the tests of an installed ``dpnp`` package, run: .. code-block:: bash - pytest -s tests + python -m pytest --pyargs dpnp.tests Examples ======== From a5e86bbd49c24c909a10caf31fab11a493b33a3a Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 12:32:02 +0200 Subject: [PATCH 2/3] Remove nonexistent pages from the API reference toctree doc/reference/index.rst listed 14 pages that do not exist. Also mark the polynomials placeholder page as orphan, since routines.rst leaves it out on purpose. Both produced Sphinx warnings. --- doc/reference/index.rst | 14 -------------- doc/reference/polynomials.rst | 4 ++++ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/doc/reference/index.rst b/doc/reference/index.rst index c6525004f71d..e84e2b5acd7c 100644 --- a/doc/reference/index.rst +++ b/doc/reference/index.rst @@ -16,21 +16,7 @@ API reference of the Data Parallel Extension for NumPy* ndarray ufunc routines - special scipy - sparse - ndimage - generic - memory - cuda - memoize - kernel - optimize - interoperability - testing - prof - environment dtypes_table comparison - misc array_api diff --git a/doc/reference/polynomials.rst b/doc/reference/polynomials.rst index 6b7868b9a6e4..b1794c327878 100644 --- a/doc/reference/polynomials.rst +++ b/doc/reference/polynomials.rst @@ -1,3 +1,7 @@ +:orphan: + +.. Not in any toctree until dpnp implements the polynomial routines. + .. currentmodule:: dpnp Polynomials From 4f89ae087b5459ccda513a8fd31635b92367ce9e Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 12:32:03 +0200 Subject: [PATCH 3/3] Remove stale files and dpctl.tensor references Remove the unused Windows-IntelLLVM_3.22.cmake, update the docstring template to the layout dpnp docstrings use, and replace the dpctl.tensor references left in dpnp/tensor with dpnp.tensor. --- .../workflows/Windows-IntelLLVM_3.22.cmake | 28 ----- doc/docstring_template.py | 101 +++++++++--------- dpnp/tensor/_array_api.py | 12 +-- dpnp/tensor/_compute_follows_data.pyx | 2 +- dpnp/tensor/_copy_utils.py | 18 ++-- dpnp/tensor/_ctors.py | 76 ++++++------- dpnp/tensor/_data_types.py | 2 +- dpnp/tensor/_device.py | 6 +- dpnp/tensor/_dlpack.pyx | 34 +++--- dpnp/tensor/_elementwise_common.py | 12 +-- dpnp/tensor/_flags.pyx | 18 ++-- dpnp/tensor/_indexing_functions.py | 8 +- dpnp/tensor/_manipulation_functions.py | 6 +- dpnp/tensor/_print.py | 10 +- dpnp/tensor/_reshape.py | 2 +- dpnp/tensor/_search_functions.py | 2 +- dpnp/tensor/_usmarray.pyx | 12 +-- 17 files changed, 158 insertions(+), 191 deletions(-) delete mode 100644 .github/workflows/Windows-IntelLLVM_3.22.cmake diff --git a/.github/workflows/Windows-IntelLLVM_3.22.cmake b/.github/workflows/Windows-IntelLLVM_3.22.cmake deleted file mode 100644 index 0f981fc513d7..000000000000 --- a/.github/workflows/Windows-IntelLLVM_3.22.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -# This module is shared by multiple languages; use include blocker. -if(__WINDOWS_INTEL) - return() -endif() -set(__WINDOWS_INTEL 1) - -include(Platform/Windows-MSVC) -macro(__windows_compiler_intel lang) - __windows_compiler_msvc(${lang}) - - set(CMAKE_${lang}_LINK_EXECUTABLE - " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -link -out: -implib: -pdb: -version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}" - ) - set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -LD -link -out: -implib: -pdb: -version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}" - ) - set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) - if(NOT "${lang}" STREQUAL "Fortran") # Fortran driver does not support -fuse-ld, yet - set(CMAKE_${lang}_CREATE_STATIC_LIBRARY - " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o -link ${CMAKE_END_TEMP_FILE}" - ) - endif() - set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT -QMF ") - set(CMAKE_${lang}_DEPFILE_FORMAT gcc) -endmacro() diff --git a/doc/docstring_template.py b/doc/docstring_template.py index a5bd168028ae..c43bbc7c6f7f 100644 --- a/doc/docstring_template.py +++ b/doc/docstring_template.py @@ -28,80 +28,75 @@ # ***************************************************************************** """ -This is template that should be used when writing docstrings in the project. - -According to this template docstrings should consist of below sections: -1. Short description. -2. Link to related functionality in `numpy` for full documentation. -3. Limitations is a special section that should describe: - - the limited functionality relative to `numpy` (exception raised) - - cases when the functionality will be executed sequentially on CPU - (fallback to `numpy`) - - list of supported data types for input array -4. See Also -5. Notes, optional -6. Examples - -Recommendations: -1. Short description - maybe partially taken/combined from `numpy` and `cupy` docstrings. -2. Limitations basically should be described according to the code, - paying attention to raised exceptions and fallback to `numpy`. -3. See Also may include links to similar functionality in `dpnp` - with short description. - - In case of only one link better to use one-line section: - .. seealso:: :func:`numpy.func` short description. - -4. Examples maybe partially taken from `numpy` docstrings - with some modifications, ex: - - >>> import dpnp as np - >>> a = np.array([0, 1, 2]) - >>> a # prints unclear result >> [i for i in a] - [0, 1, 2] - -`dpnp.array` contains a good example of docstring. +Template for docstrings of dpnp functions. + +Docstrings use the numpydoc format and are rendered by ``doc/conf.py``. They +consist of the sections below, in this order; skip the ones that don't apply: + +1. Short (one-line) description. +2. Link to the reference function: ``For full documentation refer to + :obj:`numpy.func`.`` (or ``:obj:`scipy...``` for ``dpnp.scipy``). +3. Parameters. Array inputs are typed ``{dpnp.ndarray, usm_ndarray}``. Every + keyword with a default ends with a blank line and ``Default: ``value``.``. +4. Returns, typically ``out : dpnp.ndarray``. +5. Raises, Warns, Warnings. +6. Limitations: what is not supported compared to the reference function and + the exception raised for it, usually ``NotImplementedError``. +7. See Also: related dpnp functions, each with a short description. +8. Notes, References. +9. Examples, starting with ``>>> import dpnp as np``. + +Use an existing function, e.g. :obj:`dpnp.cbrt`, as a model, and copy the +`device`, `usm_type` and `sycl_queue` parameter descriptions from an array +creation function such as :obj:`dpnp.empty`. """ -def func(a, b=None, c=True): +def func(a, /, out=None, *, order="K", where=True): """ Short (one-line) description. For full documentation refer to :obj:`numpy.func`. + Parameters + ---------- + a : {dpnp.ndarray, usm_ndarray} + Input array. + out : {None, dpnp.ndarray, usm_ndarray}, optional + Output array to populate. Array must have the correct shape and the + expected data type. + + Default: ``None``. + order : {None, "C", "F", "A", "K"}, optional + Memory layout of the newly output array, if parameter `out` is + ``None``. + + Default: ``"K"``. + + Returns + ------- + out : dpnp.ndarray + An array containing the result. + Limitations ----------- - Some limitations in comparison to baseline, ex: - Input array data types are limited by supported DPNP :ref:`Data types`. - Parameter `c` is supported only with default value ``True``. - Otherwise the function will be executed sequentially on CPU. + Parameter `where` is supported only with default value ``True``. + Otherwise ``NotImplementedError`` exception will be raised. See Also -------- - :obj:`dpnp.func2` : Short (one-line) description of the function `dpnp.func2`. - :obj:`dpnp.func3` : Short (one-line) description of the function `dpnp.func3`. + :obj:`dpnp.func2` : Short (one-line) description of `dpnp.func2`. Notes ----- - Some notes if required. + Some notes, if needed. Examples -------- - Some examples, ex: - >>> import dpnp as np >>> a = np.array([0, 1, 2]) - >>> b = np.array([2, 1, 0]) - >>> x = np.func(a, b=b, c=True) - >>> [i for i in x] - [2, 2, 2] + >>> np.func(a) + array([0, 1, 2]) """ - pass diff --git a/dpnp/tensor/_array_api.py b/dpnp/tensor/_array_api.py index 8915123932e3..e304e1ee5074 100644 --- a/dpnp/tensor/_array_api.py +++ b/dpnp/tensor/_array_api.py @@ -143,12 +143,12 @@ def default_dtypes(self, *, device=None): Returns a dictionary of default data types for ``device``. Args: - device (Optional[:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, :class:`dpctl.tensor.Device`, str]): + device (Optional[:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, :class:`dpnp.tensor.Device`, str]): array API concept of device used in getting default data types. ``device`` can be ``None`` (in which case the default device is used), an instance of :class:`dpctl.SyclDevice`, an instance - of :class:`dpctl.SyclQueue`, a :class:`dpctl.tensor.Device` - object returned by :attr:`dpctl.tensor.usm_ndarray.device`, or + of :class:`dpctl.SyclQueue`, a :class:`dpnp.tensor.Device` + object returned by :attr:`dpnp.tensor.usm_ndarray.device`, or a filter selector string. Default: ``None``. @@ -181,12 +181,12 @@ def dtypes(self, *, device=None, kind=None): specification. Args: - device (Optional[:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, :class:`dpctl.tensor.Device`, str]): + device (Optional[:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, :class:`dpnp.tensor.Device`, str]): array API concept of device used in getting default data types. ``device`` can be ``None`` (in which case the default device is used), an instance of :class:`dpctl.SyclDevice`, an instance of - :class:`dpctl.SyclQueue`, a :class:`dpctl.tensor.Device` - object returned by :attr:`dpctl.tensor.usm_ndarray.device`, or + :class:`dpctl.SyclQueue`, a :class:`dpnp.tensor.Device` + object returned by :attr:`dpnp.tensor.usm_ndarray.device`, or a filter selector string. Default: ``None``. diff --git a/dpnp/tensor/_compute_follows_data.pyx b/dpnp/tensor/_compute_follows_data.pyx index 65523a48c2cb..00399d42b1c6 100644 --- a/dpnp/tensor/_compute_follows_data.pyx +++ b/dpnp/tensor/_compute_follows_data.pyx @@ -53,7 +53,7 @@ class ExecutionPlacementError(Exception): Make sure that input arrays are associated with the same :class:`dpctl.SyclQueue`, or migrate data to the same :class:`dpctl.SyclQueue` using - :meth:`dpctl.tensor.usm_ndarray.to_device` method. + :meth:`dpnp.tensor.usm_ndarray.to_device` method. """ pass diff --git a/dpnp/tensor/_copy_utils.py b/dpnp/tensor/_copy_utils.py index ea1fdfd0b07a..48f53c308976 100644 --- a/dpnp/tensor/_copy_utils.py +++ b/dpnp/tensor/_copy_utils.py @@ -45,7 +45,7 @@ __doc__ = ( "Implementation module for copy- and cast- operations on " - ":class:`dpctl.tensor.usm_ndarray`." + ":class:`dpnp.tensor.usm_ndarray`." ) int32_t_max = 1 + np.iinfo(np.int32).max @@ -102,7 +102,7 @@ def _copy_from_numpy(np_ary, usm_type="device", sycl_queue=None): def _copy_from_numpy_into(dst, np_ary): - """Copies `np_ary` into `dst` of type :class:`dpctl.tensor.usm_ndarray""" + """Copies `np_ary` into `dst` of type :class:`dpnp.tensor.usm_ndarray""" if not isinstance(np_ary, np.ndarray): raise TypeError(f"Expected numpy.ndarray, got {type(np_ary)}") if not isinstance(dst, dpt.usm_ndarray): @@ -547,7 +547,7 @@ def from_numpy(np_ary, /, *, device=None, usm_type="device", sycl_queue=None): """ from_numpy(arg, device=None, usm_type="device", sycl_queue=None) - Creates :class:`dpctl.tensor.usm_ndarray` from instance of + Creates :class:`dpnp.tensor.usm_ndarray` from instance of :class:`numpy.ndarray`. Args: @@ -558,7 +558,7 @@ def from_numpy(np_ary, /, *, device=None, usm_type="device", sycl_queue=None): a filter selector string, an instance of :class:`dpctl.SyclDevice`, an instance of :class:`dpctl.SyclQueue`, or an instance of - :class:`dpctl.tensor.Device`. If the value is ``None``, + :class:`dpnp.tensor.Device`. If the value is ``None``, returned array is created on the default-selected device. Default: ``None`` usm_type (str): The requested USM allocation type for the @@ -586,7 +586,7 @@ def to_numpy(usm_ary, /): """ to_numpy(usm_ary) - Copies content of :class:`dpctl.tensor.usm_ndarray` instance ``usm_ary`` + Copies content of :class:`dpnp.tensor.usm_ndarray` instance ``usm_ary`` into :class:`numpy.ndarray` instance of the same shape and same data type. Args: @@ -604,7 +604,7 @@ def asnumpy(usm_ary, order="K"): """ asnumpy(usm_ary, order="K") - Copies content of :class:`dpctl.tensor.usm_ndarray` instance ``usm_ary`` + Copies content of :class:`dpnp.tensor.usm_ndarray` instance ``usm_ary`` into :class:`numpy.ndarray` instance of the same shape and same data type. @@ -988,7 +988,7 @@ def _empty_like_triple_orderK(X1, X2, X3, dt, res_shape, usm_type, dev): def copy(usm_ary, /, *, order="K"): """copy(ary, order="K") - Creates a copy of given instance of :class:`dpctl.tensor.usm_ndarray`. + Creates a copy of given instance of :class:`dpnp.tensor.usm_ndarray`. Args: ary (usm_ndarray): @@ -1061,7 +1061,7 @@ def astype( """astype(array, new_dtype, order="K", casting="unsafe", \ copy=True, device=None) - Returns a copy of the :class:`dpctl.tensor.usm_ndarray`, cast to a + Returns a copy of the :class:`dpnp.tensor.usm_ndarray`, cast to a specified type. Args: @@ -1086,7 +1086,7 @@ def astype( a filter selector string, an instance of :class:`dpctl.SyclDevice`, an instance of :class:`dpctl.SyclQueue`, or an instance of - :class:`dpctl.tensor.Device`. If the value is `None`, + :class:`dpnp.tensor.Device`. If the value is `None`, returned array is created on the same device as `array`. Default: `None`. diff --git a/dpnp/tensor/_ctors.py b/dpnp/tensor/_ctors.py index 8272465c1aa0..28ff46267aa4 100644 --- a/dpnp/tensor/_ctors.py +++ b/dpnp/tensor/_ctors.py @@ -45,7 +45,7 @@ from ._device import normalize_queue_device from ._usmarray import _is_object_with_buffer_protocol -__doc__ = "Implementation of creation functions in :module:`dpctl.tensor`" +__doc__ = "Implementation of creation functions in :mod:`dpnp.tensor`" _empty_tuple = () _host_set = frozenset([None]) @@ -589,8 +589,8 @@ def arange( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -686,11 +686,11 @@ def asarray( order="K", ): """ - Converts input object to :class:`dpctl.tensor.usm_ndarray`. + Converts input object to :class:`dpnp.tensor.usm_ndarray`. Args: obj: Python object to convert. Can be an instance of - :class:`dpctl.tensor.usm_ndarray`, + :class:`dpnp.tensor.usm_ndarray`, an object representing SYCL USM allocation and implementing ``__sycl_usm_array_interface__`` protocol, an instance of :class:`numpy.ndarray`, an object supporting Python buffer @@ -712,8 +712,8 @@ def asarray( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -886,7 +886,7 @@ def empty( sycl_queue=None, ): """ - Creates :class:`dpctl.tensor.usm_ndarray` from uninitialized + Creates :class:`dpnp.tensor.usm_ndarray` from uninitialized USM allocation. Args: @@ -903,8 +903,8 @@ def empty( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -945,7 +945,7 @@ def empty_like( x, /, *, dtype=None, order="K", device=None, usm_type=None, sycl_queue=None ): """ - Returns an uninitialized :class:`dpctl.tensor.usm_ndarray` with the + Returns an uninitialized :class:`dpnp.tensor.usm_ndarray` with the same `shape` as the input array `x`. Args: @@ -961,8 +961,8 @@ def empty_like( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1033,7 +1033,7 @@ def eye( eye(n_rows, n_cols=None, /, *, k=0, dtype=None, \ device=None, usm_type="device", sycl_queue=None) - Creates :class:`dpctl.tensor.usm_ndarray` with ones on the `k`-th + Creates :class:`dpnp.tensor.usm_ndarray` with ones on the `k`-th diagonal. Args: @@ -1059,8 +1059,8 @@ def eye( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1135,7 +1135,7 @@ def full( sycl_queue=None, ): """ - Returns a new :class:`dpctl.tensor.usm_ndarray` having a specified + Returns a new :class:`dpnp.tensor.usm_ndarray` having a specified shape and filled with `fill_value`. Args: @@ -1152,8 +1152,8 @@ def full( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1233,7 +1233,7 @@ def full_like( """full_like(x, fill_value, dtype=None, order="K", \ device=None, usm_type=None, sycl_queue=None) - Returns a new :class:`dpctl.tensor.usm_ndarray` filled with `fill_value` + Returns a new :class:`dpnp.tensor.usm_ndarray` filled with `fill_value` and having the same `shape` as the input array `x`. Args: @@ -1252,8 +1252,8 @@ def full_like( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1352,7 +1352,7 @@ def linspace( linspace(start, stop, num, dtype=None, device=None, endpoint=True, \ sycl_queue=None, usm_type="device") - Returns :class:`dpctl.tensor.usm_ndarray` array populated with + Returns :class:`dpnp.tensor.usm_ndarray` array populated with evenly spaced numbers of specified interval. Args: @@ -1380,8 +1380,8 @@ def linspace( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1441,7 +1441,7 @@ def linspace( def meshgrid(*arrays, indexing="xy"): """ - Creates tuple of :class:`dpctl.tensor.usm_ndarray` coordinate matrices + Creates tuple of :class:`dpnp.tensor.usm_ndarray` coordinate matrices from vectors. Args: @@ -1526,7 +1526,7 @@ def ones( """ones(shape, dtype=None, order="C", \ device=None, usm_type="device", sycl_queue=None) - Returns a new :class:`dpctl.tensor.usm_ndarray` having a specified + Returns a new :class:`dpnp.tensor.usm_ndarray` having a specified shape and filled with ones. Args: @@ -1541,8 +1541,8 @@ def ones( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1586,7 +1586,7 @@ def ones_like( x, /, *, dtype=None, order="K", device=None, usm_type=None, sycl_queue=None ): """ - Returns a new :class:`dpctl.tensor.usm_ndarray` filled with ones and + Returns a new :class:`dpnp.tensor.usm_ndarray` filled with ones and having the same `shape` as the input array `x`. Args: @@ -1603,8 +1603,8 @@ def ones_like( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1829,7 +1829,7 @@ def zeros( sycl_queue=None, ): """ - Returns a new :class:`dpctl.tensor.usm_ndarray` having a specified + Returns a new :class:`dpnp.tensor.usm_ndarray` having a specified shape and filled with zeros. Args: @@ -1845,8 +1845,8 @@ def zeros( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. @@ -1892,7 +1892,7 @@ def zeros_like( x, /, *, dtype=None, order="K", device=None, usm_type=None, sycl_queue=None ): """ - Creates :class:`dpctl.tensor.usm_ndarray` from USM allocation + Creates :class:`dpnp.tensor.usm_ndarray` from USM allocation initialized with zeros. Args: @@ -1911,8 +1911,8 @@ def zeros_like( is created. ``device`` can be ``None``, a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object - returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` object + returned by :attr:`dpnp.tensor.usm_ndarray.device`. Default: ``None`` usm_type (``"device"``, ``"shared"``, ``"host"``, optional): The type of SYCL USM allocation for the output array. diff --git a/dpnp/tensor/_data_types.py b/dpnp/tensor/_data_types.py index faf30ffdabd0..1f8aba44efdc 100644 --- a/dpnp/tensor/_data_types.py +++ b/dpnp/tensor/_data_types.py @@ -63,7 +63,7 @@ def _get_dtype(inp_dt, sycl_obj, ref_type=None): Type inference utility to construct data type object with defaults based on reference type. - _get_dtype is used by dpctl.tensor.asarray + _get_dtype is used by dpnp.tensor.asarray to infer data type of the output array from the input sequence. """ diff --git a/dpnp/tensor/_device.py b/dpnp/tensor/_device.py index 5f2725c74855..8ef2790474eb 100644 --- a/dpnp/tensor/_device.py +++ b/dpnp/tensor/_device.py @@ -42,7 +42,7 @@ class Device: This is a wrapper around :class:`dpctl.SyclQueue` with custom formatting. The class does not have public constructor, - but a class method :meth:`dpctl.tensor.Device.create_device` to construct + but a class method :meth:`dpnp.tensor.Device.create_device` to construct it from `device` keyword argument in Array-API functions. Instance can be queried for ``sycl_queue``, ``sycl_context``, @@ -150,7 +150,7 @@ def normalize_queue_device(sycl_queue=None, device=None): """normalize_queue_device(sycl_queue=None, device=None) Utility to process exclusive keyword arguments 'device' - and 'sycl_queue' in functions of `dpctl.tensor`. + and 'sycl_queue' in functions of `dpnp.tensor`. Args: sycl_queue (:class:`dpctl.SyclQueue`, optional): @@ -160,7 +160,7 @@ def normalize_queue_device(sycl_queue=None, device=None): from `device` keyword, or use default queue. Default: None device (string, :class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue, - :class:`dpctl.tensor.Device`, optional): + :class:`dpnp.tensor.Device`, optional): array-API keyword indicating non-partitioned SYCL device where array is allocated. diff --git a/dpnp/tensor/_dlpack.pyx b/dpnp/tensor/_dlpack.pyx index 9e83f46de534..9ac72126aeb2 100644 --- a/dpnp/tensor/_dlpack.pyx +++ b/dpnp/tensor/_dlpack.pyx @@ -147,15 +147,15 @@ cdef extern from "dlpack/dlpack.h" nogil: def get_build_dlpack_version(): """ Returns a tuple of integers representing the `major` and `minor` - version of DLPack :module:`dpctl.tensor` was built with. + version of DLPack :mod:`dpnp.tensor` was built with. This tuple can be passed as the `max_version` argument to - `__dlpack__` to guarantee module:`dpctl.tensor` can properly + `__dlpack__` to guarantee module:`dpnp.tensor` can properly consume capsule. Returns: Tuple[int, int] A tuple of integers representing the `major` and `minor` - version of DLPack used to build :module:`dpctl.tensor`. + version of DLPack used to build :mod:`dpnp.tensor`. """ return (DLPACK_MAJOR_VERSION, DLPACK_MINOR_VERSION) @@ -256,10 +256,10 @@ cpdef to_dlpack_capsule(usm_ndarray usm_ary): Constructs named Python capsule object referencing instance of ``DLManagedTensor`` from - :class:`dpctl.tensor.usm_ndarray` instance. + :class:`dpnp.tensor.usm_ndarray` instance. Args: - usm_ary: An instance of :class:`dpctl.tensor.usm_ndarray` + usm_ary: An instance of :class:`dpnp.tensor.usm_ndarray` Returns: A new capsule with name ``"dltensor"`` that contains a pointer to ``DLManagedTensor`` struct. @@ -376,10 +376,10 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied): Constructs named Python capsule object referencing instance of ``DLManagedTensorVersioned`` from - :class:`dpctl.tensor.usm_ndarray` instance. + :class:`dpnp.tensor.usm_ndarray` instance. Args: - usm_ary: An instance of :class:`dpctl.tensor.usm_ndarray` + usm_ary: An instance of :class:`dpnp.tensor.usm_ndarray` copied: A bint representing whether the data was previously copied in order to set the flags with the is-copied bitmask. @@ -753,7 +753,7 @@ cpdef object from_dlpack_capsule(object py_caps): """ from_dlpack_capsule(py_caps) - Reconstructs instance of :class:`dpctl.tensor.usm_ndarray` from + Reconstructs instance of :class:`dpnp.tensor.usm_ndarray` from named Python capsule object referencing instance of ``DLManagedTensor`` without copy. The instance forms a view in the memory of the tensor. @@ -762,7 +762,7 @@ cpdef object from_dlpack_capsule(object py_caps): Python capsule with name ``"dltensor"`` expected to reference an instance of ``DLManagedTensor`` struct. Returns: - Instance of :class:`dpctl.tensor.usm_ndarray` with a view into + Instance of :class:`dpnp.tensor.usm_ndarray` with a view into memory of the tensor. Capsule is renamed to ``"used_dltensor"`` upon success. Raises: @@ -997,7 +997,7 @@ cdef object _create_device(object device, object dl_device): def from_dlpack(x, /, *, device=None, copy=None): """from_dlpack(x, /, *, device=None, copy=None) - Constructs :class:`dpctl.tensor.usm_ndarray` or :class:`numpy.ndarray` + Constructs :class:`dpnp.tensor.usm_ndarray` or :class:`numpy.ndarray` instance from a Python object ``x`` that implements ``__dlpack__`` protocol. Args: @@ -1007,7 +1007,7 @@ def from_dlpack(x, /, *, device=None, copy=None): device ( Optional[str, :class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, - :class:`dpctl.tensor.Device`, + :class:`dpnp.tensor.Device`, tuple([:class:`enum.IntEnum`, int])]) ): Device where the output array is to be placed. ``device`` keyword @@ -1023,14 +1023,14 @@ def from_dlpack(x, /, *, device=None, copy=None): a non-partitioned SYCL device. * :class:`dpctl.SyclQueue` implies SYCL device targeted by the SYCL queue. - * :class:`dpctl.tensor.Device` + * :class:`dpnp.tensor.Device` implies SYCL device `device.sycl_queue`. The `Device` object - is obtained via :attr:`dpctl.tensor.usm_ndarray.device`. + is obtained via :attr:`dpnp.tensor.usm_ndarray.device`. * ``(device_type, device_id)`` 2-tuple matching the format of the output of the ``__dlpack_device__`` method: an integer enumerator representing the device type followed by an integer representing the index of - the device. The only supported :class:`dpctl.tensor.DLDeviceType` + the device. The only supported :class:`dpnp.tensor.DLDeviceType` device types are ``"kDLCPU"`` and ``"kDLOneAPI"``. Default: ``None``. @@ -1057,17 +1057,17 @@ def from_dlpack(x, /, *, device=None, copy=None): The type of the returned object depends on where the data backing up input object ``x`` resides. If it resides in a USM allocation on a SYCL device, the - type :class:`dpctl.tensor.usm_ndarray` is returned, otherwise if it + type :class:`dpnp.tensor.usm_ndarray` is returned, otherwise if it resides on ``"kDLCPU"`` device the type is :class:`numpy.ndarray`, and otherwise an exception is raised. .. note:: - If the return type is :class:`dpctl.tensor.usm_ndarray`, the + If the return type is :class:`dpnp.tensor.usm_ndarray`, the associated SYCL queue is derived from the ``device`` keyword. When ``device`` keyword value has type :class:`dpctl.SyclQueue`, the explicit queue instance is used, when ``device`` keyword - value has type :class:`dpctl.tensor.Device`, the + value has type :class:`dpnp.tensor.Device`, the ``device.sycl_queue`` is used. In all other cases, the cached SYCL queue corresponding to the implied SYCL device is used. diff --git a/dpnp/tensor/_elementwise_common.py b/dpnp/tensor/_elementwise_common.py index 2eb89b8fb5f8..fa3fe871aed2 100644 --- a/dpnp/tensor/_elementwise_common.py +++ b/dpnp/tensor/_elementwise_common.py @@ -85,7 +85,7 @@ class UnaryElementwiseFunc: sycl_dev - The :class:`dpctl.SyclDevice` where the function evaluation is carried out. The function is invoked when the argument of the unary function - requires casting, e.g. the argument of `dpctl.tensor.log` is an + requires casting, e.g. the argument of `dpnp.tensor.log` is an array with integral data type. docs (str): Documentation string for the unary function. @@ -142,7 +142,7 @@ def get_type_promotion_path_acceptance_function(self): sycl_dev - The :class:`dpctl.SyclDevice` where the function evaluation is carried out. The function is invoked when the argument of the unary function - requires casting, e.g. the argument of `dpctl.tensor.log` is an + requires casting, e.g. the argument of `dpnp.tensor.log` is an array with integral data type. """ return self.acceptance_fn_ @@ -166,7 +166,7 @@ def types(self): :Example: .. code-block:: python - dpctl.tensor.sin.types + dpnp.tensor.sin.types # Outputs: ['e->e', 'f->f', 'd->d', 'F->F', 'D->D'] """ types = self.types_ @@ -341,7 +341,7 @@ class BinaryElementwiseFunc: evaluation is carried out. The function is only called when both arguments of the binary function require casting, e.g. both arguments of - `dpctl.tensor.logaddexp` are arrays with integral data type. + `dpnp.tensor.logaddexp` are arrays with integral data type. """ def __init__( @@ -413,7 +413,7 @@ def get_type_promotion_path_acceptance_function(self): The acceptance function is only invoked if both input arrays must be cast to intermediary data types, as would happen during call of - `dpctl.tensor.hypot` with both arrays being of integral data type. + `dpnp.tensor.hypot` with both arrays being of integral data type. """ return self.acceptance_fn_ @@ -456,7 +456,7 @@ def types(self): :Example: .. code-block:: python - dpctl.tensor.divide.types + dpnp.tensor.divide.types # Outputs: ['ee->e', 'ff->f', 'fF->F', 'dd->d', 'dD->D', # 'Ff->F', 'FF->F', 'Dd->D', 'DD->D'] """ diff --git a/dpnp/tensor/_flags.pyx b/dpnp/tensor/_flags.pyx index 48adf80116cd..ffaa4ddd7a0a 100644 --- a/dpnp/tensor/_flags.pyx +++ b/dpnp/tensor/_flags.pyx @@ -47,7 +47,7 @@ cdef cpp_bool _check_bit(int flag, int mask): cdef class Flags: """ - Helper class to query the flags of a :class:`dpctl.tensor.usm_ndarray` + Helper class to query the flags of a :class:`dpnp.tensor.usm_ndarray` instance, which describe how the instance interfaces with its underlying memory. """ @@ -62,7 +62,7 @@ cdef class Flags: def flags(self): """ Integer representation of the memory layout flags of - :class:`dpctl.tensor.usm_ndarray` instance. + :class:`dpnp.tensor.usm_ndarray` instance. """ return self.flags_ @@ -70,7 +70,7 @@ cdef class Flags: def c_contiguous(self): """ True if the memory layout of the - :class:`dpctl.tensor.usm_ndarray` instance is C-contiguous. + :class:`dpnp.tensor.usm_ndarray` instance is C-contiguous. """ return _check_bit(self.flags_, USM_ARRAY_C_CONTIGUOUS) @@ -78,14 +78,14 @@ cdef class Flags: def f_contiguous(self): """ True if the memory layout of the - :class:`dpctl.tensor.usm_ndarray` instance is F-contiguous. + :class:`dpnp.tensor.usm_ndarray` instance is F-contiguous. """ return _check_bit(self.flags_, USM_ARRAY_F_CONTIGUOUS) @property def writable(self): """ - True if :class:`dpctl.tensor.usm_ndarray` instance is writable. + True if :class:`dpnp.tensor.usm_ndarray` instance is writable. """ return _check_bit(self.flags_, USM_ARRAY_WRITABLE) @@ -98,7 +98,7 @@ cdef class Flags: @property def fc(self): """ - True if the memory layout of the :class:`dpctl.tensor.usm_ndarray` + True if the memory layout of the :class:`dpnp.tensor.usm_ndarray` instance is C-contiguous and F-contiguous. """ return ( @@ -109,7 +109,7 @@ cdef class Flags: @property def forc(self): """ - True if the memory layout of the :class:`dpctl.tensor.usm_ndarray` + True if the memory layout of the :class:`dpnp.tensor.usm_ndarray` instance is C-contiguous or F-contiguous. """ return ( @@ -120,7 +120,7 @@ cdef class Flags: @property def fnc(self): """ - True if the memory layout of the :class:`dpctl.tensor.usm_ndarray` + True if the memory layout of the :class:`dpnp.tensor.usm_ndarray` instance is F-contiguous and not C-contiguous. """ return ( @@ -131,7 +131,7 @@ cdef class Flags: @property def contiguous(self): """ - True if the memory layout of the :class:`dpctl.tensor.usm_ndarray` + True if the memory layout of the :class:`dpnp.tensor.usm_ndarray` instance is C-contiguous and F-contiguous. Equivalent to `forc.` """ diff --git a/dpnp/tensor/_indexing_functions.py b/dpnp/tensor/_indexing_functions.py index b61edb892a0c..e6fbd96267ea 100644 --- a/dpnp/tensor/_indexing_functions.py +++ b/dpnp/tensor/_indexing_functions.py @@ -61,11 +61,11 @@ def extract(condition, arr): Returns the elements of an array that satisfies the condition. - If ``condition`` is boolean ``dpctl.tensor.extract`` is + If ``condition`` is boolean ``dpnp.tensor.extract`` is equivalent to ``arr[condition]``. - Note that ``dpctl.tensor.place`` does the opposite of - ``dpctl.tensor.extract``. + Note that ``dpnp.tensor.place`` does the opposite of + ``dpnp.tensor.extract``. Args: conditions (usm_ndarray): @@ -133,7 +133,7 @@ def place(arr, mask, vals): Change elements of an array based on conditional and input values. - If ``mask`` is boolean ``dpctl.tensor.place`` is + If ``mask`` is boolean ``dpnp.tensor.place`` is equivalent to ``arr[condition] = vals``. Args: diff --git a/dpnp/tensor/_manipulation_functions.py b/dpnp/tensor/_manipulation_functions.py index 080e79aa881b..166a6cb5a526 100644 --- a/dpnp/tensor/_manipulation_functions.py +++ b/dpnp/tensor/_manipulation_functions.py @@ -40,7 +40,7 @@ __doc__ = ( "Implementation module for array manipulation " - "functions in :module:`dpctl.tensor`" + "functions in :mod:`dpnp.tensor`" ) @@ -220,7 +220,7 @@ def _concat_axis_None(arrays): def broadcast_arrays(*args): """broadcast_arrays(*arrays) - Broadcasts one or more :class:`dpctl.tensor.usm_ndarrays` against + Broadcasts one or more :class:`dpnp.tensor.usm_ndarray` objects against one another. Args: @@ -278,7 +278,7 @@ def broadcast_to(X, /, shape): """broadcast_to(x, shape) Broadcast an array to a new `shape`; returns the broadcasted - :class:`dpctl.tensor.usm_ndarray` as a view. + :class:`dpnp.tensor.usm_ndarray` as a view. Args: x (usm_ndarray): input array diff --git a/dpnp/tensor/_print.py b/dpnp/tensor/_print.py index 715a0969d2b5..b5cc3d08931c 100644 --- a/dpnp/tensor/_print.py +++ b/dpnp/tensor/_print.py @@ -38,7 +38,7 @@ import dpnp.tensor as dpt import dpnp.tensor._tensor_impl as ti -__doc__ = "Print functions for :class:`dpctl.tensor.usm_ndarray`." +__doc__ = "Print functions for :class:`dpnp.tensor.usm_ndarray`." _default_print_options = { "linewidth": 75, @@ -166,7 +166,7 @@ def set_print_options( precision=None, floatmode=None, suppress=None, nanstr=None, infstr=None, sign=None, numpy=False) - Set options for printing :class:`dpctl.tensor.usm_ndarray` class. + Set options for printing :class:`dpnp.tensor.usm_ndarray` class. Args: linewidth (int, optional): @@ -250,7 +250,7 @@ def get_print_options(): """get_print_options() Returns a copy of current options for printing - :class:`dpctl.tensor.usm_ndarray` class. + :class:`dpnp.tensor.usm_ndarray` class. Returns: dict: dictionary with array @@ -352,7 +352,7 @@ def usm_ndarray_str( suffix="") Returns a string representing the elements of a - :class:`dpctl.tensor.usm_ndarray`. + :class:`dpnp.tensor.usm_ndarray`. Args: x (usm_ndarray): @@ -465,7 +465,7 @@ def usm_ndarray_repr( suppress=None, prefix="") Returns a formatted string representing the elements - of a :class:`dpctl.tensor.usm_ndarray` and its data type, + of a :class:`dpnp.tensor.usm_ndarray` and its data type, if not a default type. Args: diff --git a/dpnp/tensor/_reshape.py b/dpnp/tensor/_reshape.py index 0187ae496003..441a59c80b3e 100644 --- a/dpnp/tensor/_reshape.py +++ b/dpnp/tensor/_reshape.py @@ -39,7 +39,7 @@ _unravel_index, ) -__doc__ = "Implementation module for :func:`dpctl.tensor.reshape`." +__doc__ = "Implementation module for :func:`dpnp.tensor.reshape`." def _make_unit_indexes(shape): diff --git a/dpnp/tensor/_search_functions.py b/dpnp/tensor/_search_functions.py index c1d45ee4bb33..5c15575017dd 100644 --- a/dpnp/tensor/_search_functions.py +++ b/dpnp/tensor/_search_functions.py @@ -125,7 +125,7 @@ def _where_result_type(dt1, dt2, dev): def where(condition, x1, x2, /, *, order="K", out=None): """ - Returns :class:`dpctl.tensor.usm_ndarray` with elements chosen + Returns :class:`dpnp.tensor.usm_ndarray` with elements chosen from ``x1`` or ``x2`` depending on ``condition``. Args: diff --git a/dpnp/tensor/_usmarray.pyx b/dpnp/tensor/_usmarray.pyx index 78de01b936c4..2169c759abb4 100644 --- a/dpnp/tensor/_usmarray.pyx +++ b/dpnp/tensor/_usmarray.pyx @@ -301,7 +301,7 @@ cdef class usm_ndarray: instance of :class:`dpctl.memory.MemoryUSMShared`, :class:`dpctl.memory.MemoryUSMDevice`, or :class:`dpctl.memory.MemoryUSMHost`; ``buffer`` can also be - another :class:`dpctl.tensor.usm_ndarray` instance, in which case its + another :class:`dpnp.tensor.usm_ndarray` instance, in which case its underlying ``MemoryUSM*`` buffer is used. """ @@ -859,7 +859,7 @@ cdef class usm_ndarray: @property def flags(self): """ - Returns :class:`dpctl.tensor._flags.Flags` object. + Returns :class:`dpnp.tensor._flags.Flags` object. """ return _flags.Flags(self, self.flags_) @@ -935,7 +935,7 @@ cdef class usm_ndarray: @property def device(self): """ - Returns :class:`dpctl.tensor.Device` object representing + Returns :class:`dpnp.tensor.Device` object representing residence of the array data. The ``Device`` object represents Array API notion of the @@ -1137,8 +1137,8 @@ cdef class usm_ndarray: It can be a oneAPI filter selector string, an instance of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL device, an instance of - :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` - object returned by :attr:`dpctl.tensor.usm_ndarray.device`. + :class:`dpctl.SyclQueue`, or a :class:`dpnp.tensor.Device` + object returned by :attr:`dpnp.tensor.usm_ndarray.device`. stream (:class:`dpctl.SyclQueue`, optional): Execution queue to synchronize with. If ``None``, synchronization is not performed. @@ -1420,7 +1420,7 @@ cdef class usm_ndarray: allocated, or the non-partitioned parent device of the allocation device. - See :class:`dpctl.tensor.DLDeviceType` for a list of devices supported + See :class:`dpnp.tensor.DLDeviceType` for a list of devices supported by the DLPack protocol. Raises: