






"""simple docstring"""



from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__A		:       List[str]  				=		logging.get_logger(__name__)

__A		:       Tuple  				=		{
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}





class 					_UpperCAmelCase       ( __UpperCAmelCase   ,						__UpperCAmelCase							):
					SCREAMING_SNAKE_CASE_		:				Tuple							    =   "focalnet"




					def __init__(				self     :						str    ,						A     :						Optional[int]=2_24    ,						A     :						Optional[int]=4    ,						A     :						Union[str, Any]=3    ,						A     :						List[str]=96    ,						A     :						Optional[Any]=False    ,						A     :						Dict=[1_92, 3_84, 7_68, 7_68]    ,						A     :						Union[str, Any]=[2, 2, 6, 2]    ,						A     :						Optional[int]=[2, 2, 2, 2]    ,						A     :						Any=[3, 3, 3, 3]    ,						A     :						int="gelu"    ,						A     :						Dict=4.0    ,						A     :						Optional[int]=0.0    ,						A     :						List[str]=0.1    ,						A     :						int=False    ,						A     :						Tuple=1e-4    ,						A     :						Dict=False    ,						A     :						Dict=False    ,						A     :						Tuple=False    ,						A     :						Dict=0.02    ,						A     :						Any=1e-5    ,						A     :						List[Any]=32    ,						A     :						Optional[int]=None    ,						A     :						Any=None    ,						**A     :						Optional[int]    ,						)  ->  Any:
							super().__init__(**UpperCamelCase__   )

							lowercase_ : Optional[int]							       =   image_size
							lowercase_ : Dict							       =   patch_size
							lowercase_ : Dict							       =   num_channels
							lowercase_ : int							       =   embed_dim
							lowercase_ : Optional[int]							       =   use_conv_embed
							lowercase_ : int							       =   hidden_sizes
							lowercase_ : Tuple							       =   depths
							lowercase_ : Tuple							       =   focal_levels
							lowercase_ : Any							       =   focal_windows
							lowercase_ : Any							       =   hidden_act
							lowercase_ : List[str]							       =   mlp_ratio
							lowercase_ : int							       =   hidden_dropout_prob
							lowercase_ : Tuple							       =   drop_path_rate
							lowercase_ : Optional[int]							       =   use_layerscale
							lowercase_ : Dict							       =   layerscale_value
							lowercase_ : Any							       =   use_post_layernorm
							lowercase_ : Union[str, Any]							       =   use_post_layernorm_in_modulation
							lowercase_ : int							       =   normalize_modulator
							lowercase_ : Dict							       =   initializer_range
							lowercase_ : List[str]							       =   layer_norm_eps
							lowercase_ : List[str]							       =   encoder_stride
							lowercase_ : Dict							       =   ['''stem'''] + [F'''stage{idx}''' for idx in range(1    ,						len(self.depths   ) + 1   )]
							lowercase_       ,					lowercase_ : Dict							       =   get_aligned_output_features_output_indices(
							    out_features=UpperCamelCase__    ,						out_indices=UpperCamelCase__    ,						stage_names=self.stage_names   )









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     =			{
    '''google/vit-base-patch16-224''': '''https://huggingface.co/vit-base-patch16-224/resolve/main/config.json''',
    # See all ViT models at https://huggingface.co/models?filter=vit
}


class  A		(  __UpperCAmelCase     ):
		__snake_case									=   'vit'



		def __init__(     self,	UpperCamelCase__=768,	UpperCamelCase__=12,	UpperCamelCase__=12,	UpperCamelCase__=3072,	UpperCamelCase__="gelu",	UpperCamelCase__=0.0,	UpperCamelCase__=0.0,	UpperCamelCase__=0.02,	UpperCamelCase__=1E-12,	UpperCamelCase__=224,	UpperCamelCase__=16,	UpperCamelCase__=3,	UpperCamelCase__=True,	UpperCamelCase__=16,	**UpperCamelCase__,	):







								"""simple docstring"""



								super().__init__(**UpperCamelCase__   )

								lowerCAmelCase_      			=  hidden_size
								lowerCAmelCase_      			=  num_hidden_layers
								lowerCAmelCase_      			=  num_attention_heads
								lowerCAmelCase_      			=  intermediate_size
								lowerCAmelCase_      			=  hidden_act
								lowerCAmelCase_      			=  hidden_dropout_prob
								lowerCAmelCase_      			=  attention_probs_dropout_prob
								lowerCAmelCase_      			=  initializer_range
								lowerCAmelCase_      			=  layer_norm_eps
								lowerCAmelCase_      			=  image_size
								lowerCAmelCase_      			=  patch_size
								lowerCAmelCase_      			=  num_channels
								lowerCAmelCase_      			=  qkv_bias
								lowerCAmelCase_      			=  encoder_stride







class  A		(  __UpperCAmelCase     ):
		__snake_case									=   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 1E-4




