pub trait TensorShape {
// Required methods
fn reshape(&mut self, new_shape: Vec<usize>);
fn permute(&mut self, dims: &[usize]);
fn transpose(&mut self);
fn flatten(&mut self);
fn squeeze(&mut self);
fn unsqueeze(&mut self, dim: usize);
fn broadcast(&self, new_shape: &[usize]) -> Self;
fn compute_broadcast_shape(&self, target_shape: &[usize]) -> Vec<usize>;
fn compute_broadcast_strides(&self, broadcast_shape: &[usize]) -> Vec<usize>;
fn pad_shape(&self, target_rank: usize) -> Vec<usize>;
fn broadcast_tensors(a: &Self, b: &Self) -> (Self, Self)
where Self: Sized;
}Required Methods§
fn reshape(&mut self, new_shape: Vec<usize>)
fn permute(&mut self, dims: &[usize])
fn transpose(&mut self)
fn flatten(&mut self)
fn squeeze(&mut self)
fn unsqueeze(&mut self, dim: usize)
fn broadcast(&self, new_shape: &[usize]) -> Self
fn compute_broadcast_shape(&self, target_shape: &[usize]) -> Vec<usize>
fn compute_broadcast_strides(&self, broadcast_shape: &[usize]) -> Vec<usize>
fn pad_shape(&self, target_rank: usize) -> Vec<usize>
fn broadcast_tensors(a: &Self, b: &Self) -> (Self, Self)where
Self: Sized,
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.