code: def _GradWithInverseL(l, l_inverse, grad):
      middle = math_ops.matmul(l, grad, adjoint_a=True)
      middle = array_ops.matrix_set_diag(
          middle, 0.5 * array_ops.matrix_diag_part(middle)
      )
      middle = array_ops.matrix_band_part(middle, -1, 0)
      grad_a = math_ops.matmul(
          math_ops.matmul(l_inverse, middle, adjoint_a=True), l_inverse
      )
      grad_a += math_ops.conj(array_ops.matrix_transpose(grad_a))
      return grad_a * 0.5
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: _GradWithInverseL(l, l_inverse, grad) and returns: unknown