
"""simple docstring"""




from typing import Optional, Tuple, Union

import tensorflow as tf

from ...activations_tf import ACTaFN
from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
from ...modeling_tf_outputs import (
    TFBaseModelOutputWithNoAttention,
    TFBaseModelOutputWithPoolingAndNoAttention,
    TFSequenceClassifierOutput,
)
from ...modeling_tf_utils import TFPreTrainedModel, TFSequenceClassificationLoss, keras_serializable, unpack_inputs
from ...tf_utils import shape_list
from ...utils import logging
from .configuration_regnet import RegNetConfig


A__      :	List[Any]          =    logging.get_logger(__name__)

# General docstring
A__      :	Tuple          =    """RegNetConfig"""

# Base docstring
A__      :	Tuple          =    """facebook/regnet-y-040"""
A__      :	Tuple          =    [1, 1_088, 7, 7]

# Image classification docstring
A__      :	str          =    """facebook/regnet-y-040"""
A__      :	Tuple          =    """tabby, tabby cat"""

A__      :	Dict          =    [
    """facebook/regnet-y-040""",
    # See all regnet models at https://huggingface.co/models?filter=regnet
]







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase = 3 ,			__UpperCamelCase = 1 ,			__UpperCamelCase = 1 ,			__UpperCamelCase = "relu" ,			**__UpperCamelCase ,			)->					Optional[Any]:
          super().__init__(**__UpperCamelCase  )
          # The padding and conv has been verified in
          # https://colab.research.google.com/gist/sayakpaul/854bc10eeaf21c9ee2119e0b9f3841a7/scratchpad.ipynb
          UpperCAmelCase__							: List[str] 							=						tf.keras.layers.ZeroPaddingaD(padding=kernel_size // 2  )
          UpperCAmelCase__							: List[str] 							=						tf.keras.layers.ConvaD(
              filters=__UpperCamelCase ,			kernel_size=__UpperCamelCase ,			strides=__UpperCamelCase ,			padding="VALID" ,			groups=__UpperCamelCase ,			use_bias=__UpperCamelCase ,			name="convolution" ,			)
          UpperCAmelCase__							: Optional[Any] 							=						tf.keras.layers.BatchNormalization(epsilon=1E-5 ,			momentum=0.9 ,			name="normalization"  )
          UpperCAmelCase__							: int 							=						ACTaFN[activation] if activation is not None else tf.identity



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					Optional[Any]:
          UpperCAmelCase__							: str 							=						self.convolution(self.padding(__UpperCamelCase  )  )
          UpperCAmelCase__							: List[str] 							=						self.normalization(__UpperCamelCase  )
          UpperCAmelCase__							: List[str] 							=						self.activation(__UpperCamelCase  )
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			**__UpperCamelCase  )->					List[str]:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: Optional[int] 							=						config.num_channels
          UpperCAmelCase__							: Optional[int] 							=						TFRegNetConvLayer(
              out_channels=config.embedding_size ,			kernel_size=3 ,			stride=2 ,			activation=config.hidden_act ,			name="embedder" ,			)



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					Optional[Any]:
          UpperCAmelCase__							: Any 							=						shape_list(__UpperCamelCase  )[1]
          if tf.executing_eagerly() and num_channels != self.num_channels:
               raise ValueError(
                   "Make sure that the channel dimension of the pixel values match with the one set in the configuration."  )

          # When running on CPU, `tf.keras.layers.Conv2D` doesn't support `NCHW` format.
          # So change the input format from `NCHW` to `NHWC`.
          # shape = (batch_size, in_height, in_width, in_channels=num_channels)
          UpperCAmelCase__							: Optional[Any] 							=						tf.transpose(__UpperCamelCase ,			perm=(0, 2, 3, 1)  )
          UpperCAmelCase__							: Any 							=						self.embedder(__UpperCamelCase  )
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase = 2 ,			**__UpperCamelCase  )->					Dict:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: int 							=						tf.keras.layers.ConvaD(
              filters=__UpperCamelCase ,			kernel_size=1 ,			strides=__UpperCamelCase ,			use_bias=__UpperCamelCase ,			name="convolution"  )
          UpperCAmelCase__							: List[str] 							=						tf.keras.layers.BatchNormalization(epsilon=1E-5 ,			momentum=0.9 ,			name="normalization"  )



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase = False  )->					tf.Tensor:
          return self.normalization(self.convolution(__UpperCamelCase  ) ,			training=__UpperCamelCase  )







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase ,			**__UpperCamelCase  )->					Dict:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: str 							=						tf.keras.layers.GlobalAveragePoolingaD(keepdims=__UpperCamelCase ,			name="pooler"  )
          UpperCAmelCase__							: Any 							=						[
              tf.keras.layers.ConvaD(filters=__UpperCamelCase ,			kernel_size=1 ,			activation="relu" ,			name="attention.0"  ),
              tf.keras.layers.ConvaD(filters=__UpperCamelCase ,			kernel_size=1 ,			activation="sigmoid" ,			name="attention.2"  ),
          ]



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					str:
          # [batch_size, h, w, num_channels] -> [batch_size, 1, 1, num_channels]
          UpperCAmelCase__							: Optional[int] 							=						self.pooler(__UpperCamelCase  )
          for layer_module in self.attention:
               UpperCAmelCase__							: List[Any] 							=						layer_module(__UpperCamelCase  )
          UpperCAmelCase__							: Tuple 							=						hidden_state * pooled
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase = 1 ,			**__UpperCamelCase  )->					Union[str, Any]:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: Tuple 							=						in_channels != out_channels or stride != 1
          UpperCAmelCase__							: str 							=						max(1 ,			out_channels // config.groups_width  )
          UpperCAmelCase__							: Optional[int] 							=						(
              TFRegNetShortCut(__UpperCamelCase ,			stride=__UpperCamelCase ,			name="shortcut"  )
              if should_apply_shortcut
              else tf.keras.layers.Activation("linear" ,			name="shortcut"  )
          )
          # `self.layers` instead of `self.layer` because that is a reserved argument.
          UpperCAmelCase__							: Any 							=						[
              TFRegNetConvLayer(__UpperCamelCase ,			kernel_size=1 ,			activation=config.hidden_act ,			name="layer.0"  ),
              TFRegNetConvLayer(
                  __UpperCamelCase ,			stride=__UpperCamelCase ,			groups=__UpperCamelCase ,			activation=config.hidden_act ,			name="layer.1"  ),
              TFRegNetConvLayer(__UpperCamelCase ,			kernel_size=1 ,			activation=__UpperCamelCase ,			name="layer.2"  ),
          ]
          UpperCAmelCase__							: Optional[Any] 							=						ACTaFN[config.hidden_act]



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					List[str]:
          UpperCAmelCase__							: Tuple 							=						hidden_state
          for layer_module in self.layers:
               UpperCAmelCase__							: Optional[int] 							=						layer_module(__UpperCamelCase  )
          UpperCAmelCase__							: Union[str, Any] 							=						self.shortcut(__UpperCamelCase  )
          hidden_state += residual
          UpperCAmelCase__							: Union[str, Any] 							=						self.activation(__UpperCamelCase  )
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase = 1 ,			**__UpperCamelCase  )->					List[Any]:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: int 							=						in_channels != out_channels or stride != 1
          UpperCAmelCase__							: Optional[Any] 							=						max(1 ,			out_channels // config.groups_width  )
          UpperCAmelCase__							: Union[str, Any] 							=						(
              TFRegNetShortCut(__UpperCamelCase ,			stride=__UpperCamelCase ,			name="shortcut"  )
              if should_apply_shortcut
              else tf.keras.layers.Activation("linear" ,			name="shortcut"  )
          )
          UpperCAmelCase__							: Optional[Any] 							=						[
              TFRegNetConvLayer(__UpperCamelCase ,			kernel_size=1 ,			activation=config.hidden_act ,			name="layer.0"  ),
              TFRegNetConvLayer(
                  __UpperCamelCase ,			stride=__UpperCamelCase ,			groups=__UpperCamelCase ,			activation=config.hidden_act ,			name="layer.1"  ),
              TFRegNetSELayer(__UpperCamelCase ,			reduced_channels=int(round(in_channels / 4  )  ) ,			name="layer.2"  ),
              TFRegNetConvLayer(__UpperCamelCase ,			kernel_size=1 ,			activation=__UpperCamelCase ,			name="layer.3"  ),
          ]
          UpperCAmelCase__							: List[str] 							=						ACTaFN[config.hidden_act]



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					Dict:
          UpperCAmelCase__							: List[Any] 							=						hidden_state
          for layer_module in self.layers:
               UpperCAmelCase__							: Optional[int] 							=						layer_module(__UpperCamelCase  )
          UpperCAmelCase__							: Dict 							=						self.shortcut(__UpperCamelCase  )
          hidden_state += residual
          UpperCAmelCase__							: Optional[Any] 							=						self.activation(__UpperCamelCase  )
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase = 2 ,			__UpperCamelCase = 2 ,			**__UpperCamelCase  )->					int:
          super().__init__(**__UpperCamelCase  )

          UpperCAmelCase__							: Dict 							=						TFRegNetXLayer if config.layer_type == "x" else TFRegNetYLayer
          UpperCAmelCase__							: List[str] 							=						[
              # downsampling is done in the first layer with stride of 2
              layer(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			stride=__UpperCamelCase ,			name="layers.0"  ),
              *[layer(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			name=F"layers.{i+1}"  ) for i in range(depth - 1  )],
          ]



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase  )->					str:
          for layer_module in self.layers:
               UpperCAmelCase__							: List[Any] 							=						layer_module(__UpperCamelCase  )
          return hidden_state







