code: def _MatrixSolveGrad(op: ops.Operation, grad):
      """Gradient for MatrixSolve."""
      a = op.inputs[0]
      adjoint_a = op.get_attr("adjoint")
      c = op.outputs[0]
      grad_b = linalg_ops.matrix_solve(a, grad, adjoint=not adjoint_a)
      if adjoint_a:
          grad_a = -math_ops.matmul(
              c, grad_b, adjoint_b=True
          )  # pylint: disable=invalid-unary-operand-type
      else:
          grad_a = -math_ops.matmul(
              grad_b, c, adjoint_b=True
          )  # pylint: disable=invalid-unary-operand-type
      return (grad_a, grad_b)
  
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import gen_linalg_ops
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.linalg import linalg_impl
label_desc: Use image node_id 8 for calling a global function with example usage: _MatrixSolveGrad(op, grad) and returns: grad_a,  grad_b