





'''simple docstring'''


import functools
import operator

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


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

lowerCAmelCase					:     Optional[Any]												={
    '''asapp/sew-tiny-100k''': '''https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json''',
    # See all SEW models at https://huggingface.co/models?filter=sew
}
class       a_   (				_lowerCAmelCase							):
     __A      =			"sew"





     def __init__( self		:					Dict	,      lowercase		:					List[str]=32	,      lowercase		:					Dict=768	,      lowercase		:					Union[str, Any]=12	,      lowercase		:					Optional[Any]=12	,      lowercase		:					int=3_072	,      lowercase		:					Dict=2	,      lowercase		:					int="gelu"	,      lowercase		:					Optional[Any]=0.1	,      lowercase		:					Union[str, Any]=0.1	,      lowercase		:					Optional[Any]=0.1	,      lowercase		:					Dict=0.0	,      lowercase		:					Tuple=0.1	,      lowercase		:					Union[str, Any]=0.1	,      lowercase		:					Any=0.02	,      lowercase		:					Optional[int]=1e-5	,      lowercase		:					Optional[Any]="group"	,      lowercase		:					Optional[Any]="gelu"	,      lowercase		:					Optional[int]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)	,      lowercase		:					Tuple=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)	,      lowercase		:					Dict=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)	,      lowercase		:					Union[str, Any]=False	,      lowercase		:					List[str]=128	,      lowercase		:					Optional[Any]=16	,      lowercase		:					List[str]=True	,      lowercase		:					Tuple=0.05	,      lowercase		:					Union[str, Any]=10	,      lowercase		:					Optional[int]=2	,      lowercase		:					Optional[int]=0.0	,      lowercase		:					List[Any]=10	,      lowercase		:					Union[str, Any]=0	,      lowercase		:					str="mean"	,      lowercase		:					int=False	,      lowercase		:					List[Any]=False	,      lowercase		:					int=256	,      lowercase		:					str=0	,      lowercase		:					Tuple=1	,      lowercase		:					List[str]=2	,      **lowercase		:					List[str]	,      ):





        """simple docstring"""




        super().__init__(**lowercase	,      pad_token_id=lowercase	,      bos_token_id=lowercase	,      eos_token_id=lowercase						)
        lowercase_			:Any    			= hidden_size
        lowercase_			:Tuple    			= feat_extract_norm
        lowercase_			:Any    			= feat_extract_activation
        lowercase_			:List[str]    			= list(lowercase						)
        lowercase_			:Dict    			= list(lowercase						)
        lowercase_			:List[str]    			= list(lowercase						)
        lowercase_			:Optional[Any]    			= conv_bias
        lowercase_			:str    			= num_conv_pos_embeddings
        lowercase_			:Dict    			= num_conv_pos_embedding_groups
        lowercase_			:str    			= len(self.conv_dim						)
        lowercase_			:Optional[int]    			= num_hidden_layers
        lowercase_			:Any    			= intermediate_size
        lowercase_			:Dict    			= squeeze_factor
        lowercase_			:List[Any]    			= hidden_act
        lowercase_			:Any    			= num_attention_heads
        lowercase_			:List[Any]    			= hidden_dropout
        lowercase_			:Optional[Any]    			= attention_dropout
        lowercase_			:List[str]    			= activation_dropout
        lowercase_			:List[str]    			= feat_proj_dropout
        lowercase_			:List[Any]    			= final_dropout
        lowercase_			:Dict    			= layerdrop
        lowercase_			:List[Any]    			= layer_norm_eps
        lowercase_			:Any    			= initializer_range
        lowercase_			: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
        lowercase_			:Optional[Any]    			= apply_spec_augment
        lowercase_			:Union[str, Any]    			= mask_time_prob
        lowercase_			:Union[str, Any]    			= mask_time_length
        lowercase_			:Union[str, Any]    			= mask_time_min_masks
        lowercase_			:Optional[int]    			= mask_feature_prob
        lowercase_			:int    			= mask_feature_length
        lowercase_			:Optional[int]    			= mask_feature_min_masks

        # ctc loss
        lowercase_			:Optional[Any]    			= ctc_loss_reduction
        lowercase_			:Tuple    			= ctc_zero_infinity

        # sequence classification
        lowercase_			:Any    			= use_weighted_layer_sum
        lowercase_			:Any    			= classifier_proj_size







     @property
     def 							lowercase__      ( self		:					Optional[int]						):





        """simple docstring"""




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









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase					:					int	,__lowerCamelCase					:					int ):
   return int((input_a, input_a).count(0 ) == 0 )
def 							UpperCAmelCase_  (						):
   assert and_gate(0	,0 ) == 0
   assert and_gate(0	,1 ) == 0
   assert and_gate(1	,0 ) == 0
   assert and_gate(1	,1 ) == 1


if __name__ == "__main__":
 test_and_gate()
 print(and_gate(1, 0))
 print(and_gate(0, 0))
 print(and_gate(0, 1))
 print(and_gate(1, 1))


