code: def test_compute_pixel_radii_from_grid(self):
      pixel_grid = torch.tensor(
          [
              [[0.0, 0, 0], [1.0, 0.0, 0], [3.0, 0.0, 0.0]],
              [[0.0, 0.25, 0], [1.0, 0.25, 0], [3.0, 0.25, 0]],
              [[0.0, 1, 0], [1.0, 1.0, 0], [3.0000, 1.0, 0]],
          ]
      )
  
      expected_y_norm = torch.tensor(
          [
              [0.25, 0.25, 0.25],
              [0.75, 0.75, 0.75],
              [0.75, 0.75, 0.75],  # duplicated from previous row
          ]
      )
      expected_x_norm = torch.tensor(
          [
              # 3rd column is duplicated from 2nd
              [1.0, 2.0, 2.0],
              [1.0, 2.0, 2.0],
              [1.0, 2.0, 2.0],
          ]
      )
      expected_radii = (expected_x_norm + expected_y_norm) / 12**0.5
      radii = compute_pixel_radii_from_grid(pixel_grid)
      self.assertClose(radii, expected_radii[..., None])
  
imports: import unittest
  from itertools import product
  from typing import Tuple
  from unittest.mock import patch
  import torch
  from pytorch3d.common.compat import meshgrid_ij
  from pytorch3d.implicitron.models.renderer.base import EvaluationMode
  from pytorch3d.implicitron.models.renderer.ray_sampler import AdaptiveRaySampler, compute_radii, NearFarRaySampler
  from pytorch3d.renderer.cameras import CamerasBase, FoVOrthographicCameras, FoVPerspectiveCameras, OrthographicCameras, PerspectiveCameras
  from pytorch3d.renderer.implicit.utils import HeterogeneousRayBundle
  from tests.common_camera_utils import init_random_cameras
  from tests.common_testing import TestCaseMixin
label_desc: Use image node_id 1 for calling the TestRadiiComputationOnFullGrid obj's underlying member method code with example usage: obj.test_compute_pixel_radii_from_grid() without return types