class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			**__UpperCamelCase  )->					Dict:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: Optional[Any] 							=						[]
          # based on `downsample_in_first_stage`, the first layer of the first stage may or may not downsample the input
          self.stages.append(
              TFRegNetStage(
                  __UpperCamelCase ,			config.embedding_size ,			config.hidden_sizes[0] ,			stride=2 if config.downsample_in_first_stage else 1 ,			depth=config.depths[0] ,			name="stages.0" ,			)  )
          UpperCAmelCase__							: int 							=						zip(config.hidden_sizes ,			config.hidden_sizes[1:]  )
          for i, ((in_channels, out_channels), depth) in enumerate(zip(__UpperCamelCase ,			config.depths[1:]  )  ):
               self.stages.append(TFRegNetStage(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			depth=__UpperCamelCase ,			name=F"stages.{i+1}"  )  )



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase = False ,			__UpperCamelCase = True  )->					TFBaseModelOutputWithNoAttention:
          UpperCAmelCase__							: Dict 							=						() if output_hidden_states else None

          for stage_module in self.stages:
               if output_hidden_states:
                    UpperCAmelCase__							: Any 							=						hidden_states + (hidden_state,)

               UpperCAmelCase__							: int 							=						stage_module(__UpperCamelCase  )

          if output_hidden_states:
               UpperCAmelCase__							: str 							=						hidden_states + (hidden_state,)

          if not return_dict:
               return tuple(v for v in [hidden_state, hidden_states] if v is not None  )

          return TFBaseModelOutputWithNoAttention(last_hidden_state=__UpperCamelCase ,			hidden_states=__UpperCamelCase  )







