




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


UpperCAmelCase_		:				Optional[int]									=     logging.get_logger(__name__)

UpperCAmelCase_		:				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 		__A      (			UpperCamelCase__			):
      UpperCamelCase     						=					"""poolformer"""

      def __init__(		self   :Optional[int]    , __snake_case   :int=3    , __snake_case   :List[Any]=16    , __snake_case   :Union[str, Any]=16    , __snake_case   :Any=3    , __snake_case   :Optional[int]=4.0    , __snake_case   :Optional[int]=[2, 2, 6, 2]    , __snake_case   :List[str]=[64, 1_28, 3_20, 5_12]    , __snake_case   :Dict=[7, 3, 3, 3]    , __snake_case   :Any=[4, 2, 2, 2]    , __snake_case   :str=[2, 1, 1, 1]    , __snake_case   :str=4    , __snake_case   :str=0.0    , __snake_case   :List[Any]="gelu"    , __snake_case   :Optional[int]=True    , __snake_case   :Union[str, Any]=1E-5    , __snake_case   :Union[str, Any]=0.02    , **__snake_case   :int    , ):
          '''simple docstring'''

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




class 		__A      (			UpperCamelCase__			):
      UpperCamelCase     						=					version.parse("""1.11"""			)

      @property
      def     A__						(		self   :Any ):
          '''simple docstring'''

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


      @property
      def     A__						(		self   :Optional[Any] ):
          '''simple docstring'''

          return 2E-3










import pytest

import datasets


# Import fixture modules as plugins
UpperCAmelCase_		:				Union[str, Any]									=     ["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]




def 		lowerCAmelCase_   (	lowerCamelCase	,     lowerCamelCase   ):
				# Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
				for item in items:
								if any(marker in item.keywords for marker in ["""integration""", """unit"""]   ):
												continue
								item.add_marker(pytest.mark.unit   )




def 		lowerCAmelCase_   (	lowerCamelCase   ):
				config.addinivalue_line("""markers"""	,     """torchaudio_latest: mark test to run with torchaudio>=0.12"""   )




@pytest.fixture(autouse=lowerCamelCase   )
def 		lowerCAmelCase_   (	lowerCamelCase	,     lowerCamelCase   ):
				# test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
				__magic_name__	:	Tuple								=tmp_path_factory.getbasetemp() / """cache"""
				__magic_name__	:	Optional[int]								=test_hf_cache_home / """datasets"""
				__magic_name__	:	List[str]								=test_hf_cache_home / """metrics"""
				__magic_name__	:	List[str]								=test_hf_cache_home / """modules"""
				monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""	,     str(lowerCamelCase   )   )
				monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""	,     str(lowerCamelCase   )   )
				monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""	,     str(lowerCamelCase   )   )
				__magic_name__	:	Optional[Any]								=test_hf_datasets_cache / """downloads"""
				monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""	,     str(lowerCamelCase   )   )
				__magic_name__	:	Tuple								=test_hf_datasets_cache / """downloads""" / """extracted"""
				monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""	,     str(lowerCamelCase   )   )




@pytest.fixture(autouse=lowerCamelCase	,     scope="""session"""   )
def 		lowerCAmelCase_   (	):
				datasets.disable_progress_bar()




@pytest.fixture(autouse=lowerCamelCase   )
def 		lowerCAmelCase_   (	lowerCamelCase   ):
				# don't take tests into account when counting downloads
				monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""	,     lowerCamelCase   )




@pytest.fixture
def 		lowerCAmelCase_   (	lowerCamelCase   ):
				# Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
				# To be removed once SQLAlchemy 2.0 supported
				monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""	,     lowerCamelCase   )




