






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      :       Any    =						logging.get_logger(__name__)

lowerCamelCase      :       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      (a_      ):
      snake_case_	=				"""poolformer"""


      def __init__(						self       ,    __UpperCamelCase=3       ,    __UpperCamelCase=1_6       ,    __UpperCamelCase=1_6       ,    __UpperCamelCase=3       ,    __UpperCamelCase=4.0       ,    __UpperCamelCase=[2, 2, 6, 2]       ,    __UpperCamelCase=[6_4, 1_2_8, 3_2_0, 5_1_2]       ,    __UpperCamelCase=[7, 3, 3, 3]       ,    __UpperCamelCase=[4, 2, 2, 2]       ,    __UpperCamelCase=[2, 1, 1, 1]       ,    __UpperCamelCase=4       ,    __UpperCamelCase=0.0       ,    __UpperCamelCase="gelu"       ,    __UpperCamelCase=True       ,    __UpperCamelCase=1e-5       ,    __UpperCamelCase=0.0_2       ,    **__UpperCamelCase       ,    )->						Any:
           __lowerCAmelCase             =       num_channels
           __lowerCAmelCase             =       patch_size
           __lowerCAmelCase             =       stride
           __lowerCAmelCase             =       padding
           __lowerCAmelCase             =       pool_size
           __lowerCAmelCase             =       hidden_sizes
           __lowerCAmelCase             =       mlp_ratio
           __lowerCAmelCase             =       depths
           __lowerCAmelCase             =       patch_sizes
           __lowerCAmelCase             =       strides
           __lowerCAmelCase             =       num_encoder_blocks
           __lowerCAmelCase             =       drop_path_rate
           __lowerCAmelCase             =       hidden_act
           __lowerCAmelCase             =       use_layer_scale
           __lowerCAmelCase             =       layer_scale_init_value
           __lowerCAmelCase             =       initializer_range
           super().__init__(**__UpperCamelCase						)



class 				_UpperCamelCase      (a_      ):
      snake_case_	=				version.parse("""1.11"""      )


      @property
      def 			__UpperCAmelCase		(						self						)->						Mapping[str, Mapping[int, str]]:
           return OrderedDict(
               [
                   ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
               ]						)


      @property
      def 			__UpperCAmelCase		(						self						)->						float:
           return 2e-3














# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
lowerCamelCase      :       Dict    =						abspath(join(dirname(dirname(__file__)), '''src'''))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='''ignore''', category=FutureWarning)





def    __lowerCAmelCase   (    __snake_case							):
     from diffusers.utils.testing_utils import pytest_addoption_shared

     pytest_addoption_shared(__snake_case							)





def    __lowerCAmelCase   (    __snake_case							):
     from diffusers.utils.testing_utils import pytest_terminal_summary_main

     __lowerCAmelCase             =       terminalreporter.config.getoption("--make-reports"							)
     if make_reports:
          pytest_terminal_summary_main(__snake_case       ,			id=__snake_case							)






