




from ...configuration_utils import PretrainedConfig
from ...utils import logging


__lowerCamelCase   :						Tuple				=			logging.get_logger(__name__)

__lowerCamelCase   :						Optional[int]				=			{
    '''google/vivit-b-16x2-kinetics400''': (
        '''https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json'''
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}


class    lowerCamelCase    (		_lowerCamelCase						):






			'''simple docstring'''





			UpperCamelCase__								='''vivit'''

			def __init__( self			:   Tuple       ,						lowerCamelCase_			:   Dict=224       ,						lowerCamelCase_			:   Optional[int]=32       ,						lowerCamelCase_			:   str=[2, 16, 16]       ,						lowerCamelCase_			:   str=3       ,						lowerCamelCase_			:   int=768       ,						lowerCamelCase_			:   int=12       ,						lowerCamelCase_			:   int=12       ,						lowerCamelCase_			:   Tuple=3072       ,						lowerCamelCase_			:   str="gelu_fast"       ,						lowerCamelCase_			:   int=0.0       ,						lowerCamelCase_			:   Dict=0.0       ,						lowerCamelCase_			:   Tuple=0.0_2       ,						lowerCamelCase_			:   str=1E-06       ,						lowerCamelCase_			:   str=True       ,						**lowerCamelCase_			:   Optional[Any]       ,						)						->   List[str]:
								__magic_name__							:	Dict    							=							hidden_size
								__magic_name__							:	List[Any]    							=							num_hidden_layers
								__magic_name__							:	int    							=							num_attention_heads
								__magic_name__							:	List[str]    							=							intermediate_size
								__magic_name__							:	Optional[Any]    							=							hidden_act
								__magic_name__							:	Any    							=							hidden_dropout_prob
								__magic_name__							:	Any    							=							attention_probs_dropout_prob
								__magic_name__							:	Optional[Any]    							=							initializer_range
								__magic_name__							:	List[Any]    							=							layer_norm_eps

								__magic_name__							:	Optional[int]    							=							image_size
								__magic_name__							:	Dict    							=							num_frames
								__magic_name__							:	str    							=							tubelet_size
								__magic_name__							:	List[str]    							=							num_channels
								__magic_name__							:	str    							=							qkv_bias

								super().__init__(**lowerCamelCase_  )









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


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

__lowerCamelCase   :						Tuple				=			{
    '''shi-labs/nat-mini-in1k-224''': '''https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json''',
    # See all Nat models at https://huggingface.co/models?filter=nat
}


class    lowerCamelCase    (		_lowerCamelCase				,_lowerCamelCase						):






			'''simple docstring'''





			UpperCamelCase__								='''nat'''

			UpperCamelCase__								={
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}

			def __init__( self			:   Union[str, Any]       ,						lowerCamelCase_			:   Dict=4       ,						lowerCamelCase_			:   Union[str, Any]=3       ,						lowerCamelCase_			:   List[str]=64       ,						lowerCamelCase_			:   Union[str, Any]=[3, 4, 6, 5]       ,						lowerCamelCase_			:   List[Any]=[2, 4, 8, 16]       ,						lowerCamelCase_			:   List[Any]=7       ,						lowerCamelCase_			:   Union[str, Any]=3.0       ,						lowerCamelCase_			:   int=True       ,						lowerCamelCase_			:   str=0.0       ,						lowerCamelCase_			:   int=0.0       ,						lowerCamelCase_			:   Dict=0.1       ,						lowerCamelCase_			:   Optional[int]="gelu"       ,						lowerCamelCase_			:   Tuple=0.0_2       ,						lowerCamelCase_			:   Tuple=1E-5       ,						lowerCamelCase_			:   List[Any]=0.0       ,						lowerCamelCase_			:   str=None       ,						lowerCamelCase_			:   Tuple=None       ,						**lowerCamelCase_			:   Any       ,						)						->   Any:
								super().__init__(**lowerCamelCase_  )

								__magic_name__							:	List[Any]    							=							patch_size
								__magic_name__							:	str    							=							num_channels
								__magic_name__							:	Union[str, Any]    							=							embed_dim
								__magic_name__							:	Dict    							=							depths
								__magic_name__							:	str    							=							len(lowerCamelCase_  )
								__magic_name__							:	List[str]    							=							num_heads
								__magic_name__							:	Optional[int]    							=							kernel_size
								__magic_name__							:	Any    							=							mlp_ratio
								__magic_name__							:	Any    							=							qkv_bias
								__magic_name__							:	Union[str, Any]    							=							hidden_dropout_prob
								__magic_name__							:	Any    							=							attention_probs_dropout_prob
								__magic_name__							:	List[str]    							=							drop_path_rate
								__magic_name__							:	str    							=							hidden_act
								__magic_name__							:	Tuple    							=							layer_norm_eps
								__magic_name__							:	Any    							=							initializer_range
								# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
								# this indicates the channel dimension after the last stage of the model
								__magic_name__							:	str    							=							int(embed_dim * 2 ** (len(lowerCamelCase_  ) - 1)  )
								__magic_name__							:	str    							=							layer_scale_init_value
								__magic_name__							:	Dict    							=							['''stem'''] + [F'''stage{idx}''' for idx in range(1       ,						len(lowerCamelCase_  ) + 1  )]
								__magic_name__							,    __magic_name__							:	int    							=							get_aligned_output_features_output_indices(
								    out_features=lowerCamelCase_       ,						out_indices=lowerCamelCase_       ,						stage_names=self.stage_names  )



