pub struct BiasReader<E: Numeric> {
pub tensor: VirtualTensor<E>,
pub n_offset: u32,
pub shape_n: u32,
}
Expand description
A view of a tensor that starts reading data from a specified offset. Ensures safe access by preventing out-of-bounds errors. Includes pre-fetched shapes and strides for optimized performance.
Fields§
§tensor: VirtualTensor<E>
§n_offset: u32
§shape_n: u32
Implementations§
Source§impl<E: Numeric> BiasReader<E>
impl<E: Numeric> BiasReader<E>
Sourcepub fn new(
tensor: VirtualTensor<E>,
n_offset: u32,
shape_n: u32,
) -> BiasReader<E>
pub fn new( tensor: VirtualTensor<E>, n_offset: u32, shape_n: u32, ) -> BiasReader<E>
Load the 1D bias into shared memory
Sourcepub fn load_simple<G: GlobalConfig>(
&self,
unit_id: u32,
line_size: u32,
) -> Line<E>
pub fn load_simple<G: GlobalConfig>( &self, unit_id: u32, line_size: u32, ) -> Line<E>
Load the 1D bias into shared memory
pub fn __expand_new( context: &mut Scope, tensor: <VirtualTensor<E> as CubeType>::ExpandType, n_offset: <u32 as CubeType>::ExpandType, shape_n: <u32 as CubeType>::ExpandType, ) -> <BiasReader<E> as CubeType>::ExpandType
pub fn __expand_load_simple<G: GlobalConfig>( context: &mut Scope, this: <Self as CubeType>::ExpandType, unit_id: <u32 as CubeType>::ExpandType, line_size: u32, ) -> <Line<E> as CubeType>::ExpandType
Trait Implementations§
Source§impl<E: Numeric> CubeType for BiasReader<E>
impl<E: Numeric> CubeType for BiasReader<E>
type ExpandType = BiasReaderExpand<E>
Source§fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
impl<E: Numeric> Send for BiasReader<E>
impl<E: Numeric> Sync for BiasReader<E>
Auto Trait Implementations§
impl<E> Freeze for BiasReader<E>
impl<E> RefUnwindSafe for BiasReader<E>where
E: RefUnwindSafe,
impl<E> Unpin for BiasReader<E>where
E: Unpin,
impl<E> UnwindSafe for BiasReader<E>where
E: UnwindSafe,
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