pub struct Batch<'a> { /* private fields */ }Expand description
A contiguous dataset batch view.
inputs and targets are flat row-major buffers.
Implementations§
Source§impl<'a> Batch<'a>
impl<'a> Batch<'a>
Sourcepub fn target_dim(&self) -> usize
pub fn target_dim(&self) -> usize
Returns the per-sample target dimension.
Sourcepub fn inputs_flat(&self) -> &'a [f32]
pub fn inputs_flat(&self) -> &'a [f32]
Returns the contiguous flat inputs buffer.
Shape: (len * input_dim,).
Sourcepub fn targets_flat(&self) -> &'a [f32]
pub fn targets_flat(&self) -> &'a [f32]
Returns the contiguous flat targets buffer.
Shape: (len * target_dim,).
Trait Implementations§
impl<'a> Copy for Batch<'a>
Auto Trait Implementations§
impl<'a> Freeze for Batch<'a>
impl<'a> RefUnwindSafe for Batch<'a>
impl<'a> Send for Batch<'a>
impl<'a> Sync for Batch<'a>
impl<'a> Unpin for Batch<'a>
impl<'a> UnwindSafe for Batch<'a>
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