pub struct CpuStorage { /* private fields */ }Trait Implementations§
Source§impl ActivationOps for CpuStorage
impl ActivationOps for CpuStorage
fn binary_step(&self) -> Self
fn sigmoid(&self) -> Self
fn tanh(&self) -> Self
fn relu(&self) -> Self
fn leaky_relu(&self) -> Self
fn parametric_relu(&self, a: f32) -> Self
fn elu(&self, alpha: f32) -> Self
fn softmax(&self, dim: usize) -> Self
fn swish(&self) -> Self
Source§impl ArithmeticOps for CpuStorage
impl ArithmeticOps for CpuStorage
fn add_tensor(&self, other: &Self) -> Self
fn sub_tensor(&self, other: &Self) -> Self
fn mul_tensor(&self, other: &Self) -> Self
fn div_tensor(&self, other: &Self) -> Self
fn add_f32(&self, other: f32) -> Self
fn sub_f32(&self, other: f32) -> Self
fn mul_f32(&self, other: f32) -> Self
fn div_f32(&self, other: f32) -> Self
fn pow_f32(&self, other: f32) -> Self
fn greater_than(&self, other: &Self, make_binary: bool) -> Self
fn greater_than_f32(&self, other: f32, make_binary: bool) -> Self
fn less_than(&self, other: &Self, make_binary: bool) -> Self
fn less_than_f32(&self, other: f32, make_binary: bool) -> Self
fn sign(&self) -> Self
fn abs(&self) -> Self
fn add_tensor_assign(&mut self, other: &Self)
fn sub_tensor_assign(&mut self, other: &Self)
fn mul_tensor_assign(&mut self, other: &Self)
fn div_tensor_assign(&mut self, other: &Self)
fn add_f32_assign(&mut self, other: f32)
fn sub_f32_assign(&mut self, other: f32)
fn mul_f32_assign(&mut self, other: f32)
fn div_f32_assign(&mut self, other: f32)
fn pow_f32_assign(&mut self, other: f32)
fn abs_assign(&mut self)
Source§impl BlasOps for CpuStorage
impl BlasOps for CpuStorage
Source§impl Clone for CpuStorage
impl Clone for CpuStorage
Source§fn clone(&self) -> CpuStorage
fn clone(&self) -> CpuStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CpuStorage
impl Debug for CpuStorage
Source§impl DeviceStorage for CpuStorage
impl DeviceStorage for CpuStorage
fn view(&self, new_shape: Vec<usize>) -> Self
fn data(&self) -> Arc<RwLock<Vec<f32>>>
fn data_mut(&self) -> RwLockWriteGuard<'_, Vec<f32>>
fn set_data(&mut self, data: Vec<f32>)
fn shape(&self) -> &Vec<usize>
fn set_shape(&mut self, shape: Vec<usize>)
fn stride(&self) -> &Vec<usize>
fn set_stride(&mut self, stride: Vec<usize>)
fn offset(&self) -> usize
fn get(&self, indices: &[usize]) -> f32
fn set(&mut self, indices: &[usize], value: f32)
fn make_contiguous(&self) -> (Vec<f32>, i32)
fn is_contiguous(&self) -> bool
Source§impl DeviceStorageCreation for CpuStorage
impl DeviceStorageCreation for CpuStorage
fn zeros( shape: Vec<usize>, _device: Option<Device>, _requires_grad: Option<bool>, ) -> Self
fn ones( shape: Vec<usize>, _device: Option<Device>, _requires_grad: Option<bool>, ) -> Self
fn from_ndarray<S, D, T>( data: &ArrayBase<S, D>, _device: Option<Device>, _requires_grad: Option<bool>, ) -> Self
fn uniform( l_bound: f32, r_bound: f32, shape: Vec<usize>, _device: Option<Device>, _requires_grad: Option<bool>, ) -> Self
Source§impl DeviceStorageStatic for CpuStorage
impl DeviceStorageStatic for CpuStorage
fn new(data: Vec<f32>, shape: Vec<usize>) -> Self
fn new_with_stride( data: Vec<f32>, shape: Vec<usize>, stride: Vec<usize>, ) -> Self
fn create( data: Arc<RwLock<Vec<f32>>>, shape: Vec<usize>, stride: Vec<usize>, ) -> Self
fn compute_strides(shape: &Vec<usize>) -> Vec<usize>
Source§impl Display for CpuStorage
impl Display for CpuStorage
Source§impl Display for CpuStorage
impl Display for CpuStorage
Source§impl ReductionOps for CpuStorage
impl ReductionOps for CpuStorage
Source§impl TransformOps for CpuStorage
impl TransformOps for CpuStorage
Source§fn compute_broadcast_shape(&self, target_shape: &[usize]) -> Vec<usize>
fn compute_broadcast_shape(&self, target_shape: &[usize]) -> Vec<usize>
Compute broadcast shape between two shapes
Source§fn compute_broadcast_strides(&self, broadcast_shape: &[usize]) -> Vec<usize>
fn compute_broadcast_strides(&self, broadcast_shape: &[usize]) -> Vec<usize>
Compute broadcast strides
fn apply_assign<F>(&mut self, op: F)
fn elementwise_op_assign<F>(&mut self, other: &Self, op: F)
fn reshape(&mut self, new_shape: Vec<usize>)
fn scalar_op_assign<F>(&mut self, scalar: f32, op: F)
fn permute(&mut self, dims: &[usize])
fn flatten(&mut self)
fn squeeze(&mut self)
fn unsqueeze(&mut self, dim: usize)
fn apply<F>(&self, op: F) -> Self
fn elementwise_op<F>(&self, other: &Self, op: F) -> Self
fn scalar_op<F>(&self, scalar: f32, op: F) -> Self
fn sum_dim(&self, dims: &[bool]) -> Self
fn transpose(&self) -> Self
fn broadcast(&self, new_shape: &[usize]) -> Self
fn broadcast_tensors(a: &Self, b: &Self) -> (Self, Self)
Auto Trait Implementations§
impl Freeze for CpuStorage
impl RefUnwindSafe for CpuStorage
impl Send for CpuStorage
impl Sync for CpuStorage
impl Unpin for CpuStorage
impl UnwindSafe for CpuStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more