






"""simple docstring"""






import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


SCREAMING_SNAKE_CASE						:						Dict					   =       parse(importlib.metadata.version('''torch'''))



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):
				if operation not in STR_OPERATION_TO_FUNC.keys():
								raise ValueError(f'''`operation` must be one of {list(STR_OPERATION_TO_FUNC.keys()				)}, received {operation}'''				)
				A__							 =       STR_OPERATION_TO_FUNC[operation]
				if isinstance(lowerCAmelCase__       ,lowerCAmelCase__				):
								A__							 =       parse(importlib.metadata.version(lowerCAmelCase__				)				)
				return operation(lowerCAmelCase__       ,parse(lowerCAmelCase__				)				)







def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				return compare_versions(lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				)










"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE						:						Any					   =       logging.get_logger(__name__)





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					"""timm_backbone"""


	def __init__(      self  ,					__a=None  ,					__a=3  ,					__a=True  ,					__a=True  ,					__a=None  ,					**__a  ,					):


					"""simple docstring"""

					super().__init__(**__a						)
					A__							 =       backbone
					A__							 =       num_channels
					A__							 =       features_only
					A__							 =       use_pretrained_backbone
					A__							 =       True
					A__							 =       out_indices if out_indices is not None else (-1,)


