docstr: composite rays' rgbs, according to the ray marching formula.
  Args:
      rgbs: float, [M, 3]
      sigmas: float, [M,]
      ts: float, [M, 2]
      rays: int32, [N, 3]
  Returns:
      weights: float, [M]
      weights_sum: float, [N,], the alpha channel
      depth: float, [N, ], the Depth
      image: float, [N, 3], the RGB channel (after multiplying alpha!)
docstr_tok: ["composite","rays","'","rgbs",",","according","to","the","ray","marching","formula",".","Args",":","rgbs",":","float",",","[","M",",","3","]","sigmas",":","float",",","[","M",",","]","ts",":","float",",","[","M",",","2","]","rays",":","int32",",","[","N",",","3","]","Returns",":","weights",":","float",",","[","M","]","weights_sum",":","float",",","[","N",",","]",",","the","alpha","channel","depth",":","float",",","[","N",",","]",",","the","Depth","image",":","float",",","[","N",",","3","]",",","the","RGB","channel","(","after","multiplying","alpha","!",")"]
code: def forward(
      ctx, sigmas, rgbs, ts, rays, T_thresh=1e-4, binarize=False
  ):
      """composite rays' rgbs, according to the ray marching formula.
      Args:
          rgbs: float, [M, 3]
          sigmas: float, [M,]
          ts: float, [M, 2]
          rays: int32, [N, 3]
      Returns:
          weights: float, [M]
          weights_sum: float, [N,], the alpha channel
          depth: float, [N, ], the Depth
          image: float, [N, 3], the RGB channel (after multiplying alpha!)
      """
  
      sigmas = sigmas.float().contiguous()
      rgbs = rgbs.float().contiguous()
  
      M = sigmas.shape[0]
      N = rays.shape[0]
  
      weights = torch.zeros(
          M, dtype=sigmas.dtype, device=sigmas.device
      )  # may leave unmodified, so init with 0
      weights_sum = torch.empty(
          N, dtype=sigmas.dtype, device=sigmas.device
      )
  
      depth = torch.empty(N, dtype=sigmas.dtype, device=sigmas.device)
      image = torch.empty(
          N, 3, dtype=sigmas.dtype, device=sigmas.device
      )
  
      get_backend().composite_rays_train_forward(
          sigmas,
          rgbs,
          ts,
          rays,
          M,
          N,
          T_thresh,
          binarize,
          weights,
          weights_sum,
          depth,
          image,
      )
  
      ctx.save_for_backward(
          sigmas, rgbs, ts, rays, weights_sum, depth, image
      )
      ctx.dims = [M, N, T_thresh, binarize]
  
      return weights, weights_sum, depth, image
  
imports: import torch
  from torch.autograd import Function
  from torch.cuda.amp import custom_bwd, custom_fwd
label_desc: Use image node_id 1 for calling the _composite_rays_train obj's underlying member method code with example usage: obj.forward(ctx, sigmas, rgbs, ts, rays, T_thresh, binarize) and returns: weights,  weights_sum,  depth,  image