





"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


a__					:     Any							=				{
    """configuration_mpnet""": ["""MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MPNetConfig"""],
    """tokenization_mpnet""": ["""MPNetTokenizer"""],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a__					:     str							=				["""MPNetTokenizerFast"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a__					:     Union[str, Any]							=				[
       """MPNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """MPNetForMaskedLM""",
       """MPNetForMultipleChoice""",
       """MPNetForQuestionAnswering""",
       """MPNetForSequenceClassification""",
       """MPNetForTokenClassification""",
       """MPNetLayer""",
       """MPNetModel""",
       """MPNetPreTrainedModel""",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a__					:     List[str]							=				[
       """TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """TFMPNetEmbeddings""",
       """TFMPNetForMaskedLM""",
       """TFMPNetForMultipleChoice""",
       """TFMPNetForQuestionAnswering""",
       """TFMPNetForSequenceClassification""",
       """TFMPNetForTokenClassification""",
       """TFMPNetMainLayer""",
       """TFMPNetModel""",
       """TFMPNetPreTrainedModel""",
   ]


if TYPE_CHECKING:
   from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
   from .tokenization_mpnet import MPNetTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_mpnet_fast import MPNetTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_mpnet import (
          MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
          MPNetForMaskedLM,
          MPNetForMultipleChoice,
          MPNetForQuestionAnswering,
          MPNetForSequenceClassification,
          MPNetForTokenClassification,
          MPNetLayer,
          MPNetModel,
          MPNetPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_mpnet import (
          TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFMPNetEmbeddings,
          TFMPNetForMaskedLM,
          TFMPNetForMultipleChoice,
          TFMPNetForQuestionAnswering,
          TFMPNetForSequenceClassification,
          TFMPNetForTokenClassification,
          TFMPNetMainLayer,
          TFMPNetModel,
          TFMPNetPreTrainedModel,
      )

else:
   import sys

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








"""simple docstring"""


from ...configuration_utils import PretrainedConfig
from ...utils import logging


a__					:     Tuple							=				logging.get_logger(__name__)

a__					:     str							=				{
    """facebook/regnet-y-040""": """https://huggingface.co/facebook/regnet-y-040/blob/main/config.json""",
}



class      lowercase_				(     __lowerCAmelCase							):
       snake_case__				:							Tuple											=     """regnet"""
       snake_case__				:							List[Any]											=     ["""x""", """y"""]

       def __init__(			self   ,					__SCREAMING_SNAKE_CASE=3   ,					__SCREAMING_SNAKE_CASE=32   ,					__SCREAMING_SNAKE_CASE=[128, 192, 512, 1088]   ,					__SCREAMING_SNAKE_CASE=[2, 6, 12, 2]   ,					__SCREAMING_SNAKE_CASE=64   ,					__SCREAMING_SNAKE_CASE="y"   ,					__SCREAMING_SNAKE_CASE="relu"   ,					**__SCREAMING_SNAKE_CASE   ,					):






        '''simple docstring'''

        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     )}"     )
        snake_case__    							=				num_channels
        snake_case__    							=				embedding_size
        snake_case__    							=				hidden_sizes
        snake_case__    							=				depths
        snake_case__    							=				groups_width
        snake_case__    							=				layer_type
        snake_case__    							=				hidden_act
        # always downsample in the first stage
        snake_case__    							=				True

