pub struct CpuBurnDecoder<B: Backend> { /* private fields */ }Expand description
Persistent CPU codec session followed by one Burn materialization per output group.
Implementations§
Source§impl<B: Backend> CpuBurnDecoder<B>
impl<B: Backend> CpuBurnDecoder<B>
Sourcepub fn new(device: B::Device, options: BatchDecodeOptions) -> Self
pub fn new(device: B::Device, options: BatchDecodeOptions) -> Self
Construct a CPU codec session for one Burn device.
Sourcepub const fn codec(&self) -> &CpuBatchDecoder
pub const fn codec(&self) -> &CpuBatchDecoder
Borrow the retained codec session.
Sourcepub fn prepare(
&self,
inputs: Vec<EncodedImage>,
) -> Result<PreparedBatch, BurnDecodeError>
pub fn prepare( &self, inputs: Vec<EncodedImage>, ) -> Result<PreparedBatch, BurnDecodeError>
Parse and group owned inputs once for repeated training epochs.
Sourcepub fn prepare_prepared_images(
&self,
images: Vec<PreparedImage>,
) -> Result<PreparedBatch, BurnDecodeError>
pub fn prepare_prepared_images( &self, images: Vec<PreparedImage>, ) -> Result<PreparedBatch, BurnDecodeError>
Regroup caller-supplied prepared images without reparsing encoded bytes.
Source indices in the returned batch are positions in images; each
PreparedImage::source_index remains its original preparation index.
Sourcepub fn decode(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<BurnBatchDecode<B>, BurnDecodeError>
pub fn decode( &mut self, inputs: Vec<EncodedImage>, ) -> Result<BurnBatchDecode<B>, BurnDecodeError>
Prepare, decode, and materialize one owned batch.
Sourcepub fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<BurnBatchDecode<B>, BurnDecodeError>
pub fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<BurnBatchDecode<B>, BurnDecodeError>
Regroup, decode, and materialize caller-supplied prepared images.
Sourcepub fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<BurnBatchDecode<B>, BurnDecodeError>
pub fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<BurnBatchDecode<B>, BurnDecodeError>
Decode a reusable prepared batch into ordinary rank-4 Burn integer tensors.
Trait Implementations§
Auto Trait Implementations§
impl<B> !Freeze for CpuBurnDecoder<B>
impl<B> !RefUnwindSafe for CpuBurnDecoder<B>
impl<B> !UnwindSafe for CpuBurnDecoder<B>
impl<B> Send for CpuBurnDecoder<B>
impl<B> Sync for CpuBurnDecoder<B>
impl<B> Unpin for CpuBurnDecoder<B>
impl<B> UnsafeUnpin for CpuBurnDecoder<B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more