Skip to content

Commit

Permalink
Add documentation for constants and DLDeviceType enums
Browse files Browse the repository at this point in the history
  • Loading branch information
ndgrigorian committed Aug 8, 2024
1 parent 5ae872a commit c489c7e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/doc_sources/api_reference/dpctl/tensor.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _dpctl_tensor_constants:

Constants
========================

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

.. currentmodule:: dpctl.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 π.

2 changes: 2 additions & 0 deletions docs/doc_sources/api_reference/dpctl/tensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This module contains:
* :ref:`sorting functions <dpctl_tensor_sorting_functions>`
* :ref:`statistical functions <dpctl_tensor_statistical_functions>`
* :ref:`utility functions <dpctl_tensor_utility_functions>`
* :ref:`constants <dpctl_tensor_constants>`


.. toctree::
Expand All @@ -48,3 +49,4 @@ This module contains:
tensor.sorting_functions
tensor.statistical_functions
tensor.utility_functions
tensor.constants
2 changes: 2 additions & 0 deletions dpctl/tensor/_usmarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,8 @@ cdef class usm_ndarray:
The tuple describes the non-partitioned device where the array has been allocated,
or the non-partitioned parent device of the allocation device.
See ``DLDeviceType`` for a list of devices supported by the DLPack protocol.
Raises:
DLPackCreationError:
when the ``device_id`` could not be determined.
Expand Down

0 comments on commit c489c7e

Please sign in to comment.