Skip to content

Commit

Permalink
Add docstring for asarray
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Oct 1, 2024
1 parent dafb06a commit 56e3c89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ucp/_libs/arr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ cdef inline Py_ssize_t _nbytes(Py_ssize_t itemsize,


cpdef Array asarray(obj):
"""Coerce other objects to ``Array``. No-op for existing ``Array``s.
Args:
obj: Object exposing the Python buffer protocol or ``__cuda_array_interface__``
Returns:
Array: An instance of the ``Array`` class
"""
if isinstance(obj, Array):
return <Array>obj
else:
Expand Down

0 comments on commit 56e3c89

Please sign in to comment.