Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Add doc page for dpctl.tensor._flags.Flags class #1794

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions docs/doc_sources/api_reference/dpctl/flags.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _Flags_class:

``Flags`` class
===================

.. autoclass:: dpctl.tensor._flags.Flags
:members:

Note that dictionary-like access to some members is permitted:

"C", "C_CONTIGUOUS":
Equivalent to ``c_contiguous``
"F", "F_CONTIGUOUS":
Equivalent to ``f_contiguous``
"W", "WRITABLE":
Equivalent to ``writable``
"FC":
Equivalent to ``fc``
"FNC":
Equivalent to ``fnc``
"FORC", "CONTIGUOUS":
Equivalent to ``forc`` and ``contiguous``
5 changes: 5 additions & 0 deletions docs/doc_sources/api_reference/dpctl/tensor.usm_ndarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Implementation of :py:class:`usm_ndarray` conforms to
.. _dpctl_tensor_usm_ndarray_to_device_example:

.. include:: examples/usm_ndarray.rst

.. toctree::
:hidden:

flags
5 changes: 3 additions & 2 deletions dpctl/tensor/_flags.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ cdef cpp_bool _check_bit(int flag, int mask):

cdef class Flags:
"""
Helper class to represent memory layout flags of
:class:`dpctl.tensor.usm_ndarray`.
Helper class to query the flags of a :class:`dpctl.tensor.usm_ndarray`
instance, which describe how the instance interfaces with its underlying
memory.
"""
cdef int flags_
cdef usm_ndarray arr_
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_usmarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ cdef class usm_ndarray:
@property
def flags(self):
"""
Returns :class:`dpctl.tensor._flags` object.
Returns :class:`dpctl.tensor._flags.Flags` object.
"""
return _flags.Flags(self, self.flags_)

Expand Down
Loading