pub struct MnistBatch {
pub images: Vec<f32>,
pub labels: Vec<u8>,
pub batch_size: usize,
}Expand description
A loaded batch of MNIST samples.
Fields§
§images: Vec<f32>Pixel data in NCHW layout [batch, 1, 28, 28], normalised to [0.0, 1.0].
labels: Vec<u8>Integer class labels [0, 9], one per sample.
batch_size: usizeNumber of samples in this batch.
Implementations§
Source§impl MnistBatch
impl MnistBatch
Sourcepub fn image_numel(&self) -> usize
pub fn image_numel(&self) -> usize
Total number of f32 elements: batch_size × 1 × 28 × 28.
Auto Trait Implementations§
impl Freeze for MnistBatch
impl RefUnwindSafe for MnistBatch
impl Send for MnistBatch
impl Sync for MnistBatch
impl Unpin for MnistBatch
impl UnsafeUnpin for MnistBatch
impl UnwindSafe for MnistBatch
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