pitrou commented on code in PR #40294:
URL: https://github.com/apache/arrow/pull/40294#discussion_r1507798685
##########
python/pyarrow/tensor.pxi:
##########
@@ -282,10 +292,8 @@ strides: {0.strides}""".format(self)
buffer.readonly = 0
else:
buffer.readonly = 1
- # NOTE: This assumes Py_ssize_t == int64_t, and that the shape
- # and strides arrays lifetime is tied to the tensor's
- buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]
- buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]
+ buffer.shape = <Py_ssize_t *> cp.PyBytes_AsString(self._ssize_t_shape)
+ buffer.strides = <Py_ssize_t *>
cp.PyBytes_AsString(self._ssize_t_strides)
Review Comment:
I don't think Cython would take the `bytes` object pointer implicitly? That
said, I can try to remove it.
--
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]