torch_geometric.nn.pool.L2KNNIndex

class L2KNNIndex(emb: Optional[Tensor] = None)[source]

Bases: KNNIndex

Performs fast \(k\)-nearest neighbor search (\(k\)-NN) based on the \(L_2\) metric via the faiss library.

Parameters:

emb (torch.Tensor, optional) – The data points to add. (default: None)