


import copy

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


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



class 							_UpperCamelCase (						A						):

   '''simple docstring'''







   a_				:							List[Any]    = "encoder-decoder"
   a_				:							List[Any]    = True

   def __init__(  self  : List[Any]       ,  **_lowerCamelCase  : int							):






         '''simple docstring'''



         super().__init__(**_lowerCamelCase							)
         assert (
             "encoder" in kwargs and "decoder" in kwargs
         ), "Config has to be initialized with encoder and decoder config"
         __lowerCamelCase     :      Dict       						=						kwargs.pop("""encoder"""							)
         __lowerCamelCase     :      str       						=						encoder_config.pop("""model_type"""							)
         __lowerCamelCase     :      Optional[Any]       						=						kwargs.pop("""decoder"""							)
         __lowerCamelCase     :      List[Any]       						=						decoder_config.pop("""model_type"""							)

         from ..auto.configuration_auto import AutoConfig

         __lowerCamelCase     :      List[Any]       						=						AutoConfig.for_model(_lowerCamelCase       ,  **_lowerCamelCase							)
         __lowerCamelCase     :      List[Any]       						=						AutoConfig.for_model(_lowerCamelCase       ,  **_lowerCamelCase							)
         __lowerCamelCase     :      List[str]       						=						True

   @classmethod
   def   _snake_case    (  cls  : int       ,  _lowerCamelCase  : PretrainedConfig       ,  _lowerCamelCase  : PretrainedConfig       ,  **_lowerCamelCase  : Optional[int]							):






         '''simple docstring'''



         logger.info("""Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"""							)
         __lowerCamelCase     :      Optional[int]       						=						True
         __lowerCamelCase     :      Dict       						=						True

         return cls(encoder=encoder_config.to_dict()       ,  decoder=decoder_config.to_dict()       ,  **_lowerCamelCase							)


   def   _snake_case    (  self  : Optional[int]							):






         '''simple docstring'''



         __lowerCamelCase     :      Optional[Any]       						=						copy.deepcopy(self.__dict__							)
         __lowerCamelCase     :      Tuple       						=						self.encoder.to_dict()
         __lowerCamelCase     :      List[Any]       						=						self.decoder.to_dict()
         __lowerCamelCase     :      List[Any]       						=						self.__class__.model_type
         return output







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCamelCase    :						Any     =							{
    'configuration_timesformer': ['TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TimesformerConfig'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __UpperCamelCase    :						int     =							[
        'TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
        'TimesformerModel',
        'TimesformerForVideoClassification',
        'TimesformerPreTrainedModel',
    ]

if TYPE_CHECKING:
    from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_timesformer import (
            TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            TimesformerForVideoClassification,
            TimesformerModel,
            TimesformerPreTrainedModel,
        )

else:
    import sys

    __UpperCamelCase    :						List[Any]     =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



