



'''simple docstring'''






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


lowerCAmelCase:   List[str]					=		logging.get_logger(__name__)

lowerCAmelCase:   Dict					=		{
    'google/vivit-b-16x2-kinetics400': (
        'https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json'
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       """vivit"""







    def __init__( self					:    List[Any]		,     __snake_case					:    int=2_24		,     __snake_case					:    List[Any]=32		,     __snake_case					:    Dict=[2, 16, 16]		,     __snake_case					:    int=3		,     __snake_case					:    Optional[int]=7_68		,     __snake_case					:    Tuple=12		,     __snake_case					:    Dict=12		,     __snake_case					:    int=30_72		,     __snake_case					:    Optional[Any]="gelu_fast"		,     __snake_case					:    str=0.0		,     __snake_case					:    Tuple=0.0		,     __snake_case					:    Optional[Any]=0.02		,     __snake_case					:    Optional[Any]=1e-0_6		,     __snake_case					:    List[Any]=True		,     **__snake_case					:    Dict		,     ):
      a		:   Any	  =	hidden_size
      a		:   Dict	  =	num_hidden_layers
      a		:   Optional[int]	  =	num_attention_heads
      a		:   Tuple	  =	intermediate_size
      a		:   List[Any]	  =	hidden_act
      a		:   List[Any]	  =	hidden_dropout_prob
      a		:   Union[str, Any]	  =	attention_probs_dropout_prob
      a		:   str	  =	initializer_range
      a		:   Optional[int]	  =	layer_norm_eps

      a		:   Optional[Any]	  =	image_size
      a		:   int	  =	num_frames
      a		:   List[str]	  =	tubelet_size
      a		:   Optional[Any]	  =	num_channels
      a		:   Dict	  =	qkv_bias

      super().__init__(**__snake_case      )




'''simple docstring'''






from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream

class 				a__(   lowerCamelCase__      ):







    def __init__( self					:    int		,     __snake_case					:    Callable		,     __snake_case					:    Optional[Features] = None		,     __snake_case					:    str = None		,     __snake_case					:    bool = False		,     __snake_case					:    bool = False		,     __snake_case					:    Optional[dict] = None		,     __snake_case					:    Optional[int] = None		,     **__snake_case					:    Optional[int]		,     ):
      super().__init__(
          features=__snake_case		,     cache_dir=__snake_case		,     keep_in_memory=__snake_case		,     streaming=__snake_case		,     num_proc=__snake_case		,     **__snake_case		,     )
      a		:   List[Any]	  =	Generator(
          cache_dir=__snake_case		,     features=__snake_case		,     generator=__snake_case		,     gen_kwargs=__snake_case		,     **__snake_case		,     )







    def      lowercase_			( self					:    Any      ):
      # Build iterable dataset
      if self.streaming:
        a		:   Optional[int]	  =	self.builder.as_streaming_dataset(split='train'      )
      # Build regular (map-style) dataset
      else:
        a		:   List[Any]	  =	None
        a		:   Any	  =	None
        a		:   Optional[int]	  =	None
        a		:   List[str]	  =	None

        self.builder.download_and_prepare(
            download_config=__snake_case		,     download_mode=__snake_case		,     verification_mode=__snake_case		,     base_path=__snake_case		,     num_proc=self.num_proc		,     )
        a		:   Dict	  =	self.builder.as_dataset(
            split='train'		,     verification_mode=__snake_case		,     in_memory=self.keep_in_memory      )
      return dataset