'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCamelCase__  :						Optional[int]					=      logging.get_logger(__name__)


class 					_lowercase						(   lowerCAmelCase		,lowerCAmelCase ):
      '''simple docstring'''


      UpperCAmelCase_   :   Dict   				= '''maskformer-swin'''

      UpperCAmelCase_   :   Optional[int]   				= {
          '''num_attention_heads''': '''num_heads''',
          '''num_hidden_layers''': '''num_layers''',
      }




      def __init__(					self       ,lowerCamelCase_=224       ,lowerCamelCase_=4       ,lowerCamelCase_=3       ,lowerCamelCase_=96       ,lowerCamelCase_=[2, 2, 6, 2]       ,lowerCamelCase_=[3, 6, 12, 24]       ,lowerCamelCase_=7       ,lowerCamelCase_=4.0       ,lowerCamelCase_=True       ,lowerCamelCase_=0.0       ,lowerCamelCase_=0.0       ,lowerCamelCase_=0.1       ,lowerCamelCase_="gelu"       ,lowerCamelCase_=False       ,lowerCamelCase_=0.02       ,lowerCamelCase_=1e-5       ,lowerCamelCase_=None       ,lowerCamelCase_=None       ,**lowerCamelCase_       ,)      ->      Dict:



         '''simple docstring'''



         super().__init__(**lowerCamelCase_				)

         UpperCAmelCase__				:					Tuple 					=	image_size
         UpperCAmelCase__				:					Optional[Any] 					=	patch_size
         UpperCAmelCase__				:					List[Any] 					=	num_channels
         UpperCAmelCase__				:					Union[str, Any] 					=	embed_dim
         UpperCAmelCase__				:					Union[str, Any] 					=	depths
         UpperCAmelCase__				:					List[str] 					=	len(lowerCamelCase_				)
         UpperCAmelCase__				:					int 					=	num_heads
         UpperCAmelCase__				:					Optional[int] 					=	window_size
         UpperCAmelCase__				:					Tuple 					=	mlp_ratio
         UpperCAmelCase__				:					str 					=	qkv_bias
         UpperCAmelCase__				:					List[str] 					=	hidden_dropout_prob
         UpperCAmelCase__				:					Optional[Any] 					=	attention_probs_dropout_prob
         UpperCAmelCase__				:					List[Any] 					=	drop_path_rate
         UpperCAmelCase__				:					Optional[int] 					=	hidden_act
         UpperCAmelCase__				:					Union[str, Any] 					=	use_absolute_embeddings
         UpperCAmelCase__				:					Tuple 					=	layer_norm_eps
         UpperCAmelCase__				:					List[Any] 					=	initializer_range
         # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
         # this indicates the channel dimension after the last stage of the model
         UpperCAmelCase__				:					Dict 					=	int(embed_dim * 2 ** (len(lowerCamelCase_				) - 1)				)
         UpperCAmelCase__				:					Optional[Any] 					=	['''stem'''] + [f'''stage{idx}''' for idx in range(1       ,len(lowerCamelCase_				) + 1				)]
         UpperCAmelCase__					,   UpperCAmelCase__				:					Any 					=	get_aligned_output_features_output_indices(
             out_features=lowerCamelCase_       ,out_indices=lowerCamelCase_       ,stage_names=self.stage_names				)





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase__  :						str					=      {
    'configuration_git': ['GIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GitConfig', 'GitVisionConfig'],
    'processing_git': ['GitProcessor'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__  :						str					=      [
      'GIT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'GitForCausalLM',
      'GitModel',
      'GitPreTrainedModel',
      'GitVisionModel',
  ]

if TYPE_CHECKING:
  from .configuration_git import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitVisionConfig
  from .processing_git import GitProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_git import (
        GIT_PRETRAINED_MODEL_ARCHIVE_LIST,
        GitForCausalLM,
        GitModel,
        GitPreTrainedModel,
        GitVisionModel,
    )

else:
  import sys

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




