


"""simple docstring"""
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


SCREAMING_SNAKE_CASE :    Union[str, Any]									=				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE :    Optional[int]									=				{
    """sail/poolformer_s12""": """https://huggingface.co/sail/poolformer_s12/resolve/main/config.json""",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}



class 			_UpperCAmelCase (							__snake_case				):






		'''simple docstring'''

		lowerCamelCase__				='poolformer'



		def __init__(self				,       a_=3				,       a_=16				,       a_=16				,       a_=3				,       a_=4.0				,       a_=[2, 2, 6, 2]				,       a_=[64, 1_28, 3_20, 5_12]				,       a_=[7, 3, 3, 3]				,       a_=[4, 2, 2, 2]				,       a_=[2, 1, 1, 1]				,       a_=4				,       a_=0.0				,       a_="gelu"				,       a_=True				,       a_=1E-5				,       a_=0.02				,       **a_				,       ):





			'''simple docstring'''

			__snake_case	:						int						=				num_channels
			__snake_case	:						Union[str, Any]						=				patch_size
			__snake_case	:						Optional[int]						=				stride
			__snake_case	:						List[Any]						=				padding
			__snake_case	:						Optional[Any]						=				pool_size
			__snake_case	:						List[Any]						=				hidden_sizes
			__snake_case	:						Union[str, Any]						=				mlp_ratio
			__snake_case	:						List[Any]						=				depths
			__snake_case	:						Dict						=				patch_sizes
			__snake_case	:						str						=				strides
			__snake_case	:						Dict						=				num_encoder_blocks
			__snake_case	:						List[str]						=				drop_path_rate
			__snake_case	:						int						=				hidden_act
			__snake_case	:						List[str]						=				use_layer_scale
			__snake_case	:						List[str]						=				layer_scale_init_value
			__snake_case	:						List[Any]						=				initializer_range
			super().__init__(**a_					)



class 			_UpperCAmelCase (							__snake_case				):






		'''simple docstring'''

		lowerCamelCase__				=version.parse('1.11'				)



		@property
		def 				SCREAMING_SNAKE_CASE  (self					):





			'''simple docstring'''

			return OrderedDict(
			    [
			        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
			    ]					)



		@property
		def 				SCREAMING_SNAKE_CASE  (self					):





			'''simple docstring'''

			return 2E-3










from typing import TYPE_CHECKING

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


a_   :Optional[Any]        =      {"configuration_reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"]}

try:
 if not is_sentencepiece_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :str        =      ["ReformerTokenizer"]

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :int        =      ["ReformerTokenizerFast"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :List[str]        =      [
     "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ReformerAttention",
     "ReformerForMaskedLM",
     "ReformerForQuestionAnswering",
     "ReformerForSequenceClassification",
     "ReformerLayer",
     "ReformerModel",
     "ReformerModelWithLMHead",
     "ReformerPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

 try:
  if not is_sentencepiece_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_reformer import ReformerTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_reformer_fast import ReformerTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_reformer import (
      REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
      ReformerAttention,
      ReformerForMaskedLM,
      ReformerForQuestionAnswering,
      ReformerForSequenceClassification,
      ReformerLayer,
      ReformerModel,
      ReformerModelWithLMHead,
      ReformerPreTrainedModel,
  )

else:
 import sys

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






