@parameterized.parameters([dict(data=['a', 'b', 'c'], partitions=[2, (- 1), 0], num_partitions=10, error='must be non-negative'), dict(data=['a', 'b', 'c'], partitions=[2, 10, 0], num_partitions=1, error='partitions must be less than num_partitions'), dict(data=['a', 'b', 'c'], partitions=[2, 10, 0], num_partitions=10, error='partitions must be less than num_partitions'), dict(data=[['a', 'b'], ['c']], partitions=[[2], [3, 0]], num_partitions=10, error='data and partitions have incompatible ragged shapes')])
def testRuntimeError(self, data, partitions, num_partitions, error):
    data = ragged_factory_ops.constant(data)
    partitions = ragged_factory_ops.constant(partitions, dtype=dtypes.int64)
    with self.assertRaisesRegexp((ValueError, errors.InvalidArgumentError), error):
        self.evaluate(ragged_array_ops.stack_dynamic_partitions(data, partitions, num_partitions))
@parameterized.parameters([dict(data=['a', 'b', 'c'], partitions=[2, (- 1), 0], num_partitions=10, error='must be non-negative'), dict(data=['a', 'b', 'c'], partitions=[2, 10, 0], num_partitions=1, error='partitions must be less than num_partitions'), dict(data=['a', 'b', 'c'], partitions=[2, 10, 0], num_partitions=10, error='partitions must be less than num_partitions'), dict(data=[['a', 'b'], ['c']], partitions=[[2], [3, 0]], num_partitions=10, error='data and partitions have incompatible ragged shapes')])
def testRuntimeError(self, data, partitions, num_partitions, error):
    data = ragged_factory_ops.constant(data)
    partitions = ragged_factory_ops.constant(partitions, dtype=dtypes.int64)
    with self.assertRaisesRegexp((ValueError, errors.InvalidArgumentError), error):
        self.evaluate(ragged_array_ops.stack_dynamic_partitions(data, partitions, num_partitions))