Realm

oa::data::HostTensor

A dense tensor living in host memory. Shape semantics match Matrix: num_elements is the shape product and shape[0] is the leading (sample or batch) dimension.

StRust public API

Declaration

pub struct HostTensor { pub shape: Vec<usize>, pub values: HostValues, }
Public Rust declaration.

Public Methods

pub fn num_elements(&self) -> usize
pub fn dtype(&self) -> DType
pub fn to_matrix_on(&self, runtime: &Runtime) -> Result<Matrix>
fn clone(&self) -> HostTensor
fn fmt(&self, f: &mut Formatter<'_>) -> Result

Associated Functions

pub fn new(shape: impl Into<Vec<usize>>, values: HostValues) -> Result<Self>

Public Data Members

shapeVec<usize>field
valuesHostValuesfield

Public Method Documentation

pub fn num_elements( &self ) -> usize
No public source comment is attached to this declaration.
pub fn dtype( &self ) -> DType
No public source comment is attached to this declaration.
pub fn to_matrix_on( &self, runtime: &Runtime ) -> Result<Matrix>
No public source comment is attached to this declaration.
fn clone( &self ) -> HostTensor
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
pub fn new( shape: impl Into<Vec<usize>>, values: HostValues ) -> Result<Self>
No public source comment is attached to this declaration.