@keras_serializable
class   _lowercase						(       tf.keras.layers.Layer				):


     '''simple docstring'''





     _A								=							RegNetConfig



     def __init__(      self ,			__UpperCamelCase ,			**__UpperCamelCase  )->					Dict:
          super().__init__(**__UpperCamelCase  )
          UpperCAmelCase__							: Dict 							=						config
          UpperCAmelCase__							: int 							=						TFRegNetEmbeddings(__UpperCamelCase ,			name="embedder"  )
          UpperCAmelCase__							: Dict 							=						TFRegNetEncoder(__UpperCamelCase ,			name="encoder"  )
          UpperCAmelCase__							: int 							=						tf.keras.layers.GlobalAveragePoolingaD(keepdims=__UpperCamelCase ,			name="pooler"  )



     @unpack_inputs
     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase = None ,			__UpperCamelCase = None ,			__UpperCamelCase = False ,			)->					TFBaseModelOutputWithPoolingAndNoAttention:
          UpperCAmelCase__							: int 							=						(
              output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
          )
          UpperCAmelCase__							: Optional[Any] 							=						return_dict if return_dict is not None else self.config.use_return_dict

          UpperCAmelCase__							: str 							=						self.embedder(__UpperCamelCase ,			training=__UpperCamelCase  )

          UpperCAmelCase__							: Any 							=						self.encoder(
              __UpperCamelCase ,			output_hidden_states=__UpperCamelCase ,			return_dict=__UpperCamelCase ,			training=__UpperCamelCase  )

          UpperCAmelCase__							: Optional[int] 							=						encoder_outputs[0]
          UpperCAmelCase__							: Dict 							=						self.pooler(__UpperCamelCase  )

          # Change to NCHW output format have uniformity in the modules
          UpperCAmelCase__							: Union[str, Any] 							=						tf.transpose(__UpperCamelCase ,			perm=(0, 3, 1, 2)  )
          UpperCAmelCase__							: Optional[Any] 							=						tf.transpose(__UpperCamelCase ,			perm=(0, 3, 1, 2)  )

          # Change the other hidden state outputs to NCHW as well
          if output_hidden_states:
               UpperCAmelCase__							: Dict 							=						tuple([tf.transpose(__UpperCamelCase ,			perm=(0, 3, 1, 2)  ) for h in encoder_outputs[1]]  )

          if not return_dict:
               return (last_hidden_state, pooled_output) + encoder_outputs[1:]

          return TFBaseModelOutputWithPoolingAndNoAttention(
              last_hidden_state=__UpperCamelCase ,			pooler_output=__UpperCamelCase ,			hidden_states=hidden_states if output_hidden_states else encoder_outputs.hidden_states ,			)







