


"""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   __lowerCAmelCase						(						lowercase  :  Optional[Any]						,							lowercase  :  Optional[int]						,							lowercase  :  int )	->						List[Any]:


    """simple docstring"""





    snake_case    :      Optional[int]      					=    LxmertConfig.from_json_file(lowercase )
    print(F'Building PyTorch model from configuration: {config}' )
    snake_case    :      Union[str, Any]      					=    LxmertForPreTraining(lowercase )

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

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


if __name__ == "__main__":
  __snake_case   			=    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."""
  )
  __snake_case   			=    parser.parse_args()
  convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.config_file, args.pytorch_dump_path)









"""simple docstring"""



def   __lowerCAmelCase						(						lowercase  :  int )	->						bool:


    """simple docstring"""





    if p < 2:
        raise ValueError("p should not be less than 2!" )
    elif p == 2:
        return True

    snake_case    :      Dict      					=    4
    snake_case    :      str      					=    (1 << p) - 1
    for _ in range(p - 2 ):
        snake_case    :      Any      					=    ((s * s) - 2) % m
    return s == 0


if __name__ == "__main__":
  print(lucas_lehmer_test(7))
  print(lucas_lehmer_test(11))





