pub trait DefaultConvert: Sized {
type Output;
// Required method
fn default_convert(self) -> Result<Self::Output, CollateError>;
}Expand description
Recursively converts one sample without adding a batch dimension.
Tensors, supported scalar primitives, strings, and Bytes are preserved.
Options, vectors, tuples of arity two through eight, and BTreeMap values
are converted recursively. Unlike DefaultCollate, vectors are not
transposed.
Use this trait through DefaultConverter, whose example demonstrates
recursive conversion without automatic batching.
Required Associated Types§
Required Methods§
Sourcefn default_convert(self) -> Result<Self::Output, CollateError>
fn default_convert(self) -> Result<Self::Output, CollateError>
Applies built-in conversion without automatic batching.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".