


"""simple docstring"""




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


lowercase_			     =  logging.get_logger(__name__)

lowercase_			     =  {
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}
class 					__lowerCAmelCase					(   __SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		__UpperCAmelCase		:			Optional[int]										=				'focalnet'

		def __init__(  self							, _a=224							, _a=4							, _a=3							, _a=96							, _a=False							, _a=[192, 384, 768, 768]							, _a=[2, 2, 6, 2]							, _a=[2, 2, 2, 2]							, _a=[3, 3, 3, 3]							, _a="gelu"							, _a=4.0							, _a=0.0							, _a=0.1							, _a=False							, _a=1E-4							, _a=False							, _a=False							, _a=False							, _a=0.02							, _a=1E-5							, _a=32							, _a=None							, _a=None							, **_a							, ):
				super().__init__(**_a      )

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










"""simple docstring"""




def        lowercase							(		lowerCAmelCase__ :     list			) ->      bool:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		if len(lowerCAmelCase__			) == 1:
				return True
		__a           =			series[1] - series[0]
		for index in range(len(lowerCAmelCase__			) - 1			):
				if series[index + 1] - series[index] != common_diff:
						return False
		return True

def        lowercase							(		lowerCAmelCase__ :     list			) ->      float:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		__a           =			0
		for val in series:
				answer += val
		return answer / len(lowerCAmelCase__			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






