code: def test_dense_input_wrong_shape_fails(self):
      x = np.array([[3, 2, 1], [5, 4, 4]], dtype=np.int32)
      weights = np.array([[3, 2], [5, 4], [4, 3]])
      # Note: Eager mode and graph mode throw different errors here. Graph mode
      # will fail with a ValueError from the shape checking logic, while Eager
      # will fail with an InvalidArgumentError from the kernel itself.
      if context.executing_eagerly():
          with self.assertRaisesRegex(
              errors.InvalidArgumentError, "must have the same shape"
          ):
              self.evaluate(
                  sparse_ops.sparse_bincount(
                      x, weights=weights, axis=-1
                  )
              )
      else:
          with self.assertRaisesRegex(
              ValueError, "both shapes must be equal"
          ):
              self.evaluate(
                  sparse_ops.sparse_bincount(
                      x, weights=weights, axis=-1
                  )
              )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the TestSparseCountFailureModes obj's underlying member method code with example usage: obj.test_dense_input_wrong_shape_fails() without return types