
from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff


def 			UpperCamelCase					(    __lowerCamelCase     : str				,					__lowerCamelCase     : float | Decimal				,					__lowerCamelCase     : float = 10**-10    ):
       snake_case       :   List[Any]							=      a
       while True:
              snake_case       :   List[Any]							=      Decimal(__lowerCamelCase    ) - (
                  Decimal(eval(__lowerCamelCase    )    ) / Decimal(eval(str(diff(__lowerCamelCase    )    )    )    )  # noqa: S307
              )
              # This number dictates the accuracy of the answer
              if abs(eval(__lowerCamelCase    )    ) < precision:  # noqa: S307
                     return float(__lowerCamelCase    )


# Let's Execute
if __name__ == "__main__":
   # Find root of trigonometric function
   # Find value of pi
   print(F'The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}')
   # Find root of polynomial
   print(F'The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}')
   # Find Square Root of 5
   print(F'The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}')
   # Exponential Roots
   print(F'The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}')







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


__lowerCamelCase							=       logging.get_logger(__name__)

__lowerCamelCase							=       {
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}






class   UpperCAmelCase		(						A_ ):
   A__					:		List[str]						     =     "megatron-bert"



   def __init__(self		:					Optional[int]    ,						snake_case__		:					List[str]=2_90_56    ,						snake_case__		:					List[Any]=10_24    ,						snake_case__		:					str=24    ,						snake_case__		:					Tuple=16    ,						snake_case__		:					Union[str, Any]=40_96    ,						snake_case__		:					str="gelu"    ,						snake_case__		:					str=0.1    ,						snake_case__		:					Optional[int]=0.1    ,						snake_case__		:					Tuple=5_12    ,						snake_case__		:					Union[str, Any]=2    ,						snake_case__		:					Dict=0.02    ,						snake_case__		:					List[Any]=1e-12    ,						snake_case__		:					int=0    ,						snake_case__		:					Tuple="absolute"    ,						snake_case__		:					Any=True    ,						**snake_case__		:					Union[str, Any]    ,						)		->	Optional[Any]:


          '''simple docstring'''


          super().__init__(pad_token_id=snake_case__    ,						**snake_case__ )

          snake_case       :   Tuple							=      vocab_size
          snake_case       :   str							=      hidden_size
          snake_case       :   str							=      num_hidden_layers
          snake_case       :   str							=      num_attention_heads
          snake_case       :   Optional[int]							=      hidden_act
          snake_case       :   int							=      intermediate_size
          snake_case       :   List[str]							=      hidden_dropout_prob
          snake_case       :   Union[str, Any]							=      attention_probs_dropout_prob
          snake_case       :   Dict							=      max_position_embeddings
          snake_case       :   List[str]							=      type_vocab_size
          snake_case       :   List[str]							=      initializer_range
          snake_case       :   Tuple							=      layer_norm_eps
          snake_case       :   int							=      position_embedding_type
          snake_case       :   str							=      use_cache





