code: def read_binvox_coords(
      f,
      integer_division: bool = True,
      dtype: torch.dtype = torch.float32,
  ):  # pragma: no cover
      """
      Copied from meshrcnn codebase:
      https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/binvox_torch.py#L5
  
      Read a binvox file and return the indices of all nonzero voxels.
  
      This matches the behavior of binvox_rw.read_as_coord_array
      (https://github.com/dimatura/binvox-rw-py/blob/public/binvox_rw.py#L153)
      but this implementation uses torch rather than numpy, and is more efficient
      due to improved vectorization.
  
      Georgia: I think that binvox_rw.read_as_coord_array actually has a bug; when converting
      linear indices into three-dimensional indices, they use floating-point
      division instead of integer division. We can reproduce their incorrect
      implementation by passing integer_division=False.
  
      Args:
        f (str): A file pointer to the binvox file to read
        integer_division (bool): If False, then match the buggy implementation from binvox_rw
        dtype: Datatype of the output tensor. Use float64 to match binvox_rw
  
      Returns:
        coords (tensor): A tensor of shape (N, 3) where N is the number of nonzero voxels,
             and coords[i] = (x, y, z) gives the index of the ith nonzero voxel. If the
             voxel grid has shape (V, V, V) then we have 0 <= x, y, z < V.
      """
      size, translation, scale = _read_binvox_header(f)
      storage = torch.ByteStorage.from_buffer(f.read())
      data = torch.tensor([], dtype=torch.uint8)
      # pyre-fixme[28]: Unexpected keyword argument `source`.
      data.set_(source=storage)
      vals, counts = data[::2], data[1::2]
      idxs = _compute_idxs(vals, counts)
      if not integer_division:
          idxs = idxs.to(dtype)
      x_idxs = idxs // (size * size)
      zy_idxs = idxs % (size * size)
      z_idxs = zy_idxs // size
      y_idxs = zy_idxs % size
      coords = torch.stack([x_idxs, y_idxs, z_idxs], dim=1)
      return coords.to(dtype)
  
imports: import math
  from typing import Dict, List
  import numpy
  import torch
  from pytorch3d.common.datatypes import Device
  from pytorch3d.datasets.utils import collate_batched_meshes
  from pytorch3d.ops import cubify
  from pytorch3d.renderer import HardPhongShader, MeshRasterizer, MeshRenderer, PointLights, RasterizationSettings, TexturesVertex
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.transforms import Transform3d
label_desc: Use image node_id 3 for calling a global function with example usage: read_binvox_coords(f, integer_division, dtype) and returns: coords