code: def forward(
      ctx,
      in1: torch.Tensor,
      in2: torch.Tensor,
      idx1: torch.Tensor,
      grad_out: torch.Tensor,
  ) -> torch.Tensor:
      if not in1.is_contiguous():
          in1 = in1.contiguous()
      if not in2.is_contiguous():
          in2 = in2.contiguous()
      if not idx1.is_contiguous():
          idx1 = idx1.contiguous()
      if not grad_out.is_contiguous():
          grad_out = grad_out.contiguous()
  
      assert in1.is_contiguous()
      assert in2.is_contiguous()
      assert idx1.is_contiguous()
      assert grad_out.is_contiguous()
  
      grad_in1 = torch.zeros_like(in1)
      grad_in2 = torch.empty_like(in2)
  
      if in1.dtype == torch.float32:
          fused_index_mul_2d.float_backward(
              grad_in1, grad_in2, grad_out, in1, in2, idx1
          )
      elif in1.dtype == torch.half:
          fused_index_mul_2d.half_backward(
              grad_in1, grad_in2, grad_out, in1, in2, idx1
          )
  
      ctx.for_backwards = (in1, in2, idx1, grad_out)
      return grad_in1, grad_in2
  
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 1 for calling the IndexMul2dBackward_ obj's underlying member method code with example usage: obj.forward(ctx, in1, in2, idx1, grad_out) and returns: grad_in1,  grad_in2