pub enum Storage {
Cpu(CpuStorage),
}Variants§
Cpu(CpuStorage)
Trait Implementations§
Source§impl ActivationOps for Storage
impl ActivationOps for Storage
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 AddAssign<&Storage> for Storage
impl AddAssign<&Storage> for Storage
Source§fn add_assign(&mut self, rhs: &Storage)
fn add_assign(&mut self, rhs: &Storage)
Performs the
+= operation. Read moreSource§impl AddAssign<f32> for Storage
impl AddAssign<f32> for Storage
Source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+= operation. Read moreSource§impl ArithmeticOps for Storage
impl ArithmeticOps for Storage
fn add_tensor(&self, other: &Self) -> Self
fn add_tensor_assign(&mut self, other: &Self)
fn sub_tensor(&self, other: &Self) -> Self
fn sub_tensor_assign(&mut self, other: &Self)
fn mul_tensor(&self, other: &Self) -> Self
fn mul_tensor_assign(&mut self, other: &Self)
fn div_tensor(&self, other: &Self) -> Self
fn div_tensor_assign(&mut self, other: &Self)
fn add_f32(&self, other: f32) -> Self
fn add_f32_assign(&mut self, other: f32)
fn sub_f32(&self, other: f32) -> Self
fn sub_f32_assign(&mut self, other: f32)
fn mul_f32(&self, other: f32) -> Self
fn mul_f32_assign(&mut self, other: f32)
fn div_f32(&self, other: f32) -> Self
fn div_f32_assign(&mut self, other: f32)
fn pow_f32(&self, other: f32) -> Self
fn pow_f32_assign(&mut self, other: f32)
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 abs_assign(&mut self)
Source§impl DeviceStorage for Storage
impl DeviceStorage for Storage
fn view(&self, new_shape: Vec<usize>) -> Selfwhere
Self: Sized,
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 Storage
impl DeviceStorageCreation for Storage
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 DivAssign<&Storage> for Storage
impl DivAssign<&Storage> for Storage
Source§fn div_assign(&mut self, rhs: &Storage)
fn div_assign(&mut self, rhs: &Storage)
Performs the
/= operation. Read moreSource§impl DivAssign<f32> for Storage
impl DivAssign<f32> for Storage
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl MulAssign<&Storage> for Storage
impl MulAssign<&Storage> for Storage
Source§fn mul_assign(&mut self, rhs: &Storage)
fn mul_assign(&mut self, rhs: &Storage)
Performs the
*= operation. Read moreSource§impl MulAssign<f32> for Storage
impl MulAssign<f32> for Storage
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl ReductionOps for Storage
impl ReductionOps for Storage
Source§impl SubAssign<&Storage> for Storage
impl SubAssign<&Storage> for Storage
Source§fn sub_assign(&mut self, rhs: &Storage)
fn sub_assign(&mut self, rhs: &Storage)
Performs the
-= operation. Read moreSource§impl SubAssign<f32> for Storage
impl SubAssign<f32> for Storage
Source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-= operation. Read moreSource§impl TransformOps for Storage
impl TransformOps for Storage
fn apply<F>(&self, op: F) -> Self
fn apply_assign<F>(&mut self, op: F)
fn elementwise_op<F>(&self, other: &Self, op: F) -> Self
fn scalar_op<F>(&self, scalar: f32, op: F) -> Self
fn elementwise_op_assign<F>(&mut self, other: &Self, op: F)
fn scalar_op_assign<F>(&mut self, scalar: f32, op: F)
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,
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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