





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


snake_case_           =      logging.get_logger(__name__)

class 		SCREAMING_SNAKE_CASE__    (	_UpperCAmelCase						,				_UpperCAmelCase  ):
      A_						:    Optional[Any]							=   'maskformer-swin'

      A_						:    Tuple							=   {
          'num_attention_heads': 'num_heads',
          'num_hidden_layers': 'num_layers',
      }


      def __init__(self	:				List[Any]    ,      a__	:				Optional[Any]=224    ,      a__	:				List[str]=4    ,      a__	:				Dict=3    ,      a__	:				str=96    ,      a__	:				str=[2, 2, 6, 2]    ,      a__	:				Dict=[3, 6, 12, 24]    ,      a__	:				Any=7    ,      a__	:				List[Any]=4.0    ,      a__	:				List[Any]=True    ,      a__	:				Optional[Any]=0.0    ,      a__	:				Union[str, Any]=0.0    ,      a__	:				Optional[Any]=0.1    ,      a__	:				Any="gelu"    ,      a__	:				str=False    ,      a__	:				Optional[Any]=0.0_2    ,      a__	:				Union[str, Any]=1E-5    ,      a__	:				Any=None    ,      a__	:				int=None    ,      **a__	:				Dict    ,      ):





         """simple docstring"""



         super().__init__(**a__				)

         __snake_case								=       image_size
         __snake_case								=       patch_size
         __snake_case								=       num_channels
         __snake_case								=       embed_dim
         __snake_case								=       depths
         __snake_case								=       len(a__				)
         __snake_case								=       num_heads
         __snake_case								=       window_size
         __snake_case								=       mlp_ratio
         __snake_case								=       qkv_bias
         __snake_case								=       hidden_dropout_prob
         __snake_case								=       attention_probs_dropout_prob
         __snake_case								=       drop_path_rate
         __snake_case								=       hidden_act
         __snake_case								=       use_absolute_embeddings
         __snake_case								=       layer_norm_eps
         __snake_case								=       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
         __snake_case								=       int(embed_dim * 2 ** (len(a__				) - 1)				)
         __snake_case								=       ['''stem'''] + [f"""stage{idx}""" for idx in range(1    ,      len(a__				) + 1				)]
         __snake_case	,     __snake_case								=       get_aligned_output_features_output_indices(
             out_features=a__    ,      out_indices=a__    ,      stage_names=self.stage_names				)








from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


snake_case_           =      {}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['NllbTokenizer']

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['NllbTokenizerFast']


if TYPE_CHECKING:
    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_nllb import NllbTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_nllb_fast import NllbTokenizerFast

else:
    import sys

    snake_case_           =      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

