




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


lowerCamelCase__					:  List[str]      							=				logging.get_logger(__name__)

lowerCamelCase__					:  List[str]      							=				{
    '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 			lowerCamelCase_				( _SCREAMING_SNAKE_CASE			,  _SCREAMING_SNAKE_CASE   ):


 '''simple docstring'''







 lowercase_							       =       "nat"

 lowercase_							       =       {
     "num_attention_heads": "num_heads",
     "num_hidden_layers": "num_layers",
 }



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

       SCREAMING_SNAKE_CASE_      		=     patch_size
       SCREAMING_SNAKE_CASE_      		=     num_channels
       SCREAMING_SNAKE_CASE_      		=     embed_dim
       SCREAMING_SNAKE_CASE_      		=     depths
       SCREAMING_SNAKE_CASE_      		=     len(_lowerCAmelCase		)
       SCREAMING_SNAKE_CASE_      		=     num_heads
       SCREAMING_SNAKE_CASE_      		=     kernel_size
       SCREAMING_SNAKE_CASE_      		=     mlp_ratio
       SCREAMING_SNAKE_CASE_      		=     qkv_bias
       SCREAMING_SNAKE_CASE_      		=     hidden_dropout_prob
       SCREAMING_SNAKE_CASE_      		=     attention_probs_dropout_prob
       SCREAMING_SNAKE_CASE_      		=     drop_path_rate
       SCREAMING_SNAKE_CASE_      		=     hidden_act
       SCREAMING_SNAKE_CASE_      		=     layer_norm_eps
       SCREAMING_SNAKE_CASE_      		=     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
       SCREAMING_SNAKE_CASE_      		=     int(embed_dim * 2 ** (len(_lowerCAmelCase		) - 1)		)
       SCREAMING_SNAKE_CASE_      		=     layer_scale_init_value
       SCREAMING_SNAKE_CASE_      		=     ['stem'] + [F"stage{idx}" for idx in range(1							,							len(_lowerCAmelCase		) + 1		)]
       SCREAMING_SNAKE_CASE_		,					SCREAMING_SNAKE_CASE_      		=     get_aligned_output_features_output_indices(
           out_features=_lowerCAmelCase							,							out_indices=_lowerCAmelCase							,							stage_names=self.stage_names		)





def    UpperCAmelCase_				( __UpperCAmelCase		:      int				)   ->					int:
      assert isinstance(__UpperCAmelCase     ,     __UpperCAmelCase				), f"The input value of [n={number}] is not an integer"

      if number == 1:
            return 2
      elif number < 1:
            SCREAMING_SNAKE_CASE_      		=     f"The input value of [n={number}] has to be > 0"
            raise ValueError(__UpperCAmelCase				)
      else:
            SCREAMING_SNAKE_CASE_      		=     sylvester(number - 1				)
            SCREAMING_SNAKE_CASE_      		=     num - 1
            SCREAMING_SNAKE_CASE_      		=     num
            return lower * upper + 1


if __name__ == "__main__":
   print(f'''The 8th number in Sylvester\'s sequence: {sylvester(8)}''')