





'''simple docstring'''





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 			UpperCamelCase_		(  a__					):
					lowerCAmelCase_							=	"""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_				,						)		->							Dict:
										super().__init__(**lowercase__				,						pad_token_id=lowercase__				,						bos_token_id=lowercase__				,						eos_token_id=lowercase__  )
										_snake_case									=				hidden_size
										_snake_case									=				feat_extract_norm
										_snake_case									=				feat_extract_activation
										_snake_case									=				list(lowercase__  )
										_snake_case									=				list(lowercase__  )
										_snake_case									=				list(lowercase__  )
										_snake_case									=				conv_bias
										_snake_case									=				num_conv_pos_embeddings
										_snake_case									=				num_conv_pos_embedding_groups
										_snake_case									=				len(self.conv_dim  )
										_snake_case									=				num_hidden_layers
										_snake_case									=				intermediate_size
										_snake_case									=				squeeze_factor
										_snake_case									=				max_position_embeddings
										_snake_case									=				position_buckets
										_snake_case									=				share_att_key
										_snake_case									=				relative_attention
										_snake_case									=				norm_rel_ebd
										_snake_case									=				list(lowercase__  )
										_snake_case									=				hidden_act
										_snake_case									=				num_attention_heads
										_snake_case									=				hidden_dropout
										_snake_case									=				attention_dropout
										_snake_case									=				activation_dropout
										_snake_case									=				feat_proj_dropout
										_snake_case									=				final_dropout
										_snake_case									=				layer_norm_eps
										_snake_case									=				feature_layer_norm_eps
										_snake_case									=				initializer_range
										_snake_case									=				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									=				apply_spec_augment
										_snake_case									=				mask_time_prob
										_snake_case									=				mask_time_length
										_snake_case									=				mask_time_min_masks
										_snake_case									=				mask_feature_prob
										_snake_case									=				mask_feature_length
										_snake_case									=				mask_feature_min_masks

										# ctc loss
										_snake_case									=				ctc_loss_reduction
										_snake_case									=				ctc_zero_infinity

										# sequence classification
										_snake_case									=				use_weighted_layer_sum
										_snake_case									=				classifier_proj_size






					@property
					def 	lowerCAmelCase			(		self  )		->							Any:
										return functools.reduce(operator.mul				,						self.conv_stride				,						1  )










def 						lowerCamelCase__     (     UpperCamelCase__			:       List[Any]       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       str       ,    UpperCamelCase__			:       int       ,    UpperCamelCase__			:       List[str]       ,    UpperCamelCase__			:       str						)			-> List[Any]:



					'''simple docstring'''




					if index == r:
										for j in range(UpperCamelCase__						):
															print(data[j]       ,    end=' '						)
										print(' '						)
										return
					#  When no more elements are there to put in data[]
					if i >= n:
										return
					# current is included, put next at next location
					_snake_case									=				arr[i]
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    index + 1       ,    UpperCamelCase__       ,    i + 1						)
					# current is excluded, replace it with
					# next (Note that i+1 is passed, but
					# index is not changed)
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    i + 1						)
					# The main function that prints all combinations
					# of size r in arr[] of size n. This function
					# mainly uses combinationUtil()





def 						lowerCamelCase__     (     UpperCamelCase__			:       Optional[int]       ,    UpperCamelCase__			:       Tuple       ,    UpperCamelCase__			:       List[str]						)			-> Tuple:



					'''simple docstring'''




					_snake_case									=				[0] * r
					# Print all combination using temporary array 'data[]'
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    0       ,    UpperCamelCase__       ,    0						)


if __name__ == "__main__":
					# Driver code to check the function above
					UpperCAmelCase_      							=     [10, 20, 30, 40, 50]
					print_combination(arr, len(arr), 3)
					# This code is contributed by Ambuj sahu



