pub struct Sam2PreprocessWeights {
pub patch_proj_w: Vec<f32>,
pub patch_proj_b: Vec<f32>,
pub pos_embed_full: Vec<f32>,
pub embed_dim: usize,
pub grid: usize,
}Expand description
Weights extracted from the safetensors checkpoint that the host uses before the encoder graph runs.
Fields§
§patch_proj_w: Vec<f32>Patch projection weight in raw [E, 3, k, k] NCHW layout. Kept
raw (not transposed) because the host-side conv2d needs index
access; see assemble_patch_tokens.
patch_proj_b: Vec<f32>Patch projection bias [E].
pos_embed_full: Vec<f32>Stage-0 position embedding, already interpolated + tiled to
[grid · grid · E] BHWC. Added to patch tokens before the
encoder body.
embed_dim: usize§grid: usizeAuto Trait Implementations§
impl Freeze for Sam2PreprocessWeights
impl RefUnwindSafe for Sam2PreprocessWeights
impl Send for Sam2PreprocessWeights
impl Sync for Sam2PreprocessWeights
impl Unpin for Sam2PreprocessWeights
impl UnsafeUnpin for Sam2PreprocessWeights
impl UnwindSafe for Sam2PreprocessWeights
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> 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