class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     _A								=							RegNetConfig
     _A								=							'regnet'
     _A								=							'pixel_values'



     @property
     def  lowerCAmelCase__       (      self  )->					List[str]:
          return {"pixel_values": tf.TensorSpec(shape=(None, self.config.num_channels, 2_24, 2_24) ,			dtype=tf.floataa  )}





A__      :	Tuple          =    R"""
    Parameters:
    This model is a Tensorflow
    [tf.keras.layers.Layer](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer) sub-class. Use it as a
    regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and
    behavior.
        config ([`RegNetConfig`]): Model configuration class with all the parameters of the model.
            Initializing with a config file does not load the weights associated with the model, only the
            configuration. Check out the [`~TFPreTrainedModel.from_pretrained`] method to load the model weights.
"""

A__      :	Union[str, Any]          =    R"""
    Args:
        pixel_values (`tf.Tensor` of shape `(batch_size, num_channels, height, width)`):
            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See
            [`ConveNextImageProcessor.__call__`] for details.
        output_hidden_states (`bool`, *optional*):
            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
            more detail.
        return_dict (`bool`, *optional*):
            Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
"""







@add_start_docstrings(
    'The bare RegNet model outputting raw features without any specific head on top.'	,   lowerCAmelCase_	,   )
class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			*__UpperCamelCase ,			**__UpperCamelCase  )->					List[str]:
          super().__init__(__UpperCamelCase ,			*__UpperCamelCase ,			**__UpperCamelCase  )
          UpperCAmelCase__							: Tuple 							=						TFRegNetMainLayer(__UpperCamelCase ,			name="regnet"  )



     @unpack_inputs
     @add_start_docstrings_to_model_forward(__UpperCamelCase  )
     @add_code_sample_docstrings(
         checkpoint=_CHECKPOINT_FOR_DOC ,			output_type=__UpperCamelCase ,			config_class=_CONFIG_FOR_DOC ,			modality="vision" ,			expected_output=_EXPECTED_OUTPUT_SHAPE ,			)
     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase = None ,			__UpperCamelCase = None ,			__UpperCamelCase=False ,			)->					Union[TFBaseModelOutputWithPoolingAndNoAttention, Tuple[tf.Tensor]]:
          UpperCAmelCase__							: Any 							=						(
              output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
          )
          UpperCAmelCase__							: Optional[Any] 							=						return_dict if return_dict is not None else self.config.use_return_dict

          UpperCAmelCase__							: Any 							=						self.regnet(
              pixel_values=__UpperCamelCase ,			output_hidden_states=__UpperCamelCase ,			return_dict=__UpperCamelCase ,			training=__UpperCamelCase ,			)
          if not return_dict:
               return (outputs[0],) + outputs[1:]

          return TFBaseModelOutputWithPoolingAndNoAttention(
              last_hidden_state=outputs.last_hidden_state ,			pooler_output=outputs.pooler_output ,			hidden_states=outputs.hidden_states ,			)







@add_start_docstrings(
    '\n    RegNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for\n    ImageNet.\n    '	,   lowerCAmelCase_	,   )
