code: def _verifyInverse(self, x, np_type):
      for adjoint in False, True:
          y = x.astype(np_type)
          with self.session() as sess:
              # Verify that x^{-1} * x == Identity matrix.
              p = array_ops.placeholder(
                  dtypes.as_dtype(y.dtype), y.shape, name="x"
              )
              with self.test_scope():
                  inv = linalg_ops.matrix_inverse(p, adjoint=adjoint)
                  tf_ans = math_ops.matmul(inv, p, adjoint_b=adjoint)
                  np_ans = np.identity(y.shape[-1])
                  if x.ndim > 2:
                      tiling = list(y.shape)
                      tiling[-2:] = [1, 1]
                      np_ans = np.tile(np_ans, tiling)
              out = sess.run(tf_ans, feed_dict={p: y})
              self.assertAllClose(np_ans, out, rtol=1e-3, atol=1e-3)
              self.assertShapeEqual(y, tf_ans)
  
file_path: tensorflow/tensorflow/compiler/tests/matrix_inverse_op_test.py
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 1 for calling the InverseOpTest obj's underlying member method code with example usage: obj._verifyInverse(x, np_type) without return types