You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/creation_functions.py
+2-2
Original file line number
Diff line number
Diff line change
@@ -218,7 +218,7 @@ def eye(
218
218
deffrom_dlpack(
219
219
x: object, /, *,
220
220
device: Optional[device] =None,
221
-
copy: Optional[bool] =False,
221
+
copy: Optional[bool] =None
222
222
) ->Union[array, Any]:
223
223
"""
224
224
Returns a new array containing the data from another (array) object with a ``__dlpack__`` method.
@@ -238,7 +238,7 @@ def from_dlpack(
238
238
239
239
Other kinds of devices will be considered for standardization in a future version.
240
240
copy: Optional[bool]
241
-
boolean indicating whether or not to copy the input. If ``True``, the function must always copy. If ``False``, the function must never copy and must raise a ``BufferError`` in case a copy would be necessary (e.g. the producer disallows views). Default: ``False``.
241
+
boolean indicating whether or not to copy the input. If ``True``, the function must always copy. If ``False``, the function must never copy and must raise a ``BufferError`` in case a copy would be necessary (e.g. the producer disallows views). If ``None``, the function must reuse existing memory buffer if possible and copy otherwise. Default: ``None``.
242
242
243
243
If a copy is needed, the stream over which the copy is performed must be taken from the consumer, following the DLPack protocol (see :meth:`array.__dlpack__`).
0 commit comments