



'''simple docstring'''





import functools
import operator

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


__a          =		logging.get_logger(__name__)

__a          =		{
    "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     UpperCAmelCase_       (       _a	):
    """simple docstring"""







    lowercase					=		"sew-d"




    def __init__(    self					:     List[str] ,     snake_case_					:     str=32 ,     snake_case_					:     Dict=768 ,     snake_case_					:     List[Any]=12 ,     snake_case_					:     Optional[Any]=12 ,     snake_case_					:     str=3_072 ,     snake_case_					:     Dict=2 ,     snake_case_					:     Dict=512 ,     snake_case_					:     Dict=256 ,     snake_case_					:     List[str]=True ,     snake_case_					:     str=True ,     snake_case_					:     Any=("p2c", "c2p") ,     snake_case_					:     Tuple="layer_norm" ,     snake_case_					:     Dict="gelu_python" ,     snake_case_					:     str=0.1 ,     snake_case_					:     Tuple=0.1 ,     snake_case_					:     Any=0.1 ,     snake_case_					:     List[Any]=0.0 ,     snake_case_					:     Optional[Any]=0.1 ,     snake_case_					:     str=0.02 ,     snake_case_					:     str=1E-7 ,     snake_case_					:     Union[str, Any]=1E-5 ,     snake_case_					:     List[str]="group" ,     snake_case_					:     List[str]="gelu" ,     snake_case_					:     Tuple=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512) ,     snake_case_					:     Optional[int]=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,     snake_case_					:     Dict=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,     snake_case_					:     Tuple=False ,     snake_case_					:     Tuple=128 ,     snake_case_					:     str=16 ,     snake_case_					:     Optional[int]=True ,     snake_case_					:     List[str]=0.05 ,     snake_case_					:     List[Any]=10 ,     snake_case_					:     Union[str, Any]=2 ,     snake_case_					:     Dict=0.0 ,     snake_case_					:     Any=10 ,     snake_case_					:     Union[str, Any]=0 ,     snake_case_					:     Union[str, Any]="mean" ,     snake_case_					:     List[str]=False ,     snake_case_					:     int=False ,     snake_case_					:     Any=256 ,     snake_case_					:     Tuple=0 ,     snake_case_					:     Tuple=1 ,     snake_case_					:     Union[str, Any]=2 ,     **snake_case_					:     Any ,     ):
          super().__init__(**snake_case_ ,     pad_token_id=snake_case_ ,     bos_token_id=snake_case_ ,     eos_token_id=snake_case_						)
          snake_case__  :    List[str]    						=      hidden_size
          snake_case__  :    Optional[int]    						=      feat_extract_norm
          snake_case__  :    str    						=      feat_extract_activation
          snake_case__  :    List[Any]    						=      list(snake_case_						)
          snake_case__  :    Dict    						=      list(snake_case_						)
          snake_case__  :    Optional[int]    						=      list(snake_case_						)
          snake_case__  :    List[str]    						=      conv_bias
          snake_case__  :    Any    						=      num_conv_pos_embeddings
          snake_case__  :    Dict    						=      num_conv_pos_embedding_groups
          snake_case__  :    Dict    						=      len(self.conv_dim						)
          snake_case__  :    Optional[Any]    						=      num_hidden_layers
          snake_case__  :    Union[str, Any]    						=      intermediate_size
          snake_case__  :    Optional[int]    						=      squeeze_factor
          snake_case__  :    List[str]    						=      max_position_embeddings
          snake_case__  :    List[Any]    						=      position_buckets
          snake_case__  :    List[str]    						=      share_att_key
          snake_case__  :    List[Any]    						=      relative_attention
          snake_case__  :    str    						=      norm_rel_ebd
          snake_case__  :    List[str]    						=      list(snake_case_						)
          snake_case__  :    Optional[int]    						=      hidden_act
          snake_case__  :    List[Any]    						=      num_attention_heads
          snake_case__  :    Tuple    						=      hidden_dropout
          snake_case__  :    Tuple    						=      attention_dropout
          snake_case__  :    Optional[Any]    						=      activation_dropout
          snake_case__  :    List[Any]    						=      feat_proj_dropout
          snake_case__  :    Optional[Any]    						=      final_dropout
          snake_case__  :    Optional[int]    						=      layer_norm_eps
          snake_case__  :    Dict    						=      feature_layer_norm_eps
          snake_case__  :    Optional[Any]    						=      initializer_range
          snake_case__  :    Dict    						=      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
          snake_case__  :    Dict    						=      apply_spec_augment
          snake_case__  :    List[Any]    						=      mask_time_prob
          snake_case__  :    Dict    						=      mask_time_length
          snake_case__  :    Union[str, Any]    						=      mask_time_min_masks
          snake_case__  :    List[Any]    						=      mask_feature_prob
          snake_case__  :    List[str]    						=      mask_feature_length
          snake_case__  :    Tuple    						=      mask_feature_min_masks

          # ctc loss
          snake_case__  :    str    						=      ctc_loss_reduction
          snake_case__  :    Dict    						=      ctc_zero_infinity

          # sequence classification
          snake_case__  :    List[str]    						=      use_weighted_layer_sum
          snake_case__  :    List[Any]    						=      classifier_proj_size




    @property
    def lowerCamelCase       (    self					:     List[Any]						):
          return functools.reduce(operator.mul ,     self.conv_stride ,     1						)





'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__a          =		{
    "configuration_timesformer": ["TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TimesformerConfig"],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __a          =		[
           "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
           "TimesformerModel",
           "TimesformerForVideoClassification",
           "TimesformerPreTrainedModel",
       ]

if TYPE_CHECKING:
       from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_timesformer import (
                  TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TimesformerForVideoClassification,
                  TimesformerModel,
                  TimesformerPreTrainedModel,
              )

else:
       import sys

       __a          =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
