Storage

Enum Storage 

Source
pub enum Storage {
    Cpu(CpuStorage),
}

Variants§

Trait Implementations§

Source§

impl ActivationOps for Storage

Source§

fn binary_step(&self) -> Self

Source§

fn sigmoid(&self) -> Self

Source§

fn tanh(&self) -> Self

Source§

fn relu(&self) -> Self

Source§

fn leaky_relu(&self) -> Self

Source§

fn parametric_relu(&self, a: f32) -> Self

Source§

fn elu(&self, alpha: f32) -> Self

Source§

fn softmax(&self, dim: usize) -> Self

Source§

fn swish(&self) -> Self

Source§

impl Add<&Storage> for &Storage

Source§

type Output = Storage

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Storage) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f32> for &Storage

Source§

type Output = Storage

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<&Storage> for Storage

Source§

fn add_assign(&mut self, rhs: &Storage)

Performs the += operation. Read more
Source§

impl AddAssign<f32> for Storage

Source§

fn add_assign(&mut self, rhs: f32)

Performs the += operation. Read more
Source§

impl ArithmeticOps for Storage

Source§

fn add_tensor(&self, other: &Self) -> Self

Source§

fn add_tensor_assign(&mut self, other: &Self)

Source§

fn sub_tensor(&self, other: &Self) -> Self

Source§

fn sub_tensor_assign(&mut self, other: &Self)

Source§

fn mul_tensor(&self, other: &Self) -> Self

Source§

fn mul_tensor_assign(&mut self, other: &Self)

Source§

fn div_tensor(&self, other: &Self) -> Self

Source§

fn div_tensor_assign(&mut self, other: &Self)

Source§

fn add_f32(&self, other: f32) -> Self

Source§

fn add_f32_assign(&mut self, other: f32)

Source§

fn sub_f32(&self, other: f32) -> Self

Source§

fn sub_f32_assign(&mut self, other: f32)

Source§

fn mul_f32(&self, other: f32) -> Self

Source§

fn mul_f32_assign(&mut self, other: f32)

Source§

fn div_f32(&self, other: f32) -> Self

Source§

fn div_f32_assign(&mut self, other: f32)

Source§

fn pow_f32(&self, other: f32) -> Self

Source§

fn pow_f32_assign(&mut self, other: f32)

Source§

fn greater_than(&self, other: &Self, make_binary: bool) -> Self

Source§

fn greater_than_f32(&self, other: f32, make_binary: bool) -> Self

Source§

fn less_than(&self, other: &Self, make_binary: bool) -> Self

Source§

fn less_than_f32(&self, other: f32, make_binary: bool) -> Self

Source§

fn sign(&self) -> Self

Source§

fn abs(&self) -> Self

Source§

fn abs_assign(&mut self)

Source§

impl BlasOps for Storage

Source§

fn matmul(&self, other: &Self, trans_a: bool, trans_b: bool) -> Self

Source§

impl Clone for Storage

Source§

fn clone(&self) -> Storage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Storage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeviceStorage for Storage

Source§

fn view(&self, new_shape: Vec<usize>) -> Self
where Self: Sized,

Source§

fn data(&self) -> Arc<RwLock<Vec<f32>>>

Source§

fn data_mut(&self) -> RwLockWriteGuard<'_, Vec<f32>>

Source§

fn set_data(&mut self, data: Vec<f32>)

Source§

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

Source§

fn set_shape(&mut self, shape: Vec<usize>)

Source§

fn stride(&self) -> &Vec<usize>

Source§

fn set_stride(&mut self, stride: Vec<usize>)

Source§

fn offset(&self) -> usize

Source§

fn get(&self, indices: &[usize]) -> f32

Source§

fn set(&mut self, indices: &[usize], value: f32)

Source§

fn make_contiguous(&self) -> (Vec<f32>, i32)

Source§

fn is_contiguous(&self) -> bool

Source§

impl DeviceStorageCreation for Storage

Source§

fn zeros( shape: Vec<usize>, device: Option<Device>, _requires_grad: Option<bool>, ) -> Self

Source§

fn ones( shape: Vec<usize>, device: Option<Device>, _requires_grad: Option<bool>, ) -> Self

Source§

fn from_ndarray<S, D, T>( data: &ArrayBase<S, D>, device: Option<Device>, _requires_grad: Option<bool>, ) -> Self
where S: Data<Elem = T>, T: AsPrimitive<f32>, D: Dimension,

Source§

fn uniform( l_bound: f32, r_bound: f32, shape: Vec<usize>, device: Option<Device>, _requires_grad: Option<bool>, ) -> Self

Source§

impl Display for Storage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Storage

Source§

fn print(&self)

Source§

fn print_data_recursive<'a>( data: &'a [f32], shape: &'a [usize], stride: &'a [usize], ) -> String

Source§

fn print_data(&self)

Source§

impl Div<&Storage> for &Storage

Source§

type Output = Storage

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Storage) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f32> for &Storage

Source§

type Output = Storage

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<&Storage> for Storage

Source§

fn div_assign(&mut self, rhs: &Storage)

Performs the /= operation. Read more
Source§

impl DivAssign<f32> for Storage

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl Mul<&Storage> for &Storage

Source§

type Output = Storage

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Storage) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for &Storage

Source§

type Output = Storage

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<&Storage> for Storage

Source§

fn mul_assign(&mut self, rhs: &Storage)

Performs the *= operation. Read more
Source§

impl MulAssign<f32> for Storage

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl ReductionOps for Storage

Source§

fn sum(&self) -> Self

Source§

fn sum_axis(&self, axis: usize) -> Self

Source§

fn product(&self) -> Self

Source§

fn mean(&self) -> Self

Source§

impl Sub<&Storage> for &Storage

Source§

type Output = Storage

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Storage) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f32> for &Storage

Source§

type Output = Storage

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<&Storage> for Storage

Source§

fn sub_assign(&mut self, rhs: &Storage)

Performs the -= operation. Read more
Source§

impl SubAssign<f32> for Storage

Source§

fn sub_assign(&mut self, rhs: f32)

Performs the -= operation. Read more
Source§

impl TransformOps for Storage

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,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V