pub enum BiasGlobalReader<IP: MatrixPrecision> {
Some {
view: View<Line<IP::Global>, Coords2d>,
stage: StridedStage<IP::Stage, BiasTilingLayout>,
},
None,
}Expand description
Special reader to broadcast the 1D bias to the 2D accumulator matrix
Variants§
Implementations§
Source§impl<IP: MatrixPrecision> BiasGlobalReader<IP>
impl<IP: MatrixPrecision> BiasGlobalReader<IP>
pub fn new_Some( view: View<Line<IP::Global>, Coords2d>, stage: StridedStage<IP::Stage, BiasTilingLayout>, ) -> Self
pub fn __expand_new_Some( _: &mut Scope, view: <View<Line<IP::Global>, Coords2d> as CubeType>::ExpandType, stage: <StridedStage<IP::Stage, BiasTilingLayout> as CubeType>::ExpandType, ) -> BiasGlobalReaderExpand<IP>
pub fn new_None() -> Self
pub fn __expand_new_None(_: &mut Scope) -> BiasGlobalReaderExpand<IP>
Source§impl<IP: MatrixPrecision> BiasGlobalReader<IP>
impl<IP: MatrixPrecision> BiasGlobalReader<IP>
Sourcepub fn load_stage<G: GlobalConfig>(&mut self, config: G)
pub fn load_stage<G: GlobalConfig>(&mut self, config: G)
Reads all bias tiles into the stage. Unlike normal readers, bias only reads a 1D vector along
the n dimension.
Sourcepub fn stage(&self) -> BiasStage<IP::Stage>
pub fn stage(&self) -> BiasStage<IP::Stage>
Return the stage contained in this global reader. It will use custom tiling with
a stride of 0.
pub fn __expand_load_stage<G: GlobalConfig>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, config: G, ) -> <() as CubeType>::ExpandType
pub fn __expand_stage( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <BiasStage<IP::Stage> as CubeType>::ExpandType
Source§impl<IP: MatrixPrecision> BiasGlobalReader<IP>
impl<IP: MatrixPrecision> BiasGlobalReader<IP>
Sourcepub fn new(
view: CubeOption<View<Line<IP::Global>, Coords2d>>,
config: StageMemoryConfig,
) -> Self
pub fn new( view: CubeOption<View<Line<IP::Global>, Coords2d>>, config: StageMemoryConfig, ) -> Self
Create a new bias reader from the bias tensor and a global offset n_offset.
pub fn __expand_new( scope: &mut Scope, view: <CubeOption<View<Line<IP::Global>, Coords2d>> as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <Self as CubeType>::ExpandType
Trait Implementations§
Source§impl<IP: MatrixPrecision> CubeDebug for BiasGlobalReader<IP>
impl<IP: MatrixPrecision> CubeDebug for BiasGlobalReader<IP>
Source§fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
Set the debug name of this type’s expansion. Should do nothing for types that don’t appear
at runtime
Source§impl<IP: MatrixPrecision> CubeType for BiasGlobalReader<IP>
impl<IP: MatrixPrecision> CubeType for BiasGlobalReader<IP>
type ExpandType = BiasGlobalReaderExpand<IP>
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Auto Trait Implementations§
impl<IP> Freeze for BiasGlobalReader<IP>
impl<IP> RefUnwindSafe for BiasGlobalReader<IP>where
<IP as MatrixPrecision>::Global: RefUnwindSafe,
<IP as MatrixPrecision>::Stage: RefUnwindSafe,
impl<IP> Send for BiasGlobalReader<IP>
impl<IP> Sync for BiasGlobalReader<IP>
impl<IP> Unpin for BiasGlobalReader<IP>
impl<IP> UnwindSafe for BiasGlobalReader<IP>
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