'''simple docstring'''
import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A		:			List[str]	      =logging.get_logger(__name__)

_A		:			List[Any]	      ={
    '''facebook/sam-vit-huge''': '''https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json''',
    '''facebook/sam-vit-large''': '''https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json''',
    '''facebook/sam-vit-base''': '''https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json''',
}




class _lowerCAmelCase (  snake_case				):







      def __init__(     self     ,						lowercase=256     ,						lowercase=1024     ,						lowercase=16     ,						lowercase=16     ,						lowercase=4     ,						lowercase="gelu"     ,						lowercase=1e-6     ,						**lowercase     ,						):
        super().__init__(**lowercase    )
        lowercase							:       Tuple											=      hidden_size
        lowercase							:       int											=      image_size
        lowercase							:       Dict											=      patch_size
        lowercase							:       str											=      image_size // patch_size
        lowercase							:       Any											=      mask_input_channels
        lowercase							:       Tuple											=      num_point_embeddings
        lowercase							:       Optional[int]											=      hidden_act
        lowercase							:       int											=      layer_norm_eps





class _lowerCAmelCase (  snake_case				):







      def __init__(     self     ,						lowercase=256     ,						lowercase="relu"     ,						lowercase=2048     ,						lowercase=2     ,						lowercase=8     ,						lowercase=2     ,						lowercase=3     ,						lowercase=3     ,						lowercase=256     ,						lowercase=1e-6     ,						**lowercase     ,						):
        super().__init__(**lowercase    )
        lowercase							:       List[Any]											=      hidden_size
        lowercase							:       Union[str, Any]											=      hidden_act
        lowercase							:       List[str]											=      mlp_dim
        lowercase							:       List[str]											=      num_hidden_layers
        lowercase							:       List[str]											=      num_attention_heads
        lowercase							:       Tuple											=      attention_downsample_rate
        lowercase							:       List[Any]											=      num_multimask_outputs
        lowercase							:       Optional[Any]											=      iou_head_depth
        lowercase							:       str											=      iou_head_hidden_dim
        lowercase							:       int											=      layer_norm_eps





class _lowerCAmelCase (  snake_case				):







      def __init__(     self     ,						lowercase=768     ,						lowercase=256     ,						lowercase=12     ,						lowercase=12     ,						lowercase=3     ,						lowercase=1024     ,						lowercase=16     ,						lowercase="gelu"     ,						lowercase=1e-06     ,						lowercase=0.0     ,						lowercase=1e-10     ,						lowercase=True     ,						lowercase=4.0     ,						lowercase=True     ,						lowercase=True     ,						lowercase=14     ,						lowercase=[2, 5, 8, 11]     ,						lowercase=128     ,						lowercase=None     ,						**lowercase     ,						):
        super().__init__(**lowercase    )

        lowercase							:       Tuple											=      hidden_size
        lowercase							:       Tuple											=      output_channels
        lowercase							:       Union[str, Any]											=      num_hidden_layers
        lowercase							:       Union[str, Any]											=      num_attention_heads
        lowercase							:       Union[str, Any]											=      num_channels
        lowercase							:       List[str]											=      image_size
        lowercase							:       Any											=      patch_size
        lowercase							:       Union[str, Any]											=      hidden_act
        lowercase							:       int											=      layer_norm_eps
        lowercase							:       List[str]											=      attention_dropout
        lowercase							:       List[Any]											=      initializer_range
        lowercase							:       Optional[int]											=      qkv_bias
        lowercase							:       Tuple											=      mlp_ratio
        lowercase							:       Optional[int]											=      use_abs_pos
        lowercase							:       List[str]											=      use_rel_pos
        lowercase							:       List[Any]											=      window_size
        lowercase							:       List[Any]											=      global_attn_indexes
        lowercase							:       Union[str, Any]											=      num_pos_feats
        lowercase							:       int											=      int(hidden_size * mlp_ratio    ) if mlp_dim is None else mlp_dim





class _lowerCAmelCase (  snake_case				):
      UpperCAmelCase_  :	Any     =					"sam"
      UpperCAmelCase_  :	str     =					True







      def __init__(     self     ,						lowercase=None     ,						lowercase=None     ,						lowercase=None     ,						lowercase=0.02     ,						**lowercase     ,						):
        super().__init__(**lowercase    )
        lowercase							:       str											=      vision_config if vision_config is not None else {}
        lowercase							:       Dict											=      prompt_encoder_config if prompt_encoder_config is not None else {}
        lowercase							:       List[Any]											=      mask_decoder_config if mask_decoder_config is not None else {}

        if isinstance(lowercase     ,						lowercase    ):
          lowercase							:       List[str]											=      vision_config.to_dict()
        if isinstance(lowercase     ,						lowercase    ):
          lowercase							:       Tuple											=      prompt_encoder_config.to_dict()
        if isinstance(lowercase     ,						lowercase    ):
          lowercase							:       Optional[Any]											=      mask_decoder_config.to_dict()

        lowercase							:       int											=      SamVisionConfig(**lowercase    )
        lowercase							:       Any											=      SamPromptEncoderConfig(**lowercase    )
        lowercase							:       List[str]											=      SamMaskDecoderConfig(**lowercase    )
        lowercase							:       Optional[Any]											=      initializer_range







      def     lowerCamelCase__			(     self    ):
        lowercase							:       str											=      copy.deepcopy(self.__dict__    )
        lowercase							:       str											=      self.vision_config.to_dict()
        lowercase							:       List[str]											=      self.prompt_encoder_config.to_dict()
        lowercase							:       Optional[int]											=      self.mask_decoder_config.to_dict()
        lowercase							:       Dict											=      self.__class__.model_type
        return output
'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_A		:			int	      ={'''configuration_cvt''': ['''CVT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''CvtConfig''']}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _A		:			str	      =[
     '''CVT_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''CvtForImageClassification''',
     '''CvtModel''',
     '''CvtPreTrainedModel''',
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _A		:			Optional[Any]	      =[
     '''TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''TFCvtForImageClassification''',
     '''TFCvtModel''',
     '''TFCvtPreTrainedModel''',
 ]

if TYPE_CHECKING:
 from .configuration_cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_cvt import (
      CVT_PRETRAINED_MODEL_ARCHIVE_LIST,
      CvtForImageClassification,
      CvtModel,
      CvtPreTrainedModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_cvt import (
      TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFCvtForImageClassification,
      TFCvtModel,
      TFCvtPreTrainedModel,
  )


else:
 import sys

 _A		:			Tuple	      =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)