
from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A     =  logging.get_logger(__name__)

_A     =  {
    "snap-research/efficientformer-l1-300": (
        "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json"
    ),
}





class 			_lowerCAmelCase      (			__a ):
				_lowercase    	='''efficientformer'''




				def __init__(      self       ,       _UpperCamelCase = [3, 2, 6, 4]       ,       _UpperCamelCase = [48, 96, 224, 448]       ,       _UpperCamelCase = [True, True, True, True]       ,       _UpperCamelCase = 448       ,       _UpperCamelCase = 32       ,       _UpperCamelCase = 4       ,       _UpperCamelCase = 7       ,       _UpperCamelCase = 5       ,       _UpperCamelCase = 8       ,       _UpperCamelCase = 4       ,       _UpperCamelCase = 0.0       ,       _UpperCamelCase = 16       ,       _UpperCamelCase = 3       ,       _UpperCamelCase = 3       ,       _UpperCamelCase = 3       ,       _UpperCamelCase = 2       ,       _UpperCamelCase = 1       ,       _UpperCamelCase = 0.0       ,       _UpperCamelCase = 1       ,       _UpperCamelCase = True       ,       _UpperCamelCase = True       ,       _UpperCamelCase = 1e-5       ,       _UpperCamelCase = "gelu"       ,       _UpperCamelCase = 0.02       ,       _UpperCamelCase = 1e-1_2       ,       _UpperCamelCase = 224       ,       _UpperCamelCase = 1e-0_5       ,       **_UpperCamelCase       ,       )       ->   Optional[int]:
							super().__init__(**__lowerCAmelCase  )

							lowerCAmelCase_      			=			hidden_act
							lowerCAmelCase_      			=			hidden_dropout_prob
							lowerCAmelCase_      			=			hidden_sizes
							lowerCAmelCase_      			=			num_hidden_layers
							lowerCAmelCase_      			=			num_attention_heads
							lowerCAmelCase_      			=			initializer_range
							lowerCAmelCase_      			=			layer_norm_eps
							lowerCAmelCase_      			=			patch_size
							lowerCAmelCase_      			=			num_channels
							lowerCAmelCase_      			=			depths
							lowerCAmelCase_      			=			mlp_expansion_ratio
							lowerCAmelCase_      			=			downsamples
							lowerCAmelCase_      			=			dim
							lowerCAmelCase_      			=			key_dim
							lowerCAmelCase_      			=			attention_ratio
							lowerCAmelCase_      			=			resolution
							lowerCAmelCase_      			=			pool_size
							lowerCAmelCase_      			=			downsample_patch_size
							lowerCAmelCase_      			=			downsample_stride
							lowerCAmelCase_      			=			downsample_pad
							lowerCAmelCase_      			=			drop_path_rate
							lowerCAmelCase_      			=			num_metaad_blocks
							lowerCAmelCase_      			=			distillation
							lowerCAmelCase_      			=			use_layer_scale
							lowerCAmelCase_      			=			layer_scale_init_value
							lowerCAmelCase_      			=			image_size
							lowerCAmelCase_      			=			batch_norm_eps





def      lowerCamelCase__       (       __lowerCAmelCase						:						list[list[int]]					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						set       ):




			"""simple docstring"""


			lowerCAmelCase_			,						lowerCAmelCase_      			=			len(__lowerCAmelCase       ), len(grid[0]       )
			if (
			    min(__lowerCAmelCase					,							__lowerCAmelCase       ) < 0
			    or row == row_length
			    or col == col_length
			    or (row, col) in visit
			    or grid[row][col] == 1
			):
						return 0
			if row == row_length - 1 and col == col_length - 1:
						return 1

			visit.add((row, col)       )

			lowerCAmelCase_      			=			0
			count += depth_first_search(__lowerCAmelCase					,							row + 1					,							__lowerCAmelCase					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							row - 1					,							__lowerCAmelCase					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							__lowerCAmelCase					,							col + 1					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							__lowerCAmelCase					,							col - 1					,							__lowerCAmelCase       )

			visit.remove((row, col)       )
			return count


if __name__ == "__main__":
			import doctest

			doctest.testmod()



