Skip to content

Commit

Permalink
Merge pull request #51280 from tensorflow/mm-cherrypick-d7de67733925d…
Browse files Browse the repository at this point in the history
…e196ec8863a33445b73f9562d1d-on-r2.3

Prevent a CHECK-fail due to empty tensor input in `map_stage_op.cc`
  • Loading branch information
mihaimaruseac committed Aug 5, 2021
2 parents bf5ddbc + cc96b00 commit a695e18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/kernels/map_stage_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ class MapStageOp : public OpKernel {
OP_REQUIRES_OK(ctx, ctx->input("key", &key_tensor));
OP_REQUIRES_OK(ctx, ctx->input("indices", &indices_tensor));
OP_REQUIRES_OK(ctx, ctx->input_list("values", &values_tensor));
OP_REQUIRES(ctx, key_tensor->NumElements() > 0,
errors::InvalidArgument("key must not be empty"));

// Create copy for insertion into Staging Area
Tensor key(*key_tensor);
Expand Down

0 comments on commit a695e18

Please sign in to comment.