pub struct Cpu;
Trait Implementations§
Source§impl AddOps for Cpu
impl AddOps for Cpu
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, )
fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )
fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )
fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)
fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )
fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )
Source§impl BatchNormalization for Cpu
impl BatchNormalization for Cpu
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>>, )
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>>, )
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
impl ClipOps for Cpu
fn clip<T: Num>( input: *const T, output: *mut T, size: usize, stride_in: usize, stride_out: usize, min: T, max: T, )
fn clip_assign<T: Num>( input: *mut T, size: usize, stride: usize, min: T, max: T, )
fn clip_backward<T: Num>( input: *const T, mask: *mut T, max: T, min: T, size: usize, stride_in: usize, stride_out: usize, )
fn clip_backward_assign<T: Num>( mask: *mut T, max: T, min: T, size: usize, stride: usize, )
Source§impl Conv2d for Cpu
impl Conv2d for Cpu
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>>, )
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>>, )
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>>, )
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>, )
fn conv2d_bckwd_bias<T: Num>( dy: Matrix<Ref<&T>, DimDyn, Self>, dx: Matrix<Ref<&mut T>, DimDyn, Self>, )
Source§impl<'de> Deserialize<'de> for Cpu
impl<'de> Deserialize<'de> for Cpu
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl DeviceBase for Cpu
fn raw_drop_ptr<T>(ptr: *mut T)
fn mem_pool_drop_ptr(ptr: *mut u8) -> Result<(), MemPoolError>
fn clone_ptr<T>(ptr: *const T, len: usize) -> *mut T
fn assign_item<T>(ptr: *mut T, offset: usize, value: T)
fn get_item<T>(ptr: *const T, offset: usize) -> T
fn from_vec<T>(vec: Vec<T>) -> *mut T
fn zeros<T: Num>(len: usize) -> *mut T
fn raw_alloc(num_bytes: usize) -> Result<*mut u8, String>
fn mem_pool_alloc(num_bytes: usize) -> Result<*mut u8, MemPoolError>
fn drop_ptr<T>(ptr: *mut T)
fn alloc(num_bytes: usize) -> Result<*mut u8, MemPoolError>
Source§impl DivOps for Cpu
impl DivOps for Cpu
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, )
fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )
fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )
fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)
fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )
fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )
Source§impl MulOps for Cpu
impl MulOps for Cpu
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, )
fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )
fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )
fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)
fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )
fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )
Source§impl Pool2dImpl for Cpu
impl Pool2dImpl for Cpu
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>
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 SubOps for Cpu
impl SubOps for Cpu
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, )
fn array_assign<T: Num>( to: *mut T, rhs: *const T, num_elm: usize, to_stride: usize, rhs_stride: usize, )
fn scalar<T: Num>( to: *mut T, lhs: *const T, rhs: T, num_elm: usize, to_stride: usize, lhs_stride: usize, )
fn scalar_assign<T: Num>(to: *mut T, rhs: T, num_elm: usize, to_stride: usize)
fn scalar_ptr<T: Num>( to: *mut T, lhs: *const T, scalar: *const T, to_stride: usize, lhs_stride: usize, num_elm: usize, )
fn scalar_assign_ptr<T: Num>( to: *mut T, scalar: *const T, num_elm: usize, to_stride: usize, )
impl Copy for Cpu
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> 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