docstr: Checks the shapes of raysampler outputs.
docstr_tok: ["Checks","the","shapes","of","raysampler","outputs","."]
code: def _check_raysampler_output_shapes(
      self,
      raysampler,
      ray_bundle,
      batch_size,
      image_width,
      image_height,
      n_pts_per_ray,
  ):
      """
      Checks the shapes of raysampler outputs.
      """
  
      if isinstance(raysampler, MultinomialRaysampler):
          spatial_size = [image_height, image_width]
      elif isinstance(raysampler, MonteCarloRaysampler):
          spatial_size = [image_height * image_width]
      else:
          raise ValueError(str(type(raysampler)))
  
      self._check_grid_shape(
          ray_bundle.xys, batch_size, spatial_size, 0, 2
      )
      self._check_grid_shape(
          ray_bundle.origins, batch_size, spatial_size, 0, 3
      )
      self._check_grid_shape(
          ray_bundle.directions, batch_size, spatial_size, 0, 3
      )
      self._check_grid_shape(
          ray_bundle.lengths, batch_size, spatial_size, n_pts_per_ray, 0
      )
  
imports: import unittest
  from typing import Callable
  import torch
  from pytorch3d.common.compat import meshgrid_ij
  from pytorch3d.ops import eyes
  from pytorch3d.renderer import MonteCarloRaysampler, MultinomialRaysampler, NDCGridRaysampler, NDCMultinomialRaysampler
  from pytorch3d.renderer.cameras import FoVOrthographicCameras, FoVPerspectiveCameras, OrthographicCameras, PerspectiveCameras
  from pytorch3d.renderer.implicit.raysampling import _jiggle_within_stratas, _safe_multinomial
  from pytorch3d.renderer.implicit.utils import ray_bundle_to_ray_points, ray_bundle_variables_to_ray_points
  from pytorch3d.transforms import Rotate
  from .common_testing import TestCaseMixin
  from .test_cameras import init_random_cameras
label_desc: Use image node_id 6 for calling the TestRaysampling obj's underlying member method code with example usage: obj._check_raysampler_output_shapes(raysampler, ray_bundle, batch_size, image_width, image_height, n_pts_per_ray) without return types