code: def testPivoting(self):
      # This matrix triggers partial pivoting because the first diagonal entry
      # is small.
      data = np.array([[1e-9, 1.0, 0.0], [1.0, 0.0, 0], [0.0, 1.0, 5]])
      self._verifyLu(data.astype(np.float32))
  
      for dtype in (np.float32, np.float64):
          with self.subTest(dtype=dtype):
              self._verifyLu(data.astype(dtype))
              _, p = linalg_ops.lu(data)
              p_val = self.evaluate([p])
              # Make sure p_val is not the identity permutation.
              self.assertNotAllClose(np.arange(3), p_val)
  
      for dtype in (np.complex64, np.complex128):
          with self.subTest(dtype=dtype):
              complex_data = np.tril(1j * data, -1).astype(dtype)
              complex_data += np.triu(-1j * data, 1).astype(dtype)
              complex_data += data
              self._verifyLu(complex_data)
              _, p = linalg_ops.lu(data)
              p_val = self.evaluate([p])
              # Make sure p_val is not the identity permutation.
              self.assertNotAllClose(np.arange(3), p_val)
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  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 array_ops_stack
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import map_fn
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the LuOpTest obj's underlying member method code with example usage: obj.testPivoting() without return types