



"""simple docstring"""






import argparse

import torch

from transformers import LxmertConfig, LxmertForPreTraining, load_tf_weights_in_lxmert
from transformers.utils import logging


logging.set_verbosity_info()






def        snake_case_  (      A_					:		Tuple,				A_					:		int,				A_					:		Dict						):


       '''simple docstring'''





       _lowerCamelCase						:				Union[str, Any]    			= LxmertConfig.from_json_file(A_						)
       print(F'''Building PyTorch model from configuration: {config}'''						)
       _lowerCamelCase						:				List[str]    			= LxmertForPreTraining(A_						)

       # Load weights from tf checkpoint
       load_tf_weights_in_lxmert(A_,				A_,				A_						)

       # Save pytorch-model
       print(F'''Save PyTorch model to {pytorch_dump_path}'''						)
       torch.save(model.state_dict(),				A_						)


if __name__ == "__main__":
   lowerCAmelCase__        =				argparse.ArgumentParser()
   # Required parameters
   parser.add_argument(
       '''--tf_checkpoint_path''', default=None, type=str, required=True, help='''Path to the TensorFlow checkpoint path.'''
   )
   parser.add_argument(
       '''--config_file''',
       default=None,
       type=str,
       required=True,
       help='''The config json file corresponding to the pre-trained model. \nThis specifies the model architecture.''',
   )
   parser.add_argument(
       '''--pytorch_dump_path''', default=None, type=str, required=True, help='''Path to the output PyTorch model.'''
   )
   lowerCAmelCase__        =				parser.parse_args()
   convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.config_file, args.pytorch_dump_path)






def 			_a (      SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE     ):


		"""simple docstring"""




		if exponent == 1:
				return base
		if exponent % 2 == 0:
				lowercase__            =      _modexpt(SCREAMING_SNAKE_CASE						,				exponent // 2						,				SCREAMING_SNAKE_CASE     ) % modulo_value
				return (x * x) % modulo_value
		else:
				return (base * _modexpt(SCREAMING_SNAKE_CASE						,				exponent - 1						,				SCREAMING_SNAKE_CASE     )) % modulo_value
def 			_a (      SCREAMING_SNAKE_CASE = 17_77						,				SCREAMING_SNAKE_CASE = 18_55						,				SCREAMING_SNAKE_CASE = 8     ):


		"""simple docstring"""




		lowercase__            =      base
		for _ in range(1						,				SCREAMING_SNAKE_CASE     ):
				lowercase__            =      _modexpt(SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE						,				10**digits     )

		return result


if __name__ == "__main__":
			print(f"""{solution() = }""")


