'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__  :      Tuple        =					logging.get_logger(__name__)

lowercase__  :      Optional[Any]        =					{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}







class lowerCamelCase							(	lowerCamelCase					):




  '''simple docstring'''



  lowerCAmelCase__										=	'''swinv2'''

  lowerCAmelCase__										=	{
      '''num_attention_heads''': '''num_heads''',
      '''num_hidden_layers''': '''num_layers''',
  }






  def __init__(      self			:       Any  ,							UpperCAmelCase__			:       Optional[int]=224  ,							UpperCAmelCase__			:       Union[str, Any]=4  ,							UpperCAmelCase__			:       Tuple=3  ,							UpperCAmelCase__			:       List[Any]=96  ,							UpperCAmelCase__			:       Tuple=[2, 2, 6, 2]  ,							UpperCAmelCase__			:       Optional[int]=[3, 6, 12, 24]  ,							UpperCAmelCase__			:       Union[str, Any]=7  ,							UpperCAmelCase__			:       Optional[int]=4.0  ,							UpperCAmelCase__			:       Tuple=True  ,							UpperCAmelCase__			:       Union[str, Any]=0.0  ,							UpperCAmelCase__			:       Union[str, Any]=0.0  ,							UpperCAmelCase__			:       List[str]=0.1  ,							UpperCAmelCase__			:       Dict="gelu"  ,							UpperCAmelCase__			:       List[str]=False  ,							UpperCAmelCase__			:       Optional[Any]=0.02  ,							UpperCAmelCase__			:       Optional[int]=1e-5  ,							UpperCAmelCase__			:       Tuple=32  ,							**UpperCAmelCase__			:       Optional[Any]  ,							)				->Dict:
        super().__init__(**UpperCAmelCase__  )

        UpperCAmelCase_            =  image_size
        UpperCAmelCase_            =  patch_size
        UpperCAmelCase_            =  num_channels
        UpperCAmelCase_            =  embed_dim
        UpperCAmelCase_            =  depths
        UpperCAmelCase_            =  len(UpperCAmelCase__  )
        UpperCAmelCase_            =  num_heads
        UpperCAmelCase_            =  window_size
        UpperCAmelCase_            =  mlp_ratio
        UpperCAmelCase_            =  qkv_bias
        UpperCAmelCase_            =  hidden_dropout_prob
        UpperCAmelCase_            =  attention_probs_dropout_prob
        UpperCAmelCase_            =  drop_path_rate
        UpperCAmelCase_            =  hidden_act
        UpperCAmelCase_            =  use_absolute_embeddings
        UpperCAmelCase_            =  layer_norm_eps
        UpperCAmelCase_            =  initializer_range
        UpperCAmelCase_            =  encoder_stride
        # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
        # this indicates the channel dimension after the last stage of the model
        UpperCAmelCase_            =  int(embed_dim * 2 ** (len(UpperCAmelCase__  ) - 1)  )
        UpperCAmelCase_            =  (0, 0, 0, 0)






'''simple docstring'''
from collections.abc import Callable



def  __lowerCamelCase       (      _UpperCamelCase  :  Callable[[float], float]							,    _UpperCamelCase  :  float							,    _UpperCamelCase  :  float					):


      '''simple docstring'''


      UpperCAmelCase_            =  a
      UpperCAmelCase_            =  b
      if function(_UpperCamelCase					) == 0:  # one of the a or b is a root for the function
            return a
      elif function(_UpperCamelCase					) == 0:
            return b
      elif (
          function(_UpperCamelCase					) * function(_UpperCamelCase					) > 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:
            UpperCAmelCase_            =  start + (end - start) / 2.0
            while abs(start - mid					) > 10**-7:  # until precisely equals to 10^-7
                  if function(_UpperCamelCase					) == 0:
                        return mid
                  elif function(_UpperCamelCase					) * function(_UpperCamelCase					) < 0:
                        UpperCAmelCase_            =  mid
                  else:
                        UpperCAmelCase_            =  mid
                  UpperCAmelCase_            =  start + (end - start) / 2.0
            return mid



def  __lowerCamelCase       (      _UpperCamelCase  :  float					):


      '''simple docstring'''


      return x**3 - 2 * x - 5


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

      import doctest

      doctest.testmod()





