


'''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__    					=      {
    'microsoft/focalnet-tiny': 'https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json',
}




class 			lowerCamelCase_   (	_UpperCamelCase     ,       _UpperCamelCase      ):
      lowerCAmelCase__		     =     'focalnet'






      def __init__(					self				:    List[Any]						,						_A				:    Optional[int]=224						,						_A				:    int=4						,						_A				:    Optional[int]=3						,						_A				:    Tuple=96						,						_A				:    Tuple=False						,						_A				:    List[str]=[192, 384, 768, 768]						,						_A				:    Any=[2, 2, 6, 2]						,						_A				:    Dict=[2, 2, 2, 2]						,						_A				:    Union[str, Any]=[3, 3, 3, 3]						,						_A				:    Dict="gelu"						,						_A				:    List[Any]=4.0						,						_A				:    Any=0.0						,						_A				:    Any=0.1						,						_A				:    Any=False						,						_A				:    Dict=1e-4						,						_A				:    Tuple=False						,						_A				:    Union[str, Any]=False						,						_A				:    Optional[int]=False						,						_A				:    Optional[int]=0.0_2						,						_A				:    Union[str, Any]=1e-5						,						_A				:    Union[str, Any]=32						,						_A				:    Union[str, Any]=None						,						_A				:    Dict=None						,						**_A				:    List[Any]						,						):


          '''simple docstring'''


          super().__init__(**lowerCAmelCase_ )

          UpperCAmelCase__			:		List[str]													=				image_size
          UpperCAmelCase__			:		List[Any]													=				patch_size
          UpperCAmelCase__			:		Union[str, Any]													=				num_channels
          UpperCAmelCase__			:		Any													=				embed_dim
          UpperCAmelCase__			:		Dict													=				use_conv_embed
          UpperCAmelCase__			:		Optional[int]													=				hidden_sizes
          UpperCAmelCase__			:		Union[str, Any]													=				depths
          UpperCAmelCase__			:		Optional[int]													=				focal_levels
          UpperCAmelCase__			:		str													=				focal_windows
          UpperCAmelCase__			:		Tuple													=				hidden_act
          UpperCAmelCase__			:		Dict													=				mlp_ratio
          UpperCAmelCase__			:		Optional[int]													=				hidden_dropout_prob
          UpperCAmelCase__			:		Dict													=				drop_path_rate
          UpperCAmelCase__			:		Any													=				use_layerscale
          UpperCAmelCase__			:		List[str]													=				layerscale_value
          UpperCAmelCase__			:		int													=				use_post_layernorm
          UpperCAmelCase__			:		Union[str, Any]													=				use_post_layernorm_in_modulation
          UpperCAmelCase__			:		int													=				normalize_modulator
          UpperCAmelCase__			:		List[str]													=				initializer_range
          UpperCAmelCase__			:		Union[str, Any]													=				layer_norm_eps
          UpperCAmelCase__			:		Dict													=				encoder_stride
          UpperCAmelCase__			:		Union[str, Any]													=				['''stem'''] + [f"""stage{idx}""" for idx in range(1						,						len(self.depths ) + 1 )]
          UpperCAmelCase__						,						UpperCAmelCase__			:		Tuple													=				get_aligned_output_features_output_indices(
              out_features=lowerCAmelCase_						,						out_indices=lowerCAmelCase_						,						stage_names=self.stage_names )







def   a_    ( lowerCAmelCase_      :			int	):
   if number < 0:
      raise ValueError('number must not be negative'	)
   return number & (number - 1) == 0


if __name__ == "__main__":
     import doctest

     doctest.testmod()

