class_docstr: Extract patches on a point cloud
class_docstr_tok: ["Extract","patches","on","a","point","cloud"]
code: def __call__(self, data: Data, ind):
      pos = data.pos
      point = pos[ind].view(1, 3)
      ind, dist = ball_query(
          point, pos, radius=self.radius_patch, max_num=-1, mode=1
      )
  
      row, col = ind[dist[:, 0] > 0].t()
      patch = Data()
      for key in data.keys:
          if torch.is_tensor(data[key]):
              if torch.all(col < data[key].shape[0]):
                  patch[key] = data[key][col]
  
      return patch
  
imports: import collections
  import errno
  import numpy
  import os
  import os.path
  import torch
  from torch_geometric.data import Data
  from torch_points_kernels.points_cpu import ball_query
  import imageio
  from tqdm.auto import tqdm
  from torch_points3d.core.data_transform import GridSampling3D, SaveOriginalPosId
  from torch_geometric.transforms import Compose
  import torch_points3d.datasets.registration.fusion
  from torch_cluster import fps
label_desc: Use image node_id 2 for calling the PatchExtractor obj's underlying member method code with example usage: obj.__call__(data, ind) and returns: patch