code: def sample_uniform_sphere(
      size: int, radius: torch.Tensor, device: torch.device
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      """
      Sample points uniformly on a sphere.
  
      Args:
          size (int): Number of points to sample.
          device (torch.device): Device to allocate tensors on.
          radius (torch.Tensor): Radii for the points.
  
      Returns:
          Tuple: Contains the following:
              - centers (torch.Tensor): The Cartesian coordinates of the sampled points.
              - thetas (torch.Tensor): Elevation angles in radians.
              - phis (torch.Tensor): Azimuth angles in radians.
      """
      # Generate unit vectors
      unit_centers = F.normalize(
          torch.stack(
              [
                  torch.randn(size, device=device),
                  torch.abs(torch.randn(size, device=device)),
                  torch.randn(size, device=device),
              ],
              dim=-1,
          ),
          p=2,
          dim=1,
      )
      # Generate radii and scale unit vectors
      centers = unit_centers * radius.unsqueeze(-1)
      # Calculate spherical coordinates
      thetas = torch.acos(unit_centers[:, 1])
      phis = torch.atan2(unit_centers[:, 0], unit_centers[:, 2])
      phis[phis < 0] += 2 * np.pi
  
      return centers, thetas, phis
  
file_path: NeMo/nemo/collections/multimodal/data/nerf/random_poses.py
imports: import random
  from typing import Any, Dict, Iterator, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn.functional
  from torch.utils.data import IterableDataset
  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 3 for calling a global function with example usage: sample_uniform_sphere(size, radius, device) and returns: centers,  thetas,  phis