Trait BaseTensorOps

Source
pub trait BaseTensorOps
where Self::Item: NumberOps + Clone,
{ type Item; // Required methods fn shape(&self) -> &Vec<u64>; fn reshape(&self, shape: Vec<i64>) -> Result<Self> where Self: Sized; fn from_values(shape: Vec<u64>, values: Vec<Self::Item>) -> Result<Self> where Self: Sized; // Provided methods fn resolve_dim(&self, dim: i64) -> Result<u64> { ... } fn resolve_shape(&self, shape2: Vec<i64>) -> Result<Vec<u64>> { ... } fn zeros(shape: Vec<u64>) -> Result<Self> where Self: Sized, Self::Item: ConstZero { ... } fn ones(shape: Vec<u64>) -> Result<Self> where Self: Sized, Self::Item: ConstOne { ... } fn of(shape: Vec<u64>, v: Self::Item) -> Result<Self> where Self: Sized { ... } fn rand(shape: Vec<u64>, rng: &mut impl Rng) -> Result<Self> where Self: Sized { ... } }

Required Associated Types§

Required Methods§

Source

fn shape(&self) -> &Vec<u64>

Source

fn reshape(&self, shape: Vec<i64>) -> Result<Self>
where Self: Sized,

Source

fn from_values(shape: Vec<u64>, values: Vec<Self::Item>) -> Result<Self>
where Self: Sized,

Provided Methods§

Source

fn resolve_dim(&self, dim: i64) -> Result<u64>

Source

fn resolve_shape(&self, shape2: Vec<i64>) -> Result<Vec<u64>>

Source

fn zeros(shape: Vec<u64>) -> Result<Self>
where Self: Sized, Self::Item: ConstZero,

Source

fn ones(shape: Vec<u64>) -> Result<Self>
where Self: Sized, Self::Item: ConstOne,

Source

fn of(shape: Vec<u64>, v: Self::Item) -> Result<Self>
where Self: Sized,

Source

fn rand(shape: Vec<u64>, rng: &mut impl Rng) -> Result<Self>
where Self: Sized,

Implementors§