| 957 | } |
| 958 | |
| 959 | Result<std::unique_ptr<Message>> GetTensorMessage(const Tensor& tensor, |
| 960 | MemoryPool* pool) { |
| 961 | const Tensor* tensor_to_write = &tensor; |
| 962 | std::unique_ptr<Tensor> temp_tensor; |
| 963 | |
| 964 | if (!tensor.is_contiguous()) { |
| 965 | RETURN_NOT_OK(GetContiguousTensor(tensor, pool, &temp_tensor)); |
| 966 | tensor_to_write = temp_tensor.get(); |
| 967 | } |
| 968 | |
| 969 | IpcWriteOptions options; |
| 970 | options.alignment = kTensorAlignment; |
| 971 | std::shared_ptr<Buffer> metadata; |
| 972 | ARROW_ASSIGN_OR_RAISE(metadata, |
| 973 | internal::WriteTensorMessage(*tensor_to_write, 0, options)); |
| 974 | return std::make_unique<Message>(metadata, tensor_to_write->data()); |
| 975 | } |
| 976 | |
| 977 | namespace internal { |
| 978 |
nothing calls this directly
no test coverage detected