code: def testOutOfRangeError_MatrixMatrix(self, dtype, unit):
      # Matrix/Matrix
      test_string = {
          "BYTE": [
              [b"good", b"good", b"good"],
              [b"good", b"good", b"bad"],
              [b"good", b"good", b"good"],
          ],
          "UTF8_CHAR": [
              [
                  x.encode("utf-8")
                  for x in ["g\xc3\xc3d", "g\xc3\xc3d", "g\xc3\xc3d"]
              ],
              [
                  x.encode("utf-8")
                  for x in ["g\xc3\xc3d", "g\xc3\xc3d", "b\xc3d"]
              ],
              [
                  x.encode("utf-8")
                  for x in ["g\xc3\xc3d", "g\xc3\xc3d", "g\xc3\xc3d"]
              ],
          ],
      }[unit]
      position = np.array([[1, 2, 3], [1, 2, 4], [1, 2, 3]], dtype)
      length = np.array([[3, 2, 1], [1, 2, 3], [2, 2, 2]], dtype)
      substr_op = string_ops.substr(
          test_string, position, length, unit=unit
      )
      with self.cached_session():
          with self.assertRaises(errors_impl.InvalidArgumentError):
              self.evaluate(substr_op)
  
      # Matrix/Matrix (with negative)
      position = np.array([[1, 2, -3], [1, 2, -4], [1, 2, -3]], dtype)
      length = np.array([[3, 2, 1], [1, 2, 3], [2, 2, 2]], dtype)
      substr_op = string_ops.substr(
          test_string, position, length, unit=unit
      )
      with self.cached_session():
          with self.assertRaises(errors_impl.InvalidArgumentError):
              self.evaluate(substr_op)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import string_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 10 for calling the SubstrOpTest obj's underlying member method code with example usage: obj.testOutOfRangeError_MatrixMatrix(dtype, unit) without return types