



"""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


lowerCAmelCase_   						=   logging.get_logger(__name__)

lowerCAmelCase_   						=   {
    '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        __A       (	A_    ):







		'''simple docstring'''





		lowerCAmelCase			:					List[Any]   	=				"poolformer"







		def __init__(	self						:  Union[str, Any]			,_snake_case						:  Dict=3			,_snake_case						:  Dict=16			,_snake_case						:  Dict=16			,_snake_case						:  List[Any]=3			,_snake_case						:  str=4.0			,_snake_case						:  str=[2, 2, 6, 2]			,_snake_case						:  Any=[64, 128, 320, 512]			,_snake_case						:  Any=[7, 3, 3, 3]			,_snake_case						:  Any=[4, 2, 2, 2]			,_snake_case						:  List[str]=[2, 1, 1, 1]			,_snake_case						:  Dict=4			,_snake_case						:  List[str]=0.0			,_snake_case						:  List[str]="gelu"			,_snake_case						:  Optional[int]=True			,_snake_case						:  List[str]=1e-5			,_snake_case						:  Any=0.02			,**_snake_case						:  Tuple			,)					->		int:






				"""simple docstring"""



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





class        __A       (	A_    ):







		'''simple docstring'''





		lowerCAmelCase			:					List[str]   	=				version.parse("1.11"    )







		@property
		def 					UpperCAmelCase    (	self						:  str						)					->		Mapping[str, Mapping[int, str]]:






				"""simple docstring"""



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







		@property
		def 					UpperCAmelCase    (	self						:  List[str]						)					->		float:






				"""simple docstring"""



				return 2e-3





"""simple docstring"""







from typing import TYPE_CHECKING

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


lowerCAmelCase_   						=   {'configuration_xglm': ['XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XGLMConfig']}

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

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

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_   						=   [
							    'XGLM_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'XGLMForCausalLM',
							    'XGLMModel',
							    'XGLMPreTrainedModel',
							]


try:
							if not is_flax_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_   						=   [
							    'FlaxXGLMForCausalLM',
							    'FlaxXGLMModel',
							    'FlaxXGLMPreTrainedModel',
							]


try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_   						=   [
							    'TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'TFXGLMForCausalLM',
							    'TFXGLMModel',
							    'TFXGLMPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig

							try:
														if not is_sentencepiece_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_xglm import XGLMTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_xglm_fast import XGLMTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel

							try:
														if not is_flax_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_flax_xglm import FlaxXGLMForCausalLM, FlaxXGLMModel, FlaxXGLMPreTrainedModel

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_xglm import (
														    TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFXGLMForCausalLM,
														    TFXGLMModel,
														    TFXGLMPreTrainedModel,
														)


else:
							import sys

							lowerCAmelCase_   						=   _LazyModule(__name__, globals()['__file__'], _import_structure)
