code: def forward(
      self,
      rays_chunk,
      white_bg=True,
      is_train=False,
      ndc_ray=False,
      N_samples=-1,
  ):
      # sample points
      viewdirs = rays_chunk[:, 3:6]
      if ndc_ray:
          xyz_sampled, z_vals, ray_valid = self.sample_ray_ndc(
              rays_chunk[:, :3],
              viewdirs,
              is_train=is_train,
              N_samples=N_samples,
          )
          dists = torch.cat(
              (
                  z_vals[:, 1:] - z_vals[:, :-1],
                  torch.zeros_like(z_vals[:, :1]),
              ),
              dim=-1,
          )
          rays_norm = torch.norm(viewdirs, dim=-1, keepdim=True)
          dists = dists * rays_norm
          viewdirs = viewdirs / rays_norm
      else:
          xyz_sampled, z_vals, ray_valid = self.sample_ray(
              rays_chunk[:, :3],
              viewdirs,
              is_train=is_train,
              N_samples=N_samples,
          )
          dists = torch.cat(
              (
                  z_vals[:, 1:] - z_vals[:, :-1],
                  torch.zeros_like(z_vals[:, :1]),
              ),
              dim=-1,
          )
      viewdirs = viewdirs.view(-1, 1, 3).expand(xyz_sampled.shape)
  
      if self.alphaMask is not None:
          alphas = self.alphaMask.sample_alpha(xyz_sampled[ray_valid])
          alpha_mask = alphas > 0
          ray_invalid = ~ray_valid
          ray_invalid[ray_valid] |= ~alpha_mask
          ray_valid = ~ray_invalid
  
      sigma = torch.zeros(
          xyz_sampled.shape[:-1], device=xyz_sampled.device
      )
      rgb = torch.zeros(
          (*xyz_sampled.shape[:2], 3), device=xyz_sampled.device
      )
  
      if ray_valid.any():
          xyz_sampled = self.normalize_coord(xyz_sampled)
          sigma_feature = self.compute_densityfeature(
              xyz_sampled[ray_valid]
          )
  
          validsigma = self.feature2density(sigma_feature)
          sigma[ray_valid] = validsigma
  
      alpha, weight, bg_weight = raw2alpha(
          sigma, dists * self.distance_scale
      )
  
      app_mask = weight > self.rayMarch_weight_thres
  
      if app_mask.any():
          app_features = self.compute_appfeature(xyz_sampled[app_mask])
          valid_rgbs = self.renderModule(
              xyz_sampled[app_mask], viewdirs[app_mask], app_features
          )
          rgb[app_mask] = valid_rgbs
  
      acc_map = torch.sum(weight, -1)
      rgb_map = torch.sum(weight[..., None] * rgb, -2)
  
      if white_bg or (is_train and torch.rand((1,)) < 0.5):
          rgb_map = rgb_map + (1.0 - acc_map[..., None])
  
      rgb_map = rgb_map.clamp(0, 1)
  
      with torch.no_grad():
          depth_map = torch.sum(weight * z_vals, -1)
          depth_map = depth_map + (1.0 - acc_map) * rays_chunk[..., -1]
  
      return rgb_map, depth_map
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from .sh import eval_sh_bases
  import numpy
  import time
label_desc: Use image node_id 21 for calling the TensorBase obj's underlying member method code with example usage: obj.forward(rays_chunk, white_bg, is_train, ndc_ray, N_samples) and returns: rgb_map,  depth_map