code: def backward(ctx, grad):
      # grad: [B, C * C]
  
      inputs, dy_dx = ctx.saved_tensors
  
      if dy_dx is not None:
          grad = grad.contiguous()
          B, input_dim, degree = ctx.dims
          grad_inputs = torch.zeros_like(inputs)
          _backend.sh_encode_backward(
              grad, inputs, B, input_dim, degree, dy_dx, grad_inputs
          )
          return grad_inputs, None, None
      else:
          return None, None, None
  
file_path: NeMo/nemo/collections/multimodal/modules/nerf/utils/torch_ngp/shencoder.py
imports: import _shencoder
  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 2 for calling the _sh_encoder obj's underlying member method code with example usage: obj.backward(ctx, grad) and returns: grad_inputs,  None,  None, None,  None,  None