Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix tf.raw_ops.RaggedTensorToVariant invalid resize.
PiperOrigin-RevId: 368299574
Change-Id: I751c186325aa0bab397928845e790e60c2d90918
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed Apr 13, 2021
1 parent 904b392 commit b055b9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/kernels/ragged_tensor_to_variant_op.cc
Expand Up @@ -159,6 +159,11 @@ class RaggedTensorToVariantOp : public OpKernel {

// Unbatch the Ragged Tensor and encode the components.
std::vector<RaggedTensorVariant> unbatched_ragged_input;
auto batched_splits_top_vec =
batched_ragged_input.splits(0).vec<SPLIT_TYPE>();
int num_components = batched_splits_top_vec.size() - 1;
OP_REQUIRES(context, num_components >= 0,
errors::Internal("Invalid split argument."));
OP_REQUIRES_OK(context, UnbatchRaggedZerothDim<VALUE_TYPE, SPLIT_TYPE>(
batched_ragged_input, &unbatched_ragged_input));

Expand Down

0 comments on commit b055b9c

Please sign in to comment.