code: def test_partial_shape_inference(self):
      for axes in ([1], [0]), 1:
          a = array_ops.placeholder(dtypes.float32)
          b = array_ops.placeholder(dtypes.float32)
          output = math_ops.tensordot(a, b, axes)
          self.assertEqual(output.get_shape().ndims, None)
          a.set_shape([None, 2])
          b.set_shape([2, 3])
          output = math_ops.tensordot(a, b, axes)
          output_shape = output.get_shape()
          self.assertEqual(output_shape.ndims, 2)
          output_shape = output_shape.as_list()
          self.assertEqual(output_shape[0], None)
          self.assertEqual(output_shape[1], 3)
          a = array_ops.placeholder(dtypes.float32)
          b = array_ops.placeholder(dtypes.float32)
          a.set_shape([2, 2])
          b.set_shape([2, None])
          output = math_ops.tensordot(a, b, axes)
          output_shape = output.get_shape()
          self.assertEqual(output_shape.ndims, 2)
          output_shape = output_shape.as_list()
          self.assertEqual(output_shape[0], 2)
          self.assertEqual(output_shape[1], None)
  
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 4 for calling the TensordotTest obj's underlying member method code with example usage: obj.test_partial_shape_inference() without return types