

'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCamelCase_    						=       logging.get_logger(__name__)

UpperCamelCase_    						=       {
    """shi-labs/nat-mini-in1k-224""": """https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json""",
    # See all Nat models at https://huggingface.co/models?filter=nat
}





class 		__SCREAMING_SNAKE_CASE							(			lowercase__						,							lowercase__      ):
				lowerCamelCase_		       =    'nat'

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







				def __init__(       self     :		Any		,					UpperCAmelCase__     :		Union[str, Any]=4		,					UpperCAmelCase__     :		Optional[Any]=3		,					UpperCAmelCase__     :		Optional[int]=64		,					UpperCAmelCase__     :		int=[3, 4, 6, 5]		,					UpperCAmelCase__     :		Optional[int]=[2, 4, 8, 16]		,					UpperCAmelCase__     :		Dict=7		,					UpperCAmelCase__     :		Optional[Any]=3.0		,					UpperCAmelCase__     :		Optional[Any]=True		,					UpperCAmelCase__     :		Optional[int]=0.0		,					UpperCAmelCase__     :		Dict=0.0		,					UpperCAmelCase__     :		List[str]=0.1		,					UpperCAmelCase__     :		int="gelu"		,					UpperCAmelCase__     :		List[str]=0.02		,					UpperCAmelCase__     :		Union[str, Any]=1E-5		,					UpperCAmelCase__     :		List[str]=0.0		,					UpperCAmelCase__     :		Union[str, Any]=None		,					UpperCAmelCase__     :		Any=None		,					**UpperCAmelCase__     :		List[Any]		,					):
										'''simple docstring'''
										super().__init__(**UpperCAmelCase__   )

										lowercase :							Any    		=patch_size
										lowercase :							Tuple    		=num_channels
										lowercase :							Tuple    		=embed_dim
										lowercase :							str    		=depths
										lowercase :							Optional[Any]    		=len(UpperCAmelCase__   )
										lowercase :							str    		=num_heads
										lowercase :							Optional[Any]    		=kernel_size
										lowercase :							List[str]    		=mlp_ratio
										lowercase :							Dict    		=qkv_bias
										lowercase :							List[Any]    		=hidden_dropout_prob
										lowercase :							Optional[Any]    		=attention_probs_dropout_prob
										lowercase :							Optional[int]    		=drop_path_rate
										lowercase :							List[str]    		=hidden_act
										lowercase :							List[str]    		=layer_norm_eps
										lowercase :							Optional[int]    		=initializer_range
										# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
										# this indicates the channel dimension after the last stage of the model
										lowercase :							Union[str, Any]    		=int(embed_dim * 2 ** (len(UpperCAmelCase__   ) - 1)   )
										lowercase :							int    		=layer_scale_init_value
										lowercase :							Union[str, Any]    		=['''stem'''] + [F'''stage{idx}''' for idx in range(1		,					len(UpperCAmelCase__   ) + 1   )]
										lowercase		,	lowercase :							str    		=get_aligned_output_features_output_indices(
										    out_features=UpperCAmelCase__		,					out_indices=UpperCAmelCase__		,					stage_names=self.stage_names   )










'''simple docstring'''





# Algorithm for the pigeonhole sorting



def 			a_	(				_lowerCAmelCase			) -> List[str]:
  __lowerCamelCase			:			int       			=					min(_lowerCAmelCase			)  # min() finds the minimum value
  __lowerCamelCase			:			List[Any]       			=					max(_lowerCAmelCase			)  # max() finds the maximum value

  __lowerCamelCase			:			List[Any]       			=					max_val - min_val + 1  # size is difference of max and min values plus one

  # list of pigeonholes of size equal to the variable size
  __lowerCamelCase			:			List[Any]       			=					[0] * size

  # Populate the pigeonholes.
  for x in a:
    assert isinstance(_lowerCAmelCase			,_lowerCAmelCase			), "integers only please"
    holes[x - min_val] += 1

  # Putting the elements back into the array in an order.
  __lowerCamelCase			:			Tuple       			=					0
  for count in range(_lowerCAmelCase			):
    while holes[count] > 0:
      holes[count] -= 1
      __lowerCamelCase			:			List[Any]       			=					count + min_val
      i += 1

def 			a_	(				) -> str:
  __lowerCamelCase			:			Optional[Any]       			=					[8, 3, 2, 7, 4, 6, 8]
  pigeonhole_sort(_lowerCAmelCase			)
  print('Sorted order is:'			,' '.join(_lowerCAmelCase			)			)


if __name__ == "__main__":
   main()






