Skip to content

Commit f6ec8ca

Browse files
committed
allow 3-way copy arg to align all constructors
1 parent 181eefb commit f6ec8ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def eye(
218218
def from_dlpack(
219219
x: object, /, *,
220220
device: Optional[device] = None,
221-
copy: Optional[bool] = False,
221+
copy: Optional[bool] = None,
222222
) -> Union[array, Any]:
223223
"""
224224
Returns a new array containing the data from another (array) object with a ``__dlpack__`` method.
@@ -238,7 +238,7 @@ def from_dlpack(
238238
239239
Other kinds of devices will be considered for standardization in a future version.
240240
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``.
242242
243243
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__`).
244244

0 commit comments

Comments
 (0)