| 129 | }; |
| 130 | |
| 131 | TEST_F(DirectSessionMinusAXTest, RunSimpleNetwork) { |
| 132 | Initialize({3, 2, -1, 0}); |
| 133 | auto session = CreateSession(); |
| 134 | ASSERT_TRUE(session != nullptr); |
| 135 | TF_ASSERT_OK(session->Create(def_)); |
| 136 | std::vector<std::pair<string, Tensor>> inputs; |
| 137 | |
| 138 | // Request two targets: one fetch output and one non-fetched output. |
| 139 | std::vector<string> output_names = {y_ + ":0"}; |
| 140 | std::vector<string> target_nodes = {y_neg_}; |
| 141 | std::vector<Tensor> outputs; |
| 142 | Status s = session->Run(inputs, output_names, target_nodes, &outputs); |
| 143 | TF_ASSERT_OK(s); |
| 144 | |
| 145 | ASSERT_EQ(1, outputs.size()); |
| 146 | // The first output should be initialized and have the correct |
| 147 | // output. |
| 148 | auto mat = outputs[0].matrix<float>(); |
| 149 | ASSERT_TRUE(outputs[0].IsInitialized()); |
| 150 | EXPECT_FLOAT_EQ(5.0, mat(0, 0)); |
| 151 | } |
| 152 | |
| 153 | TEST_F(DirectSessionMinusAXTest, RunSimpleNetwork_Callable) { |
| 154 | Initialize({3, 2, -1, 0}); |
nothing calls this directly
no test coverage detected