Cpu

Struct Cpu 

Source
pub struct Cpu;

Trait Implementations§

Source§

impl AbsOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl AcosOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl AddOps for Cpu

Source§

fn array_array<T: Num>( to: *mut T, lhs: *const T, rhs: *const T, num_elm: usize, to_stride: usize, lhs_stride: usize, rhs_stride: usize, )

Source§

fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )

Source§

fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )

Source§

fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)

Source§

fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )

Source§

fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )

Source§

impl AsinOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl Asum for Cpu

Source§

fn asum<T: Num>(n: usize, x: *const T, incx: usize) -> T

Source§

impl AtanOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl BatchNormalization for Cpu

Source§

fn batch_norm_2d_forward_train<T: Num>( momentum: f64, x: Matrix<Ref<&T>, DimDyn, Self>, y: Matrix<Ref<&mut T>, DimDyn, Self>, scale: Matrix<Ref<&T>, DimDyn, Self>, bias: Matrix<Ref<&T>, DimDyn, Self>, mean: Matrix<Ref<&mut T>, DimDyn, Self>, variance: Matrix<Ref<&mut T>, DimDyn, Self>, saving_mean: Option<Matrix<Ref<&mut T>, DimDyn, Self>>, saving_inv_variance: Option<Matrix<Ref<&mut T>, DimDyn, Self>>, _: &Option<BatchNorm2dConfig<T>>, )

Source§

fn batch_norm_2d_backward<T: Num>( x: Matrix<Ref<&T>, DimDyn, Self>, y_grad: Matrix<Ref<&T>, DimDyn, Self>, x_grad: Matrix<Ref<&mut T>, DimDyn, Self>, scale: Matrix<Ref<&T>, DimDyn, Self>, scale_grad: Matrix<Ref<&mut T>, DimDyn, Self>, bias_grad: Matrix<Ref<&mut T>, DimDyn, Self>, saving_mean: Option<Matrix<Ref<&T>, DimDyn, Self>>, saving_inv_variance: Option<Matrix<Ref<&T>, DimDyn, Self>>, _: &Option<BatchNorm2dBackwardConfig<T>>, )

Source§

fn bach_norm_2d_forward_inference<T: Num>( x: Matrix<Ref<&T>, DimDyn, Self>, y: Matrix<Ref<&mut T>, DimDyn, Self>, scale: Matrix<Ref<&T>, DimDyn, Self>, bias: Matrix<Ref<&T>, DimDyn, Self>, mean: Matrix<Ref<&T>, DimDyn, Self>, variance: Matrix<Ref<&T>, DimDyn, Self>, _: &Option<BatchNorm2dInferenceConfig<T>>, )

Source§

impl ClipOps for Cpu

Source§

fn clip<T: Num>( input: *const T, output: *mut T, size: usize, stride_in: usize, stride_out: usize, min: T, max: T, )

Source§

fn clip_assign<T: Num>( input: *mut T, size: usize, stride: usize, min: T, max: T, )

Source§

fn clip_backward<T: Num>( input: *const T, mask: *mut T, max: T, min: T, size: usize, stride_in: usize, stride_out: usize, )

Source§

fn clip_backward_assign<T: Num>( mask: *mut T, max: T, min: T, size: usize, stride: usize, )

Source§

impl Clone for Cpu

Source§

fn clone(&self) -> Cpu

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 Conv2d for Cpu

Source§

fn conv2d<T: Num>( input: Matrix<Ref<&T>, DimDyn, Self>, y: Matrix<Ref<&mut T>, DimDyn, Self>, filter: Matrix<Ref<&T>, DimDyn, Self>, pad_h: usize, pad_w: usize, stride_h: usize, stride_w: usize, dilation_h: usize, dilation_w: usize, _config: Option<&Conv2dConfig<T>>, )

Source§

fn conv2d_bckwd_data<T: Num>( dy: Matrix<Ref<&T>, DimDyn, Self>, dx: Matrix<Ref<&mut T>, DimDyn, Self>, filter: Matrix<Ref<&T>, DimDyn, Self>, pad_h: usize, pad_w: usize, stride_h: usize, stride_w: usize, dilation_h: usize, dilation_w: usize, _config: Option<&Conv2dConfig<T>>, )

Source§

fn conv2d_bckwd_filter<T: Num>( input: Matrix<Ref<&T>, DimDyn, Self>, dy: Matrix<Ref<&T>, DimDyn, Self>, df: Matrix<Ref<&mut T>, DimDyn, Self>, pad_h: usize, pad_w: usize, stride_h: usize, stride_w: usize, dilation_h: usize, dilation_w: usize, _config: Option<&Conv2dConfig<T>>, )

Source§

fn conv2d_forward_bias<T: Num>( input: Matrix<Ref<&T>, DimDyn, Self>, y: Matrix<Ref<&mut T>, DimDyn, Self>, bias: Matrix<Ref<&T>, DimDyn, Self>, )

Source§

fn conv2d_bckwd_bias<T: Num>( dy: Matrix<Ref<&T>, DimDyn, Self>, dx: Matrix<Ref<&mut T>, DimDyn, Self>, )

Source§

impl CopyBlas for Cpu

Source§

