


'''simple docstring'''
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__snake_case							      =     logging.get_logger(__name__)

__snake_case							      =     {
    '''microsoft/resnet-50''': '''https://huggingface.co/microsoft/resnet-50/blob/main/config.json''',
}
class    lowercase	(							A__	,		A__					):

		"""simple docstring"""

		_a     =				'resnet'
		_a     =				['basic', 'bottleneck']




		def __init__(		self    ,   UpperCamelCase_=3    ,   UpperCamelCase_=64    ,   UpperCamelCase_=[256, 512, 1024, 2048]    ,   UpperCamelCase_=[3, 4, 6, 3]    ,   UpperCamelCase_="bottleneck"    ,   UpperCamelCase_="relu"    ,   UpperCamelCase_=False    ,   UpperCamelCase_=None    ,   UpperCamelCase_=None    ,   **UpperCamelCase_    ,   ):

							'''simple docstring'''


							super().__init__(**UpperCamelCase_							)
							if layer_type not in self.layer_types:
												raise ValueError(F'''layer_type={layer_type} is not one of {",".join(self.layer_types							)}'''							)
							UpperCamelCase__   :Optional[Any]												= num_channels
							UpperCamelCase__   :int												= embedding_size
							UpperCamelCase__   :Dict												= hidden_sizes
							UpperCamelCase__   :int												= depths
							UpperCamelCase__   :int												= layer_type
							UpperCamelCase__   :List[Any]												= hidden_act
							UpperCamelCase__   :Optional[int]												= downsample_in_first_stage
							UpperCamelCase__   :Tuple												= ['''stem'''] + [F'''stage{idx}''' for idx in range(1    ,   len(UpperCamelCase_							) + 1							)]
							UpperCamelCase__					,				UpperCamelCase__   :Tuple												= get_aligned_output_features_output_indices(
							    out_features=UpperCamelCase_    ,   out_indices=UpperCamelCase_    ,   stage_names=self.stage_names							)



class    lowercase	(							A__					):

		"""simple docstring"""

		_a     =				version.parse('1.11'					)




		@property
		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		@property
		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


							return 1e-3



from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
 if not (is_transformers_available() and is_torch_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from ...utils.dummy_torch_and_transformers_objects import ShapEPipeline
else:
 from .camera import create_pan_cameras
 from .pipeline_shap_e import ShapEPipeline
 from .pipeline_shap_e_img2img import ShapEImgaImgPipeline
 from .renderer import (
     BoundingBoxVolume,
     ImportanceRaySampler,
     MLPNeRFModelOutput,
     MLPNeRSTFModel,
     ShapEParamsProjModel,
     ShapERenderer,
     StratifiedRaySampler,
     VoidNeRFModel,
 )


