






"""simple docstring"""


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


_UpperCamelCase       :					Tuple									=		logging.get_logger(__name__)






class 		snake_case						(						UpperCAmelCase     ,				UpperCAmelCase ):
    __magic_name__					  =  '''maskformer-swin'''

    __magic_name__					  =  {
        '''num_attention_heads''': '''num_heads''',
        '''num_hidden_layers''': '''num_layers''',
    }





    def __init__(							self			:      Any       ,	A			:      Optional[Any]=2_2_4       ,	A			:      int=4       ,	A			:      List[Any]=3       ,	A			:      Union[str, Any]=9_6       ,	A			:      List[Any]=[2, 2, 6, 2]       ,	A			:      Optional[int]=[3, 6, 1_2, 2_4]       ,	A			:      Tuple=7       ,	A			:      Union[str, Any]=4.0       ,	A			:      Any=True       ,	A			:      Optional[Any]=0.0       ,	A			:      Tuple=0.0       ,	A			:      Tuple=0.1       ,	A			:      Optional[Any]="gelu"       ,	A			:      Union[str, Any]=False       ,	A			:      int=0.02       ,	A			:      int=1E-5       ,	A			:      Union[str, Any]=None       ,	A			:      List[str]=None       ,	**A			:      int       ,	):


      '''simple docstring'''




      super().__init__(**A    )

      a  :    Optional[Any]       =     image_size
      a  :    Union[str, Any]       =     patch_size
      a  :    str       =     num_channels
      a  :    List[Any]       =     embed_dim
      a  :    Optional[Any]       =     depths
      a  :    Tuple       =     len(A    )
      a  :    str       =     num_heads
      a  :    Tuple       =     window_size
      a  :    Any       =     mlp_ratio
      a  :    Union[str, Any]       =     qkv_bias
      a  :    Any       =     hidden_dropout_prob
      a  :    List[Any]       =     attention_probs_dropout_prob
      a  :    Union[str, Any]       =     drop_path_rate
      a  :    Union[str, Any]       =     hidden_act
      a  :    List[str]       =     use_absolute_embeddings
      a  :    int       =     layer_norm_eps
      a  :    Dict       =     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
      a  :    Dict       =     int(embed_dim * 2 ** (len(A    ) - 1)    )
      a  :    str       =     ['stem'] + [F'''stage{idx}''' for idx in range(1       ,	len(A    ) + 1    )]
      a,  a  :    Any       =     get_aligned_output_features_output_indices(
          out_features=A       ,	out_indices=A       ,	stage_names=self.stage_names    )












"""simple docstring"""


from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_UpperCamelCase       :					Optional[Any]									=		{
    'configuration_informer': [
        'INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'InformerConfig',
    ],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _UpperCamelCase       :					Tuple									=		[
       'INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'InformerForPrediction',
       'InformerModel',
       'InformerPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_informer import (
          INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          InformerForPrediction,
          InformerModel,
          InformerPreTrainedModel,
      )

else:
   import sys

   _UpperCamelCase       :					List[str]									=		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




