


'''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 						_snake_case    (   __UpperCAmelCase		):
					lowerCAmelCase					:Optional[int]            =    '''sew-d'''




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

								# ctc loss
								UpperCAmelCase__     :    Any         =   ctc_loss_reduction
								UpperCAmelCase__     :    Tuple         =   ctc_zero_infinity

								# sequence classification
								UpperCAmelCase__     :    Optional[Any]         =   use_weighted_layer_sum
								UpperCAmelCase__     :    str         =   classifier_proj_size




					@property
					def  snake_case__  (					self):
								return functools.reduce(operator.mul							,							self.conv_stride							,							1)




from __future__ import annotations

from typing import Any





def      __snake_case	(			_UpperCAmelCase				):
    if not postfix_notation:
        return 0

    __a						       =				{'''+''', '''-''', '''*''', '''/'''}
    __a						       =				[]

    for token in postfix_notation:
        if token in operations:
            __a       ,   __a						       =				stack.pop(), stack.pop()
            if token == "+":
                stack.append(a + b				)
            elif token == "-":
                stack.append(a - b				)
            elif token == "*":
                stack.append(a * b				)
            else:
                if a * b < 0 and a % b != 0:
                    stack.append(a // b + 1				)
                else:
                    stack.append(a // b				)
        else:
            stack.append(int(_UpperCAmelCase				)				)

    return stack.pop()


if __name__ == "__main__":
 import doctest

 doctest.testmod()





