| 69 | class DynamicSubgraphIfTest : public ControlFlowOpTest { |
| 70 | protected: |
| 71 | void SetUp() override { |
| 72 | interpreter_->AddSubgraphs(2); |
| 73 | builder_->BuildAddSubgraph(interpreter_->subgraph(1)); |
| 74 | builder_->BuildPadSubgraph(interpreter_->subgraph(2)); |
| 75 | builder_->BuildIfSubgraph(&interpreter_->primary_subgraph()); |
| 76 | |
| 77 | interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); |
| 78 | interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {2}); |
| 79 | interpreter_->ResizeInputTensor(interpreter_->inputs()[2], {1, 2}); |
| 80 | ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); |
| 81 | |
| 82 | FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {5, 7}); |
| 83 | FillIntTensor(interpreter_->tensor(interpreter_->inputs()[2]), {1, 2}); |
| 84 | } |
| 85 | }; |
| 86 | |
| 87 | TEST_F(DynamicSubgraphIfTest, TestIfTrue) { |
nothing calls this directly
no test coverage detected