AntoinePrv commented on code in PR #50929:
URL: https://github.com/apache/arrow/pull/50929#discussion_r3893060160
##########
cpp/src/arrow/tensor.h:
##########
@@ -56,10 +57,17 @@ constexpr bool is_tensor_supported(Type::type type_id) {
namespace internal {
ARROW_EXPORT
-Status ComputeRowMajorStrides(const FixedWidthType& type,
- const std::vector<int64_t>& shape,
+Status ComputeRowMajorStrides(const FixedWidthType& type, std::span<const
int64_t> shape,
std::vector<int64_t>* strides);
+/// Compute the row-major strides of a tensor with the given shape.
+///
+/// Pass `elem_size=1` to get the strides in number of elements, or the
element size in
+/// bytes to get them in bytes. On error, the contents of `strides` are
unspecified.
+ARROW_EXPORT
+Status ComputeRowMajorStrides(std::span<const int64_t> shape, int64_t
elem_size,
Review Comment:
That is a leftover from when I initially implemented tensor support for
fixed size list directly in DLPack (so I needed to compute the strides
internally).
Reverting now.
--
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]