


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


SCREAMING_SNAKE_CASE							    =							logging.get_logger(__name__)

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


class     __UpperCAmelCase							(       _a ,					_a							):


     """simple docstring"""
     _lowerCamelCase   =      """resnet"""
     _lowerCamelCase   =      ["""basic""", """bottleneck"""]


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







class     __UpperCAmelCase							(       _a							):


     """simple docstring"""
     _lowerCamelCase   =      version.parse("""1.11"""							)


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


     @property
     def 	snake_case_  (	self    ):
        return 1E-3







"""simple docstring"""

def lowerCAmelCase_   (					UpperCamelCase__						:			Union[str, Any]					, UpperCamelCase__						:			Union[str, Any]					, UpperCamelCase__						:			int			):






 """simple docstring"""







 if n == 0:
  return 1

 elif n % 2 == 1:
  return (binary_exponentiation(UpperCamelCase__					, n - 1					, UpperCamelCase__			) * a) % mod

 else:
  __lowercase						=						binary_exponentiation(UpperCamelCase__					, n / 2					, UpperCamelCase__			)
  return (b * b) % mod


# a prime number
UpperCAmelCase__					=701

UpperCAmelCase__					=10_0000_0000
UpperCAmelCase__					=10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)

print((a / b) % p == (a * b ** (p - 2)) % p)
