| 27 | namespace { |
| 28 | |
| 29 | void CreateTestGraph(const ::tensorflow::Scope& root, |
| 30 | benchmark_model::InputLayerInfo* input, |
| 31 | string* output_name, GraphDef* graph_def) { |
| 32 | // Create a simple graph and write it to filename_pb. |
| 33 | const int input_width = 400; |
| 34 | const int input_height = 10; |
| 35 | input->shape = TensorShape({input_width, input_height}); |
| 36 | input->data_type = DT_FLOAT; |
| 37 | const TensorShape constant_shape({input_height, input_width}); |
| 38 | |
| 39 | Tensor constant_tensor(DT_FLOAT, constant_shape); |
| 40 | test::FillFn<float>(&constant_tensor, [](int) -> float { return 3.0; }); |
| 41 | |
| 42 | auto placeholder = |
| 43 | ops::Placeholder(root, DT_FLOAT, ops::Placeholder::Shape(input->shape)); |
| 44 | input->name = placeholder.node()->name(); |
| 45 | auto m = ops::MatMul(root, placeholder, constant_tensor); |
| 46 | *output_name = m.node()->name(); |
| 47 | TF_ASSERT_OK(root.ToGraphDef(graph_def)); |
| 48 | } |
| 49 | |
| 50 | TEST(BenchmarkModelTest, InitializeAndRun) { |
| 51 | const string dir = testing::TmpDir(); |
no test coverage detected