


# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


snake_case_						:			Union[str, Any]													=							{
    '''configuration_efficientnet''': [
        '''EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''EfficientNetConfig''',
        '''EfficientNetOnnxConfig''',
    ]
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							snake_case_						:			Tuple													=							['''EfficientNetImageProcessor''']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							snake_case_						:			Optional[int]													=							[
							    '''EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''EfficientNetForImageClassification''',
							    '''EfficientNetModel''',
							    '''EfficientNetPreTrainedModel''',
							]

if TYPE_CHECKING:
							from .configuration_efficientnet import (
							    EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    EfficientNetConfig,
							    EfficientNetOnnxConfig,
							)

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .image_processing_efficientnet import EfficientNetImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_efficientnet import (
														    EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
														    EfficientNetForImageClassification,
														    EfficientNetModel,
														    EfficientNetPreTrainedModel,
														)

else:
							import sys

							snake_case_						:			Optional[Any]													=							_LazyModule(__name__, globals()['''__file__'''], _import_structure)



import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


snake_case_						:			Optional[Any]													=							'''scheduler_config.json'''

class 						A__							(		UpperCamelCase__  ):
						UpperCAmelCase             =						1
						UpperCAmelCase             =						2
						UpperCAmelCase             =						3
						UpperCAmelCase             =						4
						UpperCAmelCase             =						5
						UpperCAmelCase             =						6
						UpperCAmelCase             =						7
						UpperCAmelCase             =						8
						UpperCAmelCase             =						9
						UpperCAmelCase             =						10
						UpperCAmelCase             =						11
						UpperCAmelCase             =						12
						UpperCAmelCase             =						13
						UpperCAmelCase             =						14

@dataclass
class 						A__							(		UpperCamelCase__  ):
						UpperCAmelCase             =						42

class 						A__							:
						UpperCAmelCase             =						SCHEDULER_CONFIG_NAME
						UpperCAmelCase             =						[]
						UpperCAmelCase             =						True




						@classmethod
						def 							__UpperCamelCase				(       cls					:      List[str]				,    _a					:      Dict[str, Any] = None				,    _a					:      Optional[str] = None				,    _a					:      Optional[Any]=False				,    **_a					:      Dict				,    )							->     Dict:


										"""simple docstring"""





										_SCREAMING_SNAKE_CASE  ,				_SCREAMING_SNAKE_CASE  ,				_SCREAMING_SNAKE_CASE			  =cls.load_config(
										    pretrained_model_name_or_path=_a				,    subfolder=_a				,    return_unused_kwargs=_a				,    return_commit_hash=_a				,    **_a				,    )
										return cls.from_config(_a				,    return_unused_kwargs=_a				,    **_a  )




						def 							__UpperCamelCase				(       self					:      Dict				,    _a					:      Union[str, os.PathLike]				,    _a					:      bool = False				,    **_a					:      int  )							->     Dict:


										"""simple docstring"""





										self.save_config(save_directory=_a				,    push_to_hub=_a				,    **_a  )




						@property
						def 							__UpperCamelCase				(       self					:      List[str]  )							->     List[Any]:


										"""simple docstring"""





										return self._get_compatibles()




						@classmethod
						def 							__UpperCamelCase				(       cls					:      List[Any]  )							->     str:


										"""simple docstring"""





										_SCREAMING_SNAKE_CASE			  =list(set([cls.__name__] + cls._compatibles  )  )
										_SCREAMING_SNAKE_CASE			  =importlib.import_module(__name__.split('''.'''  )[0]  )
										_SCREAMING_SNAKE_CASE			  =[
										    getattr(_a				,    _a  ) for c in compatible_classes_str if hasattr(_a				,    _a  )
										]
										return compatible_classes