code: def get_view_direction(
      thetas: torch.Tensor,
      phis: torch.Tensor,
      overhead: float,
      front: float,
  ) -> torch.Tensor:
      """
      Get the view direction based on given theta and phi values.
  
      Parameters:
      - thetas (torch.Tensor): Array of theta values with shape [B,]
      - phis (torch.Tensor): Array of phi values with shape [B,]
      - overhead (float): Threshold for determining top and bottom views.
      - front (float): Threshold for determining front, back and side views.
  
      Returns:
      - torch.Tensor: Array of view directions. Values can be:
          0: front
          1: side (camera left)
          2: back
          3: side (camera right)
          4: top
          5: bottom
  
      Notes:
      - Phi and theta values are assumed to be in radians.
      """
  
      num_samples = thetas.shape[0]
      res = torch.zeros(num_samples, dtype=torch.long)
  
      # Normalize phis values to [0, 2*pi]
      phis = phis % (2 * np.pi)
  
      # Determine direction based on phis
      res[(phis < front / 2) | (phis >= 2 * np.pi - front / 2)] = 0
      res[(phis >= front / 2) & (phis < np.pi - front / 2)] = 1
      res[(phis >= np.pi - front / 2) & (phis < np.pi + front / 2)] = 2
      res[
          (phis >= np.pi + front / 2) & (phis < 2 * np.pi - front / 2)
      ] = 3
  
      # Override directions based on thetas for top and bottom views
      res[thetas <= overhead] = 4
      res[thetas >= (np.pi - overhead)] = 5
  
      return res
  
file_path: NeMo/nemo/collections/multimodal/data/nerf/utils.py
imports: from typing import Dict, Optional
  import numpy
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: get_view_direction(thetas, phis, overhead, front) and returns: res