diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-10-09 20:51:50 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-09 20:56:31 -0700 |
commit | 5d670479c6ea20c510fa46ae1bb45123df75e067 (patch) | |
tree | 87eef5ff822051c0a40f28de0e4d8d67bd44fa5c /tensorflow/contrib | |
parent | 854ae599743a1e92a31ad49cfe42c6454cefd3b9 (diff) |
Add a more verbose error message.
PiperOrigin-RevId: 216471178
Diffstat (limited to 'tensorflow/contrib')
-rw-r--r-- | tensorflow/contrib/lite/kernels/embedding_lookup.cc | 10 | ||||
-rw-r--r-- | tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tensorflow/contrib/lite/kernels/embedding_lookup.cc b/tensorflow/contrib/lite/kernels/embedding_lookup.cc index fe33f98eb0..1d0c71ad48 100644 --- a/tensorflow/contrib/lite/kernels/embedding_lookup.cc +++ b/tensorflow/contrib/lite/kernels/embedding_lookup.cc @@ -78,7 +78,10 @@ TfLiteStatus EvalFloat(TfLiteContext* context, TfLiteNode* node, for (int i = 0; i < SizeOfDimension(lookup, 0); i++) { int idx = lookup->data.i32[i]; if (idx >= row_size || idx < 0) { - context->ReportError(context, "Embedding Lookup: index out of bounds."); + context->ReportError(context, + "Embedding Lookup: index out of bounds. " + "Got %d, and bounds are [0, %d]", + idx, row_size - 1); return kTfLiteError; } else { memcpy(output->data.raw + i * row_bytes, @@ -104,7 +107,10 @@ TfLiteStatus EvalHybrid(TfLiteContext* context, TfLiteNode* node, for (int i = 0; i < SizeOfDimension(lookup, 0); i++) { int idx = lookup->data.i32[i]; if (idx >= row_size || idx < 0) { - context->ReportError(context, "Embedding Lookup: index out of bounds."); + context->ReportError(context, + "Embedding Lookup: index out of bounds. " + "Got %d, and bounds are [0, %d]", + idx, row_size - 1); return kTfLiteError; } else { // Dequantize embedding values. diff --git a/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc b/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc index aa75b03990..0b076941ea 100644 --- a/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc +++ b/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc @@ -188,7 +188,9 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { int idx = ids->data.i32[i]; if (idx >= num_rows || idx < 0) { context->ReportError(context, - "Embedding Lookup Sparse: index out of bounds."); + "Embedding Lookup Sparse: index out of bounds. " + "Got %d, and bounds are [0, %d]", + idx, num_rows - 1); return kTfLiteError; } |