


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


snake_case							:       Any										=	logging.get_logger(__name__)

snake_case							:       Tuple										=	{
    '''shi-labs/dinat-mini-in1k-224''': '''https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json''',
    # See all Dinat models at https://huggingface.co/models?filter=dinat
}







class 						_snake_case    ( _snake_case		,       _snake_case				):
 SCREAMING_SNAKE_CASE__ =			'dinat'

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




 def __init__(						self   ,    _lowerCamelCase=4   ,    _lowerCamelCase=3   ,    _lowerCamelCase=64   ,    _lowerCamelCase=[3, 4, 6, 5]   ,    _lowerCamelCase=[2, 4, 8, 16]   ,    _lowerCamelCase=7   ,    _lowerCamelCase=[[1, 8, 1], [1, 4, 1, 4], [1, 2, 1, 2, 1, 2], [1, 1, 1, 1, 1]]   ,    _lowerCamelCase=3.0   ,    _lowerCamelCase=True   ,    _lowerCamelCase=0.0   ,    _lowerCamelCase=0.0   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase="gelu"   ,    _lowerCamelCase=0.02   ,    _lowerCamelCase=1e-5   ,    _lowerCamelCase=0.0   ,    _lowerCamelCase=None   ,    _lowerCamelCase=None   ,    **_lowerCamelCase   ,    ):
       super().__init__(**_lowerCamelCase       )

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









from typing import TYPE_CHECKING

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


snake_case							:       Any										=	{
    '''configuration_gpt_neo''': ['''GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoConfig''', '''GPTNeoOnnxConfig'''],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     snake_case							:       List[Any]										=	[
         '''GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''GPTNeoForCausalLM''',
         '''GPTNeoForQuestionAnswering''',
         '''GPTNeoForSequenceClassification''',
         '''GPTNeoForTokenClassification''',
         '''GPTNeoModel''',
         '''GPTNeoPreTrainedModel''',
         '''load_tf_weights_in_gpt_neo''',
     ]

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     snake_case							:       Any										=	[
         '''FlaxGPTNeoForCausalLM''',
         '''FlaxGPTNeoModel''',
         '''FlaxGPTNeoPreTrainedModel''',
     ]


if TYPE_CHECKING:
     from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_gpt_neo import (
              GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST,
              GPTNeoForCausalLM,
              GPTNeoForQuestionAnswering,
              GPTNeoForSequenceClassification,
              GPTNeoForTokenClassification,
              GPTNeoModel,
              GPTNeoPreTrainedModel,
              load_tf_weights_in_gpt_neo,
          )

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_gpt_neo import FlaxGPTNeoForCausalLM, FlaxGPTNeoModel, FlaxGPTNeoPreTrainedModel


else:
     import sys

     snake_case							:       Optional[int]										=	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





