





import numpy as np






def 			SCREAMING_SNAKE_CASE__							(    UpperCamelCase__:							List[str]      ):
		SCREAMING_SNAKE_CASE__		,  SCREAMING_SNAKE_CASE__								= a.shape
		SCREAMING_SNAKE_CASE__								= min(lowerCamelCase_   ,				lowerCamelCase_      )
		SCREAMING_SNAKE_CASE__								= np.eye(lowerCamelCase_      )
		SCREAMING_SNAKE_CASE__								= a.copy()

		for k in range(t - 1      ):
				# select a column of modified matrix A':
				SCREAMING_SNAKE_CASE__								= r[k:, [k]]
				# construct first basis vector
				SCREAMING_SNAKE_CASE__								= np.zeros_like(lowerCamelCase_      )
				SCREAMING_SNAKE_CASE__								= 1.0
				# determine scaling factor
				SCREAMING_SNAKE_CASE__								= np.linalg.norm(lowerCamelCase_      )
				# construct vector v for Householder reflection
				SCREAMING_SNAKE_CASE__								= x + np.sign(x[0]      ) * alpha * ea
				v /= np.linalg.norm(lowerCamelCase_      )

				# construct the Householder matrix
				SCREAMING_SNAKE_CASE__								= np.eye(m - k      ) - 2.0 * v @ v.T
				# pad with ones and zeros as necessary
				SCREAMING_SNAKE_CASE__								= np.block([[np.eye(lowerCamelCase_      ), np.zeros((k, m - k)      )], [np.zeros((m - k, k)      ), q_k]]      )

				SCREAMING_SNAKE_CASE__								= q @ q_k.T
				SCREAMING_SNAKE_CASE__								= q_k @ r

		return q, r


if __name__ == "__main__":
	import doctest

	doctest.testmod()






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


_lowerCamelCase							=     logging.get_logger(__name__)

_lowerCamelCase							=     {
    'MCG-NJU/videomae-base': 'https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json',
}




class 					UpperCamelCase_    (       UpperCamelCase__      ):
							lowerCamelCase_          =   "videomae"


							def __init__(							self      :Dict							,			__A      :List[str]=224							,			__A      :List[Any]=16							,			__A      :int=3							,			__A      :Optional[Any]=16							,			__A      :Optional[int]=2							,			__A      :Optional[Any]=768							,			__A      :List[str]=12							,			__A      :Optional[Any]=12							,			__A      :List[str]=3072							,			__A      :Tuple="gelu"							,			__A      :Optional[int]=0.0							,			__A      :Union[str, Any]=0.0							,			__A      :int=0.0_2							,			__A      :Union[str, Any]=1E-12							,			__A      :Optional[Any]=True							,			__A      :Union[str, Any]=True							,			__A      :Optional[int]=6							,			__A      :Tuple=384							,			__A      :str=4							,			__A      :List[str]=1536							,			__A      :Dict=True							,			**__A      :int							,			)				->				Optional[int]:



									"""simple docstring"""



									super().__init__(**__A						)

									SCREAMING_SNAKE_CASE__								= image_size
									SCREAMING_SNAKE_CASE__								= patch_size
									SCREAMING_SNAKE_CASE__								= num_channels
									SCREAMING_SNAKE_CASE__								= num_frames
									SCREAMING_SNAKE_CASE__								= tubelet_size

									SCREAMING_SNAKE_CASE__								= hidden_size
									SCREAMING_SNAKE_CASE__								= num_hidden_layers
									SCREAMING_SNAKE_CASE__								= num_attention_heads
									SCREAMING_SNAKE_CASE__								= intermediate_size
									SCREAMING_SNAKE_CASE__								= hidden_act
									SCREAMING_SNAKE_CASE__								= hidden_dropout_prob
									SCREAMING_SNAKE_CASE__								= attention_probs_dropout_prob
									SCREAMING_SNAKE_CASE__								= initializer_range
									SCREAMING_SNAKE_CASE__								= layer_norm_eps
									SCREAMING_SNAKE_CASE__								= qkv_bias
									SCREAMING_SNAKE_CASE__								= use_mean_pooling

									SCREAMING_SNAKE_CASE__								= decoder_num_attention_heads
									SCREAMING_SNAKE_CASE__								= decoder_hidden_size
									SCREAMING_SNAKE_CASE__								= decoder_num_hidden_layers
									SCREAMING_SNAKE_CASE__								= decoder_intermediate_size
									SCREAMING_SNAKE_CASE__								= norm_pix_loss