一、原始pytorch实现最远点采样算法 import torch def farthest_point_sample(xyz, M): """ Input: xyz: pointcloud data, [B, N, 3] M: number of samples Return: centroids: sampled pointcloud index, [B, M]采样点云索引 """ device = xyz.device # cpu or cuda B, N, C = xyz.shape