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§
Sourcefn view(&self) -> ArrayViewD<'_, f64>
fn view(&self) -> ArrayViewD<'_, f64>
Get tensor data as ArrayViewD
Sourcefn to_scirs2(&self) -> Result<SciRS2Array>
fn to_scirs2(&self) -> Result<SciRS2Array>
Convert to SciRS2 format (placeholder)
Sourcefn matmul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>
fn matmul(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>
Perform tensor operations using SciRS2 backend
Sourcefn add(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>
fn add(&self, other: &dyn SciRS2Tensor) -> Result<SciRS2Array>
Element-wise operations