




"""simple docstring"""

from collections.abc import Callable






def 		_snake_case	(   _snake_case				:   Callable[[float], float]							,    _snake_case				:   float							,    _snake_case				:   float				)       ->   float:






      '''simple docstring'''


      _A     =  a
      _A     =  b
      if function(_snake_case				) == 0:  # one of the a or b is a root for the function
            return a
      elif function(_snake_case				) == 0:
            return b
      elif (
          function(_snake_case				) * function(_snake_case				) > 0
      ):  # if none of these are root and they are both positive or negative,
            # then this algorithm can't find the root
            raise ValueError('could not find root in given interval.'				)
      else:
            _A     =  start + (end - start) / 2.0
            while abs(start - mid				) > 10**-7:  # until precisely equals to 10^-7
                  if function(_snake_case				) == 0:
                        return mid
                  elif function(_snake_case				) * function(_snake_case				) < 0:
                        _A     =  mid
                  else:
                        _A     =  mid
                  _A     =  start + (end - start) / 2.0
            return mid






def 		_snake_case	(   _snake_case				:   float				)       ->   float:






      '''simple docstring'''


      return x**3 - 2 * x - 5


if __name__ == "__main__":
       print(bisection(f, 1, 1_000))

       import doctest

       doctest.testmod()







"""simple docstring"""

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


a							      =     logging.get_logger(__name__)

a							      =     {
    '''facebook/vit-mae-base''': '''https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json''',
    # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae
}





class 							lowercase_			(	__lowerCAmelCase				):



 '''simple docstring'''
 UpperCAmelCase       :	int     =      '''vit_mae'''

 def __init__(					self			:			Union[str, Any]       ,				_UpperCAmelCase			:			Optional[int]=768       ,				_UpperCAmelCase			:			Tuple=12       ,				_UpperCAmelCase			:			Optional[Any]=12       ,				_UpperCAmelCase			:			Optional[int]=3_072       ,				_UpperCAmelCase			:			Any="gelu"       ,				_UpperCAmelCase			:			Optional[Any]=0.0       ,				_UpperCAmelCase			:			Optional[int]=0.0       ,				_UpperCAmelCase			:			Dict=0.02       ,				_UpperCAmelCase			:			List[Any]=1E-1_2       ,				_UpperCAmelCase			:			Optional[Any]=224       ,				_UpperCAmelCase			:			int=16       ,				_UpperCAmelCase			:			str=3       ,				_UpperCAmelCase			:			Tuple=True       ,				_UpperCAmelCase			:			int=16       ,				_UpperCAmelCase			:			str=512       ,				_UpperCAmelCase			:			int=8       ,				_UpperCAmelCase			:			List[Any]=2_048       ,				_UpperCAmelCase			:			Optional[Any]=0.75       ,				_UpperCAmelCase			:			List[str]=False       ,				**_UpperCAmelCase			:			Union[str, Any]       ,				):
       super().__init__(**_UpperCAmelCase						)

       _A     =  hidden_size
       _A     =  num_hidden_layers
       _A     =  num_attention_heads
       _A     =  intermediate_size
       _A     =  hidden_act
       _A     =  hidden_dropout_prob
       _A     =  attention_probs_dropout_prob
       _A     =  initializer_range
       _A     =  layer_norm_eps
       _A     =  image_size
       _A     =  patch_size
       _A     =  num_channels
       _A     =  qkv_bias
       _A     =  decoder_num_attention_heads
       _A     =  decoder_hidden_size
       _A     =  decoder_num_hidden_layers
       _A     =  decoder_intermediate_size
       _A     =  mask_ratio
       _A     =  norm_pix_loss

