






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


__lowerCamelCase :      int										=				logging.get_logger(__name__)

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



class 							SCREAMING_SNAKE_CASE__						(    UpperCamelCase_						):





					"""simple docstring"""






					a_     =		"timesformer"



					def __init__( self					:  List[Any]							,		__A					:  Union[str, Any]=2_2_4							,		__A					:  Any=1_6							,		__A					:  List[Any]=3							,		__A					:  Union[str, Any]=8							,		__A					:  List[str]=7_6_8							,		__A					:  int=1_2							,		__A					:  Dict=1_2							,		__A					:  Optional[int]=3_0_7_2							,		__A					:  Optional[int]="gelu"							,		__A					:  Tuple=0.0							,		__A					:  int=0.0							,		__A					:  Union[str, Any]=0.0_2							,		__A					:  str=1e-6							,		__A					:  int=True							,		__A					:  int="divided_space_time"							,		__A					:  int=0							,		**__A					:  List[str]							,		):
						super().__init__(**__A	)

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

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

						snake_case__			:				str       =  attention_type
						snake_case__			:				str       =  drop_path_rate











from datetime import datetime

import matplotlib.pyplot as plt
import torch







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int       ):
	for param in module.parameters():
		snake_case__			:				Tuple       =  False







def 					SCREAMING_SNAKE_CASE    (			):
	snake_case__			:				Any       =  "cuda" if torch.cuda.is_available() else "cpu"
	if torch.backends.mps.is_available() and torch.backends.mps.is_built():
		snake_case__			:				List[Any]       =  "mps"
	if device == "mps":
		print(
		    "WARNING: MPS currently doesn't seem to work, and messes up backpropagation without any visible torch"
		    " errors. I recommend using CUDA on a colab notebook or CPU instead if you're facing inexplicable issues"
		    " with generations."       )
	return device







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							str       ):
	snake_case__			:				List[str]       =  plt.imshow(snake_case_       )
	fig.axes.get_xaxis().set_visible(snake_case_       )
	fig.axes.get_yaxis().set_visible(snake_case_       )
	plt.show()







def 					SCREAMING_SNAKE_CASE    (			):
	snake_case__			:				str       =  datetime.now()
	snake_case__			:				Optional[Any]       =  current_time.strftime("%H:%M:%S"       )
	return timestamp



