AntoinePrv commented on code in PR #50827:
URL: https://github.com/apache/arrow/pull/50827#discussion_r3773616790
##########
python/pyarrow/tensor.pxi:
##########
@@ -310,20 +310,45 @@ strides: {self.strides}"""
A Python integer representing a pointer to a stream. Currently not
supported.
Stream is provided by the consumer to the producer to instruct the
producer
to ensure that operations can safely be performed on the array.
+ max_version : tuple[int, int], optional
+ The maximum DLPack version the consumer supports, as (major,
minor).
+ A capsule of a different version may be returned, so the consumer
must
+ check it. Default is None, exporting the unversioned capsule.
+ dl_device : tuple[enum.Enum, int], optional
+ The device of the exported capsule, in the format returned by
+ :meth:`__dlpack_device__`. Default is None, meaning the device of
the
+ tensor itself. Since only CPU tensors are supported, any other
device
+ raises ``BufferError``.
+ copy : bool, optional
+ If True, the data is always copied. If False, it is never copied
and
+ ``BufferError`` is raised if a copy is required. If None
(default), the
+ data is copied only if needed, which for CPU tensors is never.
Review Comment:
Good catch! I think at the moment `None` gets converted to `False`.
> the data is copied only if needed, which for CPU tensors is never.
Ideally the `copy=None` should get forwarded as such to the C++ side, but at
the moment, `None` would get the same handling as `False` because we only
handle CPU (I'm planning on another PR to handle different devices).
What do you prefer we do? Explicitly pass a `None` to C++, or explicitly
convert `None` to `False` on the Python side?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]