

'''simple docstring'''




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


_a				: Any 							=						logging.get_logger(__name__)

_a				: Dict 							=						{
    'ZinengTang/tvlt-base': 'https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json',
}



class        lowercase_	(		a ):

  '''simple docstring'''





  __lowerCAmelCase					: Union[str, Any]      =   "tvlt"
  def __init__(     self   , a_=2_2_4   , a_=2_0_4_8   , a_=1_2_8   , a_=[1_6, 1_6]   , a_=[1_6, 1_6]   , a_=3   , a_=1   , a_=8   , a_=7_6_8   , a_=1_2   , a_=1_2   , a_=3_0_7_2   , a_="gelu"   , a_=0.0   , a_=0.0   , a_=0.02   , a_=1E-6   , a_=True   , a_=False   , a_=1_6   , a_=5_1_2   , a_=8   , a_=2_0_4_8   , a_=0.75   , a_=0.15   , a_="frame-level"   , a_=True   , a_=True   , a_="classification"   , **a_   , )							->				int:


    """simple docstring"""
    super().__init__(**a_     )

    if audio_mask_type not in ("frame-level", "patch_level"):
      raise ValueError(
          'audio_mask_type must be one of two acceptable strategies - {\'frame_level\', \'patch-level\') '
          F'''got {audio_mask_type}'''     )

    UpperCAmelCase													=	image_size
    UpperCAmelCase													=	spectrogram_length
    UpperCAmelCase													=	frequency_length
    UpperCAmelCase													=	image_patch_size
    UpperCAmelCase													=	audio_patch_size
    UpperCAmelCase													=	num_image_channels
    UpperCAmelCase													=	num_audio_channels
    UpperCAmelCase													=	num_frames

    UpperCAmelCase													=	hidden_size
    UpperCAmelCase													=	num_hidden_layers
    UpperCAmelCase													=	num_attention_heads
    UpperCAmelCase													=	intermediate_size
    UpperCAmelCase													=	hidden_act
    UpperCAmelCase													=	hidden_dropout_prob
    UpperCAmelCase													=	attention_probs_dropout_prob
    UpperCAmelCase													=	initializer_range
    UpperCAmelCase													=	layer_norm_eps
    UpperCAmelCase													=	qkv_bias
    UpperCAmelCase													=	use_mean_pooling

    UpperCAmelCase													=	decoder_num_attention_heads
    UpperCAmelCase													=	decoder_hidden_size
    UpperCAmelCase													=	decoder_num_hidden_layers
    UpperCAmelCase													=	decoder_intermediate_size
    UpperCAmelCase													=	pixel_mask_ratio
    UpperCAmelCase													=	audio_mask_ratio
    UpperCAmelCase													=	audio_mask_type

    UpperCAmelCase													=	task_matching
    UpperCAmelCase													=	task_mae
    UpperCAmelCase													=	loss_type





'''simple docstring'''




from collections import OrderedDict
from dataclasses import fields
from typing import Any, Tuple

import numpy as np

from .import_utils import is_torch_available


def       lowerCamelCase__		(						SCREAMING_SNAKE_CASE      :   Optional[Any]						):
  if is_torch_available():
    import torch

    if isinstance(SCREAMING_SNAKE_CASE       ,   torch.Tensor						):
      return True

  return isinstance(SCREAMING_SNAKE_CASE       ,   np.ndarray						)



class        lowercase_	(		a ):

  '''simple docstring'''





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


    """simple docstring"""
    UpperCAmelCase													=	fields(self     )

    # Safety and consistency checks
    if not len(a_     ):
      raise ValueError(F'''{self.__class__.__name__} has no fields.'''     )

    UpperCAmelCase													=	getattr(self   , class_fields[0].name     )
    UpperCAmelCase													=	all(getattr(self   , field.name     ) is None for field in class_fields[1:]     )

    if other_fields_are_none and isinstance(a_   , a_     ):
      for key, value in first_field.items():
        UpperCAmelCase													=	value
    else:
      for field in class_fields:
        UpperCAmelCase													=	getattr(self   , field.name     )
        if v is not None:
          UpperCAmelCase													=	v
  def __delitem__(     self   , *a_   , **a_     )							->				int:


    """simple docstring"""
    raise Exception(F'''You cannot use ``__delitem__`` on a {self.__class__.__name__} instance.'''     )
  def 						snake_case_			(     self   , *a_   , **a_     )							->				Tuple:


    """simple docstring"""
    raise Exception(F'''You cannot use ``setdefault`` on a {self.__class__.__name__} instance.'''     )
  def 						snake_case_			(     self   , *a_   , **a_     )							->				int:


    """simple docstring"""
    raise Exception(F'''You cannot use ``pop`` on a {self.__class__.__name__} instance.'''     )
  def 						snake_case_			(     self   , *a_   , **a_     )							->				Dict:


    """simple docstring"""
    raise Exception(F'''You cannot use ``update`` on a {self.__class__.__name__} instance.'''     )
  def __getitem__(     self   , a_     )							->				Tuple:


    """simple docstring"""
    if isinstance(a_   , a_     ):
      UpperCAmelCase													=	dict(self.items()     )
      return inner_dict[k]
    else:
      return self.to_tuple()[k]
  def __setattr__(     self   , a_   , a_     )							->				Dict:


    """simple docstring"""
    if name in self.keys() and value is not None:
      # Don't call self.__setitem__ to avoid recursion errors
      super().__setitem__(a_   , a_     )
    super().__setattr__(a_   , a_     )
  def __setitem__(     self   , a_   , a_     )							->				str:


    """simple docstring"""
    # Will raise a KeyException if needed
    super().__setitem__(a_   , a_     )
    # Don't call self.__setattr__ to avoid recursion errors
    super().__setattr__(a_   , a_     )





  def 						snake_case_			(     self     )							->				Tuple[Any]:


    """simple docstring"""
    return tuple(self[k] for k in self.keys()     )


