pub struct VecCollate;Expand description
Moves samples unchanged into their existing vector.
§Examples
use rusttorch_data::{Collate, VecCollate};
let mut collator = VecCollate;
let batch = collator
.collate(vec![String::from("first"), String::from("second")])
.expect("VecCollate is infallible");
assert_eq!(batch, ["first", "second"]);Trait Implementations§
Source§impl Checkpointable for VecCollate
impl Checkpointable for VecCollate
Source§fn save_state(&self) -> Self::State
fn save_state(&self) -> Self::State
Captures the current component state.
Source§fn validate_state(&self, _state: &Self::State) -> Result<()>
fn validate_state(&self, _state: &Self::State) -> Result<()>
Checks state compatibility without mutating the component.
Source§fn load_validated(&mut self, _state: &Self::State)
fn load_validated(&mut self, _state: &Self::State)
Restores state previously accepted by
Self::validate_state.Source§impl Clone for VecCollate
impl Clone for VecCollate
Source§impl<Sample> Collate<Sample> for VecCollate
impl<Sample> Collate<Sample> for VecCollate
impl Copy for VecCollate
Source§impl Debug for VecCollate
impl Debug for VecCollate
Auto Trait Implementations§
impl Forget for VecCollate
impl Freeze for VecCollate
impl RefUnwindSafe for VecCollate
impl Send for VecCollate
impl Sync for VecCollate
impl Unpin for VecCollate
impl UnsafeUnpin for VecCollate
impl UnwindSafe for VecCollate
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