Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix a check fail
PiperOrigin-RevId: 372011072
Change-Id: I1062cfaed0aa16884e9a16312483794d188db76f
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed May 4, 2021
1 parent faa76f3 commit 77dd114
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/kernels/load_and_remap_matrix_op.cc
Expand Up @@ -123,6 +123,11 @@ class LoadAndRemapMatrixOp : public OpKernel {
// Processes the checkpoint source and the provided Tensor name.
const Tensor* ckpt_path_t;
OP_REQUIRES_OK(context, context->input("ckpt_path", &ckpt_path_t));
OP_REQUIRES(
context, ckpt_path_t->NumElements() == 1,
errors::InvalidArgument("The `ckpt_path` tensor must have exactly one "
"element, got tensor of shape ",
ckpt_path_t->shape().DebugString()));
const string& ckpt_path = ckpt_path_t->scalar<tstring>()();
const Tensor* old_tensor_name_t;
OP_REQUIRES_OK(context,
Expand Down

0 comments on commit 77dd114

Please sign in to comment.