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


__UpperCAmelCase							=			logging.get_logger(__name__)

__UpperCAmelCase							=			{
    "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json",
}





class 							UpperCamelCase__						(     __SCREAMING_SNAKE_CASE    ,  __SCREAMING_SNAKE_CASE     ):






       """simple docstring"""


       UpperCAmelCase_							    ="bit"
       UpperCAmelCase_							    =["preactivation", "bottleneck"]
       UpperCAmelCase_							    =["SAME", "VALID"]



       def __init__(				self      ,			_A=3      ,			_A=64      ,			_A=[256, 512, 1024, 2048]      ,			_A=[3, 4, 6, 3]      ,			_A="preactivation"      ,			_A="relu"      ,			_A=None      ,			_A=32      ,			_A=0.0      ,			_A=False      ,			_A=32      ,			_A=1      ,			_A=None      ,			_A=None      ,			**_A      ,			)							->							int:
          super().__init__(**_SCREAMING_SNAKE_CASE     )
          if layer_type not in self.layer_types:
             raise ValueError(F'''layer_type={layer_type} is not one of {",".join(self.layer_types     )}'''     )
          if global_padding is not None:
             if global_padding.upper() in self.supported_padding:
                SCREAMING_SNAKE_CASE_     =	global_padding.upper()
             else:
                raise ValueError(F'''Padding strategy {global_padding} not supported'''     )
          SCREAMING_SNAKE_CASE_     =	num_channels
          SCREAMING_SNAKE_CASE_     =	embedding_size
          SCREAMING_SNAKE_CASE_     =	hidden_sizes
          SCREAMING_SNAKE_CASE_     =	depths
          SCREAMING_SNAKE_CASE_     =	layer_type
          SCREAMING_SNAKE_CASE_     =	hidden_act
          SCREAMING_SNAKE_CASE_     =	global_padding
          SCREAMING_SNAKE_CASE_     =	num_groups
          SCREAMING_SNAKE_CASE_     =	drop_path_rate
          SCREAMING_SNAKE_CASE_     =	embedding_dynamic_padding
          SCREAMING_SNAKE_CASE_     =	output_stride
          SCREAMING_SNAKE_CASE_     =	width_factor

          SCREAMING_SNAKE_CASE_     =	['''stem'''] + [F'''stage{idx}''' for idx in range(1      ,			len(_SCREAMING_SNAKE_CASE     ) + 1     )]
          SCREAMING_SNAKE_CASE_     =	get_aligned_output_features_output_indices(
              out_features=_SCREAMING_SNAKE_CASE      ,			out_indices=_SCREAMING_SNAKE_CASE      ,			stage_names=self.stage_names     )






from typing import TYPE_CHECKING

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


UpperCamelCase								=	{
    """configuration_nezha""": ["""NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NezhaConfig"""],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase								=	[
         """NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """NezhaForNextSentencePrediction""",
         """NezhaForMaskedLM""",
         """NezhaForPreTraining""",
         """NezhaForMultipleChoice""",
         """NezhaForQuestionAnswering""",
         """NezhaForSequenceClassification""",
         """NezhaForTokenClassification""",
         """NezhaModel""",
         """NezhaPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_nezha import (
              NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST,
              NezhaForMaskedLM,
              NezhaForMultipleChoice,
              NezhaForNextSentencePrediction,
              NezhaForPreTraining,
              NezhaForQuestionAnswering,
              NezhaForSequenceClassification,
              NezhaForTokenClassification,
              NezhaModel,
              NezhaPreTrainedModel,
          )


else:
     import sys

     UpperCamelCase								=	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




