code: def _GetSmallMatrixSolveLsOpTests(
      dtype, use_placeholder, fast, l2_regularizer
  ):
      def Square(self):
          # 2x2 matrices, 2x3 right-hand sides.
          matrix = np.array([[1.0, 2.0], [3.0, 4.0]])
          rhs = np.array([[1.0, 0.0, 1.0], [0.0, 1.0, 1.0]])
          for batch_shape in (), (2, 3):
              self._verifySolve(
                  matrix,
                  rhs,
                  dtype,
                  use_placeholder,
                  fast,
                  l2_regularizer,
                  batch_shape=batch_shape,
              )
  
      def Overdetermined(self):
          # 2x2 matrices, 2x3 right-hand sides.
          matrix = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
          rhs = np.array(
              [[1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 1.0, 0.0]]
          )
          for batch_shape in (), (2, 3):
              self._verifySolve(
                  matrix,
                  rhs,
                  dtype,
                  use_placeholder,
                  fast,
                  l2_regularizer,
                  batch_shape=batch_shape,
              )
  
      def Underdetermined(self):
          # 2x2 matrices, 2x3 right-hand sides.
          matrix = np.array([[1.0, 2.0, 3], [4.0, 5.0, 6.0]])
          rhs = np.array([[1.0, 0.0, 1.0], [0.0, 1.0, 1.0]])
          for batch_shape in (), (2, 3):
              self._verifySolve(
                  matrix,
                  rhs,
                  dtype,
                  use_placeholder,
                  fast,
                  l2_regularizer,
                  batch_shape=batch_shape,
              )
  
      return (Square, Overdetermined, Underdetermined)
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  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 linalg_ops
  from tensorflow.python.ops import math_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 4 for calling a global function with example usage: _GetSmallMatrixSolveLsOpTests(dtype, use_placeholder, fast, l2_regularizer) and returns: Square,  Overdetermined,  Underdetermined