




from typing import List

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


__a          =			logging.get_logger(__name__)

__a          =			{
    'snap-research/efficientformer-l1-300': (
        'https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'
    ),
}







class   __a(					__lowerCamelCase       ):






    """simple docstring"""





    lowerCAmelCase        =				'efficientformer'





    def __init__(				self       ,_SCREAMING_SNAKE_CASE = [3, 2, 6, 4]       ,_SCREAMING_SNAKE_CASE = [48, 96, 224, 448]       ,_SCREAMING_SNAKE_CASE = [True, True, True, True]       ,_SCREAMING_SNAKE_CASE = 448       ,_SCREAMING_SNAKE_CASE = 32       ,_SCREAMING_SNAKE_CASE = 4       ,_SCREAMING_SNAKE_CASE = 7       ,_SCREAMING_SNAKE_CASE = 5       ,_SCREAMING_SNAKE_CASE = 8       ,_SCREAMING_SNAKE_CASE = 4       ,_SCREAMING_SNAKE_CASE = 0.0       ,_SCREAMING_SNAKE_CASE = 16       ,_SCREAMING_SNAKE_CASE = 3       ,_SCREAMING_SNAKE_CASE = 3       ,_SCREAMING_SNAKE_CASE = 3       ,_SCREAMING_SNAKE_CASE = 2       ,_SCREAMING_SNAKE_CASE = 1       ,_SCREAMING_SNAKE_CASE = 0.0       ,_SCREAMING_SNAKE_CASE = 1       ,_SCREAMING_SNAKE_CASE = True       ,_SCREAMING_SNAKE_CASE = True       ,_SCREAMING_SNAKE_CASE = 1e-5       ,_SCREAMING_SNAKE_CASE = "gelu"       ,_SCREAMING_SNAKE_CASE = 0.02       ,_SCREAMING_SNAKE_CASE = 1e-12       ,_SCREAMING_SNAKE_CASE = 224       ,_SCREAMING_SNAKE_CASE = 1e-05       ,**_SCREAMING_SNAKE_CASE       ,)			->		Any:
         super().__init__(**UpperCamelCase_  )

         UpperCAmelCase_      :							Optional[int]       =      hidden_act
         UpperCAmelCase_      :							str       =      hidden_dropout_prob
         UpperCAmelCase_      :							Optional[int]       =      hidden_sizes
         UpperCAmelCase_      :							Optional[int]       =      num_hidden_layers
         UpperCAmelCase_      :							Any       =      num_attention_heads
         UpperCAmelCase_      :							Optional[int]       =      initializer_range
         UpperCAmelCase_      :							str       =      layer_norm_eps
         UpperCAmelCase_      :							Optional[int]       =      patch_size
         UpperCAmelCase_      :							str       =      num_channels
         UpperCAmelCase_      :							Union[str, Any]       =      depths
         UpperCAmelCase_      :							Tuple       =      mlp_expansion_ratio
         UpperCAmelCase_      :							List[str]       =      downsamples
         UpperCAmelCase_      :							Tuple       =      dim
         UpperCAmelCase_      :							str       =      key_dim
         UpperCAmelCase_      :							int       =      attention_ratio
         UpperCAmelCase_      :							Optional[int]       =      resolution
         UpperCAmelCase_      :							Dict       =      pool_size
         UpperCAmelCase_      :							Any       =      downsample_patch_size
         UpperCAmelCase_      :							Optional[Any]       =      downsample_stride
         UpperCAmelCase_      :							str       =      downsample_pad
         UpperCAmelCase_      :							Dict       =      drop_path_rate
         UpperCAmelCase_      :							int       =      num_metaad_blocks
         UpperCAmelCase_      :							Union[str, Any]       =      distillation
         UpperCAmelCase_      :							int       =      use_layer_scale
         UpperCAmelCase_      :							Any       =      layer_scale_init_value
         UpperCAmelCase_      :							Any       =      image_size
         UpperCAmelCase_      :							Any       =      batch_norm_eps





def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2







def lowerCamelCase__       (      _lowercase			,						_lowercase=0				):

     '''simple docstring'''


     return sorted(_lowercase			,						key=lambda _lowercase				: x[column]				)







def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase=float('''inf'''				)				):

     '''simple docstring'''


     for i in range(points_counts - 1				):
          for j in range(i + 1			,						_lowercase				):
               UpperCAmelCase_      :							Optional[int]       =      euclidean_distance_sqr(points[i]			,						points[j]				)
               if current_dis < min_dis:
                    UpperCAmelCase_      :							Optional[Any]       =      current_dis
     return min_dis







def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase=float('''inf'''				)				):

     '''simple docstring'''


     for i in range(min(6			,						points_counts - 1				)			,						_lowercase				):
          for j in range(max(0			,						i - 6				)			,						_lowercase				):
               UpperCAmelCase_      :							List[str]       =      euclidean_distance_sqr(points[i]			,						points[j]				)
               if current_dis < min_dis:
                    UpperCAmelCase_      :							Optional[int]       =      current_dis
     return min_dis







def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     if points_counts <= 3:
          return dis_between_closest_pair(_lowercase			,						_lowercase				)

     # recursion
     UpperCAmelCase_      :							Optional[int]       =      points_counts // 2
     UpperCAmelCase_      :							List[Any]       =      closest_pair_of_points_sqr(
         _lowercase			,						points_sorted_on_y[:mid]			,						_lowercase				)
     UpperCAmelCase_      :							Dict       =      closest_pair_of_points_sqr(
         _lowercase			,						points_sorted_on_y[mid:]			,						points_counts - mid				)
     UpperCAmelCase_      :							Union[str, Any]       =      min(_lowercase			,						_lowercase				)
     UpperCAmelCase_      :							str       =      []
     for point in points_sorted_on_x:
          if abs(point[0] - points_sorted_on_x[mid][0]				) < closest_pair_dis:
               cross_strip.append(_lowercase				)

     UpperCAmelCase_      :							Optional[Any]       =      dis_between_closest_in_strip(
         _lowercase			,						len(_lowercase				)			,						_lowercase				)
     return min(_lowercase			,						_lowercase				)







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Tuple       =      column_based_sort(_lowercase			,						column=0				)
     UpperCAmelCase_      :							List[Any]       =      column_based_sort(_lowercase			,						column=1				)
     return (
         closest_pair_of_points_sqr(
             _lowercase			,						_lowercase			,						_lowercase				)
     ) ** 0.5


if __name__ == "__main__":
     __a          =			[(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
     print('Distance:', closest_pair_of_points(points, len(points)))