Skip to content
Permalink
Browse files Browse the repository at this point in the history
Ensure non-empty rt_nested_splits in tf.raw_ops.RaggedTensorToVariant
PiperOrigin-RevId: 387664237
Change-Id: Ia1700c34b5610873d63561abc86e23b46ead93b3
  • Loading branch information
pak-laura authored and tensorflower-gardener committed Jul 29, 2021
1 parent ffbdacf commit be7a4de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tensorflow/core/kernels/ragged_tensor_to_variant_op.cc
Expand Up @@ -157,6 +157,12 @@ class RaggedTensorToVariantOp : public OpKernel {
return;
}

// Checked here instead of at input in case batched_input_ is false
OP_REQUIRES(context, ragged_nested_splits_len > 0,
errors::InvalidArgument(
"rt_nested_splits must be a list of one or more, but "
"received rt_nested_splits of length 0."));

// Unbatch the Ragged Tensor and encode the components.
std::vector<RaggedTensorVariant> unbatched_ragged_input;
auto batched_splits_top_vec =
Expand Down

0 comments on commit be7a4de

Please sign in to comment.