

"""simple docstring"""





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


__UpperCamelCase    : Dict				 =						logging.get_logger(__name__)

__UpperCamelCase    : int				 =						{
    '''speechbrain/m-ctc-t-large''': '''https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json''',
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}







class 							SCREAMING_SNAKE_CASE   (						a_			):






					"""simple docstring"""



					lowercase__												=			"mctct"







					def __init__(			self     :							Any  ,lowercase_     :							List[Any]=8_0_6_5  ,lowercase_     :							Any=1_5_3_6  ,lowercase_     :							Optional[int]=3_6  ,lowercase_     :							Any=6_1_4_4  ,lowercase_     :							List[Any]=4  ,lowercase_     :							Optional[Any]=3_8_4  ,lowercase_     :							Dict=9_2_0  ,lowercase_     :							int=1E-5  ,lowercase_     :							Union[str, Any]=0.3  ,lowercase_     :							Dict="relu"  ,lowercase_     :							int=0.02  ,lowercase_     :							List[Any]=0.3  ,lowercase_     :							str=0.3  ,lowercase_     :							Union[str, Any]=1  ,lowercase_     :							str=0  ,lowercase_     :							Union[str, Any]=2  ,lowercase_     :							int=1  ,lowercase_     :							Dict=0.3  ,lowercase_     :							Any=1  ,lowercase_     :							Any=(7,)  ,lowercase_     :							Tuple=(3,)  ,lowercase_     :							str=8_0  ,lowercase_     :							Union[str, Any]=1  ,lowercase_     :							Tuple=None  ,lowercase_     :							Union[str, Any]="sum"  ,lowercase_     :							List[str]=False  ,**lowercase_     :							Tuple  ,):
						super().__init__(**lowercase_  ,pad_token_id=lowercase_  ,bos_token_id=lowercase_  ,eos_token_id=lowercase_						)
						lowerCAmelCase__      :		Optional[int]    							=      vocab_size
						lowerCAmelCase__      :		List[str]    							=      hidden_size
						lowerCAmelCase__      :		Optional[Any]    							=      num_hidden_layers
						lowerCAmelCase__      :		int    							=      intermediate_size
						lowerCAmelCase__      :		Dict    							=      num_attention_heads
						lowerCAmelCase__      :		List[Any]    							=      attention_head_dim
						lowerCAmelCase__      :		Union[str, Any]    							=      max_position_embeddings
						lowerCAmelCase__      :		str    							=      layer_norm_eps
						lowerCAmelCase__      :		List[str]    							=      layerdrop
						lowerCAmelCase__      :		Any    							=      hidden_act
						lowerCAmelCase__      :		Dict    							=      initializer_range
						lowerCAmelCase__      :		Dict    							=      hidden_dropout_prob
						lowerCAmelCase__      :		Tuple    							=      attention_probs_dropout_prob
						lowerCAmelCase__      :		Optional[Any]    							=      pad_token_id
						lowerCAmelCase__      :		Optional[int]    							=      bos_token_id
						lowerCAmelCase__      :		Union[str, Any]    							=      eos_token_id
						lowerCAmelCase__      :		str    							=      conv_glu_dim
						lowerCAmelCase__      :		Any    							=      conv_dropout
						lowerCAmelCase__      :		Any    							=      num_conv_layers
						lowerCAmelCase__      :		List[Any]    							=      input_feat_per_channel
						lowerCAmelCase__      :		List[Any]    							=      input_channels
						lowerCAmelCase__      :		Tuple    							=      conv_channels
						lowerCAmelCase__      :		List[str]    							=      ctc_loss_reduction
						lowerCAmelCase__      :		Dict    							=      ctc_zero_infinity

						# prevents config testing fail with exporting to json
						lowerCAmelCase__      :		List[str]    							=      list(lowercase_						)
						lowerCAmelCase__      :		int    							=      list(lowercase_						)

						if len(self.conv_kernel						) != self.num_conv_layers:
							raise ValueError(
							    '''Configuration for convolutional module is incorrect. '''
							    '''It is required that `len(config.conv_kernel)` == `config.num_conv_layers` '''
							    F'but is `len(config.conv_kernel) = {len(self.conv_kernel						)}`, '
							    F'`config.num_conv_layers = {self.num_conv_layers}`.'						)







"""simple docstring"""





def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''					)

	lowerCAmelCase__      :		int    							=      str(bin(A_					)					)
	binary_number += "0" * shift_amount
	return binary_number

def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''					)

	lowerCAmelCase__      :		Any    							=      str(bin(A_					)					)[2:]
	if shift_amount >= len(A_					):
		return "0b0"
	lowerCAmelCase__      :		Tuple    							=      binary_number[: len(A_					) - shift_amount]
	return "0b" + shifted_binary_number

def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number >= 0:  # Get binary representation of positive number
		lowerCAmelCase__      :		Union[str, Any]    							=      '''0''' + str(bin(A_					)					).strip('''-'''					)[2:]
	else:  # Get binary (2's complement) representation of negative number
		lowerCAmelCase__      :		Optional[Any]    							=      len(bin(A_					)[3:]					)  # Find 2's complement of number
		lowerCAmelCase__      :		Optional[int]    							=      bin(abs(A_					) - (1 << binary_number_length)					)[3:]
		lowerCAmelCase__      :		int    							=      (
		    '''1''' + '''0''' * (binary_number_length - len(A_					)) + binary_number
		)

	if shift_amount >= len(A_					):
		return "0b" + binary_number[0] * len(A_					)
	return (
	    "0b"
	    + binary_number[0] * shift_amount
	    + binary_number[: len(A_					) - shift_amount]
	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




