code: def testNotImplementedCheck(self):
      # Test that the correct message is issued
      np.random.seed(42)
      matrix = constant_op.constant(
          np.random.uniform(low=-1.0, high=1.0, size=(5, 2)).astype(
              np.float32
          )
      )
  
      def _NoGrad(x):
          with backprop.GradientTape() as tape:
              tape.watch(x)
              ret = linalg_ops.qr(x, full_matrices=True)
          return tape.gradient(ret, x)
  
      m = r"QrGrad not implemented when nrows > ncols and full_matrices is true."
      with self.assertRaisesRegex(NotImplementedError, m):
          _NoGrad(matrix)
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  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 gradient_checker_v2
  from tensorflow.python.ops import linalg_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 1 for calling the QrGradOpTest obj's underlying member method code with example usage: obj.testNotImplementedCheck() and returns: tape