jorisvandenbossche commented on code in PR #40064:
URL: https://github.com/apache/arrow/pull/40064#discussion_r1489080427
##########
cpp/src/arrow/record_batch.h:
##########
@@ -80,6 +80,13 @@ class ARROW_EXPORT RecordBatch {
/// in the resulting struct array.
Result<std::shared_ptr<StructArray>> ToStructArray() const;
+ /// \brief Convert record batch with one data type to Tensor
+ ///
+ /// Create a Tensor object with shape (number of rows, number of columns) and
+ /// strides (type size in bytes, type size in bytes * number of rows).
+ /// Generated Tensor will have column-major layout.
+ Result<std::shared_ptr<Tensor>> ToTensor() const;
Review Comment:
```suggestion
Result<std::shared_ptr<Tensor>> ToTensor(MemoryPool* pool =
default_memory_pool()) const;
```
Should probably give this a memory pool argument (since it is allocating new
memory), that can you pass through to AllocateBuffer
--
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]