Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
01f4f01
Update _accumulation.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
ce0dbcf
Update _array_api.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
bb18a1c
Update _clip.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
71aa230
Update _copy_utils.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
550a7f9
Update _ctors.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
06da7e1
Update _data_types.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
9df90ee
Update _device.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
8c8cc73
Update _dlpack.pyx doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
fea6832
Update _flags.pyx doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
1d021b6
Update _elementwise_common.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
6f27c9c
Update _indexing_functions.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
f8db906
Update _elementwise_funcs.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
4283245
Update _linear_algebra_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
e92de86
Update _manipulation_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
93f1421
Update _print.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
d44e198
Update _reduction.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
dec9739
Update _reshape.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
022c8d0
Update _search_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
6692c3a
Update _searchsorted.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
7517ded
Update _set_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
59373f7
Update _slicing.pxi doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
664e6c1
Update _sorting.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
39bf99c
Update _statistical_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
8eaed32
Update _testing.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
95f2a57
Update _type_util.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
ce277cd
Update _usmarray.pyx doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
bff1672
Update _utility_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
16cf161
Update _compute_follows_data.pyx. doc to Sphinx format
vlad-perevezentsev Jun 11, 2026
e98a6bf
Add missing None to parameter type
vlad-perevezentsev Jun 11, 2026
68ef2d4
Add missing Default values to parameter docstrings
vlad-perevezentsev Jun 11, 2026
4d5be4e
Add missing None to parameter type(2)
vlad-perevezentsev Jun 11, 2026
dc3a6c0
Fix typos in dpnp.tensor docs
vlad-perevezentsev Jun 11, 2026
7d11958
Fix wrong rST roles
vlad-perevezentsev Jun 11, 2026
b9726ae
Replace dpctl.tensor with dpnp.tensor
vlad-perevezentsev Jun 11, 2026
92e26db
Remove redundant signature lines
vlad-perevezentsev Jun 11, 2026
7233403
Fix parameter name mismatches
vlad-perevezentsev Jun 11, 2026
99a57f9
Small update _usmarray.pyx to Sphinx format
vlad-perevezentsev Jun 11, 2026
306bcca
Fix typos in dpnp.tensor docs(2)
vlad-perevezentsev Jun 11, 2026
124386e
Update usm_ndarray docstrings
vlad-perevezentsev Apr 10, 2026
4d67432
Add dpnp.tensor API reference documentation
vlad-perevezentsev Apr 10, 2026
318c890
Add user guides for dpnp.tensor module
vlad-perevezentsev Apr 10, 2026
8d48839
Fix some typos and gaps
vlad-perevezentsev Jun 11, 2026
183e6ba
Remove cross-reference fallback for dpnp.tensor to dpctl
vlad-perevezentsev Jun 11, 2026
d49a663
Add :nosignatures: for dpnp.tensor docs
vlad-perevezentsev Jun 11, 2026
0c475ac
Remove outdated dpctl.tensor docs link from tensor.rst
vlad-perevezentsev Jun 11, 2026
02c8775
Update usm_ndarray docs
vlad-perevezentsev Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions doc/_templates/autosummary/cython_class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ name }}
{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree: generated
{% for item in methods if item != "__init__" %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:toctree: generated
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
12 changes: 12 additions & 0 deletions doc/_templates/autosummary/elementwise.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

{% if objtype == "data" %}
.. auto{{ objtype }}:: {{ objname }}
:no-value:
{% endif %}

{% if objtype == "function" %}
.. auto{{ objtype }}:: {{ objname }}
{% endif %}
48 changes: 48 additions & 0 deletions doc/_templates/autosummary/usm_ndarray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}



.. autoclass:: {{ name }}

{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree: generated
:nosignatures:
{% for item in methods if item != "__init__" %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:toctree: generated
:nosignatures:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}

.. rubric:: {{ _('Special attributes') }}

.. autosummary::
:toctree: generated
:nosignatures:

~{{name}}.__dlpack_device__
~{{name}}.__dlpack__
~{{name}}.__sycl_usm_array_interface__
~{{name}}._pointer
~{{name}}._element_offset
~{{name}}._byte_bounds

{% endif %}
{% endblock %}
66 changes: 0 additions & 66 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# http://www.sphinx-doc.org/en/master/config

from datetime import datetime
from urllib.parse import urljoin

from sphinx.ext.autodoc import FunctionDocumenter
from sphinx.ext.napoleon import NumpyDocstring, docstring
Expand Down Expand Up @@ -235,9 +234,6 @@ def _can_document_member(member, *args, **kwargs):

autosummary_generate = True

_DPCTL_021_BASE = "https://intelpython.github.io/dpctl/0.21.1/"
_DPCTL_021_INV = urljoin(_DPCTL_021_BASE, "objects.inv")

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
Expand Down Expand Up @@ -309,65 +305,3 @@ def _parse_returns_section_patched(self, section: str) -> list[str]:


NumpyDocstring._parse_returns_section = _parse_returns_section_patched


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _load_dpctl_tensor_inventory(app):
"""Load dpctl 0.21.1 inventory for dpnp.tensor fallback only."""
from sphinx.ext.intersphinx import fetch_inventory
from sphinx.util import logging

logger = logging.getLogger(__name__)

try:
inv = fetch_inventory(app, _DPCTL_021_BASE, _DPCTL_021_INV)
except Exception as exc:
logger.warning(
"Failed to load dpctl 0.21.1 inventory from %s: %s",
_DPCTL_021_INV,
exc,
)
inv = {}

app.builder.env._dpctl_tensor_021_inventory = inv


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _resolve_dpnp_tensor_refs(app, env, node, contnode):
"""Resolve dpnp.tensor.* references to dpctl 0.21.1 documentation.

This temporary workaround is needed because dpnp.tensor documentation
is not generated yet, while the corresponding API is still documented
in dpctl 0.21.1.
"""
from docutils import nodes as docutils_nodes

target = node.get("reftarget", "")
if not target.startswith("dpnp.tensor"):
return None

dpctl_target = target.replace("dpnp.tensor", "dpctl.tensor", 1)
dpctl_tensor_inv = getattr(env, "_dpctl_tensor_021_inventory", {})

for _objtype, objects in dpctl_tensor_inv.items():
if dpctl_target not in objects:
continue

item = objects[dpctl_target]
location = item.uri
if location.endswith("$"):
location = location[:-1] + dpctl_target

refuri = urljoin(_DPCTL_021_BASE, location)
newnode = docutils_nodes.reference(
"", "", internal=False, refuri=refuri
)
newnode += contnode.deepcopy()
return newnode

return None


def setup(app):
app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400)
app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400)
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ core `NumPy*`_ functions and numerical data types.

