import torch


def dist(input, other, *args, **kwargs):
    """
    Returns the p-norm of (``input`` - ``other``)

    Examples::

        >>> import torch
        >>> import treetensor.torch as ttorch
        >>> t1 = torch.randn(5)
        >>> t1
        tensor([-0.6566,  1.2243,  1.5018, -0.1492,  0.8947])
        >>> t2 = torch.randn(5)
        >>> t2
        tensor([0.5898, 0.6839, 0.0388, 0.4649, 0.7964])
        >>> ttorch.dist(t1, t2)
        tensor(2.0911)

        >>> tt1 = ttorch.randn({'a': (5, ), 'b': {'x': (6, )}})
        >>> tt1
        <Tensor 0x7f95f68495f8>
        ├── a --> tensor([-0.5491,  1.5006, -0.0483,  1.2282, -1.4837])
        └── b --> <Tensor 0x7f95f68494e0>
            └── x --> tensor([-1.8414,  1.2913,  0.0943,  0.3473,  1.2717,  0.6013])
        >>> tt2 = ttorch.randn({'a': (5, ), 'b': {'x': (6, )}})
        >>> tt2
        <Tensor 0x7f95f68ef2b0>
        ├── a --> tensor([ 0.1389, -0.7804, -1.3048, -1.1066,  1.3225])
        └── b --> <Tensor 0x7f95f6849dd8>
            └── x --> tensor([ 1.4873,  0.2218, -0.1063, -0.8726, -0.6756,  0.4805])
        >>> ttorch.dist(tt1, tt2)
        <Tensor 0x7f95f6849358>
        ├── a --> tensor(4.5366)
        └── b --> <Tensor 0x7f95f68494a8>
            └── x --> tensor(4.1904)
    """
    return torch.dist(input, other, *args, **kwargs)