code: def test_shape_function(self):
      # size must be scalar.
      with self.assertRaisesRegex(
          (ValueError, errors.InvalidArgumentError),
          "(?s)Shape must be rank 0 but is rank 1.*Bincount",
      ):
          gen_math_ops.bincount([1, 2, 3, 1, 6, 8], [1], [])
      # size must be positive.
      with self.assertRaisesRegex(
          (ValueError, errors.InvalidArgumentError),
          "must be non-negative",
      ):
          gen_math_ops.bincount([1, 2, 3, 1, 6, 8], -5, [])
      # if size is a constant then the shape is known.
      v1 = gen_math_ops.bincount([1, 2, 3, 1, 6, 8], 5, [])
      self.assertAllEqual(v1.get_shape().as_list(), [5])
      # if size is a placeholder then the shape is unknown.
      with ops.Graph().as_default():
          s = array_ops.placeholder(dtype=dtypes.int32)
          v2 = gen_math_ops.bincount([1, 2, 3, 1, 6, 8], s, [])
          self.assertAllEqual(v2.get_shape().as_list(), [None])
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  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 bincount_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 9 for calling the BincountTest obj's underlying member method code with example usage: obj.test_shape_function() without return types