code: def geometry_guided_near_far_torch(
      orig, dir, vert, geo_threshold=DEFAULT_GEO_THRESH
  ):
      num_vert = vert.shape[0]
      num_rays = orig.shape[0]
      orig_ = torch.repeat_interleave(orig[:, None, :], num_vert, 1)
      dir_ = torch.repeat_interleave(dir[:, None, :], num_vert, 1)
      vert_ = torch.repeat_interleave(vert[None, ...], num_rays, 0)
      orig_v = vert_ - orig_
      z0 = torch.einsum(
          "ij,ij->i", orig_v.reshape(-1, 3), dir_.reshape(-1, 3)
      ).reshape(num_rays, num_vert)
      dz = torch.sqrt(
          geo_threshold**2
          - (torch.norm(orig_v, dim=2) ** 2 - z0**2)
      )
      near = z0 - dz
      near[near != near] = float("inf")
      near = near.min(dim=1)[0]
      far = z0 + dz
      far[far != far] = float("-inf")
      far = far.max(dim=1)[0]
      return near, far
  
file_path: ml-neuman/utils/ray_utils.py
imports: import numpy
  import torch
  import igl
  from geometry.pcd_projector import PointCloudProjectorNp
  from utils.constant import DEFAULT_GEO_THRESH, PERTURB_EPSILON
label_desc: Use image node_id 11 for calling a global function with example usage: geometry_guided_near_far_torch(orig, dir, vert, geo_threshold) and returns: near,  far