



"""simple docstring"""







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


UpperCamelCase     =							logging.get_logger(__name__)

UpperCamelCase     =							{
    """google/efficientnet-b7""": """https://huggingface.co/google/efficientnet-b7/resolve/main/config.json""",
}






class       UpperCamelCase__			(   _lowerCAmelCase      ):

			"""simple docstring"""


			A__	:					Any							  =     "efficientnet"


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

				A__											=					num_channels
				A__											=					image_size
				A__											=					width_coefficient
				A__											=					depth_coefficient
				A__											=					depth_divisor
				A__											=					kernel_sizes
				A__											=					in_channels
				A__											=					out_channels
				A__											=					depthwise_padding
				A__											=					strides
				A__											=					num_block_repeats
				A__											=					expand_ratios
				A__											=					squeeze_expansion_ratio
				A__											=					hidden_act
				A__											=					hidden_dim
				A__											=					pooling_type
				A__											=					initializer_range
				A__											=					batch_norm_eps
				A__											=					batch_norm_momentum
				A__											=					dropout_rate
				A__											=					drop_connect_rate
				A__											=					sum(SCREAMING_SNAKE_CASE__		) * 4






class       UpperCamelCase__			(   _lowerCAmelCase      ):

			"""simple docstring"""


			A__	:					Union[str, Any]							  =     version.parse("1.11"      )


			@property
			def   snake_case__	(      self		)      ->	Mapping[str, Mapping[int, str]]:
				return OrderedDict(
				    [
				        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
				    ]		)







			@property
			def   snake_case__	(      self		)      ->	float:
				return 1e-5









"""simple docstring"""







def       _lowerCamelCase				(							UpperCAmelCase_ :       bytes     )	-> str:






	"""simple docstring"""





	return "".join([hex(UpperCAmelCase_     )[2:].zfill(2     ).upper() for byte in list(UpperCAmelCase_     )]     )

def       _lowerCamelCase				(							UpperCAmelCase_ :       str     )	-> bytes:






	"""simple docstring"""





	if (len(UpperCAmelCase_     ) % 2) != 0:
		raise ValueError(
		    "Base16 encoded data is invalid:\nData does not have an even number of hex digits."     )
	# Check the character set - the standard base16 alphabet
	# is uppercase according to RFC3548 section 6
	if not set(UpperCAmelCase_     ) <= set("0123456789ABCDEF"     ):
		raise ValueError(
		    "Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters."     )
	# For every two hexadecimal digits (= a byte), turn it into an integer.
	# Then, string the result together into bytes, and return it.
	return bytes(int(data[i] + data[i + 1],	16     ) for i in range(0,	len(UpperCAmelCase_     ),	2     )     )


if __name__ == "__main__":
			import doctest

			doctest.testmod()




