code: def testHigherRankIndexOutOfRange(self):
      # GPU kernels don't throw exceptions.
      with self.cached_session(use_gpu=False) as sess:
          shape = (2, 3)
          indices = array_ops.placeholder(shape=shape, dtype=np.int32)
          data = np.zeros(shape + (5,))
          partitions = data_flow_ops.dynamic_partition(
              data, indices, num_partitions=7
          )
          for i in range(2):
              for j in range(3):
                  bad = np.zeros(shape, dtype=np.int32)
                  bad[i, j] = 17
                  with self.assertRaisesOpError(
                      r"partitions\[%d,%d\] = 17 is not in \[0, 7\)"
                      % (i, j)
                  ):
                      sess.run(partitions, feed_dict={indices: bad})
  
imports: import unittest
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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 data_flow_ops
  from tensorflow.python.ops import gradients_impl
  import tensorflow.python.ops.data_flow_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 16 for calling the DynamicPartitionTest obj's underlying member method code with example usage: obj.testHigherRankIndexOutOfRange() without return types