Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

torch_cdist

Cdist


Description

Cdist

Usage

torch_cdist(x1, x2, p = 2L, compute_mode = NULL)

Arguments

x1

(Tensor) input tensor of shape B \times P \times M.

x2

(Tensor) input tensor of shape B \times R \times M.

p

NA p value for the p-norm distance to calculate between each vector pair \in [0, ∞].

compute_mode

NA 'use_mm_for_euclid_dist_if_necessary' - will use matrix multiplication approach to calculate euclidean distance (p = 2) if P > 25 or R > 25 'use_mm_for_euclid_dist' - will always use matrix multiplication approach to calculate euclidean distance (p = 2) 'donot_use_mm_for_euclid_dist' - will never use matrix multiplication approach to calculate euclidean distance (p = 2) Default: use_mm_for_euclid_dist_if_necessary.

TEST

Computes batched the p-norm distance between each pair of the two collections of row vectors.


torch

Tensors and Neural Networks with 'GPU' Acceleration

v0.3.0
MIT + file LICENSE
Authors
Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.