---
title: "PairwiseDistance"
sidebar_label: "PairwiseDistance"
description: "The clika_runtime.nn PairwiseDistance class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

PairwiseDistance(p=2.0, eps=None, keepdim=False)

    The p-norm of ``x1 - x2 + eps`` over the last axis, with broadcasting of
    the leading dimensions.

    The module form of ``clika_runtime.nn.functional.pairwise_distance``:
    construct it once with the settings, then call it like a function.

    Args:
        p: the norm degree; an integer keeps its kind.
        eps: the perturbation added before the norm; unset is 1e-6; None takes
            the function's own default.
        keepdim: keeps the reduced axis as size 1.
    

## `__init__`

```python
__init__(self, p: 'bool | int | float' = 2.0, eps: 'float | None' = None, keepdim: 'bool' = False) -> 'None'
```

Initialize self.  See help(type(self)) for accurate signature.

## `extra_repr`

```python
extra_repr(self) -> 'str'
```

extra_repr() -> str

One line of per-class detail for :meth:`__repr__`; a layer prints
its geometry here (``in_features=64, out_features=256``).

## `forward`

```python
forward(self, x1: 'Tensor', x2: 'Tensor') -> 'Tensor'
```

forward(x1, x2) -> Tensor

Runs ``clika_runtime.nn.functional.pairwise_distance`` on ``x1``,
``x2`` with the stored settings; returns a new tensor.
