Skip to content

Commit

Permalink
Merge pull request #51256 from tensorflow/mm-cherrypick-be7a4de6adfbd…
Browse files Browse the repository at this point in the history
…303ce08be4332554dff70362612-on-r2.3

Ensure non-empty rt_nested_splits in tf.raw_ops.RaggedTensorToVariant
  • Loading branch information
mihaimaruseac committed Aug 5, 2021
2 parents 6c1eb96 + c3ef7bc commit aa7401d
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
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,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<RaggedTensor> ragged_components;
auto batched_splits_top_vec =
Expand Down

0 comments on commit aa7401d

Please sign in to comment.