code: def test_uniform_ray_dataset(self, device, dtype):
      cameras = create_four_cameras(device, dtype)
      imgs = create_random_images_for_cameras(cameras)
      dataset = RayDataset(
          cameras, 1, 2, False, device=device, dtype=dtype
      )
      dataset.init_ray_dataset()
      dataset.init_images_for_training(imgs)
  
      batch_size = 32
      data_loader = instantiate_ray_dataloader(
          dataset, batch_size=batch_size, shuffle=False
      )
      d = next(iter(data_loader))  # First batch of 32 labeled rays
  
      # Check dimensions
      assert d[0].shape == (batch_size, 3)  # Ray origins
      assert d[1].shape == (batch_size, 3)  # Ray directions
      assert d[2].shape == (batch_size, 3)  # Ray rgbs
  
      # Comparing RGB values between sampled rays and original images
      assert_close(
          d[2][0].cpu().to(dtype), (imgs[0][:, 0, 0] / 255.0).to(dtype)
      )
      assert_close(
          d[2][1].cpu().to(dtype), (imgs[0][:, 0, 1] / 255.0).to(dtype)
      )  # First row, second column in the image (1 sample point index)
      assert_close(
          d[2][9].cpu().to(dtype), (imgs[0][:, 1, 0] / 255.0).to(dtype)
      )
  
file_path: kornia/test/nerf/test_data_utils.py
imports: from __future__ import annotations
  import torch
  from kornia.core import Device, Tensor
  from kornia.geometry.camera import PinholeCamera
  from kornia.nerf.data_utils import RayDataset, instantiate_ray_dataloader
  from kornia.testing import assert_close
  from test.nerf.test_rays import create_four_cameras
label_desc: Use image node_id 1 for calling the TestDataset obj's underlying member method code with example usage: obj.test_uniform_ray_dataset(device, dtype) without return types