


import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import VideoMAEConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
     import torch
     from torch import nn

     from transformers import (
         MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING,
         VideoMAEForPreTraining,
         VideoMAEForVideoClassification,
         VideoMAEModel,
     )
     from transformers.models.videomae.modeling_videomae import VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
     from transformers import VideoMAEImageProcessor







class 						_snake_case    :




 def __init__(						self   ,    _lowerCamelCase   ,    _lowerCamelCase=13   ,    _lowerCamelCase=10   ,    _lowerCamelCase=3   ,    _lowerCamelCase=2   ,    _lowerCamelCase=2   ,    _lowerCamelCase=2   ,    _lowerCamelCase=True   ,    _lowerCamelCase=True   ,    _lowerCamelCase=32   ,    _lowerCamelCase=5   ,    _lowerCamelCase=4   ,    _lowerCamelCase=37   ,    _lowerCamelCase="gelu"   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=10   ,    _lowerCamelCase=0.02   ,    _lowerCamelCase=0.9   ,    _lowerCamelCase=None   ,    ):
       a		:str									=			parent
       a		:str									=			batch_size
       a		:List[str]									=			image_size
       a		:List[str]									=			num_channels
       a		:Any									=			patch_size
       a		:str									=			tubelet_size
       a		:Any									=			num_frames
       a		:int									=			is_training
       a		:List[str]									=			use_labels
       a		:Any									=			hidden_size
       a		:Optional[Any]									=			num_hidden_layers
       a		:List[str]									=			num_attention_heads
       a		:List[str]									=			intermediate_size
       a		:List[str]									=			hidden_act
       a		:Dict									=			hidden_dropout_prob
       a		:Optional[Any]									=			attention_probs_dropout_prob
       a		:Optional[int]									=			type_sequence_label_size
       a		:Any									=			initializer_range
       a		:Union[str, Any]									=			mask_ratio
       a		:Tuple									=			scope

       # in VideoMAE, the number of tokens equals num_frames/tubelet_size * num_patches per frame
       a		:Dict									=			(image_size // patch_size) ** 2
       a		:Optional[int]									=			(num_frames // tubelet_size) * self.num_patches_per_frame

       # use this variable to define bool_masked_pos
       a		:int									=			int(mask_ratio * self.seq_length       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:Optional[int]									=			floats_tensor(
           [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size]       )

       a		:Dict									=			None
       if self.use_labels:
             a		:Dict									=			ids_tensor([self.batch_size]   ,    self.type_sequence_label_size       )

       a		:Union[str, Any]									=			self.get_config()

       return config, pixel_values, labels




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       return VideoMAEConfig(
           image_size=self.image_size   ,    patch_size=self.patch_size   ,    num_channels=self.num_channels   ,    num_frames=self.num_frames   ,    tubelet_size=self.tubelet_size   ,    hidden_size=self.hidden_size   ,    num_hidden_layers=self.num_hidden_layers   ,    num_attention_heads=self.num_attention_heads   ,    intermediate_size=self.intermediate_size   ,    hidden_act=self.hidden_act   ,    hidden_dropout_prob=self.hidden_dropout_prob   ,    attention_probs_dropout_prob=self.attention_probs_dropout_prob   ,    is_decoder=_lowerCamelCase   ,    initializer_range=self.initializer_range   ,    )




 def 			SCREAMING_SNAKE_CASE__							(						self   ,    _lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase       ):
       a		:Tuple									=			VideoMAEModel(config=_lowerCamelCase       )
       model.to(_lowerCamelCase       )
       model.eval()
       a		:int									=			model(_lowerCamelCase       )
       self.parent.assertEqual(result.last_hidden_state.shape   ,    (self.batch_size, self.seq_length, self.hidden_size)       )




 def 			SCREAMING_SNAKE_CASE__							(						self   ,    _lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase       ):
       a		:str									=			VideoMAEForPreTraining(_lowerCamelCase       )
       model.to(_lowerCamelCase       )
       model.eval()
       # important: each video needs to have the same number of masked patches
       # hence we define a single mask, which we then repeat for each example in the batch
       a		:Dict									=			torch.ones((self.num_masks,)       )
       a		:List[str]									=			torch.cat([mask, torch.zeros(self.seq_length - mask.size(0       )       )]       )
       a		:Dict									=			mask.expand(self.batch_size   ,    -1       ).bool()

       a		:Tuple									=			model(_lowerCamelCase   ,    _lowerCamelCase       )
       # model only returns predictions for masked patches
       a		:Optional[Any]									=			mask.sum().item()
       a		:List[str]									=			3 * self.tubelet_size * self.patch_size**2
       self.parent.assertEqual(result.logits.shape   ,    (self.batch_size, num_masked_patches, decoder_num_labels)       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:Optional[int]									=			self.prepare_config_and_inputs()
       a				,							a				,							a		:Tuple									=			config_and_inputs
       a		:Union[str, Any]									=			{'''pixel_values''': pixel_values}
       return config, inputs_dict







@require_torch
class 						_snake_case    ( _snake_case		,       _snake_case		,       unittest.TestCase				):
 SCREAMING_SNAKE_CASE__ =			(
     (VideoMAEModel, VideoMAEForPreTraining, VideoMAEForVideoClassification) if is_torch_available() else ()
 )
 SCREAMING_SNAKE_CASE__ =			(
     {'feature-extraction': VideoMAEModel, 'video-classification': VideoMAEForVideoClassification}
     if is_torch_available()
     else {}
 )

 SCREAMING_SNAKE_CASE__ =			False
 SCREAMING_SNAKE_CASE__ =			False
 SCREAMING_SNAKE_CASE__ =			False
 SCREAMING_SNAKE_CASE__ =			False




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:List[Any]									=			VideoMAEModelTester(self       )
       a		:Dict									=			ConfigTester(self   ,    config_class=_lowerCamelCase   ,    has_text_modality=_lowerCamelCase   ,    hidden_size=37       )




 def 			SCREAMING_SNAKE_CASE__							(						self   ,    _lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase=False       ):
       a		:List[str]									=			copy.deepcopy(_lowerCamelCase       )

       if model_class == VideoMAEForPreTraining:
             # important: each video needs to have the same number of masked patches
             # hence we define a single mask, which we then repeat for each example in the batch
             a		:Optional[Any]									=			torch.ones((self.model_tester.num_masks,)       )
             a		:Any									=			torch.cat([mask, torch.zeros(self.model_tester.seq_length - mask.size(0       )       )]       )
             a		:Any									=			mask.expand(self.model_tester.batch_size   ,    -1       ).bool()
             a		:Tuple									=			bool_masked_pos.to(_lowerCamelCase       )

       if return_labels:
             if model_class in [
                 *get_values(_lowerCamelCase       ),
             ]:
                   a		:List[Any]									=			torch.zeros(
                       self.model_tester.batch_size   ,    dtype=torch.long   ,    device=_lowerCamelCase       )

       return inputs_dict




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       self.config_tester.run_common_tests()




 @unittest.skip(reason='''VideoMAE does not use inputs_embeds'''       )
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       pass




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a				,							a		:Union[str, Any]									=			self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
             a		:Any									=			model_class(_lowerCamelCase       )
             self.assertIsInstance(model.get_input_embeddings()   ,    (nn.Module)       )
             a		:int									=			model.get_output_embeddings()
             self.assertTrue(x is None or isinstance(_lowerCamelCase   ,    nn.Linear       )       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a				,							a		:Optional[int]									=			self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
             a		:Optional[Any]									=			model_class(_lowerCamelCase       )
             a		:int									=			inspect.signature(model.forward       )
             # signature.parameters is an OrderedDict => so arg_names order is deterministic
             a		:List[str]									=			[*signature.parameters.keys()]

             a		:Union[str, Any]									=			['''pixel_values''']
             self.assertListEqual(arg_names[:1]   ,    _lowerCamelCase       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:List[Any]									=			self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_model(*_lowerCamelCase       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:List[str]									=			self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_for_pretraining(*_lowerCamelCase       )




 @slow
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       for model_name in VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
             a		:Optional[int]									=			VideoMAEModel.from_pretrained(_lowerCamelCase       )
             self.assertIsNotNone(_lowerCamelCase       )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       if not self.has_attentions:
             pass

       else:
             a				,							a		:Any									=			self.model_tester.prepare_config_and_inputs_for_common()
             a		:List[str]									=			True

             for model_class in self.all_model_classes:
                   a		:Union[str, Any]									=			self.model_tester.seq_length - self.model_tester.num_masks
                   a		:Dict									=			(
                       num_visible_patches if model_class == VideoMAEForPreTraining else self.model_tester.seq_length
                   )

                   a		:Union[str, Any]									=			True
                   a		:int									=			False
                   a		:Tuple									=			True
                   a		:str									=			model_class(_lowerCamelCase       )
                   model.to(_lowerCamelCase       )
                   model.eval()
                   with torch.no_grad():
                         a		:Dict									=			model(**self._prepare_for_class(_lowerCamelCase   ,    _lowerCamelCase       )       )
                   a		:Optional[int]									=			outputs.attentions
                   self.assertEqual(len(_lowerCamelCase       )   ,    self.model_tester.num_hidden_layers       )

                   # check that output_attentions also work using config
                   del inputs_dict["output_attentions"]
                   a		:List[str]									=			True
                   a		:List[str]									=			model_class(_lowerCamelCase       )
                   model.to(_lowerCamelCase       )
                   model.eval()
                   with torch.no_grad():
                         a		:Union[str, Any]									=			model(**self._prepare_for_class(_lowerCamelCase   ,    _lowerCamelCase       )       )
                   a		:Any									=			outputs.attentions
                   self.assertEqual(len(_lowerCamelCase       )   ,    self.model_tester.num_hidden_layers       )

                   self.assertListEqual(
                       list(attentions[0].shape[-3:]       )   ,    [self.model_tester.num_attention_heads, seq_len, seq_len]   ,    )
                   a		:List[Any]									=			len(_lowerCamelCase       )

                   # Check attention is always last and order is fine
                   a		:Tuple									=			True
                   a		:Dict									=			True
                   a		:int									=			model_class(_lowerCamelCase       )
                   model.to(_lowerCamelCase       )
                   model.eval()
                   with torch.no_grad():
                         a		:Any									=			model(**self._prepare_for_class(_lowerCamelCase   ,    _lowerCamelCase       )       )

                   self.assertEqual(out_len + 1   ,    len(_lowerCamelCase       )       )

                   a		:List[Any]									=			outputs.attentions

                   self.assertEqual(len(_lowerCamelCase       )   ,    self.model_tester.num_hidden_layers       )
                   self.assertListEqual(
                       list(self_attentions[0].shape[-3:]       )   ,    [self.model_tester.num_attention_heads, seq_len, seq_len]   ,    )




 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       def check_hidden_states_output(_lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase       ):
             a		:Optional[Any]									=			model_class(_lowerCamelCase       )
             model.to(_lowerCamelCase       )
             model.eval()

             with torch.no_grad():
                   a		:List[str]									=			model(**self._prepare_for_class(_lowerCamelCase   ,    _lowerCamelCase       )       )

             a		:Union[str, Any]									=			outputs.hidden_states
             a		:List[Any]									=			self.model_tester.num_hidden_layers + 1
             self.assertEqual(len(_lowerCamelCase       )   ,    _lowerCamelCase       )

             a		:Any									=			self.model_tester.seq_length - self.model_tester.num_masks
             a		:Any									=			num_visible_patches if model_class == VideoMAEForPreTraining else self.model_tester.seq_length

             self.assertListEqual(
                 list(hidden_states[0].shape[-2:]       )   ,    [seq_length, self.model_tester.hidden_size]   ,    )

       a				,							a		:Union[str, Any]									=			self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
             a		:int									=			True
             check_hidden_states_output(_lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase       )

             # check that output_hidden_states also work using config
             del inputs_dict["output_hidden_states"]
             a		:int									=			True

             check_hidden_states_output(_lowerCamelCase   ,    _lowerCamelCase   ,    _lowerCamelCase       )




 @unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.'''       )
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       pass







def 							__lowerCamelCase		(					):




      """simple docstring"""





      a		:Union[str, Any]									=			hf_hub_download(
          repo_id='''hf-internal-testing/spaghetti-video'''					,    filename='''eating_spaghetti.npy'''					,    repo_type='''dataset'''		)
      a		:Union[str, Any]									=			np.load(UpperCAmelCase_		)
      return list(UpperCAmelCase_		)







@require_torch
@require_vision
class 						_snake_case    ( unittest.TestCase				):




 @cached_property
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       # logits were tested with a different mean and std, so we use the same here
       return (
           VideoMAEImageProcessor(image_mean=[0.5, 0.5, 0.5]   ,    image_std=[0.5, 0.5, 0.5]       )
           if is_vision_available()
           else None
       )




 @slow
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:List[str]									=			VideoMAEForVideoClassification.from_pretrained('''MCG-NJU/videomae-base-finetuned-kinetics'''       ).to(
           _lowerCamelCase       )

       a		:List[Any]									=			self.default_image_processor
       a		:Optional[int]									=			prepare_video()
       a		:List[str]									=			image_processor(_lowerCamelCase   ,    return_tensors='''pt'''       ).to(_lowerCamelCase       )

       # forward pass
       with torch.no_grad():
             a		:Union[str, Any]									=			model(**_lowerCamelCase       )

       # verify the logits
       a		:int									=			torch.Size((1, 400)       )
       self.assertEqual(outputs.logits.shape   ,    _lowerCamelCase       )

       a		:Tuple									=			torch.tensor([0.3669, -0.0688, -0.2421]       ).to(_lowerCamelCase       )

       self.assertTrue(torch.allclose(outputs.logits[0, :3]   ,    _lowerCamelCase   ,    atol=1e-4       )       )




 @slow
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       a		:str									=			VideoMAEForPreTraining.from_pretrained('''MCG-NJU/videomae-base-short'''       ).to(_lowerCamelCase       )

       a		:str									=			self.default_image_processor
       a		:str									=			prepare_video()
       a		:int									=			image_processor(_lowerCamelCase   ,    return_tensors='''pt'''       ).to(_lowerCamelCase       )

       # add boolean mask, indicating which patches to mask
       a		:Any									=			hf_hub_download(repo_id='''hf-internal-testing/bool-masked-pos'''   ,    filename='''bool_masked_pos.pt'''       )
       a		:Union[str, Any]									=			torch.load(_lowerCamelCase       )

       # forward pass
       with torch.no_grad():
             a		:Optional[Any]									=			model(**_lowerCamelCase       )

       # verify the logits
       a		:List[Any]									=			torch.Size([1, 1408, 1536]       )
       a		:Union[str, Any]									=			torch.tensor(
           [[0.7994, 0.9612, 0.8508], [0.7401, 0.8958, 0.8302], [0.5862, 0.7468, 0.7325]]   ,    device=_lowerCamelCase       )
       self.assertEqual(outputs.logits.shape   ,    _lowerCamelCase       )
       self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]   ,    _lowerCamelCase   ,    atol=1e-4       )       )

       # verify the loss (`config.norm_pix_loss` = `True`)
       a		:List[Any]									=			torch.tensor([0.5142]   ,    device=_lowerCamelCase       )
       self.assertTrue(torch.allclose(outputs.loss   ,    _lowerCamelCase   ,    atol=1e-4       )       )

       # verify the loss (`config.norm_pix_loss` = `False`)
       a		:Any									=			VideoMAEForPreTraining.from_pretrained('''MCG-NJU/videomae-base-short'''   ,    norm_pix_loss=_lowerCamelCase       ).to(
           _lowerCamelCase       )

       with torch.no_grad():
             a		:Tuple									=			model(**_lowerCamelCase       )

       a		:List[Any]									=			torch.tensor(torch.tensor([0.6469]       )   ,    device=_lowerCamelCase       )
       self.assertTrue(torch.allclose(outputs.loss   ,    _lowerCamelCase   ,    atol=1e-4       )       )









import functools
import operator

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


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

snake_case							:       Optional[Any]										=	{
    '''microsoft/wavlm-base''': '''https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json''',
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}







class 						_snake_case    ( _snake_case				):
 SCREAMING_SNAKE_CASE__ =			'wavlm'




 def __init__(						self   ,    _lowerCamelCase=32   ,    _lowerCamelCase=768   ,    _lowerCamelCase=12   ,    _lowerCamelCase=12   ,    _lowerCamelCase=3072   ,    _lowerCamelCase="gelu"   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.0   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.02   ,    _lowerCamelCase=1e-5   ,    _lowerCamelCase="group"   ,    _lowerCamelCase="gelu"   ,    _lowerCamelCase=(512, 512, 512, 512, 512, 512, 512)   ,    _lowerCamelCase=(5, 2, 2, 2, 2, 2, 2)   ,    _lowerCamelCase=(10, 3, 3, 3, 3, 2, 2)   ,    _lowerCamelCase=False   ,    _lowerCamelCase=128   ,    _lowerCamelCase=16   ,    _lowerCamelCase=320   ,    _lowerCamelCase=800   ,    _lowerCamelCase=False   ,    _lowerCamelCase=True   ,    _lowerCamelCase=0.05   ,    _lowerCamelCase=10   ,    _lowerCamelCase=2   ,    _lowerCamelCase=0.0   ,    _lowerCamelCase=10   ,    _lowerCamelCase=320   ,    _lowerCamelCase=2   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=100   ,    _lowerCamelCase=256   ,    _lowerCamelCase=256   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase="mean"   ,    _lowerCamelCase=False   ,    _lowerCamelCase=False   ,    _lowerCamelCase=256   ,    _lowerCamelCase=(512, 512, 512, 512, 1500)   ,    _lowerCamelCase=(5, 3, 3, 1, 1)   ,    _lowerCamelCase=(1, 2, 3, 1, 1)   ,    _lowerCamelCase=512   ,    _lowerCamelCase=80   ,    _lowerCamelCase=0   ,    _lowerCamelCase=1   ,    _lowerCamelCase=2   ,    _lowerCamelCase=False   ,    _lowerCamelCase=3   ,    _lowerCamelCase=2   ,    _lowerCamelCase=3   ,    _lowerCamelCase=None   ,    **_lowerCamelCase   ,    ):
       super().__init__(**_lowerCamelCase   ,    pad_token_id=_lowerCamelCase   ,    bos_token_id=_lowerCamelCase   ,    eos_token_id=_lowerCamelCase       )
       a		:Union[str, Any]									=			hidden_size
       a		:List[Any]									=			feat_extract_norm
       a		:Tuple									=			feat_extract_activation
       a		:Tuple									=			list(_lowerCamelCase       )
       a		:Optional[Any]									=			list(_lowerCamelCase       )
       a		:Optional[Any]									=			list(_lowerCamelCase       )
       a		:int									=			conv_bias
       a		:Tuple									=			num_buckets
       a		:Tuple									=			max_bucket_distance
       a		:int									=			num_conv_pos_embeddings
       a		:List[str]									=			num_conv_pos_embedding_groups
       a		:Tuple									=			len(self.conv_dim       )
       a		:Any									=			num_hidden_layers
       a		:Tuple									=			intermediate_size
       a		:Any									=			hidden_act
       a		:List[str]									=			num_attention_heads
       a		:int									=			hidden_dropout
       a		:Optional[Any]									=			attention_dropout
       a		:Dict									=			activation_dropout
       a		:Any									=			feat_proj_dropout
       a		:Dict									=			final_dropout
       a		:int									=			layerdrop
       a		:Tuple									=			layer_norm_eps
       a		:Union[str, Any]									=			initializer_range
       a		:Union[str, Any]									=			num_ctc_classes
       a		:Optional[Any]									=			vocab_size
       a		:str									=			do_stable_layer_norm
       a		:Dict									=			use_weighted_layer_sum
       a		:Any									=			classifier_proj_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)`, 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
       a		:List[Any]									=			apply_spec_augment
       a		:Optional[int]									=			mask_time_prob
       a		:Optional[Any]									=			mask_time_length
       a		:Tuple									=			mask_time_min_masks
       a		:Dict									=			mask_feature_prob
       a		:List[Any]									=			mask_feature_length

       # parameters for pretraining with codevector quantized representations
       a		:Tuple									=			num_codevectors_per_group
       a		:List[str]									=			num_codevector_groups
       a		:List[Any]									=			contrastive_logits_temperature
       a		:Union[str, Any]									=			num_negatives
       a		:Union[str, Any]									=			codevector_dim
       a		:Dict									=			proj_codevector_dim
       a		:Union[str, Any]									=			diversity_loss_weight

       # ctc loss
       a		:Dict									=			ctc_loss_reduction
       a		:Optional[int]									=			ctc_zero_infinity

       # adapter
       a		:Any									=			add_adapter
       a		:str									=			adapter_kernel_size
       a		:Tuple									=			adapter_stride
       a		:Dict									=			num_adapter_layers
       a		:Any									=			output_hidden_size or hidden_size

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

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




 @property
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       return functools.reduce(operator.mul   ,    self.conv_stride   ,    1       )





