code: def test_rotate_on_spot_yaw(self):
      N = 14
      eye = torch.rand(N, 3)
      at = torch.rand(N, 3)
      up = torch.rand(N, 3)
  
      R, T = look_at_view_transform(eye=eye, at=at, up=up)
  
      # Moving around the y axis looks left.
      angles = torch.FloatTensor([0, -radians(10), 0])
      rotation = axis_angle_to_matrix(angles)
      R_rot, T_rot = rotate_on_spot(R, T, rotation)
  
      eye_rot, at_rot, up_rot = camera_to_eye_at_up(
          get_world_to_view_transform(R=R_rot, T=T_rot)
      )
      self.assertClose(eye, eye_rot, atol=1e-5)
  
      # Make vectors pointing exactly left and up
      left = torch.cross(up, at - eye, dim=-1)
      left_rot = torch.cross(up_rot, at_rot - eye_rot, dim=-1)
      fully_up = torch.cross(at - eye, left, dim=-1)
      fully_up_rot = torch.cross(at_rot - eye_rot, left_rot, dim=-1)
  
      # The up direction is unchanged
      self.assertClose(
          normalize(fully_up), normalize(fully_up_rot), atol=1e-5
      )
  
      # The camera has moved left
      agree = _batched_dotprod(
          torch.cross(left, left_rot, dim=1), fully_up
      )
      self.assertGreater(agree.min(), 0)
  
      # Batch dimension for rotation
      R_rot2, T_rot2 = rotate_on_spot(R, T, rotation.expand(N, 3, 3))
      self.assertClose(R_rot, R_rot2)
      self.assertClose(T_rot, T_rot2)
  
      # No batch dimension for either
      R_rot3, T_rot3 = rotate_on_spot(R[0], T[0], rotation)
      self.assertClose(R_rot[:1], R_rot3)
      self.assertClose(T_rot[:1], T_rot3)
  
      # No batch dimension for R, T
      R_rot4, T_rot4 = rotate_on_spot(
          R[0], T[0], rotation.expand(N, 3, 3)
      )
      self.assertClose(R_rot[:1].expand(N, 3, 3), R_rot4)
      self.assertClose(T_rot[:1].expand(N, 3), T_rot4)
  
file_path: pytorch3d/tests/test_camera_utils.py
imports: import unittest
  from math import radians
  import torch
  from pytorch3d.renderer.camera_utils import camera_to_eye_at_up, rotate_on_spot
  from pytorch3d.renderer.cameras import get_world_to_view_transform, look_at_view_transform, PerspectiveCameras
  from pytorch3d.transforms import axis_angle_to_matrix
  from torch.nn.functional import normalize
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 3 for calling the TestCameraUtils obj's underlying member method code with example usage: obj.test_rotate_on_spot_yaw() without return types