






from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCamelCase        =				logging.get_logger(__name__)

UpperCamelCase        =				{
    "facebook/deit-base-distilled-patch16-224": (
        "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json"
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}

class        lowerCAmelCase_				(      lowercase	):







				"""simple docstring"""




				_snake_case				:   List[Any]        =			"""deit"""







				def __init__( self     :Optional[Any]  ,     lowerCamelCase__     :List[str]=7_68  ,     lowerCamelCase__     :int=12  ,     lowerCamelCase__     :Any=12  ,     lowerCamelCase__     :Optional[Any]=30_72  ,     lowerCamelCase__     :Optional[Any]="gelu"  ,     lowerCamelCase__     :str=0.0  ,     lowerCamelCase__     :Tuple=0.0  ,     lowerCamelCase__     :int=0.02  ,     lowerCamelCase__     :Tuple=1e-12  ,     lowerCamelCase__     :Union[str, Any]=2_24  ,     lowerCamelCase__     :List[Any]=16  ,     lowerCamelCase__     :List[Any]=3  ,     lowerCamelCase__     :Optional[int]=True  ,     lowerCamelCase__     :str=16  ,     **lowerCamelCase__     :str  ,     ):
					super().__init__(**lowerCamelCase__     )

					UpperCamelCase__ :int						=      hidden_size
					UpperCamelCase__ :Dict						=      num_hidden_layers
					UpperCamelCase__ :Optional[int]						=      num_attention_heads
					UpperCamelCase__ :Optional[Any]						=      intermediate_size
					UpperCamelCase__ :Tuple						=      hidden_act
					UpperCamelCase__ :Dict						=      hidden_dropout_prob
					UpperCamelCase__ :List[str]						=      attention_probs_dropout_prob
					UpperCamelCase__ :str						=      initializer_range
					UpperCamelCase__ :int						=      layer_norm_eps
					UpperCamelCase__ :Any						=      image_size
					UpperCamelCase__ :int						=      patch_size
					UpperCamelCase__ :List[str]						=      num_channels
					UpperCamelCase__ :Any						=      qkv_bias
					UpperCamelCase__ :Tuple						=      encoder_stride

class        lowerCAmelCase_				(      lowercase	):







				"""simple docstring"""




				_snake_case				:   int        =			version.parse("""1.11"""	)







				@property
				def 				__a   ( self     :List[str]     ):
					return OrderedDict(
					    [
					        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
					    ]     )







				@property
				def 				__a   ( self     :Union[str, Any]     ):
					return 1e-4



"""simple docstring"""



from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader







class    __a						( __snake_case							):







				def __init__( self      ,	UpperCAmelCase      ,	UpperCAmelCase = None      ,	UpperCAmelCase = None      ,	UpperCAmelCase = True      ,	UpperCAmelCase = None      ,	UpperCAmelCase = False      ,	UpperCAmelCase = None      ,	UpperCAmelCase = True      ,	UpperCAmelCase = "arrow"      ,	**UpperCAmelCase      ,	):

					'''simple docstring'''






					super().__init__(
					    split=UpperCAmelCase      ,	features=UpperCAmelCase      ,	cache_dir=UpperCAmelCase      ,	keep_in_memory=UpperCAmelCase      ,	streaming=UpperCAmelCase      ,	**UpperCAmelCase      ,	)
					lowerCAmelCase_      							=			load_from_cache_file
					lowerCAmelCase_      							=			file_format
					lowerCAmelCase_      							=			Spark(
					    df=UpperCAmelCase      ,	features=UpperCAmelCase      ,	cache_dir=UpperCAmelCase      ,	working_dir=UpperCAmelCase      ,	**UpperCAmelCase      ,	)







				def      lowerCamelCase_     ( self   ):

					'''simple docstring'''






					if self.streaming:
						return self.builder.as_streaming_dataset(split=self.split   )
					lowerCAmelCase_      							=			None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
					self.builder.download_and_prepare(
					    download_mode=UpperCAmelCase      ,	file_format=self._file_format      ,	)
					return self.builder.as_dataset(split=self.split   )