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