class_docstr: This is the configuration class to store the configuration of a [`SamVisionModel`]. It is used to instantiate a SAM
  vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
  defaults will yield a similar configuration to that of the SAM ViT-h
  [facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  Args:
      hidden_size (`int`, *optional*, defaults to 768):
          Dimensionality of the encoder layers and the pooler layer.
      output_channels (`int`, *optional*, defaults to 256):
          Dimensionality of the output channels in the Patch Encoder.
      num_hidden_layers (`int`, *optional*, defaults to 12):
          Number of hidden layers in the Transformer encoder.
      num_attention_heads (`int`, *optional*, defaults to 12):
          Number of attention heads for each attention layer in the Transformer encoder.
      num_channels (`int`, *optional*, defaults to 3):
          Number of channels in the input image.
      image_size (`int`, *optional*, defaults to 1024):
          Expected resolution. Target size of the resized input image.
      patch_size (`int`, *optional*, defaults to 16):
          Size of the patches to be extracted from the input image.
      hidden_act (`str`, *optional*, defaults to `"gelu"`):
          The non-linear activation function (function or string)
      layer_norm_eps (`float`, *optional*, defaults to 1e-06):
          The epsilon used by the layer normalization layers.
      attention_dropout (`float`, *optional*, defaults to 0.0):
          The dropout ratio for the attention probabilities.
      initializer_range (`float`, *optional*, defaults to 1e-10):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      qkv_bias (`bool`, *optional*, defaults to `True`):
          Whether to add a bias to query, key, value projections.
      mlp_ratio (`float`, *optional*, defaults to 4.0):
          Ratio of mlp hidden dim to embedding dim.
      use_abs_pos (`bool`, *optional*, defaults to `True`):
          Whether to use absolute position embedding.
      use_rel_pos (`bool`, *optional*, defaults to `True`):
          Whether to use relative position embedding.
      window_size (`int`, *optional*, defaults to 14):
          Window size for relative position.
      global_attn_indexes (`List[int]`, *optional*, defaults to `[2, 5, 8, 11]`):
          The indexes of the global attention layers.
      num_pos_feats (`int`, *optional*, defaults to 128):
          The dimensionality of the position embedding.
      mlp_dim (`int`, *optional*):
          The dimensionality of the MLP layer in the Transformer encoder. If `None`, defaults to `mlp_ratio *
          hidden_size`.
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","a","[","`","SamVisionModel","`","]",".","It","is","used","to","instantiate","a","SAM","vision","encoder","according","to","the","specified","arguments",",","defining","the","model","architecture",".","Instantiating","a","configuration","defaults","will","yield","a","similar","configuration","to","that","of","the","SAM","ViT-h","[","facebook\/sam-vit-huge","]","(","https",":","\/\/huggingface.co\/facebook\/sam-vit-huge",")","architecture",".","Configuration","objects","inherit","from","[","`","PretrainedConfig","`","]","and","can","be","used","to","control","the","model","outputs",".","Read","the","documentation","from","[","`","PretrainedConfig","`","]","for","more","information",".","Args",":","hidden_size","(","`","int","`",",","*","optional","*",",","defaults","to","768",")",":","Dimensionality","of","the","encoder","layers","and","the","pooler","layer",".","output_channels","(","`","int","`",",","*","optional","*",",","defaults","to","256",")",":","Dimensionality","of","the","output","channels","in","the","Patch","Encoder",".","num_hidden_layers","(","`","int","`",",","*","optional","*",",","defaults","to","12",")",":","Number","of","hidden","layers","in","the","Transformer","encoder",".","num_attention_heads","(","`","int","`",",","*","optional","*",",","defaults","to","12",")",":","Number","of","attention","heads","for","each","attention","layer","in","the","Transformer","encoder",".","num_channels","(","`","int","`",",","*","optional","*",",","defaults","to","3",")",":","Number","of","channels","in","the","input","image",".","image_size","(","`","int","`",",","*","optional","*",",","defaults","to","1024",")",":","Expected","resolution",".","Target","size","of","the","resized","input","image",".","patch_size","(","`","int","`",",","*","optional","*",",","defaults","to","16",")",":","Size","of","the","patches","to","be","extracted","from","the","input","image",".","hidden_act","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","gelu","''","`",")",":","The","non-linear","activation","function","(","function","or","string",")","layer_norm_eps","(","`","float","`",",","*","optional","*",",","defaults","to","1e-06",")",":","The","epsilon","used","by","the","layer","normalization","layers",".","attention_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","ratio","for","the","attention","probabilities",".","initializer_range","(","`","float","`",",","*","optional","*",",","defaults","to","1e-10",")",":","The","standard","deviation","of","the","truncated_normal_initializer","for","initializing","all","weight","matrices",".","qkv_bias","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","add","a","bias","to","query",",","key",",","value","projections",".","mlp_ratio","(","`","float","`",",","*","optional","*",",","defaults","to","4.0",")",":","Ratio","of","mlp","hidden","dim","to","embedding","dim",".","use_abs_pos","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","use","absolute","position","embedding",".","use_rel_pos","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","use","relative","position","embedding",".","window_size","(","`","int","`",",","*","optional","*",",","defaults","to","14",")",":","Window","size","for","relative","position",".","global_attn_indexes","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","2",",","5",",","8",",","11","]","`",")",":","The","indexes","of","the","global","attention","layers",".","num_pos_feats","(","`","int","`",",","*","optional","*",",","defaults","to","128",")",":","The","dimensionality","of","the","position","embedding",".","mlp_dim","(","`","int","`",",","*","optional","*",")",":","The","dimensionality","of","the","MLP","layer","in","the","Transformer","encoder",".","If","`","None","`",",","defaults","to","`","mlp_ratio","*","hidden_size","`","."]
code: def __init__(
      self,
      hidden_size=768,
      output_channels=256,
      num_hidden_layers=12,
      num_attention_heads=12,
      num_channels=3,
      image_size=1024,
      patch_size=16,
      hidden_act="gelu",
      layer_norm_eps=1e-06,
      attention_dropout=0.0,
      initializer_range=1e-10,
      qkv_bias=True,
      mlp_ratio=4.0,
      use_abs_pos=True,
      use_rel_pos=True,
      window_size=14,
      global_attn_indexes=[2, 5, 8, 11],
      num_pos_feats=128,
      mlp_dim=None,
      **kwargs,
  ):
      super().__init__(**kwargs)
  
      self.hidden_size = hidden_size
      self.output_channels = output_channels
      self.num_hidden_layers = num_hidden_layers
      self.num_attention_heads = num_attention_heads
      self.num_channels = num_channels
      self.image_size = image_size
      self.patch_size = patch_size
      self.hidden_act = hidden_act
      self.layer_norm_eps = layer_norm_eps
      self.attention_dropout = attention_dropout
      self.initializer_range = initializer_range
      self.qkv_bias = qkv_bias
      self.mlp_ratio = mlp_ratio
      self.use_abs_pos = use_abs_pos
      self.use_rel_pos = use_rel_pos
      self.window_size = window_size
      self.global_attn_indexes = global_attn_indexes
      self.num_pos_feats = num_pos_feats
      self.mlp_dim = (
          int(hidden_size * mlp_ratio) if mlp_dim is None else mlp_dim
      )
  
file_path: transformers/src/transformers/models/sam/configuration_sam.py
imports: from ...configuration_utils import PretrainedConfig
  from ...utils import logging
label_desc: Use image node_id 1 to create a new SamVisionConfig object from inherited base classes: PretrainedConfig with example: obj = SamVisionConfig(hidden_size, output_channels, num_hidden_layers, num_attention_heads, num_channels, image_size, patch_size, hidden_act, layer_norm_eps, attention_dropout, initializer_range, qkv_bias, mlp_ratio, use_abs_pos, use_rel_pos, window_size, global_attn_indexes, num_pos_feats, mlp_dim)