





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


A__:    Tuple  	=	logging.get_logger(__name__)

A__:    Tuple  	=	{
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}




class        _a    (    UpperCamelCase__						,			UpperCamelCase__):

      """simple docstring"""


      UpperCamelCase__  		=       """focalnet"""






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


          super().__init__(**__lowerCamelCase					)

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








def 				lowerCAmelCase_ (							A_):
    if not all(char in "01" for char in bin_string):
        raise ValueError("Non-binary value was passed to the function")
    if not bin_string:
        raise ValueError("Empty string was passed to the function")
    UpperCamelCase__:	List[Any]					=     ""
    while len(A_) % 3 != 0:
        UpperCamelCase__:	int					=     "0" + bin_string
    UpperCamelCase__:	Optional[int]					=     [
        bin_string[index : index + 3]
        for index in range(len(A_))
        if index % 3 == 0
    ]
    for bin_group in bin_string_in_3_list:
        UpperCamelCase__:	Union[str, Any]					=     0
        for index, val in enumerate(A_):
            oct_val += int(2 ** (2 - index) * int(A_))
        oct_string += str(A_)
    return oct_string


if __name__ == "__main__":
   from doctest import testmod

   testmod()

