

from collections import OrderedDict
from typing import List, Mapping

from packaging import version

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


_SCREAMING_SNAKE_CASE    :      Tuple          =			logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE    :      List[str]          =			{
    'google/efficientnet-b7': 'https://huggingface.co/google/efficientnet-b7/resolve/main/config.json',
}







class  UpperCamelCase__		(    SCREAMING_SNAKE_CASE_   ):







	'''simple docstring'''
	_lowerCAmelCase							       =				"efficientnet"





	def __init__(			self				,       UpperCamelCase__ = 3				,       UpperCamelCase__ = 600				,       UpperCamelCase__ = 2.0				,       UpperCamelCase__ = 3.1				,       UpperCamelCase__ = 8				,       UpperCamelCase__ = [3, 3, 5, 3, 5, 5, 3]				,       UpperCamelCase__ = [32, 16, 24, 40, 80, 112, 192]				,       UpperCamelCase__ = [16, 24, 40, 80, 112, 192, 320]				,       UpperCamelCase__ = []				,       UpperCamelCase__ = [1, 2, 2, 2, 1, 2, 1]				,       UpperCamelCase__ = [1, 2, 2, 3, 3, 4, 1]				,       UpperCamelCase__ = [1, 6, 6, 6, 6, 6, 6]				,       UpperCamelCase__ = 0.2_5				,       UpperCamelCase__ = "swish"				,       UpperCamelCase__ = 2560				,       UpperCamelCase__ = "mean"				,       UpperCamelCase__ = 0.0_2				,       UpperCamelCase__ = 0.0_0_1				,       UpperCamelCase__ = 0.9_9				,       UpperCamelCase__ = 0.5				,       UpperCamelCase__ = 0.2				,       **UpperCamelCase__				,       ):
					super().__init__(**UpperCamelCase__		)

					A__  :	Optional[Any]         =							num_channels
					A__  :	str         =							image_size
					A__  :	int         =							width_coefficient
					A__  :	Optional[int]         =							depth_coefficient
					A__  :	str         =							depth_divisor
					A__  :	Tuple         =							kernel_sizes
					A__  :	List[str]         =							in_channels
					A__  :	List[Any]         =							out_channels
					A__  :	Optional[Any]         =							depthwise_padding
					A__  :	Union[str, Any]         =							strides
					A__  :	Optional[int]         =							num_block_repeats
					A__  :	Any         =							expand_ratios
					A__  :	Optional[Any]         =							squeeze_expansion_ratio
					A__  :	Optional[Any]         =							hidden_act
					A__  :	Union[str, Any]         =							hidden_dim
					A__  :	Any         =							pooling_type
					A__  :	Union[str, Any]         =							initializer_range
					A__  :	Tuple         =							batch_norm_eps
					A__  :	Union[str, Any]         =							batch_norm_momentum
					A__  :	Union[str, Any]         =							dropout_rate
					A__  :	Dict         =							drop_connect_rate
					A__  :	Tuple         =							sum(UpperCamelCase__		) * 4







class  UpperCamelCase__		(    SCREAMING_SNAKE_CASE_   ):







	'''simple docstring'''
	_lowerCAmelCase							       =				version.parse("1.11"   )





	@property
	def   __snake_case				(			self		):
					return OrderedDict(
					    [
					        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
					    ]		)





	@property
	def   __snake_case				(			self		):
					return 1e-5

import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format







class  UpperCamelCase__		:







	'''simple docstring'''
	_lowerCAmelCase							       =				None





	def   __snake_case				(			self		):
					A__  :	Dict         =							self.feature_extraction_class(**self.feat_extract_dict		)
					A__  :	Tuple         =							json.loads(feat_extract.to_json_string()		)
					for key, value in self.feat_extract_dict.items():
									self.assertEqual(obj[key]				,       UpperCamelCase__		)





	def   __snake_case				(			self		):
					A__  :	Any         =							self.feature_extraction_class(**self.feat_extract_dict		)

					with tempfile.TemporaryDirectory() as tmpdirname:
									A__  :	Any         =							os.path.join(UpperCamelCase__				,       '''feat_extract.json'''		)
									feat_extract_first.to_json_file(UpperCamelCase__		)
									A__  :	Dict         =							self.feature_extraction_class.from_json_file(UpperCamelCase__		)

					self.assertEqual(feat_extract_second.to_dict()				,       feat_extract_first.to_dict()		)





	def   __snake_case				(			self		):
					A__  :	Any         =							self.feature_extraction_class(**self.feat_extract_dict		)

					with tempfile.TemporaryDirectory() as tmpdirname:
									A__  :	Any         =							feat_extract_first.save_pretrained(UpperCamelCase__		)[0]
									check_json_file_has_correct_format(UpperCamelCase__		)
									A__  :	Optional[int]         =							self.feature_extraction_class.from_pretrained(UpperCamelCase__		)

					self.assertEqual(feat_extract_second.to_dict()				,       feat_extract_first.to_dict()		)





	def   __snake_case				(			self		):
					A__  :	str         =							self.feature_extraction_class()
					self.assertIsNotNone(UpperCamelCase__		)