
import gc
import unittest

import numpy as np
import torch
from torch.backends.cuda import sdp_kernel

from diffusers import (
    CMStochasticIterativeScheduler,
    ConsistencyModelPipeline,
    UNetaDModel,
)
from diffusers.utils import randn_tensor, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_a, require_torch_gpu

from ..pipeline_params import UNCONDITIONAL_IMAGE_GENERATION_BATCH_PARAMS, UNCONDITIONAL_IMAGE_GENERATION_PARAMS
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()




class 					_lowerCamelCase			(   UpperCamelCase_						,				unittest.TestCase			):





     """simple docstring"""







     SCREAMING_SNAKE_CASE_		 =	ConsistencyModelPipeline
     SCREAMING_SNAKE_CASE_		 =	UNCONDITIONAL_IMAGE_GENERATION_PARAMS
     SCREAMING_SNAKE_CASE_		 =	UNCONDITIONAL_IMAGE_GENERATION_BATCH_PARAMS

     # Override required_optional_params to remove num_images_per_prompt
     SCREAMING_SNAKE_CASE_		 =	frozenset(
         [
             '''num_inference_steps''',
             '''generator''',
             '''latents''',
             '''output_type''',
             '''return_dict''',
             '''callback''',
             '''callback_steps''',
         ]			)






     @property
     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Union[str, Any]:




           """simple docstring"""







           UpperCamelCase__     : int											=					UNetaDModel.from_pretrained(
               '''diffusers/consistency-models-test'''    ,    subfolder='''test_unet'''    ,    )
           return unet






     @property
     def  __SCREAMING_SNAKE_CASE      (				self	)	-> str:




           """simple docstring"""







           UpperCamelCase__     : List[str]											=					UNetaDModel.from_pretrained(
               '''diffusers/consistency-models-test'''    ,    subfolder='''test_unet_class_cond'''    ,    )
           return unet






     def  __SCREAMING_SNAKE_CASE      (				self    ,    __SCREAMING_SNAKE_CASE=False	)	-> Optional[int]:




           """simple docstring"""







           if class_cond:
                 UpperCamelCase__     : Optional[Any]											=					self.dummy_cond_unet
           else:
                 UpperCamelCase__     : Dict											=					self.dummy_uncond_unet

           # Default to CM multistep sampler
           UpperCamelCase__     : Optional[Any]											=					CMStochasticIterativeScheduler(
               num_train_timesteps=4_0    ,    sigma_min=0.002    ,    sigma_max=80.0    ,    )

           UpperCamelCase__     : Optional[Any]											=					{
               '''unet''': unet,
               '''scheduler''': scheduler,
           }

           return components






     def  __SCREAMING_SNAKE_CASE      (				self    ,    __SCREAMING_SNAKE_CASE    ,    __SCREAMING_SNAKE_CASE=0	)	-> List[str]:




           """simple docstring"""







           if str(__SCREAMING_SNAKE_CASE	).startswith('''mps'''	):
                 UpperCamelCase__     : Dict											=					torch.manual_seed(__SCREAMING_SNAKE_CASE	)
           else:
                 UpperCamelCase__     : Union[str, Any]											=					torch.Generator(device=__SCREAMING_SNAKE_CASE	).manual_seed(__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : str											=					{
               '''batch_size''': 1,
               '''num_inference_steps''': None,
               '''timesteps''': [2_2, 0],
               '''generator''': generator,
               '''output_type''': '''np''',
           }

           return inputs






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Union[str, Any]:




           """simple docstring"""







           UpperCamelCase__     : str											=					'''cpu'''  # ensure determinism for the device-dependent torch.Generator
           UpperCamelCase__     : List[str]											=					self.get_dummy_components()
           UpperCamelCase__     : Optional[Any]											=					ConsistencyModelPipeline(**__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Any											=					pipe.to(__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : List[str]											=					self.get_dummy_inputs(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : List[str]											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 3_2, 3_2, 3)

           UpperCamelCase__     : Dict											=					image[0, -3:, -3:, -1]
           UpperCamelCase__     : Any											=					np.array([0.3572, 0.6273, 0.4031, 0.3961, 0.4321, 0.5730, 0.5266, 0.4780, 0.5004]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Union[str, Any]:




           """simple docstring"""







           UpperCamelCase__     : List[Any]											=					'''cpu'''  # ensure determinism for the device-dependent torch.Generator
           UpperCamelCase__     : int											=					self.get_dummy_components(class_cond=__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : str											=					ConsistencyModelPipeline(**__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Optional[int]											=					pipe.to(__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : str											=					self.get_dummy_inputs(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Optional[int]											=					0
           UpperCamelCase__     : List[Any]											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 3_2, 3_2, 3)

           UpperCamelCase__     : int											=					image[0, -3:, -3:, -1]
           UpperCamelCase__     : Any											=					np.array([0.3572, 0.6273, 0.4031, 0.3961, 0.4321, 0.5730, 0.5266, 0.4780, 0.5004]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Optional[int]:




           """simple docstring"""







           UpperCamelCase__     : List[Any]											=					'''cpu'''  # ensure determinism for the device-dependent torch.Generator
           UpperCamelCase__     : List[str]											=					self.get_dummy_components()
           UpperCamelCase__     : Any											=					ConsistencyModelPipeline(**__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : str											=					pipe.to(__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : Any											=					self.get_dummy_inputs(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : str											=					1
           UpperCamelCase__     : Optional[Any]											=					None
           UpperCamelCase__     : List[str]											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 3_2, 3_2, 3)

           UpperCamelCase__     : str											=					image[0, -3:, -3:, -1]
           UpperCamelCase__     : List[Any]											=					np.array([0.5004, 0.5004, 0.4994, 0.5008, 0.4976, 0.5018, 0.4990, 0.4982, 0.4987]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Any:




           """simple docstring"""







           UpperCamelCase__     : List[str]											=					'''cpu'''  # ensure determinism for the device-dependent torch.Generator
           UpperCamelCase__     : str											=					self.get_dummy_components(class_cond=__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Optional[int]											=					ConsistencyModelPipeline(**__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : List[str]											=					pipe.to(__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : int											=					self.get_dummy_inputs(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : str											=					1
           UpperCamelCase__     : Union[str, Any]											=					None
           UpperCamelCase__     : Any											=					0
           UpperCamelCase__     : str											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 3_2, 3_2, 3)

           UpperCamelCase__     : Optional[int]											=					image[0, -3:, -3:, -1]
           UpperCamelCase__     : int											=					np.array([0.5004, 0.5004, 0.4994, 0.5008, 0.4976, 0.5018, 0.4990, 0.4982, 0.4987]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3




@slow
@require_torch_gpu
class 					_lowerCamelCase			(   unittest.TestCase			):





     """simple docstring"""







     def  __SCREAMING_SNAKE_CASE      (				self	)	-> List[str]:




           """simple docstring"""







           super().tearDown()
           gc.collect()
           torch.cuda.empty_cache()






     def  __SCREAMING_SNAKE_CASE      (				self    ,    __SCREAMING_SNAKE_CASE=0    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE="cpu"    ,    __SCREAMING_SNAKE_CASE=torch.floataa    ,    __SCREAMING_SNAKE_CASE=(1, 3, 6_4, 6_4)	)	-> List[Any]:




           """simple docstring"""







           UpperCamelCase__     : Tuple											=					torch.manual_seed(__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : Union[str, Any]											=					{
               '''num_inference_steps''': None,
               '''timesteps''': [2_2, 0],
               '''class_labels''': 0,
               '''generator''': generator,
               '''output_type''': '''np''',
           }

           if get_fixed_latents:
                 UpperCamelCase__     : List[str]											=					self.get_fixed_latents(seed=__SCREAMING_SNAKE_CASE    ,    device=__SCREAMING_SNAKE_CASE    ,    dtype=__SCREAMING_SNAKE_CASE    ,    shape=__SCREAMING_SNAKE_CASE	)
                 UpperCamelCase__     : Tuple											=					latents

           return inputs






     def  __SCREAMING_SNAKE_CASE      (				self    ,    __SCREAMING_SNAKE_CASE=0    ,    __SCREAMING_SNAKE_CASE="cpu"    ,    __SCREAMING_SNAKE_CASE=torch.floataa    ,    __SCREAMING_SNAKE_CASE=(1, 3, 6_4, 6_4)	)	-> Union[str, Any]:




           """simple docstring"""







           if type(__SCREAMING_SNAKE_CASE	) == str:
                 UpperCamelCase__     : List[str]											=					torch.device(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : List[Any]											=					torch.Generator(device=__SCREAMING_SNAKE_CASE	).manual_seed(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Union[str, Any]											=					randn_tensor(__SCREAMING_SNAKE_CASE    ,    generator=__SCREAMING_SNAKE_CASE    ,    device=__SCREAMING_SNAKE_CASE    ,    dtype=__SCREAMING_SNAKE_CASE	)
           return latents






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> List[Any]:




           """simple docstring"""







           UpperCamelCase__     : List[str]											=					UNetaDModel.from_pretrained('''diffusers/consistency_models'''    ,    subfolder='''diffusers_cd_imagenet64_l2'''	)
           UpperCamelCase__     : int											=					CMStochasticIterativeScheduler(
               num_train_timesteps=4_0    ,    sigma_min=0.002    ,    sigma_max=80.0    ,    )
           UpperCamelCase__     : Union[str, Any]											=					ConsistencyModelPipeline(unet=__SCREAMING_SNAKE_CASE    ,    scheduler=__SCREAMING_SNAKE_CASE	)
           pipe.to(torch_device=__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : Dict											=					self.get_inputs()
           UpperCamelCase__     : Dict											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 6_4, 6_4, 3)

           UpperCamelCase__     : Optional[Any]											=					image[0, -3:, -3:, -1]

           UpperCamelCase__     : str											=					np.array([0.0888, 0.0881, 0.0666, 0.0479, 0.0292, 0.0195, 0.0201, 0.0163, 0.0254]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 2e-2






     def  __SCREAMING_SNAKE_CASE      (				self	)	-> List[str]:




           """simple docstring"""







           UpperCamelCase__     : Optional[int]											=					UNetaDModel.from_pretrained('''diffusers/consistency_models'''    ,    subfolder='''diffusers_cd_imagenet64_l2'''	)
           UpperCamelCase__     : List[str]											=					CMStochasticIterativeScheduler(
               num_train_timesteps=4_0    ,    sigma_min=0.002    ,    sigma_max=80.0    ,    )
           UpperCamelCase__     : Dict											=					ConsistencyModelPipeline(unet=__SCREAMING_SNAKE_CASE    ,    scheduler=__SCREAMING_SNAKE_CASE	)
           pipe.to(torch_device=__SCREAMING_SNAKE_CASE	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : Dict											=					self.get_inputs()
           UpperCamelCase__     : Optional[int]											=					1
           UpperCamelCase__     : Tuple											=					None
           UpperCamelCase__     : Tuple											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 6_4, 6_4, 3)

           UpperCamelCase__     : Dict											=					image[0, -3:, -3:, -1]

           UpperCamelCase__     : Union[str, Any]											=					np.array([0.0340, 0.0152, 0.0063, 0.0267, 0.0221, 0.0107, 0.0416, 0.0186, 0.0217]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 2e-2






     @require_torch_a
     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Optional[int]:




           """simple docstring"""







           UpperCamelCase__     : List[Any]											=					UNetaDModel.from_pretrained('''diffusers/consistency_models'''    ,    subfolder='''diffusers_cd_imagenet64_l2'''	)
           UpperCamelCase__     : List[Any]											=					CMStochasticIterativeScheduler(
               num_train_timesteps=4_0    ,    sigma_min=0.002    ,    sigma_max=80.0    ,    )
           UpperCamelCase__     : Tuple											=					ConsistencyModelPipeline(unet=__SCREAMING_SNAKE_CASE    ,    scheduler=__SCREAMING_SNAKE_CASE	)
           pipe.to(torch_device=__SCREAMING_SNAKE_CASE    ,    torch_dtype=torch.floataa	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : int											=					self.get_inputs(get_fixed_latents=__SCREAMING_SNAKE_CASE    ,    device=__SCREAMING_SNAKE_CASE	)
           # Ensure usage of flash attention in torch 2.0
           with sdp_kernel(enable_flash=__SCREAMING_SNAKE_CASE    ,    enable_math=__SCREAMING_SNAKE_CASE    ,    enable_mem_efficient=__SCREAMING_SNAKE_CASE	):
                 UpperCamelCase__     : Optional[Any]											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 6_4, 6_4, 3)

           UpperCamelCase__     : List[Any]											=					image[0, -3:, -3:, -1]

           UpperCamelCase__     : Union[str, Any]											=					np.array([0.1875, 0.1428, 0.1289, 0.2151, 0.2092, 0.1477, 0.1877, 0.1641, 0.1353]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3






     @require_torch_a
     def  __SCREAMING_SNAKE_CASE      (				self	)	-> str:




           """simple docstring"""







           UpperCamelCase__     : Any											=					UNetaDModel.from_pretrained('''diffusers/consistency_models'''    ,    subfolder='''diffusers_cd_imagenet64_l2'''	)
           UpperCamelCase__     : Tuple											=					CMStochasticIterativeScheduler(
               num_train_timesteps=4_0    ,    sigma_min=0.002    ,    sigma_max=80.0    ,    )
           UpperCamelCase__     : Union[str, Any]											=					ConsistencyModelPipeline(unet=__SCREAMING_SNAKE_CASE    ,    scheduler=__SCREAMING_SNAKE_CASE	)
           pipe.to(torch_device=__SCREAMING_SNAKE_CASE    ,    torch_dtype=torch.floataa	)
           pipe.set_progress_bar_config(disable=__SCREAMING_SNAKE_CASE	)

           UpperCamelCase__     : List[Any]											=					self.get_inputs(get_fixed_latents=__SCREAMING_SNAKE_CASE    ,    device=__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Tuple											=					1
           UpperCamelCase__     : Union[str, Any]											=					None
           # Ensure usage of flash attention in torch 2.0
           with sdp_kernel(enable_flash=__SCREAMING_SNAKE_CASE    ,    enable_math=__SCREAMING_SNAKE_CASE    ,    enable_mem_efficient=__SCREAMING_SNAKE_CASE	):
                 UpperCamelCase__     : Any											=					pipe(**__SCREAMING_SNAKE_CASE	).images
           assert image.shape == (1, 6_4, 6_4, 3)

           UpperCamelCase__     : List[Any]											=					image[0, -3:, -3:, -1]

           UpperCamelCase__     : Optional[int]											=					np.array([0.1663, 0.1948, 0.2275, 0.1680, 0.1204, 0.1245, 0.1858, 0.1338, 0.2095]	)

           assert np.abs(image_slice.flatten() - expected_slice	).max() < 1e-3




import functools
import operator

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


lowerCamelCase  =logging.get_logger(__name__)

lowerCamelCase  ={
    "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json",
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}




class 					_lowerCamelCase			(   UpperCamelCase_			):





     """simple docstring"""







     SCREAMING_SNAKE_CASE_		 =	'''wav2vec2'''






     def __init__(				self    ,    __SCREAMING_SNAKE_CASE=3_2    ,    __SCREAMING_SNAKE_CASE=7_6_8    ,    __SCREAMING_SNAKE_CASE=1_2    ,    __SCREAMING_SNAKE_CASE=1_2    ,    __SCREAMING_SNAKE_CASE=3_0_7_2    ,    __SCREAMING_SNAKE_CASE="gelu"    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=0.0    ,    __SCREAMING_SNAKE_CASE=0.0    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=0.02    ,    __SCREAMING_SNAKE_CASE=1e-5    ,    __SCREAMING_SNAKE_CASE="group"    ,    __SCREAMING_SNAKE_CASE="gelu"    ,    __SCREAMING_SNAKE_CASE=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)    ,    __SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)    ,    __SCREAMING_SNAKE_CASE=(1_0, 3, 3, 3, 3, 2, 2)    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE=1_2_8    ,    __SCREAMING_SNAKE_CASE=1_6    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE=True    ,    __SCREAMING_SNAKE_CASE=0.05    ,    __SCREAMING_SNAKE_CASE=1_0    ,    __SCREAMING_SNAKE_CASE=2    ,    __SCREAMING_SNAKE_CASE=0.0    ,    __SCREAMING_SNAKE_CASE=1_0    ,    __SCREAMING_SNAKE_CASE=0    ,    __SCREAMING_SNAKE_CASE=3_2_0    ,    __SCREAMING_SNAKE_CASE=2    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE=1_0_0    ,    __SCREAMING_SNAKE_CASE=2_5_6    ,    __SCREAMING_SNAKE_CASE=2_5_6    ,    __SCREAMING_SNAKE_CASE=0.1    ,    __SCREAMING_SNAKE_CASE="sum"    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE=2_5_6    ,    __SCREAMING_SNAKE_CASE=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)    ,    __SCREAMING_SNAKE_CASE=(5, 3, 3, 1, 1)    ,    __SCREAMING_SNAKE_CASE=(1, 2, 3, 1, 1)    ,    __SCREAMING_SNAKE_CASE=5_1_2    ,    __SCREAMING_SNAKE_CASE=0    ,    __SCREAMING_SNAKE_CASE=1    ,    __SCREAMING_SNAKE_CASE=2    ,    __SCREAMING_SNAKE_CASE=False    ,    __SCREAMING_SNAKE_CASE=3    ,    __SCREAMING_SNAKE_CASE=2    ,    __SCREAMING_SNAKE_CASE=3    ,    __SCREAMING_SNAKE_CASE=None    ,    __SCREAMING_SNAKE_CASE=None    ,    **__SCREAMING_SNAKE_CASE    ,    )	-> str:




           """simple docstring"""







           super().__init__(**__SCREAMING_SNAKE_CASE    ,    pad_token_id=__SCREAMING_SNAKE_CASE    ,    bos_token_id=__SCREAMING_SNAKE_CASE    ,    eos_token_id=__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : str											=					hidden_size
           UpperCamelCase__     : List[Any]											=					feat_extract_norm
           UpperCamelCase__     : Union[str, Any]											=					feat_extract_activation
           UpperCamelCase__     : Union[str, Any]											=					list(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Dict											=					list(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Dict											=					list(__SCREAMING_SNAKE_CASE	)
           UpperCamelCase__     : Tuple											=					conv_bias
           UpperCamelCase__     : Optional[Any]											=					num_conv_pos_embeddings
           UpperCamelCase__     : Tuple											=					num_conv_pos_embedding_groups
           UpperCamelCase__     : Tuple											=					len(self.conv_dim	)
           UpperCamelCase__     : Optional[Any]											=					num_hidden_layers
           UpperCamelCase__     : Union[str, Any]											=					intermediate_size
           UpperCamelCase__     : Union[str, Any]											=					hidden_act
           UpperCamelCase__     : List[Any]											=					num_attention_heads
           UpperCamelCase__     : Optional[int]											=					hidden_dropout
           UpperCamelCase__     : Tuple											=					attention_dropout
           UpperCamelCase__     : List[Any]											=					activation_dropout
           UpperCamelCase__     : Optional[int]											=					feat_proj_dropout
           UpperCamelCase__     : int											=					final_dropout
           UpperCamelCase__     : str											=					layerdrop
           UpperCamelCase__     : Dict											=					layer_norm_eps
           UpperCamelCase__     : str											=					initializer_range
           UpperCamelCase__     : List[Any]											=					vocab_size
           UpperCamelCase__     : Dict											=					do_stable_layer_norm
           UpperCamelCase__     : Dict											=					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
           UpperCamelCase__     : Tuple											=					apply_spec_augment
           UpperCamelCase__     : str											=					mask_time_prob
           UpperCamelCase__     : Tuple											=					mask_time_length
           UpperCamelCase__     : Optional[Any]											=					mask_time_min_masks
           UpperCamelCase__     : str											=					mask_feature_prob
           UpperCamelCase__     : List[str]											=					mask_feature_length
           UpperCamelCase__     : Optional[Any]											=					mask_feature_min_masks

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

           # ctc loss
           UpperCamelCase__     : List[str]											=					ctc_loss_reduction
           UpperCamelCase__     : Optional[Any]											=					ctc_zero_infinity

           # adapter
           UpperCamelCase__     : List[Any]											=					add_adapter
           UpperCamelCase__     : Any											=					adapter_kernel_size
           UpperCamelCase__     : Tuple											=					adapter_stride
           UpperCamelCase__     : Tuple											=					num_adapter_layers
           UpperCamelCase__     : Optional[Any]											=					output_hidden_size or hidden_size
           UpperCamelCase__     : Union[str, Any]											=					adapter_attn_dim

           # SequenceClassification-specific parameter. Feel free to ignore for other classes.
           UpperCamelCase__     : List[str]											=					classifier_proj_size

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






     @property
     def  __SCREAMING_SNAKE_CASE      (				self	)	-> Optional[Any]:




           """simple docstring"""







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


