

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


__A			:					List[str]						=			logging.get_logger(__name__)

__A			:					str						=			{
    'microsoft/resnet-50': 'https://huggingface.co/microsoft/resnet-50/blob/main/config.json',
}





class 			_SCREAMING_SNAKE_CASE (   __snake_case					,       __snake_case		):







   '''simple docstring'''




   lowerCamelCase__				=      "resnet"
   lowerCamelCase__				=      ["basic", "bottleneck"]





   def __init__(       self					:			List[Any]     , __lowerCamelCase					:			List[Any]=3     , __lowerCamelCase					:			Optional[int]=64     , __lowerCamelCase					:			int=[256, 512, 1024, 2048]     , __lowerCamelCase					:			Dict=[3, 4, 6, 3]     , __lowerCamelCase					:			List[str]="bottleneck"     , __lowerCamelCase					:			Optional[int]="relu"     , __lowerCamelCase					:			List[Any]=False     , __lowerCamelCase					:			Optional[Any]=None     , __lowerCamelCase					:			List[str]=None     , **__lowerCamelCase					:			Union[str, Any]     , ):
       super().__init__(**__lowerCamelCase			)
       if layer_type not in self.layer_types:
           raise ValueError(f"layer_type={layer_type} is not one of {','.join(self.layer_types			)}"			)
       SCREAMING_SNAKE_CASE										=   num_channels
       SCREAMING_SNAKE_CASE										=   embedding_size
       SCREAMING_SNAKE_CASE										=   hidden_sizes
       SCREAMING_SNAKE_CASE										=   depths
       SCREAMING_SNAKE_CASE										=   layer_type
       SCREAMING_SNAKE_CASE										=   hidden_act
       SCREAMING_SNAKE_CASE										=   downsample_in_first_stage
       SCREAMING_SNAKE_CASE										=   ["stem"] + [f"stage{idx}" for idx in range(1     , len(__lowerCamelCase			) + 1			)]
       SCREAMING_SNAKE_CASE							,	SCREAMING_SNAKE_CASE										=   get_aligned_output_features_output_indices(
           out_features=__lowerCamelCase     , out_indices=__lowerCamelCase     , stage_names=self.stage_names			)





class 			_SCREAMING_SNAKE_CASE (   __snake_case		):







   '''simple docstring'''




   lowerCamelCase__				=      version.parse("1.11"		)





   @property
   def      _snake_case		(       self					:			List[Any]			):
       return OrderedDict(
           [
               ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
           ]			)





   @property
   def      _snake_case		(       self					:			Union[str, Any]			):
       return 1e-3


from collections.abc import Callable

import numpy as np





def 	__a     (      A__			:  Callable			,  A__			:  float			,  A__			:  float			,  A__			:  float			,  A__			:  float       ):
    SCREAMING_SNAKE_CASE										=   int(np.ceil((x_end - xa) / step_size       )       )
    SCREAMING_SNAKE_CASE										=   np.zeros((n + 1,)       )
    SCREAMING_SNAKE_CASE										=   ya
    SCREAMING_SNAKE_CASE										=   xa

    for k in range(A__       ):
        SCREAMING_SNAKE_CASE										=   y[k] + step_size * ode_func(A__			,  y[k]       )
        SCREAMING_SNAKE_CASE										=   y[k] + (
            (step_size / 2) * (ode_func(A__			,  y[k]       ) + ode_func(x + step_size			,  A__       ))
        )
        x += step_size

    return y


if __name__ == "__main__":
    import doctest

    doctest.testmod()