pub struct LinearGradientBatchArgs<'a, T, const NI: usize, const NO: usize>{
pub output: CudaTensor2dPtr<T, NI, NO>,
/* private fields */
}
Expand description
Defines the list that is passed to the cuda kernel function as arguments for the calculation of the amount of update of the linear layer weights during the mini-batch.
Fields§
§output: CudaTensor2dPtr<T, NI, NO>
Implementations§
Source§impl<'a, T, const NI: usize, const NO: usize> LinearGradientBatchArgs<'a, T, NI, NO>
Create an instance of an object representing the list of arguments
s for calculating the amount of updates to the linear layer weights during a mini-batch run.
impl<'a, T, const NI: usize, const NO: usize> LinearGradientBatchArgs<'a, T, NI, NO>
Create an instance of an object representing the list of arguments s for calculating the amount of updates to the linear layer weights during a mini-batch run.
Sourcepub fn new(
loss: &'a CudaVecView<'a, T, CudaTensor1dPtr<T, NO>>,
input: &'a CudaVecView<'a, T, CudaTensor1dPtr<T, NI>>,
output: CudaTensor2dPtr<T, NI, NO>,
batch_size: usize,
) -> LinearGradientBatchArgs<'a, T, NI, NO>
pub fn new( loss: &'a CudaVecView<'a, T, CudaTensor1dPtr<T, NO>>, input: &'a CudaVecView<'a, T, CudaTensor1dPtr<T, NI>>, output: CudaTensor2dPtr<T, NI, NO>, batch_size: usize, ) -> LinearGradientBatchArgs<'a, T, NI, NO>
Create a LinearGradientBatchArgs instance
§Arguments
loss
- lossinput
- inputoutput
- output (All elements must be initialized to zero.)batch_len
- batch_count
Trait Implementations§
Source§impl<'a, T, const NI: usize, const NO: usize> KernelArgs for LinearGradientBatchArgs<'a, T, NI, NO>
impl<'a, T, const NI: usize, const NO: usize> KernelArgs for LinearGradientBatchArgs<'a, T, NI, NO>
Source§fn as_vec(&mut self) -> Vec<&mut dyn AsKernelPtr>
fn as_vec(&mut self) -> Vec<&mut dyn AsKernelPtr>
Returns a Vec<&mut dyn AsMutKernelPtr> of the type implementing AsMutKernelPtr,
which is converted to a data type that can be passed to the cuda kernel in subsequent processing.
Auto Trait Implementations§
impl<'a, T, const NI: usize, const NO: usize> Freeze for LinearGradientBatchArgs<'a, T, NI, NO>
impl<'a, T, const NI: usize, const NO: usize> RefUnwindSafe for LinearGradientBatchArgs<'a, T, NI, NO>where
T: RefUnwindSafe,
impl<'a, T, const NI: usize, const NO: usize> !Send for LinearGradientBatchArgs<'a, T, NI, NO>
impl<'a, T, const NI: usize, const NO: usize> !Sync for LinearGradientBatchArgs<'a, T, NI, NO>
impl<'a, T, const NI: usize, const NO: usize> Unpin for LinearGradientBatchArgs<'a, T, NI, NO>
impl<'a, T, const NI: usize, const NO: usize> UnwindSafe for LinearGradientBatchArgs<'a, T, NI, NO>where
T: RefUnwindSafe,
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> 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