




"""simple docstring"""





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


A   =       logging.get_logger(__name__)

A   =       {
    """facebook/timesformer""": """https://huggingface.co/facebook/timesformer/resolve/main/config.json""",
}



class      a__				(	__magic_name__   ):
			lowercase_    =	"timesformer"


			def __init__(      self      :    Tuple      ,  UpperCamelCase_      :    Tuple=224      ,  UpperCamelCase_      :    str=16      ,  UpperCamelCase_      :    List[str]=3      ,  UpperCamelCase_      :    Dict=8      ,  UpperCamelCase_      :    str=768      ,  UpperCamelCase_      :    Any=12      ,  UpperCamelCase_      :    str=12      ,  UpperCamelCase_      :    List[Any]=3072      ,  UpperCamelCase_      :    Any="gelu"      ,  UpperCamelCase_      :    List[str]=0.0      ,  UpperCamelCase_      :    Union[str, Any]=0.0      ,  UpperCamelCase_      :    int=0.02      ,  UpperCamelCase_      :    Any=1e-6      ,  UpperCamelCase_      :    List[Any]=True      ,  UpperCamelCase_      :    str="divided_space_time"      ,  UpperCamelCase_      :    int=0      ,  **UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						super().__init__(**UpperCamelCase_)

						__UpperCAmelCase	: Optional[Any]		=					image_size
						__UpperCAmelCase	: int		=					patch_size
						__UpperCAmelCase	: str		=					num_channels
						__UpperCAmelCase	: List[str]		=					num_frames

						__UpperCAmelCase	: Dict		=					hidden_size
						__UpperCAmelCase	: List[Any]		=					num_hidden_layers
						__UpperCAmelCase	: List[Any]		=					num_attention_heads
						__UpperCAmelCase	: Union[str, Any]		=					intermediate_size
						__UpperCAmelCase	: Optional[int]		=					hidden_act
						__UpperCAmelCase	: Dict		=					hidden_dropout_prob
						__UpperCAmelCase	: Any		=					attention_probs_dropout_prob
						__UpperCAmelCase	: Tuple		=					initializer_range
						__UpperCAmelCase	: str		=					layer_norm_eps
						__UpperCAmelCase	: Any		=					qkv_bias

						__UpperCAmelCase	: List[str]		=					attention_type
						__UpperCAmelCase	: List[str]		=					drop_path_rate








"""simple docstring"""





from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader



class      a__				(	__magic_name__   ):


			def __init__(      self      :    List[Any]      ,  UpperCamelCase_      :    pyspark.sql.DataFrame      ,  UpperCamelCase_      :    Optional[NamedSplit] = None      ,  UpperCamelCase_      :    Optional[Features] = None      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    str = None      ,  UpperCamelCase_      :    bool = False      ,  UpperCamelCase_      :    str = None      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    str = "arrow"      ,  **UpperCamelCase_      :    Tuple      ,  ):


						"""simple docstring"""




						super().__init__(
						    split=UpperCamelCase_      ,  features=UpperCamelCase_      ,  cache_dir=UpperCamelCase_      ,  keep_in_memory=UpperCamelCase_      ,  streaming=UpperCamelCase_      ,  **UpperCamelCase_      ,  )
						__UpperCAmelCase	: List[Any]		=					load_from_cache_file
						__UpperCAmelCase	: List[Any]		=					file_format
						__UpperCAmelCase	: str		=					Spark(
						    df=UpperCamelCase_      ,  features=UpperCamelCase_      ,  cache_dir=UpperCamelCase_      ,  working_dir=UpperCamelCase_      ,  **UpperCamelCase_      ,  )


			def       a_     (      self      :    Union[str, Any]):


						"""simple docstring"""




						if self.streaming:
									return self.builder.as_streaming_dataset(split=self.split)
						__UpperCAmelCase	: List[Any]		=					None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
						self.builder.download_and_prepare(
						    download_mode=UpperCamelCase_      ,  file_format=self._file_format      ,  )
						return self.builder.as_dataset(split=self.split)


