class_docstr: Layer to transform a depth image into a point cloud
      
class_docstr_tok: ["Layer","to","transform","a","depth","image","into","a","point","cloud"]
code: def __init__(self, batch_size, height, width, ctx=mx.cpu()):
      super(BackprojectDepth, self).__init__()
  
      self.batch_size = batch_size
      self.height = height
      self.width = width
  
      self.ctx = ctx
  
      meshgrid = np.meshgrid(
          range(self.width), range(self.height), indexing="xy"
      )
      id_coords = np.stack(meshgrid, axis=0).astype(np.float32)
      id_coords = mx.nd.array(id_coords).as_in_context(self.ctx)
  
      pix_coords = mx.nd.expand_dims(
          mx.nd.stack(
              *[id_coords[0].reshape(-1), id_coords[1].reshape(-1)],
              axis=0,
          ),
          axis=0,
      )
      pix_coords = pix_coords.repeat(repeats=batch_size, axis=0)
      pix_coords = pix_coords.as_in_context(self.ctx)
  
      with self.name_scope():
          self.id_coords = self.params.get(
              "id_coords",
              shape=id_coords.shape,
              init=mx.init.Zero(),
              grad_req="null",
          )
          self.id_coords.initialize(ctx=self.ctx)
          self.id_coords.set_data(mx.nd.array(id_coords))
  
          self.ones = self.params.get(
              "ones",
              shape=(self.batch_size, 1, self.height * self.width),
              init=mx.init.One(),
              grad_req="null",
          )
          self.ones.initialize(ctx=self.ctx)
  
          self.pix_coords = self.params.get(
              "pix_coords",
              shape=(self.batch_size, 3, self.height * self.width),
              init=mx.init.Zero(),
              grad_req="null",
          )
          self.pix_coords.initialize(ctx=self.ctx)
          self.pix_coords.set_data(
              mx.nd.concat(pix_coords, self.ones.data(), dim=1)
          )
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import mxnet
  from mxnet.gluon import nn
label_desc: Use image node_id 1 to create a new BackprojectDepth object from inherited base classes: nn with example: obj = BackprojectDepth(batch_size, height, width, ctx)