'''simple docstring'''


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


snake_case__	:     Tuple      =    logging.get_logger(__name__)

snake_case__	:     Dict      =    {
    '''uw-madison/nystromformer-512''': '''https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json''',
    # See all Nystromformer models at https://huggingface.co/models?filter=nystromformer
}






class 	__SCREAMING_SNAKE_CASE		(			lowerCamelCase_			):







  '''simple docstring'''






  lowerCamelCase_						:str		       =						'''nystromformer'''


  def __init__(					self ,						snake_case_=3_0_0_0_0 ,						snake_case_=7_6_8 ,						snake_case_=1_2 ,						snake_case_=1_2 ,						snake_case_=3_0_7_2 ,						snake_case_="gelu_new" ,						snake_case_=0.1 ,						snake_case_=0.1 ,						snake_case_=5_1_0 ,						snake_case_=2 ,						snake_case_=6_4 ,						snake_case_=6_4 ,						snake_case_=6_5 ,						snake_case_=False ,						snake_case_=0.02 ,						snake_case_=1E-5 ,						snake_case_=1 ,						snake_case_=0 ,						snake_case_=2 ,						**snake_case_ ,						):




       '''simple docstring'''

       UpperCAmelCase_				:  Any  = vocab_size
       UpperCAmelCase_				:  Dict  = max_position_embeddings
       UpperCAmelCase_				:  Union[str, Any]  = hidden_size
       UpperCAmelCase_				:  Tuple  = num_hidden_layers
       UpperCAmelCase_				:  Union[str, Any]  = num_attention_heads
       UpperCAmelCase_				:  List[str]  = intermediate_size
       UpperCAmelCase_				:  List[Any]  = hidden_act
       UpperCAmelCase_				:  int  = hidden_dropout_prob
       UpperCAmelCase_				:  Any  = attention_probs_dropout_prob
       UpperCAmelCase_				:  Tuple  = initializer_range
       UpperCAmelCase_				:  int  = type_vocab_size
       UpperCAmelCase_				:  Optional[int]  = segment_means_seq_len
       UpperCAmelCase_				:  List[str]  = num_landmarks
       UpperCAmelCase_				:  List[Any]  = conv_kernel_size
       UpperCAmelCase_				:  List[str]  = inv_coeff_init_option
       UpperCAmelCase_				:  Optional[Any]  = layer_norm_eps
       super().__init__(pad_token_id=snake_case_ ,						bos_token_id=snake_case_ ,						eos_token_id=snake_case_ ,						**snake_case_		)







'''simple docstring'''


def    _lowerCamelCase       ( lowerCamelCase_   :				list  ):



     """simple docstring"""





     UpperCAmelCase_				:  Optional[int]  = len(lowerCamelCase_  )

     # Set the gap value to be decreased by a factor of 1.3
     # after each iteration
     UpperCAmelCase_				:  Optional[Any]  = 1.3

     # Continue sorting until the gap is 1
     while gap > 1:
          # Decrease the gap value
          UpperCAmelCase_				:  Optional[Any]  = int(gap / shrink  )

          # Sort the elements using insertion sort
          for i in range(lowerCamelCase_      ,	len(lowerCamelCase_  )  ):
               UpperCAmelCase_				:  Optional[int]  = collection[i]
               UpperCAmelCase_				:  Tuple  = i
               while j >= gap and collection[j - gap] > temp:
                    UpperCAmelCase_				:  Tuple  = collection[j - gap]
                    j -= gap
               UpperCAmelCase_				:  Optional[int]  = temp

     return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()






