aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib
diff options
context:
space:
mode:
authorGravatar Shashi Shekhar <shashishekhar@google.com>2018-10-03 18:26:28 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-03 18:30:47 -0700
commit54bebc286bbe7d6a866a3bdbcefd8af55adbe39a (patch)
tree394b77691c12048fb68e364a11f840334201dbc0 /tensorflow/contrib
parent18f589350f0cb244e2373480048d17cbacd241e1 (diff)
Fix a test.
- SetCustomOp also sets the name of the custom op. Test was checking against the wrong name in the profile. PiperOrigin-RevId: 215665359
Diffstat (limited to 'tensorflow/contrib')
-rw-r--r--tensorflow/contrib/lite/profiling/profile_summarizer_test.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/profiling/profile_summarizer_test.cc b/tensorflow/contrib/lite/profiling/profile_summarizer_test.cc
index 67a5eecfa0..465c294962 100644
--- a/tensorflow/contrib/lite/profiling/profile_summarizer_test.cc
+++ b/tensorflow/contrib/lite/profiling/profile_summarizer_test.cc
@@ -31,6 +31,8 @@ namespace profiling {
namespace {
+const char* kOpName = "SimpleOpEval";
+
#ifdef TFLITE_PROFILING_ENABLED
TfLiteStatus SimpleOpEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = tflite::GetInput(context, node, /*index=*/0);
@@ -63,7 +65,7 @@ TfLiteRegistration* RegisterSimpleOpWithProfilingDetails() {
SimpleOpEval,
SimpleOpProfilingString,
tflite::BuiltinOperator_CUSTOM,
- "SimpleOpEval",
+ kOpName,
1};
return &registration;
}
@@ -89,7 +91,7 @@ void SimpleOpModel::Init(
inputs_[0] = AddInput({TensorType_INT32, {1}});
inputs_[1] = AddInput({TensorType_INT32, {1}});
output_ = AddOutput({TensorType_INT32, {}});
- SetCustomOp("SimpleAdd", {}, registration);
+ SetCustomOp(kOpName, {}, registration);
BuildInterpreter({GetShape(inputs_[0]), GetShape(inputs_[1])});
}