



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


_lowerCAmelCase	:   List[Any]    =   logging.get_logger(__name__)

_lowerCAmelCase	:   Union[str, Any]    =   {
    "facebook/timesformer": "https://huggingface.co/facebook/timesformer/resolve/main/config.json",
}


class 	__snake_case   ( SCREAMING_SNAKE_CASE ):
		SCREAMING_SNAKE_CASE__								=	'timesformer'
		def __init__(							self    ,a_=224    ,a_=16    ,a_=3    ,a_=8    ,a_=768    ,a_=12    ,a_=12    ,a_=3072    ,a_="gelu"    ,a_=0.0    ,a_=0.0    ,a_=0.02    ,a_=1e-6    ,a_=True    ,a_="divided_space_time"    ,a_=0    ,**a_    ,):







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

						lowerCAmelCase__		  =  image_size
						lowerCAmelCase__		  =  patch_size
						lowerCAmelCase__		  =  num_channels
						lowerCAmelCase__		  =  num_frames

						lowerCAmelCase__		  =  hidden_size
						lowerCAmelCase__		  =  num_hidden_layers
						lowerCAmelCase__		  =  num_attention_heads
						lowerCAmelCase__		  =  intermediate_size
						lowerCAmelCase__		  =  hidden_act
						lowerCAmelCase__		  =  hidden_dropout_prob
						lowerCAmelCase__		  =  attention_probs_dropout_prob
						lowerCAmelCase__		  =  initializer_range
						lowerCAmelCase__		  =  layer_norm_eps
						lowerCAmelCase__		  =  qkv_bias

						lowerCAmelCase__		  =  attention_type
						lowerCAmelCase__		  =  drop_path_rate





from typing import Dict

from .base import GenericTensor, Pipeline


class 	__snake_case   ( SCREAMING_SNAKE_CASE ):
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_=None    ,a_=None    ,a_=None    ,**a_						):







						"""simple docstring"""
						if tokenize_kwargs is None:
										lowerCAmelCase__		  =  {}

						if truncation is not None:
										if "truncation" in tokenize_kwargs:
														raise ValueError(
														    'truncation parameter defined twice (given as keyword argument as well as in tokenize_kwargs)'						)
										lowerCAmelCase__		  =  truncation

						lowerCAmelCase__		  =  tokenize_kwargs

						lowerCAmelCase__		  =  {}
						if return_tensors is not None:
										lowerCAmelCase__		  =  return_tensors

						return preprocess_params, {}, postprocess_params
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,**a_						):







						"""simple docstring"""
						lowerCAmelCase__		  =  self.framework
						lowerCAmelCase__		  =  self.tokenizer(a_    ,return_tensors=a_    ,**a_						)
						return model_inputs
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_						):







						"""simple docstring"""
						lowerCAmelCase__		  =  self.model(**a_						)
						return model_outputs
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,a_=False						):







						"""simple docstring"""
						# [0] is the first available tensor, logits or last_hidden_state.
						if return_tensors:
										return model_outputs[0]
						if self.framework == "pt":
										return model_outputs[0].tolist()
						elif self.framework == "tf":
										return model_outputs[0].numpy().tolist()



		def __call__(							self    ,*a_    ,**a_						):







						"""simple docstring"""
						return super().__call__(*a_    ,**a_						)
