code: def circle_poses(
      radius: torch.Tensor = torch.tensor([3.2]),
      theta: torch.Tensor = torch.tensor([60]),
      phi: torch.Tensor = torch.tensor([0]),
      angle_overhead: float = 30,
      angle_front: float = 60,
      return_dirs: bool = False,
      device: torch.device = "cuda",
  ) -> torch.Tensor:
      """
      Generate camera poses based on a circular arrangement.
  
      Parameters:
          radius: torch.Tensor - Radii for the camera positions.
          theta: torch.Tensor - Theta angles for the camera positions.
          phi: torch.Tensor - Phi angles for the camera positions.
          angle_overhead: float - Angle range of the overhead view.
          angle_front: float - Angle range of the front view.
          return_dirs: bool - Whether to return the view directions.
          device: str - The device to allocate the tensor on (e.g., 'cuda' or 'cpu').
  
      Returns:
          Tuple: Contains the following:
              - poses (torch.Tensor): Generated poses, shape [size, 4, 4].
              - dirs (torch.Tensor, optional): View directions, if requested.
      """
      # Convert degrees to radians for theta and phi
      theta = theta / 180 * np.pi
      phi = phi / 180 * np.pi
      angle_overhead = angle_overhead / 180 * np.pi
      angle_front = angle_front / 180 * np.pi
  
      # Calculate camera centers in Cartesian coordinates
      centers = torch.stack(
          [
              radius * torch.sin(theta) * torch.sin(phi),
              radius * torch.cos(theta),
              radius * torch.sin(theta) * torch.cos(phi),
          ],
          dim=-1,
      )  # [B, 3]
  
      # Compute camera look-at matrix
      forward_vector, up_vector, right_vector = compute_look_at_vectors(
          centers=centers, device=device
      )
  
      # Construct the 4x4 pose matrices
      poses = construct_poses(
          centers=centers,
          right_vector=right_vector,
          up_vector=up_vector,
          forward_vector=forward_vector,
          device=device,
      )
  
      dirs = (
          get_view_direction(theta, phi, angle_overhead, angle_front)
          if return_dirs
          else None
      )
  
      return poses, dirs
  
file_path: NeMo/nemo/collections/multimodal/data/nerf/circle_poses.py
imports: from typing import Dict, Union
  import numpy
  import torch
  from torch.utils.data import Dataset
  from nemo.collections.multimodal.data.nerf.cameras import PinholeCamera
  from nemo.collections.multimodal.data.nerf.utils import compute_look_at_vectors, construct_poses, get_rays, get_view_direction
label_desc: Use image node_id 1 for calling a global function with example usage: circle_poses(radius, theta, phi, angle_overhead, angle_front, return_dirs, device) and returns: poses,  dirs