SciRS2Tensor

Trait SciRS2Tensor 

Source
pub trait SciRS2Tensor {
    // Required methods
    fn shape(&self) -> &[usize];
    fn view(&self) -> ArrayViewD<'_, f64>;
    fn to_scirs2(&self) -> Result<SciRS2Array>;
    fn matmul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>;
    fn add(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>;
    fn mul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>;
    fn sub(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>;
    fn sum(&self, axis: Option<usize>) -> Result<SciRS2Array>;
    fn mean(&self, axis: Option<usize>) -> Result<SciRS2Array>;
    fn max(&self, axis: Option<usize>) -> Result<SciRS2Array>;
    fn min(&self, axis: Option<usize>) -> Result<SciRS2Array>;
}
Expand description

Trait for tensor operations compatible with SciRS2

Required Methods§

Source

fn shape(&self) -> &[usize]

Get tensor shape

Source

fn view(&self) -> ArrayViewD<'_, f64>

Get tensor data as ArrayViewD

Source

fn to_scirs2(&self) -> Result<SciRS2Array>

Convert to SciRS2 format (placeholder)

Source

fn matmul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>

Perform tensor operations using SciRS2 backend

Source

fn add(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>

Element-wise operations

Source

fn mul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>

Source

fn sub(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>

Source

fn sum(&self, axis: Option<usize>) -> Result<SciRS2Array>

Reduction operations

Source

fn mean(&self, axis: Option<usize>) -> Result<SciRS2Array>

Source

fn max(&self, axis: Option<usize>) -> Result<SciRS2Array>

Source

fn min(&self, axis: Option<usize>) -> Result<SciRS2Array>

Implementors§