TransformOps

Trait TransformOps 

Source
pub trait TransformOps {
Show 18 methods // Required methods fn apply<F>(&self, op: F) -> Self where F: Fn(f32) -> f32; fn apply_assign<F>(&mut self, op: F) where F: Fn(f32) -> f32; fn elementwise_op<F>(&self, other: &Self, op: F) -> Self where F: Fn(f32, f32) -> f32; fn scalar_op<F>(&self, scalar: f32, op: F) -> Self where F: Fn(f32, f32) -> f32; fn elementwise_op_assign<F>(&mut self, other: &Self, op: F) where F: Fn(f32, f32) -> f32; fn scalar_op_assign<F>(&mut self, scalar: f32, op: F) where F: Fn(f32, f32) -> f32; fn sum_dim(&self, dims: &[bool]) -> Self; fn reshape(&mut self, new_shape: Vec<usize>); fn permute(&mut self, dims: &[usize]); fn transpose(&self) -> 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§

Source

fn apply<F>(&self, op: F) -> Self
where F: Fn(f32) -> f32,

Source

fn apply_assign<F>(&mut self, op: F)
where F: Fn(f32) -> f32,

Source

fn elementwise_op<F>(&self, other: &Self, op: F) -> Self
where F: Fn(f32, f32) -> f32,

Source

fn scalar_op<F>(&self, scalar: f32, op: F) -> Self
where F: Fn(f32, f32) -> f32,

Source

fn elementwise_op_assign<F>(&mut self, other: &Self, op: F)
where F: Fn(f32, f32) -> f32,

Source

fn scalar_op_assign<F>(&mut self, scalar: f32, op: F)
where F: Fn(f32, f32) -> f32,

Source

fn sum_dim(&self, dims: &[bool]) -> Self

Source

fn reshape(&mut self, new_shape: Vec<usize>)

Source

fn permute(&mut self, dims: &[usize])

Source

fn transpose(&self) -> Self

Source

fn flatten(&mut self)

Source

fn squeeze(&mut self)

Source

fn unsqueeze(&mut self, dim: usize)

Source

fn broadcast(&self, new_shape: &[usize]) -> Self

Source

fn compute_broadcast_shape(&self, target_shape: &[usize]) -> Vec<usize>

Source

fn compute_broadcast_strides(&self, broadcast_shape: &[usize]) -> Vec<usize>

Source

fn pad_shape(&self, target_rank: usize) -> Vec<usize>

Source

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.

Implementors§