diff options
author | 2018-03-12 15:05:11 -0700 | |
---|---|---|
committer | 2018-03-12 15:09:02 -0700 | |
commit | c9956b9b6da05b5acea3f5d528ec5fed29f45092 (patch) | |
tree | 3f340de7ff02b92801b89ba28a4b6a20f3532fbe /tensorflow/contrib/lite/interpreter_test.cc | |
parent | 6921d4fdbb7f10a0f9a6211eb0b1b535a417d081 (diff) |
TFLite Delegate: Expose input / output tensor indicies in `Init`
PiperOrigin-RevId: 188784614
Diffstat (limited to 'tensorflow/contrib/lite/interpreter_test.cc')
-rw-r--r-- | tensorflow/contrib/lite/interpreter_test.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tensorflow/contrib/lite/interpreter_test.cc b/tensorflow/contrib/lite/interpreter_test.cc index 17eb2f4b07..7a029c7df8 100644 --- a/tensorflow/contrib/lite/interpreter_test.cc +++ b/tensorflow/contrib/lite/interpreter_test.cc @@ -923,8 +923,24 @@ TEST_F(TestDelegate, BasicDelegate) { ASSERT_EQ(interpreter_->execution_plan().size(), 1); int node = interpreter_->execution_plan()[0]; const auto* node_and_reg = interpreter_->node_and_registration(node); - ASSERT_EQ(node_and_reg->second.custom_name, + EXPECT_EQ(node_and_reg->second.custom_name, SimpleDelegate::FakeFusedRegistration().custom_name); + + const TfLiteDelegateParams* params = + reinterpret_cast<const TfLiteDelegateParams*>( + node_and_reg->first.builtin_data); + ASSERT_EQ(params->nodes_to_replace->size, 3); + EXPECT_EQ(params->nodes_to_replace->data[0], 0); + EXPECT_EQ(params->nodes_to_replace->data[1], 1); + EXPECT_EQ(params->nodes_to_replace->data[2], 2); + + ASSERT_EQ(params->input_tensors->size, 2); + EXPECT_EQ(params->input_tensors->data[0], 0); + EXPECT_EQ(params->input_tensors->data[1], 1); + + ASSERT_EQ(params->output_tensors->size, 2); + EXPECT_EQ(params->output_tensors->data[0], 3); + EXPECT_EQ(params->output_tensors->data[1], 4); } TEST_F(TestDelegate, ComplexDeligate) { |