


from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset
class 	lowerCamelCase_       (				lowerCAmelCase__				):



					'''simple docstring'''







					def A      (				self						)   ->			List[str]:







								'''simple docstring'''

								return [
								    {"col_1": 3, "col_2": "a"},
								    {"col_1": 2, "col_2": "b"},
								    {"col_1": 1, "col_2": "c"},
								    {"col_1": 0, "col_2": "d"},
								]






					def A      (				self						)   ->			Tuple:







								'''simple docstring'''

								__lowercase 					=   {'''col_1''': [3, 2, 1, 0], '''col_2''': ['''a''', '''b''', '''c''', '''d''']}
								return Dataset.from_dict(snake_case_						)






					def A      (				self						)   ->			Any:







								'''simple docstring'''

								__lowercase 					=   self._create_example_records()
								__lowercase 					=   Dataset.from_list(snake_case_						)
								self.assertListEqual(dset.column_names ,       ['''col_1''', '''col_2''']						)
								for i, r in enumerate(snake_case_						):
											self.assertDictEqual(snake_case_ ,       example_records[i]						)






					def A      (				self						)   ->			Tuple:







								'''simple docstring'''

								__lowercase 					=   self._create_example_records()
								__lowercase 					=   Dataset.from_list(snake_case_						)
								__lowercase 					=   Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]}						)
								self.assertEqual(dset.info ,       dset_from_dict.info						)






					def A      (				self						)   ->			Optional[int]:  # checks what happens with missing columns







								'''simple docstring'''

								__lowercase 					=   [{'''col_1''': 1}, {'''col_2''': '''x'''}]
								__lowercase 					=   Dataset.from_list(snake_case_						)
								self.assertDictEqual(dset[0] ,       {'''col_1''': 1}						)
								self.assertDictEqual(dset[1] ,       {'''col_1''': None}						)  # NB: first record is used for columns






					def A      (				self						)   ->			str:  # checks if the type can be inferred from the second record







								'''simple docstring'''

								__lowercase 					=   [{'''col_1''': []}, {'''col_1''': [1, 2]}]
								__lowercase 					=   Dataset.from_list(snake_case_						)
								self.assertEqual(dset.info.features['''col_1'''] ,       Sequence(Value('''int64'''						)						)						)






					def A      (				self						)   ->			Union[str, Any]:







								'''simple docstring'''

								__lowercase 					=   Dataset.from_list([]						)
								self.assertEqual(len(snake_case_						) ,       0						)
								self.assertListEqual(dset.column_names ,       []						)






from typing import List

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


a : Any		=				logging.get_logger(__name__)

a : int		=				{
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}
class 	lowerCamelCase_       (				lowerCAmelCase__				):



					'''simple docstring'''







					__UpperCAmelCase            =				"efficientformer"






					def __init__(				self ,       snake_case_ = [3, 2, 6, 4] ,       snake_case_ = [4_8, 9_6, 2_2_4, 4_4_8] ,       snake_case_ = [True, True, True, True] ,       snake_case_ = 4_4_8 ,       snake_case_ = 3_2 ,       snake_case_ = 4 ,       snake_case_ = 7 ,       snake_case_ = 5 ,       snake_case_ = 8 ,       snake_case_ = 4 ,       snake_case_ = 0.0 ,       snake_case_ = 1_6 ,       snake_case_ = 3 ,       snake_case_ = 3 ,       snake_case_ = 3 ,       snake_case_ = 2 ,       snake_case_ = 1 ,       snake_case_ = 0.0 ,       snake_case_ = 1 ,       snake_case_ = True ,       snake_case_ = True ,       snake_case_ = 1e-5 ,       snake_case_ = "gelu" ,       snake_case_ = 0.0_2 ,       snake_case_ = 1e-1_2 ,       snake_case_ = 2_2_4 ,       snake_case_ = 1e-0_5 ,       **snake_case_ ,       )   ->			None:







								'''simple docstring'''

								super().__init__(**snake_case_						)

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


