pub struct SamConfig {
pub embed_dim: usize,
pub depth: usize,
pub num_heads: usize,
pub img_size: usize,
pub patch_size: usize,
pub mlp_ratio: f32,
pub out_chans: usize,
pub window_size: usize,
pub global_attn_indexes: Vec<usize>,
pub use_rel_pos: bool,
pub qkv_bias: bool,
}Fields§
§embed_dim: usize§depth: usize§num_heads: usize§img_size: usize§patch_size: usize§mlp_ratio: f32§out_chans: usize§window_size: usize§global_attn_indexes: Vec<usize>§use_rel_pos: bool§qkv_bias: boolImplementations§
Source§impl SamConfig
impl SamConfig
pub fn tiny() -> Self
pub fn small() -> Self
pub fn base() -> Self
pub fn large() -> Self
pub fn with_img_size(self, size: usize) -> Self
pub fn with_window_size(self, size: usize) -> Self
pub fn num_patches(&self) -> usize
pub fn patch_grid_size(&self) -> (usize, usize)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SamConfig
impl<'de> Deserialize<'de> for SamConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SamConfig
impl RefUnwindSafe for SamConfig
impl Send for SamConfig
impl Sync for SamConfig
impl Unpin for SamConfig
impl UnwindSafe for SamConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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