ClikaRT::ops::pairwise_distance
function
pairwise_distance()
Tensor pairwise_distance(
Tensor a,
Tensor b,
Scalar p = 2.0,
std::optional<double> eps = std::nullopt,
bool keepdim = false
)
Row-wise L_p distance between two batched vectors.
Reduces the LAST axis; leading dims broadcast.
Parameters
a: left operand[.., K].b: right operand[.., K].p: the norm degree, an int or floatScalar, kind-preserved; default 2.eps: small perturbation for gradient stability;std::nulloptselects 1e-6.keepdim: keep the reduced axis as size 1; default false.
Returns: the distances; the broadcast shape minus the last axis.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) when the trailing extents disagree.
Declared in ClikaRT/compute/ops.h, line 2858