




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


A   =       logging.get_logger(__name__)

A   =       {
    """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__				(	__magic_name__   ):
			lowercase_    =	"poolformer"


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


						"""simple docstring"""




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






class      a__				(	__magic_name__   ):
			lowercase_    =	version.parse("1.11"   )


			@property
			def       a_     (      self      :    Optional[Any]):


						"""simple docstring"""




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


			@property
			def       a_     (      self      :    Optional[int]):


						"""simple docstring"""




						return 2e-3








"""simple docstring"""





from ...processing_utils import ProcessorMixin



class      a__				(	__magic_name__   ):
			lowercase_    =	["image_processor", "feature_extractor"]
			lowercase_    =	"TvltImageProcessor"
			lowercase_    =	"TvltFeatureExtractor"


			def __init__(      self      :    Tuple      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    Dict):


						"""simple docstring"""




						super().__init__(image_processor=UpperCamelCase_      ,  feature_extractor=UpperCamelCase_)

						__UpperCAmelCase	: Optional[int]		=					image_processor
						__UpperCAmelCase	: Dict		=					feature_extractor


			def __call__(      self      :    Tuple      ,  UpperCamelCase_      :    str=None      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    str=None      ,  UpperCamelCase_      :    List[str]=False      ,  UpperCamelCase_      :    Optional[int]=False      ,  *UpperCamelCase_      :    List[str]      ,  **UpperCamelCase_      :    str      ,  ):


						"""simple docstring"""




						if images is None and audio is None:
									raise ValueError("You need to specify either an `images` or `audio` input to process.")

						__UpperCAmelCase	: Optional[Any]		=					None
						if images is not None:
									__UpperCAmelCase	: int		=					self.image_processor(UpperCamelCase_      ,  mask_pixel=UpperCamelCase_      ,  *UpperCamelCase_      ,  **UpperCamelCase_)
						if images_mixed is not None:
									__UpperCAmelCase	: int		=					self.image_processor(UpperCamelCase_      ,  is_mixed=UpperCamelCase_      ,  *UpperCamelCase_      ,  **UpperCamelCase_)
						if audio is not None:
									__UpperCAmelCase	: List[Any]		=					self.feature_extractor(
									    UpperCamelCase_      ,  *UpperCamelCase_      ,  sampling_rate=UpperCamelCase_      ,  mask_audio=UpperCamelCase_      ,  **UpperCamelCase_)

						__UpperCAmelCase	: List[str]		=					{}
						if audio is not None:
									output_dict.update(UpperCamelCase_)
						if images is not None:
									output_dict.update(UpperCamelCase_)
						if images_mixed_dict is not None:
									output_dict.update(UpperCamelCase_)
						return output_dict


			@property
			def       a_     (      self      :    str):


						"""simple docstring"""




						__UpperCAmelCase	: List[Any]		=					self.image_processor.model_input_names
						__UpperCAmelCase	: List[Any]		=					self.feature_extractor.model_input_names
						return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names))


