

'''simple docstring'''
import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey







class 							A__    :





  def __init__(		self      :	Tuple							,					_a      :	Any							,					_a      :	int							,					_a      :	int )	->    List[str]:





       '''simple docstring'''






       if dst_width < 0 or dst_height < 0:
            raise ValueError('Destination width/height should be > 0' )

       _SCREAMING_SNAKE_CASE							    =img
       _SCREAMING_SNAKE_CASE							    =img.shape[1]
       _SCREAMING_SNAKE_CASE							    =img.shape[0]
       _SCREAMING_SNAKE_CASE							    =dst_width
       _SCREAMING_SNAKE_CASE							    =dst_height

       _SCREAMING_SNAKE_CASE							    =self.src_w / self.dst_w
       _SCREAMING_SNAKE_CASE							    =self.src_h / self.dst_h

       _SCREAMING_SNAKE_CASE							    =_SCREAMING_SNAKE_CASE							    =(
           np.ones((self.dst_h, self.dst_w, 3)							,					np.uinta ) * 255
       )





  def 						A  (		self      :	Any )	->    Tuple:





       '''simple docstring'''






       for i in range(self.dst_h ):
            for j in range(self.dst_w ):
                 _SCREAMING_SNAKE_CASE							    =self.img[self.get_y(_a )][self.get_x(_a )]





  def 						A  (		self      :	int							,					_a      :	int )	->    int:





       '''simple docstring'''






       return int(self.ratio_x * x )





  def 						A  (		self      :	Dict							,					_a      :	int )	->    int:





       '''simple docstring'''






       return int(self.ratio_y * y )


if __name__ == "__main__":
     lowerCamelCase ,    lowerCamelCase :      Optional[Any]					 =     8_0_0, 6_0_0
     lowerCamelCase :      str					 =     imread("image_data/lena.jpg", 1)
     lowerCamelCase :      Optional[int]					 =     NearestNeighbour(im, dst_w, dst_h)
     n.process()

     imshow(
         f'''Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}''', n.output
     )
     waitKey(0)
     destroyAllWindows()


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