overview
quick_start_guide
user_guides/index
reference/index
tensor
dpnp_backend_api
1 change: 1 addition & 0 deletions doc/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ API reference of the Data Parallel Extension for NumPy*
.. toctree::
:maxdepth: 2

tensor
ndarray
ufunc
routines
Expand Down
16 changes: 16 additions & 0 deletions doc/reference/tensor.accumulation_functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _dpnp_tensor_accumulation_functions:

Accumulation functions
======================

Accumulation functions compute cumulative results along a given axis of the input array.

.. currentmodule:: dpnp.tensor

.. autosummary::
:toctree: generated
:nosignatures:

cumulative_logsumexp
cumulative_prod
cumulative_sum
35 changes: 35 additions & 0 deletions doc/reference/tensor.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _dpnp_tensor_constants:

Constants
=========

The following constants are defined in :py:mod:`dpnp.tensor`:

.. currentmodule:: dpnp.tensor

.. autodata:: DLDeviceType

.. data:: e

``float``:
IEEE 754 floating-point representation of Euler's constant.

.. data:: inf

``float``:
IEEE 754 floating-point representation of (positive) infinity.

.. data:: nan

``float``:
IEEE 754 floating-point representation of Not a Number (NaN).

.. data:: newaxis

``NoneType``:
Alias for ``None`` which is useful for indexing.

.. data:: pi

``float``:
IEEE 754 floating-point representation of the mathematical constant π.
32 changes: 32 additions & 0 deletions doc/reference/tensor.creation_functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. _dpnp_tensor_creation_functions:

Array creation functions
========================

The following functions in :py:mod:`dpnp.tensor` can be used
to create new arrays:

.. currentmodule:: dpnp.tensor

.. autosummary::
:toctree: generated
:nosignatures:

arange
asarray
empty
empty_like
eye
from_dlpack
full
full_like
linspace
meshgrid
ones
ones_like
tril
triu
zeros
zeros_like
from_numpy
copy
22 changes: 22 additions & 0 deletions doc/reference/tensor.data_type_functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _dpnp_tensor_data_type_functions:

Data type functions
===================

The package :py:mod:`dpnp.tensor` contains the following data type functions conforming
to `Python Array API specification <array_api_data_type_fns_>`_:

.. _array_api_data_type_fns: https://data-apis.org/array-api/latest/API_specification/data_type_functions.html

.. currentmodule:: dpnp.tensor

.. autosummary::
:toctree: generated
:nosignatures:

astype
can_cast
finfo
iinfo
isdtype
result_type
Loading
Loading