code: def test_invalid_shape(self):
      a = [[1, 2], [3, 4]]
      b = [[1, 2], [3, 4], [5, 6]]
      a_axes = [1]
      b_axes = [0]
      # Invalid static shapes.
      with self.assertRaises(
          (ValueError, errors_impl.InvalidArgumentError)
      ):
          math_ops.tensordot(a, b, (a_axes, b_axes))
  
      # Invalid dynamic shapes.
      if context.executing_eagerly():
          return
      with self.cached_session() as sess:
          with self.assertRaisesOpError(
              r"Matrix size-incompatible: In\[0\]: \[2,2\], In\[1\]: \[3,2\]"
          ):
              a_ph = array_ops.placeholder(dtypes.float32)
              b_ph = array_ops.placeholder(dtypes.float32)
              axes_ph = array_ops.placeholder(dtypes.int32)
              output = math_ops.tensordot(a_ph, b_ph, axes_ph)
              _ = sess.run(
                  [output],
                  feed_dict={
                      a_ph: a,
                      b_ph: b,
                      axes_ph: (a_axes, b_axes),
                  },
              )
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/math_ops/tensordot_op_test.py
imports: import numpy
  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 test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the TensordotTest obj's underlying member method code with example usage: obj.test_invalid_shape() without return types