Struct arrow::tensor::Tensor[][src]

pub struct Tensor<'a, T: ArrowPrimitiveType> { /* fields omitted */ }
Expand description

Tensor of primitive types

Implementations

impl<'a, T: ArrowPrimitiveType> Tensor<'a, T>[src]

pub fn try_new(
    buffer: Buffer,
    shape: Option<Vec<usize>>,
    strides: Option<Vec<usize>>,
    names: Option<Vec<&'a str>>
) -> Result<Self>
[src]

Creates a new Tensor

pub fn new_row_major(
    buffer: Buffer,
    shape: Option<Vec<usize>>,
    names: Option<Vec<&'a str>>
) -> Result<Self>
[src]

Creates a new Tensor using row major memory layout

pub fn new_column_major(
    buffer: Buffer,
    shape: Option<Vec<usize>>,
    names: Option<Vec<&'a str>>
) -> Result<Self>
[src]

Creates a new Tensor using column major memory layout

pub fn data_type(&self) -> &DataType[src]

The data type of the Tensor

pub fn shape(&self) -> Option<&Vec<usize>>[src]

The sizes of the dimensions

pub fn data(&self) -> &Buffer[src]

Returns a reference to the underlying Buffer

pub fn strides(&self) -> Option<&Vec<usize>>[src]

The number of bytes between elements in each dimension

pub fn names(&self) -> Option<&Vec<&'a str>>[src]

The names of the dimensions

pub fn ndim(&self) -> usize[src]

The number of dimensions

pub fn dim_name(&self, i: usize) -> Option<&'a str>[src]

The name of dimension i

pub fn size(&self) -> usize[src]

The total number of elements in the Tensor

pub fn is_contiguous(&self) -> Result<bool>[src]

Indicates if the data is laid out contiguously in memory

pub fn is_row_major(&self) -> Result<bool>[src]

Indicates if the memory layout row major

pub fn is_column_major(&self) -> Result<bool>[src]

Indicates if the memory layout column major

Trait Implementations

impl<'a, T: Debug + ArrowPrimitiveType> Debug for Tensor<'a, T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Tensor<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Tensor<'a, T> where
    T: Send

impl<'a, T> Sync for Tensor<'a, T> where
    T: Sync

impl<'a, T> Unpin for Tensor<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Tensor<'a, T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V