




'''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


_snake_case : Optional[Any]  				=						logging.get_logger(__name__)

_snake_case : int  				=						{
    'google/efficientnet-b7': 'https://huggingface.co/google/efficientnet-b7/resolve/main/config.json',
}

class      A       (						_a       ):
							lowercase_							     =							'efficientnet'







							def __init__(    self			:    str				,     lowerCAmelCase_			:    int = 3				,     lowerCAmelCase_			:    int = 6_00				,     lowerCAmelCase_			:    float = 2.0				,     lowerCAmelCase_			:    float = 3.1				,     lowerCAmelCase_			:    int = 8				,     lowerCAmelCase_			:    List[int] = [3, 3, 5, 3, 5, 5, 3]				,     lowerCAmelCase_			:    List[int] = [32, 16, 24, 40, 80, 1_12, 1_92]				,     lowerCAmelCase_			:    List[int] = [16, 24, 40, 80, 1_12, 1_92, 3_20]				,     lowerCAmelCase_			:    List[int] = []				,     lowerCAmelCase_			:    List[int] = [1, 2, 2, 2, 1, 2, 1]				,     lowerCAmelCase_			:    List[int] = [1, 2, 2, 3, 3, 4, 1]				,     lowerCAmelCase_			:    List[int] = [1, 6, 6, 6, 6, 6, 6]				,     lowerCAmelCase_			:    float = 0.2_5				,     lowerCAmelCase_			:    str = "swish"				,     lowerCAmelCase_			:    int = 25_60				,     lowerCAmelCase_			:    str = "mean"				,     lowerCAmelCase_			:    float = 0.0_2				,     lowerCAmelCase_			:    float = 0.0_0_1				,     lowerCAmelCase_			:    float = 0.9_9				,     lowerCAmelCase_			:    float = 0.5				,     lowerCAmelCase_			:    float = 0.2				,     **lowerCAmelCase_			:    Optional[int]				,     )     ->				Optional[int]:


														"""simple docstring"""


														super().__init__(**lowerCAmelCase_   )

														_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(lowerCAmelCase_   ) * 4



class      A       (						_a       ):
							lowercase_							     =							version.parse('1.11'       )







							@property
							def   __lowerCAmelCase     (    self			:    Any   )     ->				Mapping[str, Mapping[int, str]]:


														"""simple docstring"""


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







							@property
							def   __lowerCAmelCase     (    self			:    Dict   )     ->				float:


														"""simple docstring"""


														return 1e-5







'''simple docstring'''


import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict
@pytest.mark.parametrize(
    '''split_dict'''					,		[
        SplitDict(),
        SplitDict({'''train''': SplitInfo(name='''train'''					,		num_bytes=1337					,		num_examples=42					,		dataset_name='''my_dataset''' )} ),
        SplitDict({'''train''': SplitInfo(name='''train'''					,		num_bytes=1337					,		num_examples=42 )} ),
        SplitDict({'''train''': SplitInfo()} ),
    ]					,		)
def 						snake_case_       (UpperCamelCase			:    SplitDict ):





							'''simple docstring'''


							_a      	=							split_dict._to_yaml_list()
							assert len(UpperCamelCase ) == len(UpperCamelCase )
							_a      	=							SplitDict._from_yaml_list(UpperCamelCase )
							for split_name, split_info in split_dict.items():
														# dataset_name field is deprecated, and is therefore not part of the YAML dump
														_a      	=							None
														# the split name of split_dict takes over the name of the split info object
														_a      	=							split_name
							assert split_dict == reloaded

@pytest.mark.parametrize(
    '''split_info'''					,		[SplitInfo(), SplitInfo(dataset_name=UpperCamelCase ), SplitInfo(dataset_name='''my_dataset''' )] )
def 						snake_case_       (UpperCamelCase			:    List[str] ):





							'''simple docstring'''


							_a      	=							asdict(SplitDict({'''train''': split_info} ) )
							assert "dataset_name" in split_dict_asdict["train"]
							assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name

