


"""simple docstring"""





import functools
import operator

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


snake_case__		:     Optional[int]    				=				logging.get_logger(__name__)

snake_case__		:     Optional[int]    				=				{
    '''microsoft/unispeech-sat-base-100h-libri-ft''': (
        '''https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json'''
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}



class 		snake_case_(       a__			):
     __UpperCamelCase  =					'''unispeech-sat'''






     def __init__(	self  :					List[Any]					,				UpperCamelCase_  :					Dict=3_2					,				UpperCamelCase_  :					Union[str, Any]=7_6_8					,				UpperCamelCase_  :					Dict=1_2					,				UpperCamelCase_  :					str=1_2					,				UpperCamelCase_  :					List[Any]=3_0_7_2					,				UpperCamelCase_  :					Union[str, Any]="gelu"					,				UpperCamelCase_  :					List[str]=0.1					,				UpperCamelCase_  :					Union[str, Any]=0.1					,				UpperCamelCase_  :					Optional[int]=0.1					,				UpperCamelCase_  :					List[Any]=0.0					,				UpperCamelCase_  :					Optional[Any]=0.0					,				UpperCamelCase_  :					Dict=0.1					,				UpperCamelCase_  :					Dict=0.1					,				UpperCamelCase_  :					List[Any]=0.02					,				UpperCamelCase_  :					Optional[Any]=1E-5					,				UpperCamelCase_  :					Union[str, Any]="group"					,				UpperCamelCase_  :					List[Any]="gelu"					,				UpperCamelCase_  :					Optional[int]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)					,				UpperCamelCase_  :					Tuple=(5, 2, 2, 2, 2, 2, 2)					,				UpperCamelCase_  :					Optional[Any]=(1_0, 3, 3, 3, 3, 2, 2)					,				UpperCamelCase_  :					int=False					,				UpperCamelCase_  :					Dict=1_2_8					,				UpperCamelCase_  :					str=1_6					,				UpperCamelCase_  :					int=False					,				UpperCamelCase_  :					Any=True					,				UpperCamelCase_  :					Optional[Any]=0.05					,				UpperCamelCase_  :					int=1_0					,				UpperCamelCase_  :					List[str]=2					,				UpperCamelCase_  :					List[str]=0.0					,				UpperCamelCase_  :					Dict=1_0					,				UpperCamelCase_  :					int=0					,				UpperCamelCase_  :					Dict=3_2_0					,				UpperCamelCase_  :					List[Any]=2					,				UpperCamelCase_  :					Optional[int]=0.1					,				UpperCamelCase_  :					Union[str, Any]=1_0_0					,				UpperCamelCase_  :					Optional[Any]=2_5_6					,				UpperCamelCase_  :					Any=2_5_6					,				UpperCamelCase_  :					int=0.1					,				UpperCamelCase_  :					Optional[Any]="mean"					,				UpperCamelCase_  :					Union[str, Any]=False					,				UpperCamelCase_  :					List[str]=False					,				UpperCamelCase_  :					Optional[int]=2_5_6					,				UpperCamelCase_  :					List[str]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)					,				UpperCamelCase_  :					Any=(5, 3, 3, 1, 1)					,				UpperCamelCase_  :					Any=(1, 2, 3, 1, 1)					,				UpperCamelCase_  :					Tuple=5_1_2					,				UpperCamelCase_  :					Tuple=0					,				UpperCamelCase_  :					Any=1					,				UpperCamelCase_  :					Any=2					,				UpperCamelCase_  :					List[Any]=5_0_4					,				**UpperCamelCase_  :					int					,				):
           super().__init__(**UpperCamelCase_					,				pad_token_id=UpperCamelCase_					,				bos_token_id=UpperCamelCase_					,				eos_token_id=UpperCamelCase_				)
           lowerCAmelCase					:	str       =   hidden_size
           lowerCAmelCase					:	Optional[Any]       =   feat_extract_norm
           lowerCAmelCase					:	str       =   feat_extract_activation
           lowerCAmelCase					:	Optional[Any]       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	Tuple       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	Dict       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	Tuple       =   conv_bias
           lowerCAmelCase					:	Dict       =   num_conv_pos_embeddings
           lowerCAmelCase					:	str       =   num_conv_pos_embedding_groups
           lowerCAmelCase					:	List[str]       =   len(self.conv_dim				)
           lowerCAmelCase					:	List[Any]       =   num_hidden_layers
           lowerCAmelCase					:	Optional[Any]       =   intermediate_size
           lowerCAmelCase					:	List[str]       =   hidden_act
           lowerCAmelCase					:	Dict       =   num_attention_heads
           lowerCAmelCase					:	Optional[Any]       =   hidden_dropout
           lowerCAmelCase					:	Optional[int]       =   attention_dropout
           lowerCAmelCase					:	Tuple       =   activation_dropout
           lowerCAmelCase					:	str       =   feat_proj_dropout
           lowerCAmelCase					:	Dict       =   final_dropout
           lowerCAmelCase					:	str       =   layerdrop
           lowerCAmelCase					:	int       =   layer_norm_eps
           lowerCAmelCase					:	str       =   initializer_range
           lowerCAmelCase					:	List[str]       =   vocab_size
           lowerCAmelCase					:	List[str]       =   num_clusters
           lowerCAmelCase					:	Union[str, Any]       =   do_stable_layer_norm
           lowerCAmelCase					:	Union[str, Any]       =   use_weighted_layer_sum

           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)`, but is `len(config.conv_dim) ='''
                     F''' {len(self.conv_dim				)}`, `len(config.conv_stride) = {len(self.conv_stride				)}`,'''
                     F''' `len(config.conv_kernel) = {len(self.conv_kernel				)}`.'''				)

           # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
           lowerCAmelCase					:	Optional[int]       =   apply_spec_augment
           lowerCAmelCase					:	int       =   mask_time_prob
           lowerCAmelCase					:	Tuple       =   mask_time_length
           lowerCAmelCase					:	int       =   mask_time_min_masks
           lowerCAmelCase					:	str       =   mask_feature_prob
           lowerCAmelCase					:	List[str]       =   mask_feature_length
           lowerCAmelCase					:	List[Any]       =   mask_feature_min_masks

           # parameters for pretraining with codevector quantized representations
           lowerCAmelCase					:	List[Any]       =   num_codevectors_per_group
           lowerCAmelCase					:	Optional[int]       =   num_codevector_groups
           lowerCAmelCase					:	int       =   contrastive_logits_temperature
           lowerCAmelCase					:	Tuple       =   feat_quantizer_dropout
           lowerCAmelCase					:	List[str]       =   num_negatives
           lowerCAmelCase					:	Any       =   codevector_dim
           lowerCAmelCase					:	Dict       =   proj_codevector_dim
           lowerCAmelCase					:	int       =   diversity_loss_weight

           # ctc loss
           lowerCAmelCase					:	Optional[Any]       =   ctc_loss_reduction
           lowerCAmelCase					:	Optional[int]       =   ctc_zero_infinity

           # SequenceClassification-specific parameter. Feel free to ignore for other classes.
           lowerCAmelCase					:	Any       =   classifier_proj_size

           # XVector-specific parameters. Feel free to ignore for other classes.
           lowerCAmelCase					:	Any       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	Union[str, Any]       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	str       =   list(UpperCamelCase_				)
           lowerCAmelCase					:	int       =   xvector_output_dim






     @property
     def      lowerCamelCase__     (	self  :					Union[str, Any]				):
           return functools.reduce(operator.mul					,				self.conv_stride					,				1				)






"""simple docstring"""





from __future__ import annotations

from typing import Any



class 		snake_case_(       a__			):
     pass



class 		snake_case_:






     def __init__(	self  :					Any					,				UpperCamelCase_  :					Any				):
           lowerCAmelCase					:	Any       =   data
           lowerCAmelCase					:	Node | None       =   None






     def __iter__(	self  :					int				):
           lowerCAmelCase					:	Any       =   self
           lowerCAmelCase					:	Union[str, Any]       =   []
           while node:
                 if node in visited:
                       raise ContainsLoopError
                 visited.append(UpperCamelCase_				)
                 yield node.data
                 lowerCAmelCase					:	Optional[int]       =   node.next_node






     @property
     def      lowerCamelCase__     (	self  :					str				):
           try:
                 list(self				)
                 return False
           except ContainsLoopError:
                 return True


if __name__ == "__main__":
 snake_case__		:     Dict    				=				Node(1)
 snake_case__		:     Any    				=				Node(2)
 snake_case__		:     int    				=				Node(3)
 snake_case__		:     Any    				=				Node(4)
 print(root_node.has_loop)  # False
 snake_case__		:     Tuple    				=				root_node.next_node
 print(root_node.has_loop)  # True

 snake_case__		:     List[Any]    				=				Node(5)
 snake_case__		:     int    				=				Node(6)
 snake_case__		:     List[Any]    				=				Node(5)
 snake_case__		:     Dict    				=				Node(6)
 print(root_node.has_loop)  # False

 snake_case__		:     Any    				=				Node(1)
 print(root_node.has_loop)  # False


