


'''simple docstring'''
from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class    lowercase	(							A__					):

		"""simple docstring"""

		def __init__(		self    ,   UpperCamelCase_    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = False    ,   UpperCamelCase_ = False    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = None    ,   **UpperCamelCase_    ,   ):

							'''simple docstring'''


							super().__init__(
							    features=UpperCamelCase_    ,   cache_dir=UpperCamelCase_    ,   keep_in_memory=UpperCamelCase_    ,   streaming=UpperCamelCase_    ,   num_proc=UpperCamelCase_    ,   **UpperCamelCase_    ,   )
							UpperCamelCase__   :Any												= Generator(
							    cache_dir=UpperCamelCase_    ,   features=UpperCamelCase_    ,   generator=UpperCamelCase_    ,   gen_kwargs=UpperCamelCase_    ,   **UpperCamelCase_    ,   )




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


							if self.streaming:
												UpperCamelCase__   :Optional[Any]												= self.builder.as_streaming_dataset(split='''train'''							)
							# Build regular (map-style) dataset
							else:
												UpperCamelCase__   :Optional[int]												= None
												UpperCamelCase__   :int												= None
												UpperCamelCase__   :Any												= None
												UpperCamelCase__   :Any												= None

												self.builder.download_and_prepare(
												    download_config=UpperCamelCase_    ,   download_mode=UpperCamelCase_    ,   verification_mode=UpperCamelCase_    ,   base_path=UpperCamelCase_    ,   num_proc=self.num_proc    ,   )
												UpperCamelCase__   :List[Any]												= self.builder.as_dataset(
												    split='''train'''    ,   verification_mode=UpperCamelCase_    ,   in_memory=self.keep_in_memory							)
							return dataset
"""simple docstring"""






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     UpperCAmelCase						(_UpperCAmelCase  ):



    """simple docstring"""

    _UpperCAmelCase	:Optional[Any]						    = "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    ,			):
       super().__init__(**_UpperCAmelCase							)

       lowercase__:   List[str]					=      hidden_act
       lowercase__:   Union[str, Any]					=      hidden_dropout_prob
       lowercase__:   Union[str, Any]					=      hidden_sizes
       lowercase__:   Any					=      num_hidden_layers
       lowercase__:   int					=      num_attention_heads
       lowercase__:   Dict					=      initializer_range
       lowercase__:   Optional[int]					=      layer_norm_eps
       lowercase__:   int					=      patch_size
       lowercase__:   int					=      num_channels
       lowercase__:   str					=      depths
       lowercase__:   List[str]					=      mlp_expansion_ratio
       lowercase__:   List[str]					=      downsamples
       lowercase__:   List[str]					=      dim
       lowercase__:   Optional[Any]					=      key_dim
       lowercase__:   Union[str, Any]					=      attention_ratio
       lowercase__:   Any					=      resolution
       lowercase__:   Any					=      pool_size
       lowercase__:   List[Any]					=      downsample_patch_size
       lowercase__:   Optional[int]					=      downsample_stride
       lowercase__:   Union[str, Any]					=      downsample_pad
       lowercase__:   List[Any]					=      drop_path_rate
       lowercase__:   Optional[Any]					=      num_metaad_blocks
       lowercase__:   Any					=      distillation
       lowercase__:   Optional[int]					=      use_layer_scale
       lowercase__:   List[str]					=      layer_scale_init_value
       lowercase__:   Dict					=      image_size
       lowercase__:   List[str]					=      batch_norm_eps
