Skip to content

Commit

Permalink
Merge pull request #51058 from geetachavan1/cherrypicks_S0AB0
Browse files Browse the repository at this point in the history
Ensure non-empty rt_nested_splits in tf.raw_ops.RaggedTensorToVariant
  • Loading branch information
mihaimaruseac committed Aug 2, 2021
2 parents d80d38e + 801ecc9 commit ecdb9de
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 ecdb9de

Please sign in to comment.