pub struct PatchEmbed {
pub config: PatchEmbedConfig,
pub weights: PatchEmbedWeights,
}Expand description
Patch embedder: converts a CHW image to a [N_patches, embed_dim] token
sequence via a strided Conv2D with stride = kernel_size = patch_size.
Fields§
§config: PatchEmbedConfig§weights: PatchEmbedWeightsImplementations§
Source§impl PatchEmbed
impl PatchEmbed
Sourcepub fn new(cfg: PatchEmbedConfig, rng: &mut LcgRng) -> Self
pub fn new(cfg: PatchEmbedConfig, rng: &mut LcgRng) -> Self
Create a new PatchEmbed with Xavier-initialised weights.
Auto Trait Implementations§
impl Freeze for PatchEmbed
impl RefUnwindSafe for PatchEmbed
impl Send for PatchEmbed
impl Sync for PatchEmbed
impl Unpin for PatchEmbed
impl UnsafeUnpin for PatchEmbed
impl UnwindSafe for PatchEmbed
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