| 969 | } |
| 970 | |
| 971 | Result<std::unique_ptr<Message>> GetTensorMessage(const Tensor& tensor, |
| 972 | MemoryPool* pool) { |
| 973 | const Tensor* tensor_to_write = &tensor; |
| 974 | std::unique_ptr<Tensor> temp_tensor; |
| 975 | |
| 976 | if (!tensor.is_contiguous()) { |
| 977 | RETURN_NOT_OK(GetContiguousTensor(tensor, pool, &temp_tensor)); |
| 978 | tensor_to_write = temp_tensor.get(); |
| 979 | } |
| 980 | |
| 981 | IpcWriteOptions options; |
| 982 | options.alignment = kTensorAlignment; |
| 983 | std::shared_ptr<Buffer> metadata; |
| 984 | ARROW_ASSIGN_OR_RAISE(metadata, |
| 985 | internal::WriteTensorMessage(*tensor_to_write, 0, options)); |
| 986 | return std::make_unique<Message>(metadata, tensor_to_write->data()); |
| 987 | } |
| 988 | |
| 989 | namespace internal { |
| 990 |
nothing calls this directly
no test coverage detected