code: def backward(ctx, grad_grad_in1, grad_grad_in2):
      if not grad_grad_in1.is_contiguous():
          grad_grad_in1 = grad_grad_in1.contiguous()
      if not grad_grad_in2.is_contiguous():
          grad_grad_in2 = grad_grad_in2.contiguous()
  
      assert grad_grad_in1.is_contiguous()
      assert grad_grad_in2.is_contiguous()
  
      in1, in2, idx1, grad_out = ctx.for_backwards
  
      grad_in1 = torch.zeros_like(in1)
      grad_in2 = torch.empty_like(in2)
      grad_grad_out = torch.empty_like(grad_out)
  
      if in1.dtype == torch.float32:
          fused_index_mul_2d.float_backward_backward(
              grad_grad_out,
              grad_in1,
              grad_in2,
              grad_out,
              grad_grad_in1,
              grad_grad_in2,
              in1,
              in2,
              idx1,
          )
      elif in1.dtype == torch.half:
          fused_index_mul_2d.half_backward_backward(
              grad_grad_out,
              grad_in1,
              grad_in2,
              grad_out,
              grad_grad_in1,
              grad_grad_in2,
              in1,
              in2,
              idx1,
          )
  
      return grad_in1, grad_in2, None, grad_grad_out
  
file_path: apex/apex/contrib/index_mul_2d/index_mul_2d.py
imports: import torch
  import fused_index_mul_2d
label_desc: Use image node_id 2 for calling the IndexMul2dBackward_ obj's underlying member method code with example usage: obj.backward(ctx, grad_grad_in1, grad_grad_in2) and returns: grad_in1,  grad_in2,  None,  grad_grad_out