code: def testInvalidEnsureShape(self):
      with self.session() as sess:
          p = array_ops.placeholder(dtypes.int32)
          with self.test_scope():
              op = check_ops.ensure_shape(p, (None, 3, 3))
          with self.assertRaisesRegex(
              errors_impl.InvalidArgumentError,
              "is not compatible with expected shape",
          ):
              sess.run(op, {p: [[0, 1, 2], [3, 4, 5], [6, 7, 8]]})
  
file_path: tensorflow-upstream/tensorflow/compiler/tests/ensure_shape_op_test.py
imports: from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import check_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the EnsureShapeOpTest obj's underlying member method code with example usage: obj.testInvalidEnsureShape() without return types