Expand description
Apache Arrow memory layout integration for zero-copy tensor access.
This module provides conversions between IPFRS tensor types and Apache Arrow arrays, enabling zero-copy interoperability with the Arrow ecosystem (Parquet, Flight, etc.).
§Example
use ipfrs_core::arrow::{TensorBlockArrowExt, arrow_to_tensor_block};
use ipfrs_core::tensor::{TensorBlock, TensorDtype, TensorShape};
use bytes::Bytes;
use arrow_array::Float32Array;
// Convert Arrow array to TensorBlock (zero-copy)
let arrow_array = Float32Array::from(vec![1.0f32, 2.0, 3.0, 4.0]);
let tensor = arrow_to_tensor_block(&arrow_array, TensorShape::new(vec![2, 2])).unwrap();
// Convert TensorBlock back to Arrow array
let arrow_back = tensor.to_arrow_array().unwrap();Traits§
- Tensor
Block Arrow Ext - Extension trait for TensorBlock to provide Arrow conversions
Functions§
- arrow_
dtype_ to_ tensor - Convert Arrow DataType to TensorDtype
- arrow_
to_ tensor_ block - Convert an Arrow array to a TensorBlock (zero-copy)
- tensor_
dtype_ to_ arrow - Convert TensorDtype to Arrow DataType
- tensors_
to_ record_ batch - Create an Arrow RecordBatch from multiple TensorBlocks