code: def forward(self, inputs, bound=1, max_level=None):
      # inputs: [..., input_dim], normalized real world positions in [-bound, bound]
      # max_level: only calculate first max_level levels (None will use all levels)
      # return: [..., num_levels * level_dim]
  
      inputs = (inputs + bound) / (2 * bound)  # map to [0, 1]
  
      # print('inputs', inputs.shape, inputs.dtype, inputs.min().item(), inputs.max().item())
  
      prefix_shape = list(inputs.shape[:-1])
      inputs = inputs.view(-1, self.input_dim)
  
      outputs = grid_encode(
          inputs,
          self.embeddings,
          self.offsets,
          self.per_level_scale,
          self.base_resolution,
          inputs.requires_grad,
          self.gridtype_id,
          self.align_corners,
          self.interp_id,
          max_level,
      )
      outputs = outputs.view(prefix_shape + [self.output_dim])
  
      # print('outputs', outputs.shape, outputs.dtype, outputs.min().item(), outputs.max().item())
  
      return outputs
  
file_path: NeMo/nemo/collections/multimodal/modules/nerf/utils/torch_ngp/gridencoder.py
imports: import math
  import _gridencoder
  import numpy
  import torch
  import torch.nn
  from torch.autograd import Function
  from torch.cuda.amp import custom_bwd, custom_fwd
label_desc: Use image node_id 4 for calling the GridEncoder obj's underlying member method code with example usage: obj.forward(inputs, bound, max_level) and returns: outputs