Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent a CHECK-fail due to empty tensor input in map_stage_op.cc
PiperOrigin-RevId: 387737906
Change-Id: Idc52df0c71c7ed6e2dd633b651a581932f277c8a
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Jul 30, 2021
1 parent 102cacf commit d7de677
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/kernels/map_stage_op.cc
Expand Up @@ -527,6 +527,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 d7de677

Please sign in to comment.