Skip to content

Commit 338742a

Browse files
committed
clarify what's 'on CPU'
1 parent 60f7439 commit 338742a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/array_api_stubs/_draft/creation_functions.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ def from_dlpack(
230230
device: Optional[device]
231231
device on which to place the created array. If ``device`` is ``None`` and ``x`` supports DLPack, the output array must be on the same device as ``x``. Default: ``None``.
232232
233-
The v2023.12 standard only mandates that a compliant library must offer a way for ``from_dlpack`` to create an array on CPU (using
234-
a library-specific way to represent the CPU device (``kDLCPU`` in DLPack) e.g. a ``"CPU"`` string or a ``Device("CPU")`` object).
233+
The v2023.12 standard only mandates that a compliant library must offer a way for ``from_dlpack`` to create an array
234+
whose underlying memory is accessible to the Python interpreter (using a library-specific way to represent the CPU
235+
device (``kDLCPU`` in DLPack) e.g. a ``"CPU"`` string or a ``Device("CPU")`` object).
235236
If the array library does not support the CPU device and needs to outsource to another (compliant) array library, it may do so
236237
with a clear user documentation and/or run-time warning. If a copy must be made to enable this, and ``copy`` is set to ``False``,
237238
the function must raise ``ValueError``.

0 commit comments

Comments
 (0)