pub struct BatchExec<'c, 'g> { /* private fields */ }Expand description
一次批量前向的执行器。一批一个,用完检查 BatchExec::finish。
Implementations§
Trait Implementations§
Source§impl<'c, 'g> Exec for BatchExec<'c, 'g>
impl<'c, 'g> Exec for BatchExec<'c, 'g>
fn conv(&self, l: &Conv2d, x: &Self::T) -> Self::T
fn conv_transpose(&self, l: &ConvTranspose2d, x: &Self::T) -> Self::T
fn act(&self, a: Activation, x: &mut Self::T)
fn add(&self, a: &Self::T, b: &Self::T) -> Self::T
fn add_assign(&self, a: &mut Self::T, b: &Self::T)
fn pad_right_bottom(&self, x: &Self::T, right: usize, bottom: usize) -> Self::T
fn max_pool2d( &self, x: &Self::T, k: (usize, usize), stride: (usize, usize), ceil_mode: bool, ) -> Self::T
fn avg_pool2d(&self, x: &Self::T, k: (usize, usize)) -> Self::T
Source§fn global_avg(&self, x: &Self::T) -> Self::T
fn global_avg(&self, x: &Self::T) -> Self::T
每个通道的全局平均,结果
[C, 1, 1]。Source§fn scale_channels(&self, x: &mut Self::T, s: &Self::T)
fn scale_channels(&self, x: &mut Self::T, s: &Self::T)
s 是 [C, 1, 1],逐通道乘到 x 上。fn concat(&self, xs: &[&Self::T]) -> Self::T
fn chw_to_seq(&self, x: &Self::T) -> Self::T
fn linear(&self, l: &Linear, x: &Self::T) -> Self::T
fn layer_norm(&self, l: &LayerNorm, x: &Self::T) -> Self::T
Auto Trait Implementations§
impl<'c, 'g> !Freeze for BatchExec<'c, 'g>
impl<'c, 'g> !RefUnwindSafe for BatchExec<'c, 'g>
impl<'c, 'g> !Send for BatchExec<'c, 'g>
impl<'c, 'g> !Sync for BatchExec<'c, 'g>
impl<'c, 'g> !UnwindSafe for BatchExec<'c, 'g>
impl<'c, 'g> Forget for BatchExec<'c, 'g>
impl<'c, 'g> Unpin for BatchExec<'c, 'g>
impl<'c, 'g> UnsafeUnpin for BatchExec<'c, 'g>
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