






import functools
import operator

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


a_							=    logging.get_logger(__name__)

a_							=    {
    '''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      lowercase__     (			lowercase__	):
	a_         ="""unispeech-sat"""

	def __init__(							self		,    __UpperCAmelCase=32		,    __UpperCAmelCase=768		,    __UpperCAmelCase=12		,    __UpperCAmelCase=12		,    __UpperCAmelCase=3072		,    __UpperCAmelCase="gelu"		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=0.0		,    __UpperCAmelCase=0.0		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=0.02		,    __UpperCAmelCase=1E-5		,    __UpperCAmelCase="group"		,    __UpperCAmelCase="gelu"		,    __UpperCAmelCase=(512, 512, 512, 512, 512, 512, 512)		,    __UpperCAmelCase=(5, 2, 2, 2, 2, 2, 2)		,    __UpperCAmelCase=(10, 3, 3, 3, 3, 2, 2)		,    __UpperCAmelCase=False		,    __UpperCAmelCase=128		,    __UpperCAmelCase=16		,    __UpperCAmelCase=False		,    __UpperCAmelCase=True		,    __UpperCAmelCase=0.05		,    __UpperCAmelCase=10		,    __UpperCAmelCase=2		,    __UpperCAmelCase=0.0		,    __UpperCAmelCase=10		,    __UpperCAmelCase=0		,    __UpperCAmelCase=320		,    __UpperCAmelCase=2		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase=100		,    __UpperCAmelCase=256		,    __UpperCAmelCase=256		,    __UpperCAmelCase=0.1		,    __UpperCAmelCase="mean"		,    __UpperCAmelCase=False		,    __UpperCAmelCase=False		,    __UpperCAmelCase=256		,    __UpperCAmelCase=(512, 512, 512, 512, 1500)		,    __UpperCAmelCase=(5, 3, 3, 1, 1)		,    __UpperCAmelCase=(1, 2, 3, 1, 1)		,    __UpperCAmelCase=512		,    __UpperCAmelCase=0		,    __UpperCAmelCase=1		,    __UpperCAmelCase=2		,    __UpperCAmelCase=504		,    **__UpperCAmelCase		,    )->					Optional[Any]:







							'''simple docstring'''





							super().__init__(**__lowercase		,    pad_token_id=__lowercase		,    bos_token_id=__lowercase		,    eos_token_id=__lowercase       )
							lowerCAmelCase__       =						hidden_size
							lowerCAmelCase__       =						feat_extract_norm
							lowerCAmelCase__       =						feat_extract_activation
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						conv_bias
							lowerCAmelCase__       =						num_conv_pos_embeddings
							lowerCAmelCase__       =						num_conv_pos_embedding_groups
							lowerCAmelCase__       =						len(self.conv_dim       )
							lowerCAmelCase__       =						num_hidden_layers
							lowerCAmelCase__       =						intermediate_size
							lowerCAmelCase__       =						hidden_act
							lowerCAmelCase__       =						num_attention_heads
							lowerCAmelCase__       =						hidden_dropout
							lowerCAmelCase__       =						attention_dropout
							lowerCAmelCase__       =						activation_dropout
							lowerCAmelCase__       =						feat_proj_dropout
							lowerCAmelCase__       =						final_dropout
							lowerCAmelCase__       =						layerdrop
							lowerCAmelCase__       =						layer_norm_eps
							lowerCAmelCase__       =						initializer_range
							lowerCAmelCase__       =						vocab_size
							lowerCAmelCase__       =						num_clusters
							lowerCAmelCase__       =						do_stable_layer_norm
							lowerCAmelCase__       =						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__       =						apply_spec_augment
							lowerCAmelCase__       =						mask_time_prob
							lowerCAmelCase__       =						mask_time_length
							lowerCAmelCase__       =						mask_time_min_masks
							lowerCAmelCase__       =						mask_feature_prob
							lowerCAmelCase__       =						mask_feature_length
							lowerCAmelCase__       =						mask_feature_min_masks

							# parameters for pretraining with codevector quantized representations
							lowerCAmelCase__       =						num_codevectors_per_group
							lowerCAmelCase__       =						num_codevector_groups
							lowerCAmelCase__       =						contrastive_logits_temperature
							lowerCAmelCase__       =						feat_quantizer_dropout
							lowerCAmelCase__       =						num_negatives
							lowerCAmelCase__       =						codevector_dim
							lowerCAmelCase__       =						proj_codevector_dim
							lowerCAmelCase__       =						diversity_loss_weight

							# ctc loss
							lowerCAmelCase__       =						ctc_loss_reduction
							lowerCAmelCase__       =						ctc_zero_infinity

							# SequenceClassification-specific parameter. Feel free to ignore for other classes.
							lowerCAmelCase__       =						classifier_proj_size

							# XVector-specific parameters. Feel free to ignore for other classes.
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						list(__lowercase       )
							lowerCAmelCase__       =						xvector_output_dim


	@property
	def 		UpperCAmelCase  (							self       )->					Optional[int]:







							'''simple docstring'''





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










from collections import defaultdict
from math import ceil, sqrt


def        _a  (     UpperCamelCase_					:				int = 1_000_000    ,   UpperCamelCase_					:				int = 10   ) ->   int:
						"""simple docstring"""







						lowerCAmelCase__       =						defaultdict(UpperCamelCase_   )

						for outer_width in range(3    ,   (t_limit // 4) + 2   ):
												if outer_width * outer_width > t_limit:
																		lowerCAmelCase__       =						max(
																		    ceil(sqrt(outer_width * outer_width - t_limit   )   )    ,   1   )
												else:
																		lowerCAmelCase__       =						1

												hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

												for hole_width in range(UpperCamelCase_    ,   outer_width - 1    ,   2   ):
																		count[outer_width * outer_width - hole_width * hole_width] += 1

						return sum(1 for n in count.values() if 1 <= n <= 10   )


if __name__ == "__main__":
	print(F"{solution() = }")






