





import numpy as np

def      a    (   _lowercase :  List[str]							)  ->Union[str, Any]:
		UpperCamelCase__	,      UpperCamelCase__								=						a.shape
		UpperCamelCase__								=						min(_lowercase			,    _lowercase							)
		UpperCamelCase__								=						np.eye(_lowercase							)
		UpperCamelCase__								=						a.copy()

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

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

				UpperCamelCase__								=						q @ q_k.T
				UpperCamelCase__								=						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						( _lowercase       ):
					__A        = "videomae"




					def __init__(    self     ,   __lowerCAmelCase=224     ,   __lowerCAmelCase=16     ,   __lowerCAmelCase=3     ,   __lowerCAmelCase=16     ,   __lowerCAmelCase=2     ,   __lowerCAmelCase=768     ,   __lowerCAmelCase=12     ,   __lowerCAmelCase=12     ,   __lowerCAmelCase=3_072     ,   __lowerCAmelCase="gelu"     ,   __lowerCAmelCase=0.0     ,   __lowerCAmelCase=0.0     ,   __lowerCAmelCase=0.0_2     ,   __lowerCAmelCase=1E-1_2     ,   __lowerCAmelCase=True     ,   __lowerCAmelCase=True     ,   __lowerCAmelCase=6     ,   __lowerCAmelCase=384     ,   __lowerCAmelCase=4     ,   __lowerCAmelCase=1_536     ,   __lowerCAmelCase=True     ,   **__lowerCAmelCase     ,   )    ->	Any:
							super().__init__(**__lowerCAmelCase							)

							UpperCamelCase__								=						image_size
							UpperCamelCase__								=						patch_size
							UpperCamelCase__								=						num_channels
							UpperCamelCase__								=						num_frames
							UpperCamelCase__								=						tubelet_size

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

							UpperCamelCase__								=						decoder_num_attention_heads
							UpperCamelCase__								=						decoder_hidden_size
							UpperCamelCase__								=						decoder_num_hidden_layers
							UpperCamelCase__								=						decoder_intermediate_size
							UpperCamelCase__								=						norm_pix_loss





