pub trait TensorOps<T, I>: BaseTensorOps<Item = I>where
I: NumberOps,{
Show 22 methods
// Required methods
fn matmul(&self, rhs: &T) -> Result<T>;
fn item(&self) -> Result<Vec<I>>;
fn sum(&self, dim: i64) -> Result<T>;
fn apply(&self, f: impl Fn(Self::Item) -> Self::Item) -> Result<T>;
fn apply_xy(
&self,
rhs: &T,
f: impl Fn(Self::Item, Self::Item) -> Self::Item,
) -> Result<T>;
fn size(&self) -> Result<usize>;
// Provided methods
fn max(&self) -> Result<I>
where I: PartialOrd + FloatCore { ... }
fn log(&self, i: I) -> Result<T>
where I: Real { ... }
fn ln(&self) -> Result<T>
where I: Real { ... }
fn add(&self, rhs: &T) -> Result<T> { ... }
fn add_item(&self, rhs: &Self::Item) -> Result<T> { ... }
fn sub(&self, rhs: &T) -> Result<T> { ... }
fn sub_item(&self, rhs: &Self::Item) -> Result<T> { ... }
fn mul(&self, rhs: &T) -> Result<T> { ... }
fn mul_item(&self, rhs: &Self::Item) -> Result<T> { ... }
fn div_item(&self, rhs: &Self::Item) -> Result<T> { ... }
fn div(&self, rhs: &T) -> Result<T> { ... }
fn dim(&self, dim: i64) -> Result<u64> { ... }
fn sqrt(&self) -> Result<T>
where I: Real { ... }
fn tanh(&self) -> Result<T>
where I: Real { ... }
fn neg(&self) -> Result<T>
where I: Neg<Output = I> { ... }
fn exp(&self) -> Result<T>
where I: Real { ... }
}
Required Methods§
fn matmul(&self, rhs: &T) -> Result<T>
fn item(&self) -> Result<Vec<I>>
fn sum(&self, dim: i64) -> Result<T>
fn apply(&self, f: impl Fn(Self::Item) -> Self::Item) -> Result<T>
fn apply_xy( &self, rhs: &T, f: impl Fn(Self::Item, Self::Item) -> Self::Item, ) -> Result<T>
fn size(&self) -> Result<usize>
Provided Methods§
fn max(&self) -> Result<I>where
I: PartialOrd + FloatCore,
fn log(&self, i: I) -> Result<T>where
I: Real,
fn ln(&self) -> Result<T>where
I: Real,
fn add(&self, rhs: &T) -> Result<T>
fn add_item(&self, rhs: &Self::Item) -> Result<T>
fn sub(&self, rhs: &T) -> Result<T>
fn sub_item(&self, rhs: &Self::Item) -> Result<T>
fn mul(&self, rhs: &T) -> Result<T>
fn mul_item(&self, rhs: &Self::Item) -> Result<T>
fn div_item(&self, rhs: &Self::Item) -> Result<T>
fn div(&self, rhs: &T) -> Result<T>
fn dim(&self, dim: i64) -> Result<u64>
fn sqrt(&self) -> Result<T>where
I: Real,
fn tanh(&self) -> Result<T>where
I: Real,
fn neg(&self) -> Result<T>where
I: Neg<Output = I>,
fn exp(&self) -> Result<T>where
I: Real,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.