fn copy_raw<T: Num>(n: usize, x: *const T, incx: usize, y: *mut T, incy: usize)

Source§

impl CosOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl CoshOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl Debug for Cpu

Source§

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

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

impl Default for Cpu

Source§

fn default() -> Cpu

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Cpu

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DeviceBase for Cpu

Source§

fn raw_drop_ptr<T>(ptr: *mut T)

Source§

fn mem_pool_drop_ptr(ptr: *mut u8) -> Result<(), MemPoolError>

Source§

fn clone_ptr<T>(ptr: *const T, len: usize) -> *mut T

Source§

fn assign_item<T>(ptr: *mut T, offset: usize, value: T)

Source§

fn get_item<T>(ptr: *const T, offset: usize) -> T

Source§

fn from_vec<T>(vec: Vec<T>) -> *mut T

Source§

fn zeros<T: Num>(len: usize) -> *mut T

Source§

fn raw_alloc(num_bytes: usize) -> Result<*mut u8, String>

Source§

fn mem_pool_alloc(num_bytes: usize) -> Result<*mut u8, MemPoolError>

Source§

fn drop_ptr<T>(ptr: *mut T)

Source§

fn alloc(num_bytes: usize) -> Result<*mut u8, MemPoolError>

Source§

impl DivOps for Cpu

Source§

fn array_array<T: Num>( to: *mut T, lhs: *const T, rhs: *const T, num_elm: usize, to_stride: usize, lhs_stride: usize, rhs_stride: usize, )

Source§

fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )

Source§

fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )

Source§

fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)

Source§

fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )

Source§

fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )

Source§

impl Dropout for Cpu

Source§

fn dropout<T: Num>( x: &Matrix<Ref<&T>, DimDyn, Self>, state: &mut DropoutState<T, Self>, ) -> Matrix<Owned<T>, DimDyn, Self>

Source§

fn dropout_grad<T: Num>( dy: &Matrix<Ref<&T>, DimDyn, Self>, state: &DropoutState<T, Self>, ) -> Matrix<Owned<T>, DimDyn, Self>

Source§

impl ExpOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl Gemm for Cpu

Source§

fn gemm_unchecked<T: Num>( transa: BlasTrans, transb: BlasTrans, m: usize, n: usize, k: usize, alpha: T, a: *const T, lda: usize, b: *const T, ldb: usize, beta: T, c: *mut T, ldc: usize, )

Source§

impl LogOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl MaxIdx for Cpu

Source§

fn max_idx<T: Num>(input: *const T, size: usize, stride: usize) -> usize

Source§

impl MulOps for Cpu

Source§

fn array_array<T: Num>( to: *mut T, lhs: *const T, rhs: *const T, num_elm: usize, to_stride: usize, lhs_stride: usize, rhs_stride: usize, )

Source§

fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )

Source§

fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )

Source§

fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)

Source§

fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )

Source§

fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )

Source§

impl Pool2dImpl for Cpu

Source§

fn pool2d<T: Num>( input: Matrix<Ref<&T>, DimDyn, Self>, output: Matrix<Ref<&mut T>, DimDyn, Self>, kernel: (usize, usize), stride: (usize, usize), padding: (usize, usize), _config: &Pool2dConfig<T>, ) -> Result<(), String>

Source§

fn pool2d_backward<T: Num>( input: Matrix<Ref<&T>, DimDyn, Self>, input_grad: Matrix<Ref<&mut T>, DimDyn, Self>, _output: Matrix<Ref<&T>, DimDyn, Self>, output_grad: Matrix<Ref<&T>, DimDyn, Self>, kernel_shape: (usize, usize), stride: (usize, usize), padding: (usize, usize), _config: &Pool2dConfig<T>, )

Source§

impl PowOws for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, scalar: T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, scalar: T, num_elm: usize, to_stride: usize)

Source§

impl ReluOps for Cpu

Source§

fn relu<T: Num>( input: *const T, output: *mut T, alpha: T, size: usize, input_stride: usize, output_stride: usize, )

Source§

fn relu_backward_mask<T: Num>( input: *const T, mask: *mut T, alpha: T, size: usize, input_stride: usize, mask_stride: usize, )

Source§

impl Serialize for Cpu

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SinOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl SinhOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl SqrtOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl SubOps for Cpu

Source§

fn array_array<T: Num>( to: *mut T, lhs: *const T, rhs: *const T, num_elm: usize, to_stride: usize, lhs_stride: usize, rhs_stride: usize, )

Source§

fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )

Source§

fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )

Source§

fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)

Source§

fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )

Source§

fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )

Source§

impl TanOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl TanhOps for Cpu

Source§

fn array<T: Num>( to: *mut T, other: *const T, num_elm: usize, to_stride: usize, other_stride: usize, )

Source§

fn array_assign<T: Num>(to: *mut T, num_elm: usize, to_stride: usize)

Source§

impl Copy for Cpu

Source§

impl Device for Cpu

Auto Trait Implementations§

§

impl Freeze for Cpu

§

impl RefUnwindSafe for Cpu

§

impl Send for Cpu

§

impl Sync for Cpu

§

impl Unpin for Cpu

§

impl UnwindSafe for Cpu

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> 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, 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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,