





'''simple docstring'''







import functools
import operator

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


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

lowerCAmelCase_					:    List[Any]      	=			{
    '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 				__SCREAMING_SNAKE_CASE  (_UpperCAmelCase      ):






				"""simple docstring"""







				__a            ='sew-d'




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

								# ctc loss
								_a								= ctc_loss_reduction
								_a								= ctc_zero_infinity

								# sequence classification
								_a								= use_weighted_layer_sum
								_a								= classifier_proj_size




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



def 		_lowercase (     lowercase__   ,	lowercase__						):
      if a < 0 or b < 0:
            raise ValueError('''the value of both inputs must be positive'''						)
      __lowerCAmelCase					:						int					=					str(bin(lowercase__						)						)[2:]  # remove the leading "0b"
      __lowerCAmelCase					:						Any					=					str(bin(lowercase__						)						)[2:]
      __lowerCAmelCase					:						List[str]					=					max(len(lowercase__						)   ,	len(lowercase__						)						)
      return "0b" + "".join(
          str(int('''1''' in (char_a, char_b)						)						)
          for char_a, char_b in zip(a_binary.zfill(lowercase__						)   ,	b_binary.zfill(lowercase__						)						)						)


if __name__ == "__main__":
 import doctest

 doctest.testmod()