class   _lowercase						(       lowerCAmelCase_	,   lowerCAmelCase_				):


     '''simple docstring'''





     def __init__(      self ,			__UpperCamelCase ,			*__UpperCamelCase ,			**__UpperCamelCase  )->					Tuple:
          super().__init__(__UpperCamelCase ,			*__UpperCamelCase ,			**__UpperCamelCase  )
          UpperCAmelCase__							: Tuple 							=						config.num_labels
          UpperCAmelCase__							: Optional[Any] 							=						TFRegNetMainLayer(__UpperCamelCase ,			name="regnet"  )
          # classification head
          UpperCAmelCase__							: Optional[Any] 							=						[
              tf.keras.layers.Flatten(),
              tf.keras.layers.Dense(config.num_labels ,			name="classifier.1"  ) if config.num_labels > 0 else tf.identity,
          ]



     @unpack_inputs
     @add_start_docstrings_to_model_forward(__UpperCamelCase  )
     @add_code_sample_docstrings(
         checkpoint=_IMAGE_CLASS_CHECKPOINT ,			output_type=__UpperCamelCase ,			config_class=_CONFIG_FOR_DOC ,			expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT ,			)
     def  lowerCAmelCase__       (      self ,			__UpperCamelCase = None ,			__UpperCamelCase = None ,			__UpperCamelCase = None ,			__UpperCamelCase = None ,			__UpperCamelCase=False ,			)->					Union[TFSequenceClassifierOutput, Tuple[tf.Tensor]]:
          UpperCAmelCase__							: Dict 							=						(
              output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
          )
          UpperCAmelCase__							: Optional[Any] 							=						return_dict if return_dict is not None else self.config.use_return_dict

          UpperCAmelCase__							: Optional[int] 							=						self.regnet(
              __UpperCamelCase ,			output_hidden_states=__UpperCamelCase ,			return_dict=__UpperCamelCase ,			training=__UpperCamelCase  )

          UpperCAmelCase__							: Union[str, Any] 							=						outputs.pooler_output if return_dict else outputs[1]

          UpperCAmelCase__							: Any 							=						self.classifier[0](__UpperCamelCase  )
          UpperCAmelCase__							: List[str] 							=						self.classifier[1](__UpperCamelCase  )

          UpperCAmelCase__							: Optional[Any] 							=						None if labels is None else self.hf_compute_loss(labels=__UpperCamelCase ,			logits=__UpperCamelCase  )

          if not return_dict:
               UpperCAmelCase__							: int 							=						(logits,) + outputs[2:]
               return ((loss,) + output) if loss is not None else output

          return TFSequenceClassifierOutput(loss=__UpperCamelCase ,			logits=__UpperCamelCase ,			hidden_states=outputs.hidden_states  )





"""simple docstring"""




def 							a__ (				lowerCAmelCase	:       list       ,    lowerCAmelCase	:       list		):






     '''simple docstring'''
     _validate_point(lowerCAmelCase		)
     _validate_point(lowerCAmelCase		)
     if len(lowerCAmelCase		) != len(lowerCAmelCase		):
          raise ValueError("Both points must be in the same n-dimensional space"		)

     return float(sum(abs(a - b		) for a, b in zip(lowerCAmelCase       ,    lowerCAmelCase		)		)		)



def 							a__ (				lowerCAmelCase	:       list[float]		):






     '''simple docstring'''
     if point:
          if isinstance(lowerCAmelCase       ,    lowerCAmelCase		):
               for item in point:
                    if not isinstance(lowerCAmelCase       ,    (int, float)		):
                         UpperCAmelCase__							: Tuple 							=						(
                             "Expected a list of numbers as input, found "
                             F"{type(lowerCAmelCase		).__name__}"
                         )
                         raise TypeError(lowerCAmelCase		)
          else:
               UpperCAmelCase__							: Dict 							=						F"Expected a list of numbers as input, found {type(lowerCAmelCase		).__name__}"
               raise TypeError(lowerCAmelCase		)
     else:
          raise ValueError("Missing an input"		)



def 							a__ (				lowerCAmelCase	:       list       ,    lowerCAmelCase	:       list		):






     '''simple docstring'''
     _validate_point(lowerCAmelCase		)
     _validate_point(lowerCAmelCase		)
     if len(lowerCAmelCase		) != len(lowerCAmelCase		):
          raise ValueError("Both points must be in the same n-dimensional space"		)

     return float(sum(abs(x - y		) for x, y in zip(lowerCAmelCase       ,    lowerCAmelCase		)		)		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()



