pub struct TensorExtractor { /* private fields */ }Expand description
Extracts tensor data from Arrow RecordBatches.
This struct configures which columns to extract and how to convert them.
Implementations§
Source§impl TensorExtractor
impl TensorExtractor
Sourcepub fn from_columns(columns: Vec<String>) -> Self
pub fn from_columns(columns: Vec<String>) -> Self
Creates an extractor from owned column names.
Sourcepub fn extract_f32(&self, batch: &RecordBatch) -> Result<TensorData<f32>>
pub fn extract_f32(&self, batch: &RecordBatch) -> Result<TensorData<f32>>
Extracts data as f32 tensor.
Numeric columns are converted to f32. Non-numeric columns cause an error.
§Errors
Returns an error if:
- A requested column doesn’t exist
- A column contains non-numeric data
Sourcepub fn extract_f64(&self, batch: &RecordBatch) -> Result<TensorData<f64>>
pub fn extract_f64(&self, batch: &RecordBatch) -> Result<TensorData<f64>>
Extracts data as f64 tensor.
Numeric columns are converted to f64. Non-numeric columns cause an error.
§Errors
Returns an error if:
- A requested column doesn’t exist
- A column contains non-numeric data
Sourcepub fn extract_i64(&self, batch: &RecordBatch) -> Result<TensorData<i64>>
pub fn extract_i64(&self, batch: &RecordBatch) -> Result<TensorData<i64>>
Extracts data as i64 tensor.
Integer columns are converted to i64. Non-integer columns cause an error.
§Errors
Returns an error if:
- A requested column doesn’t exist
- A column contains non-integer data
Trait Implementations§
Source§impl Clone for TensorExtractor
impl Clone for TensorExtractor
Source§fn clone(&self) -> TensorExtractor
fn clone(&self) -> TensorExtractor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TensorExtractor
impl RefUnwindSafe for TensorExtractor
impl Send for TensorExtractor
impl Sync for TensorExtractor
impl Unpin for TensorExtractor
impl UnsafeUnpin for TensorExtractor
impl UnwindSafe for TensorExtractor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.