docstr: Test the AO raymarching algorithm.
docstr_tok: ["Test","the","AO","raymarching","algorithm","."]
code: def test_absorption_only(self):
      """
      Test the AO raymarching algorithm.
      """
      (
          rays_z,
          rays_densities,
          rays_features,
          depths_gt,
          features_gt,
          opacities_gt,
      ) = TestRaymarching._init_random_rays(
          n_rays=1000, n_pts_per_ray=9, device=None, dtype=torch.float32
      )
  
      # init the AO raymarcher
      raymarcher_ao = AbsorptionOnlyRaymarcher()
  
      # allow gradients for a differentiability check
      rays_densities.requires_grad = True
  
      # render opacities, check with gt and check that returned features are None
      opacities_render = raymarcher_ao(rays_densities)[..., 0]
      self.assertClose(opacities_render, opacities_gt)
  
      # check differentiability
      loss = opacities_render.mean()
      loss.backward()
      self.assertTrue(torch.isfinite(rays_densities.grad.data).all())
  
file_path: pytorch3d/tests/test_raymarching.py
imports: import unittest
  import torch
  from pytorch3d.renderer import AbsorptionOnlyRaymarcher, EmissionAbsorptionRaymarcher
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 7 for calling the TestRaymarching obj's underlying member method code with example usage: obj.test_absorption_only() without return types