


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__   (       lowerCAmelCase   ,							lowerCAmelCase):
     SCREAMING_SNAKE_CASE__      			=			'''focalnet'''





     def __init__(self		,     UpperCAmelCase=2_2_4		,     UpperCAmelCase=4		,     UpperCAmelCase=3		,     UpperCAmelCase=9_6		,     UpperCAmelCase=False		,     UpperCAmelCase=[1_9_2, 3_8_4, 7_6_8, 7_6_8]		,     UpperCAmelCase=[2, 2, 6, 2]		,     UpperCAmelCase=[2, 2, 2, 2]		,     UpperCAmelCase=[3, 3, 3, 3]		,     UpperCAmelCase="gelu"		,     UpperCAmelCase=4.0		,     UpperCAmelCase=0.0		,     UpperCAmelCase=0.1		,     UpperCAmelCase=False		,     UpperCAmelCase=1e-4		,     UpperCAmelCase=False		,     UpperCAmelCase=False		,     UpperCAmelCase=False		,     UpperCAmelCase=0.02		,     UpperCAmelCase=1e-5		,     UpperCAmelCase=3_2		,     UpperCAmelCase=None		,     UpperCAmelCase=None		,     **UpperCAmelCase		,     )     ->   Dict:
      super().__init__(**UpperCAmelCase       )

      _lowercase							      =image_size
      _lowercase							      =patch_size
      _lowercase							      =num_channels
      _lowercase							      =embed_dim
      _lowercase							      =use_conv_embed
      _lowercase							      =hidden_sizes
      _lowercase							      =depths
      _lowercase							      =focal_levels
      _lowercase							      =focal_windows
      _lowercase							      =hidden_act
      _lowercase							      =mlp_ratio
      _lowercase							      =hidden_dropout_prob
      _lowercase							      =drop_path_rate
      _lowercase							      =use_layerscale
      _lowercase							      =layerscale_value
      _lowercase							      =use_post_layernorm
      _lowercase							      =use_post_layernorm_in_modulation
      _lowercase							      =normalize_modulator
      _lowercase							      =initializer_range
      _lowercase							      =layer_norm_eps
      _lowercase							      =encoder_stride
      _lowercase							      =['''stem'''] + [f"stage{idx}" for idx in range(1		,     len(self.depths       ) + 1       )]
      _lowercase      ,    _lowercase							      =get_aligned_output_features_output_indices(
          out_features=UpperCAmelCase		,     out_indices=UpperCAmelCase		,     stage_names=self.stage_names       )





"""simple docstring"""
# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


SCREAMING_SNAKE_CASE :    Union[str, Any]									=				subprocess.check_output("""git merge-base main HEAD""".split()).decode("""utf-8""")
SCREAMING_SNAKE_CASE :    Any									=				subprocess.check_output(F'git diff --name-only {fork_point_sha}'.split()).decode("""utf-8""").split()

SCREAMING_SNAKE_CASE :    Union[str, Any]									=				"""|""".join(sys.argv[1:])
SCREAMING_SNAKE_CASE :    int									=				re.compile(rF'^({joined_dirs}).*?\.py$')

SCREAMING_SNAKE_CASE :    str									=				[x for x in modified_files if regex.match(x)]
print(""" """.join(relevant_modified_files), end="""""")





