class_docstr: A dataset class to generate random poses.
class_docstr_tok: ["A","dataset","class","to","generate","random","poses","."]
docstr: Collate function to bundle multiple samples into a single batch.
  
  Args:
      batch (List[Dict]): List of samples to collate.
  
  Returns:
      Dict: A dictionary containing the collated batch.
docstr_tok: ["Collate","function","to","bundle","multiple","samples","into","a","single","batch",".","Args",":","batch","(","List","[","Dict","]",")",":","List","of","samples","to","collate",".","Returns",":","Dict",":","A","dictionary","containing","the","collated","batch","."]
code: def collate_fn(self, batch: List[Dict[str, Any]]) -> Dict[str, Any]:
      """
      Collate function to bundle multiple samples into a single batch.
  
      Args:
          batch (List[Dict]): List of samples to collate.
  
      Returns:
          Dict: A dictionary containing the collated batch.
      """
      return {
          "height": self.height,
          "width": self.width,
          "rays_o": torch.cat(
              [item["rays_o"] for item in batch], dim=0
          ),
          "rays_d": torch.cat(
              [item["rays_d"] for item in batch], dim=0
          ),
          "mvp": torch.cat([item["mvp"] for item in batch], dim=0),
          "dir": torch.cat([item["dir"] for item in batch], dim=0),
          "azimuth": torch.cat(
              [item["azimuth"] for item in batch], dim=0
          ),
      }
  
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 6 for calling the RandomPosesDataset obj's underlying member method code with example usage: obj.collate_fn(batch) and returns: dict