src/graphnet/models/utils.py
def calculate_distance_matrix(xyz_coords: Tensor) -> Tensor:
    """
    Calculate the matrix of pairwise distances between pulses in (x,y,z)-coordinates.

    Args:
        xyz_coords: (x,y,z)-coordinates of pulses, of shape [nb_doms, 3].

    Returns:
        Matrix of pairwise distances, of shape [nb_doms, nb_doms]
    """
    diff = xyz_coords.unsqueeze(dim=2) - xyz_coords.T.unsqueeze(dim=0)
    return torch.sqrt(torch.sum(diff**2, dim=1))

    Calculate the matrix of pairwise distances between pulses in (x,y,z)-coordinates.

    Args:
        xyz_coords: (x,y,z)-coordinates of pulses, of shape [nb_doms, 3].

    Returns:
        Matrix of pairwise distances, of shape [nb_doms, nb_doms]
    
Calculate the matrix of pairwise distances between pulses in (x,y,z)-coordinates.
Calculate the matrix of pairwise distances between pulses in ( x y z ) - coordinates .
def calculate_distance_matrix(xyz_coords: Tensor) -> Tensor:
    diff = xyz_coords.unsqueeze(dim=2) - xyz_coords.T.unsqueeze(dim=0)
    return torch.sqrt(torch.sum(diff**2, dim=1))
def calculate_distance_matrix ( xyz_coords : Tensor ) -> Tensor : diff = xyz_coords . unsqueeze ( dim = 2 ) - xyz_coords . T . unsqueeze ( dim = 0 ) return torch . sqrt ( torch . sum ( diff ** 2 , dim = 1 ) )
Calculate the matrix of pairwise distances between pulses in (x,y,z)-coordinates.
Calculate the matrix of pairwise distances between pulses in ( x y z ) - coordinates .
"""
    Calculate the matrix of pairwise distances between pulses in (x,y,z)-coordinates.

    Args:
        xyz_coords: (x,y,z)-coordinates of pulses, of shape [nb_doms, 3].

    Returns:
        Matrix of pairwise distances, of shape [nb_doms, nb_doms]
    """
Matrix of pairwise distances, of shape [nb_doms, nb_doms]
Matrix of pairwise distances of shape [ nb_doms nb_doms ]
xyz_coords
Tensor
(x,y,z)-coordinates of pulses, of shape [nb_doms, 3].
( x y z ) - coordinates of pulses of shape [ nb_doms 3 ] .