From 56e3c8999be2f23c3563f002960e487f1a2d7526 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 1 Oct 2024 00:33:26 -0700 Subject: [PATCH] Add docstring for `asarray` --- ucp/_libs/arr.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ucp/_libs/arr.pyx b/ucp/_libs/arr.pyx index 40501966..8ca0428a 100644 --- a/ucp/_libs/arr.pyx +++ b/ucp/_libs/arr.pyx @@ -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 obj else: