code: def _variance_estimator_sparse(r, pos, f, batch_idx):
      with torch.no_grad():
          assign_index = radius(
              pos, pos, r, batch_x=batch_idx, batch_y=batch_idx
          )
          y_idx, x_idx = assign_index
          # diff = pos[x_idx] - pos[y_idx]
          # squared_distance = (diff * diff).sum(dim=-1, keepdim=True)
          # weights = 1.0 / torch.clamp(squared_distance, min=1e-16)
  
          grad_f = (f[x_idx] - f[y_idx]) ** 2
      y = scatter_add(grad_f, y_idx, dim=0, dim_size=pos.size(0))
      return y
  
file_path: torch-points3d/torch_points3d/core/losses/dirichlet_loss.py
imports: import torch
  import torch_points_kernels
  from torch_cluster import radius
  from torch_scatter import scatter_add
label_desc: Use image node_id 5 for calling a global function with example usage: _variance_estimator_sparse(r, pos, f, batch_idx) and returns: y