






'''simple docstring'''

import math
def     __lowercase  (_lowercase,						_lowercase     )   ->     float:


     """simple docstring"""
     return math.pow(_lowercase,						2     ) - a
def     __lowercase  (_lowercase     )   ->     float:


     """simple docstring"""
     return 2 * x
def     __lowercase  (_lowercase     )   ->     float:


     """simple docstring"""
     __lowerCamelCase						:       str				   =				2.0

     while start <= a:
          __lowerCamelCase						:       Optional[Any]				   =				math.pow(_lowercase,						2     )

     return start
def     __lowercase  (_lowercase,						_lowercase = 9_999,						_lowercase = 0.00_0000_0000_0001     )   ->     float:


     """simple docstring"""

     if a < 0:
          raise ValueError("""math domain error"""     )

     __lowerCamelCase						:       List[Any]				   =				get_initial_point(_lowercase     )

     for _ in range(_lowercase     ):
          __lowerCamelCase						:       Union[str, Any]				   =				value
          __lowerCamelCase						:       int				   =				value - fx(_lowercase,						_lowercase     ) / fx_derivative(_lowercase     )
          if abs(prev_value - value     ) < tolerance:
               return value

     return value


if __name__ == "__main__":
   from doctest import testmod

   testmod()










'''simple docstring'''

import argparse

import torch

from transformers import RemBertConfig, RemBertModel, load_tf_weights_in_rembert
from transformers.utils import logging


logging.set_verbosity_info()
def     __lowercase  (_lowercase,						_lowercase,						_lowercase     )   ->     Optional[Any]:


     """simple docstring"""
     # Initialise PyTorch model
     __lowerCamelCase						:       str				   =				RemBertConfig.from_json_file(_lowercase     )
     print("""Building PyTorch model from configuration: {}""".format(str(_lowercase     )     )     )
     __lowerCamelCase						:       List[Any]				   =				RemBertModel(_lowercase     )

     # Load weights from tf checkpoint
     load_tf_weights_in_rembert(_lowercase,						_lowercase,						_lowercase     )

     # Save pytorch-model
     print("""Save PyTorch model to {}""".format(_lowercase     )     )
     torch.save(model.state_dict(),						_lowercase     )


if __name__ == "__main__":
   UpperCAmelCase__						:Tuple          =			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(
       """--rembert_config_file""",
       default=None,
       type=str,
       required=True,
       help=(
           """The config json file corresponding to the pre-trained RemBERT model. \n"""
           """This specifies the model architecture."""
       ),
   )
   parser.add_argument(
       """--pytorch_dump_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
   )
   UpperCAmelCase__						:List[Any]          =			parser.parse_args()
   convert_rembert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.rembert_config_file, args.pytorch_dump_path)



