code: def forward(ctx, inputs, degree, output_dim):
      # inputs: [B, input_dim], float
      # RETURN: [B, F], float
  
      if not inputs.is_cuda:
          inputs = inputs.cuda()
      inputs = inputs.contiguous()
  
      B, input_dim = inputs.shape  # batch size, coord dim
  
      outputs = torch.empty(
          B, output_dim, dtype=inputs.dtype, device=inputs.device
      )
  
      _backend.freq_encode_forward(
          inputs, B, input_dim, degree, output_dim, outputs
      )
  
      ctx.save_for_backward(inputs, outputs)
      ctx.dims = [B, input_dim, degree, output_dim]
  
      return outputs
  
file_path: NeMo/nemo/collections/multimodal/modules/nerf/utils/torch_ngp/freqencoder.py
imports: import _freqencoder
  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 1 for calling the _freq_encoder obj's underlying member method code with example usage: obj.forward(ctx, inputs, degree, output_dim) and returns: outputs