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


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

lowerCamelCase_    :		Union[str, Any]							=	{
    """unc-nlp/lxmert-base-uncased""": """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json""",
}


class 						a__							(       __snake_case		):
			A__    :       Any        =      'lxmert'
			A__    :       int        =      {}



			def __init__(						self				,						UpperCAmelCase=3_0_5_2_2				,						UpperCAmelCase=7_6_8				,						UpperCAmelCase=1_2				,						UpperCAmelCase=9_5_0_0				,						UpperCAmelCase=1_6_0_0				,						UpperCAmelCase=4_0_0				,						UpperCAmelCase=3_0_7_2				,						UpperCAmelCase="gelu"				,						UpperCAmelCase=0.1				,						UpperCAmelCase=0.1				,						UpperCAmelCase=5_1_2				,						UpperCAmelCase=2				,						UpperCAmelCase=0.02				,						UpperCAmelCase=1e-12				,						UpperCAmelCase=9				,						UpperCAmelCase=5				,						UpperCAmelCase=5				,						UpperCAmelCase=2_0_4_8				,						UpperCAmelCase=4				,						UpperCAmelCase=6.67				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						**UpperCAmelCase				,						)			->   int:
								__a		 =       vocab_size
								__a		 =       hidden_size
								__a		 =       num_attention_heads
								__a		 =       hidden_act
								__a		 =       intermediate_size
								__a		 =       hidden_dropout_prob
								__a		 =       attention_probs_dropout_prob
								__a		 =       max_position_embeddings
								__a		 =       type_vocab_size
								__a		 =       initializer_range
								__a		 =       layer_norm_eps
								__a		 =       num_qa_labels
								__a		 =       num_object_labels
								__a		 =       num_attr_labels
								__a		 =       l_layers
								__a		 =       x_layers
								__a		 =       r_layers
								__a		 =       visual_feat_dim
								__a		 =       visual_pos_dim
								__a		 =       visual_loss_normalizer
								__a		 =       task_matched
								__a		 =       task_mask_lm
								__a		 =       task_obj_predict
								__a		 =       task_qa
								__a		 =       visual_obj_loss
								__a		 =       visual_attr_loss
								__a		 =       visual_feat_loss
								__a		 =       {'vision': r_layers, 'cross_encoder': x_layers, 'language': l_layers}
								super().__init__(**UpperCAmelCase   )





from datetime import datetime

import matplotlib.pyplot as plt
import torch
def 							lowerCAmelCase(     __lowerCamelCase						):
					for param in module.parameters():
										__a		 =       False
def 							lowerCAmelCase(     ):
					__a		 =       'cuda' if torch.cuda.is_available() else 'cpu'
					if torch.backends.mps.is_available() and torch.backends.mps.is_built():
										__a		 =       '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 							lowerCAmelCase(     __lowerCamelCase						):
					__a		 =       plt.imshow(__lowerCamelCase						)
					fig.axes.get_xaxis().set_visible(__lowerCamelCase						)
					fig.axes.get_yaxis().set_visible(__lowerCamelCase						)
					plt.show()



def 							lowerCAmelCase(     ):
					__a		 =       datetime.now()
					__a		 =       current_time.strftime('%H:%M:%S'						)
					return timestamp




