Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure non-empty rt_nested_splits in tf.raw_ops.RaggedTensorToVariant #51255

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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