


import functools
import operator

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


__UpperCamelCase   		=       logging.get_logger(__name__)

__UpperCamelCase   		=       {
    'asapp/sew-d-tiny-100k': 'https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}







class        lowerCamelCase__	(							__A      ):






			"""simple docstring"""






			_UpperCamelCase		:					List[str]    =		'sew-d'




			def __init__(							self      ,						snake_case=32      ,						snake_case=768      ,						snake_case=12      ,						snake_case=12      ,						snake_case=3072      ,						snake_case=2      ,						snake_case=512      ,						snake_case=256      ,						snake_case=True      ,						snake_case=True      ,						snake_case=("p2c", "c2p")      ,						snake_case="layer_norm"      ,						snake_case="gelu_python"      ,						snake_case=0.1      ,						snake_case=0.1      ,						snake_case=0.1      ,						snake_case=0.0      ,						snake_case=0.1      ,						snake_case=0.02      ,						snake_case=1E-7      ,						snake_case=1E-5      ,						snake_case="group"      ,						snake_case="gelu"      ,						snake_case=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)      ,						snake_case=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)      ,						snake_case=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)      ,						snake_case=False      ,						snake_case=128      ,						snake_case=16      ,						snake_case=True      ,						snake_case=0.05      ,						snake_case=10      ,						snake_case=2      ,						snake_case=0.0      ,						snake_case=10      ,						snake_case=0      ,						snake_case="mean"      ,						snake_case=False      ,						snake_case=False      ,						snake_case=256      ,						snake_case=0      ,						snake_case=1      ,						snake_case=2      ,						**snake_case      ,						):

						'''simple docstring'''


						super().__init__(**snake_case      ,						pad_token_id=snake_case      ,						bos_token_id=snake_case      ,						eos_token_id=snake_case     )
						UpperCamelCase__					=       hidden_size
						UpperCamelCase__					=       feat_extract_norm
						UpperCamelCase__					=       feat_extract_activation
						UpperCamelCase__					=       list(snake_case     )
						UpperCamelCase__					=       list(snake_case     )
						UpperCamelCase__					=       list(snake_case     )
						UpperCamelCase__					=       conv_bias
						UpperCamelCase__					=       num_conv_pos_embeddings
						UpperCamelCase__					=       num_conv_pos_embedding_groups
						UpperCamelCase__					=       len(self.conv_dim     )
						UpperCamelCase__					=       num_hidden_layers
						UpperCamelCase__					=       intermediate_size
						UpperCamelCase__					=       squeeze_factor
						UpperCamelCase__					=       max_position_embeddings
						UpperCamelCase__					=       position_buckets
						UpperCamelCase__					=       share_att_key
						UpperCamelCase__					=       relative_attention
						UpperCamelCase__					=       norm_rel_ebd
						UpperCamelCase__					=       list(snake_case     )
						UpperCamelCase__					=       hidden_act
						UpperCamelCase__					=       num_attention_heads
						UpperCamelCase__					=       hidden_dropout
						UpperCamelCase__					=       attention_dropout
						UpperCamelCase__					=       activation_dropout
						UpperCamelCase__					=       feat_proj_dropout
						UpperCamelCase__					=       final_dropout
						UpperCamelCase__					=       layer_norm_eps
						UpperCamelCase__					=       feature_layer_norm_eps
						UpperCamelCase__					=       initializer_range
						UpperCamelCase__					=       vocab_size

						if (
						    (len(self.conv_stride     ) != self.num_feat_extract_layers)
						    or (len(self.conv_kernel     ) != self.num_feat_extract_layers)
						    or (len(self.conv_dim     ) != self.num_feat_extract_layers)
						):
									raise ValueError(
									    "Configuration for convolutional layers is incorrect."
									    "It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"
									    F'''but is `len(config.conv_dim) = {len(self.conv_dim     )}`, `len(config.conv_stride)'''
									    F'''= {len(self.conv_stride     )}`, `len(config.conv_kernel) = {len(self.conv_kernel     )}`.'''     )

						# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
						UpperCamelCase__					=       apply_spec_augment
						UpperCamelCase__					=       mask_time_prob
						UpperCamelCase__					=       mask_time_length
						UpperCamelCase__					=       mask_time_min_masks
						UpperCamelCase__					=       mask_feature_prob
						UpperCamelCase__					=       mask_feature_length
						UpperCamelCase__					=       mask_feature_min_masks

						# ctc loss
						UpperCamelCase__					=       ctc_loss_reduction
						UpperCamelCase__					=       ctc_zero_infinity

						# sequence classification
						UpperCamelCase__					=       use_weighted_layer_sum
						UpperCamelCase__					=       classifier_proj_size







			@property
			def 				snake_case__				(							self     ):

						'''simple docstring'''


						return functools.reduce(operator.mul      ,						self.conv_stride      ,						1     )






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__UpperCamelCase    		=       {
    'configuration_mobilenet_v2': [
        'MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileNetV2Config',
        'MobileNetV2OnnxConfig',
    ],
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__UpperCamelCase    		=       ['MobileNetV2FeatureExtractor']
						__UpperCamelCase    		=       ['MobileNetV2ImageProcessor']


try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__UpperCamelCase    		=       [
						    'MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'MobileNetV2ForImageClassification',
						    'MobileNetV2ForSemanticSegmentation',
						    'MobileNetV2Model',
						    'MobileNetV2PreTrainedModel',
						    'load_tf_weights_in_mobilenet_v2',
						]


if TYPE_CHECKING:
						from .configuration_mobilenet_va import (
						    MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    MobileNetVaConfig,
						    MobileNetVaOnnxConfig,
						)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
												from .image_processing_mobilenet_va import MobileNetVaImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mobilenet_va import (
												    MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MobileNetVaForImageClassification,
												    MobileNetVaForSemanticSegmentation,
												    MobileNetVaModel,
												    MobileNetVaPreTrainedModel,
												    load_tf_weights_in_mobilenet_va,
												)


else:
						import sys

						__UpperCamelCase    		=       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


