pub struct GemmaVisionConfig {
pub patch_size: usize,
pub model_patch_size: usize,
pub mm_embed_dim: usize,
pub mm_posemb_size: usize,
pub num_soft_tokens: usize,
pub output_proj_dims: usize,
pub pooling_kernel_size: usize,
pub rms_norm_eps: f64,
}Expand description
Vision tower / projection config for Gemma 4 unified.
The HF nested vision_config carries these fields; defaults
match google/gemma-4-12B.
Fields§
§patch_size: usizePatch grid step in input pixels.
model_patch_size: usize“Macro patch” used by Gemma 4 unified — model_patch_size
pixels per soft-token-output tile.
mm_embed_dim: usizeEmbedding dimension of the per-patch projection (before pool).
mm_posemb_size: usizeNumber of positional embeddings (max patch grid the model ever sees).
num_soft_tokens: usizeNumber of soft tokens the projector outputs for one image.
output_proj_dims: usizeFinal projection target — matches the LM hidden_size so the
soft tokens can be spliced into the text token stream.
pooling_kernel_size: usizeSquare pooling kernel applied between patch projection and the soft-token down-sampler.
rms_norm_eps: f64RMS norm epsilon used inside the projector.
Trait Implementations§
Source§impl Clone for GemmaVisionConfig
impl Clone for GemmaVisionConfig
Source§fn clone(&self) -> GemmaVisionConfig
fn clone(&self) -> GemmaVisionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GemmaVisionConfig
impl Debug for GemmaVisionConfig
Source§impl Default for GemmaVisionConfig
impl Default for GemmaVisionConfig
Source§fn default() -> GemmaVisionConfig
fn default() -> GemmaVisionConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GemmaVisionConfigwhere
GemmaVisionConfig: Default,
impl<'de> Deserialize<'de> for GemmaVisionConfigwhere
GemmaVisionConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaVisionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaVisionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GemmaVisionConfig
impl RefUnwindSafe for GemmaVisionConfig
impl Send for GemmaVisionConfig
impl Sync for GemmaVisionConfig
impl Unpin for GemmaVisionConfig
impl UnsafeUnpin for GemmaVisionConfig
impl UnwindSafe for GemmaVisionConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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