code: def construct_poses(
      centers: torch.Tensor,
      right_vector: torch.Tensor,
      up_vector: torch.Tensor,
      forward_vector: torch.Tensor,
      device: torch.device,
  ) -> torch.Tensor:
      """
      Construct the 4x4 pose matrices.
  
      Args:
          size (int): Number of pose matrices to construct.
          centers (torch.Tensor): The Cartesian coordinates of the camera centers.
          right_vector (torch.Tensor): The right vectors of the cameras.
          up_vector (torch.Tensor): The up vectors of the cameras.
          forward_vector (torch.Tensor): The forward vectors of the cameras.
          device (torch.device): Device to allocate tensors on.
  
      Returns:
          torch.Tensor: The pose matrices, shape [size, 4, 4].
      """
      poses = (
          torch.eye(4, dtype=torch.float32, device=device)
          .unsqueeze(0)
          .repeat(len(centers), 1, 1)
      )
      poses[:, :3, :3] = torch.stack(
          [right_vector, up_vector, forward_vector], dim=-1
      )
      poses[:, :3, 3] = centers
  
      return poses
  
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 3 for calling a global function with example usage: construct_poses(centers, right_vector, up_vector, forward_vector, device) and returns: poses