@@ -152,33 +152,48 @@ cdef class StridedMemoryView:
152152
153153 @classmethod
154154 def from_dlpack (cls , obj: object , stream_ptr: int | None = None ) -> StridedMemoryView:
155+ """Create a view from an object supporting the DLPack_ protocol.
156+
157+ Parameters
158+ ----------
159+ obj : object
160+ An object implementing the DLPack_ protocol (via ``__dlpack__``).
161+ stream_ptr : int , optional
162+ Stream pointer for synchronization. If ``None``, no synchronization is performed.
163+
164+ .. _DLPack: https://dmlc.github.io/dlpack/latest/
165+ """
155166 cdef StridedMemoryView buf = StridedMemoryView.__new__ (cls )
156167 view_as_dlpack(obj , stream_ptr , buf )
157168 return buf
158169
159170 @classmethod
160171 def from_cuda_array_interface(cls , obj: object , stream_ptr: int | None = None ) -> StridedMemoryView:
161- """Create a view from an object supporting the `` __cuda_array_interface__`` protocol.
172+ """Create a view from an object supporting the `__cuda_array_interface__`_ protocol.
162173
163174 Parameters
164175 ----------
165176 obj : object
166- An object implementing the `` __cuda_array_interface__`` protocol.
177+ An object implementing the `__cuda_array_interface__`_ protocol.
167178 stream_ptr : int , optional
168179 Stream pointer for synchronization. If ``None``, no synchronization is performed.
180+
181+ .. _`__cuda_array_interface__`: https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html
169182 """
170183 cdef StridedMemoryView buf = StridedMemoryView.__new__ (cls )
171184 view_as_cai(obj , stream_ptr , buf )
172185 return buf
173186
174187 @classmethod
175188 def from_array_interface(cls , obj: object ) -> StridedMemoryView:
176- """Create a view from an object supporting the `` __array_interface__`` protocol.
189+ """Create a view from an object supporting the `__array_interface__`_ protocol.
177190
178191 Parameters
179192 ----------
180193 obj : object
181- An object implementing the ``__array_interface__`` protocol (e.g., a numpy array ).
194+ An object implementing the `__array_interface__`_ protocol (e.g., a numpy array ).
195+
196+ .. _`__array_interface__`: https://numpy.org/doc/stable/reference/arrays.interface.html
182197 """
183198 cdef StridedMemoryView buf = StridedMemoryView.__new__ (cls )
184199 view_as_array_interface(obj , buf )
@@ -188,14 +203,17 @@ cdef class StridedMemoryView:
188203 def from_any_interface(cls , obj: object , stream_ptr: int | None = None ) -> StridedMemoryView:
189204 """Create a view by automatically selecting the best available protocol.
190205
191- Tries DLPack first , then falls back to `` __cuda_array_interface__`` .
206+ Tries DLPack_ first , then falls back to `__cuda_array_interface__`_ .
192207
193208 Parameters
194209 ----------
195210 obj : object
196- An object implementing DLPack or `` __cuda_array_interface__`` .
211+ An object implementing DLPack_ or `__cuda_array_interface__`_ .
197212 stream_ptr : int , optional
198213 Stream pointer for synchronization. If ``None``, no synchronization is performed.
214+
215+ .. _DLPack: https://dmlc.github.io/dlpack/latest/
216+ .. _`__cuda_array_interface__`: https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html
199217 """
200218 if check_has_dlpack(obj ):
201219 return cls .from_dlpack(obj, stream_ptr)
0 commit comments