code: def test_loss_sparse(self):
      pos = torch.tensor(
          [
              [0, 0, 0],
              [1, 0, 0],
              [1.1, 0, 0],
              [0, 0, 0],
              [1, 0, 0],
              [1.1, 0, 0],
          ],
          dtype=torch.float,
      )
      f = torch.tensor([1, 1, 3, 0, 1, 0], dtype=torch.float)
      batch_idx = torch.tensor([0, 0, 0, 1, 1, 1])
  
      var = _variance_estimator_sparse(1.01, pos, f, batch_idx)
      torch.testing.assert_allclose(var, [0, 4, 4, 1, 2, 1])
  
      loss = dirichlet_loss(1.01, pos, f, batch_idx)
      self.assertAlmostEqual(
          loss.item(), sum([0, 4, 4, 1, 2, 1]) / (2 * 6)
      )
  
file_path: torch-points3d/test/test_losses.py
imports: import unittest
  import torch
  import os
  import sys
  from torch_points3d.core.losses.dirichlet_loss import _variance_estimator_dense, dirichlet_loss, _variance_estimator_sparse
label_desc: Use image node_id 2 for calling the TestDirichletLoss obj's underlying member method code with example usage: obj.test_loss_sparse() without return types