diff options
author | Manjunath Kudlur <keveman@google.com> | 2016-07-15 14:28:59 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-07-15 15:33:32 -0700 |
commit | 25ac3dabfa3af7a313eb46b03690117c85030cc2 (patch) | |
tree | 06010c7cc7d25a538880c5f0d53df079e27093fd /tensorflow/tools/benchmark | |
parent | 194efde51895e0251d39c72c969dff1a50b67d35 (diff) |
Improvements to the C++ graph building API.
TESTED:
- passed opensource_build: http://ci.tensorflow.org/job/tensorflow-cl-presubmit-multijob/2780/
Change: 127585603
Diffstat (limited to 'tensorflow/tools/benchmark')
-rw-r--r-- | tensorflow/tools/benchmark/benchmark_model_test.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tensorflow/tools/benchmark/benchmark_model_test.cc b/tensorflow/tools/benchmark/benchmark_model_test.cc index f6d93f9c1f..cbbec7bbbe 100644 --- a/tensorflow/tools/benchmark/benchmark_model_test.cc +++ b/tensorflow/tools/benchmark/benchmark_model_test.cc @@ -39,16 +39,15 @@ TEST(BenchmarkModelTest, InitializeAndRun) { Tensor constant_tensor(DT_FLOAT, constant_shape); test::FillFn<float>(&constant_tensor, [](int) -> float { return 3.0; }); - GraphDefBuilder b(GraphDefBuilder::kFailImmediately); - Node* placeholder = - ops::Placeholder(DT_FLOAT, b.opts().WithAttr("shape", input_shape)); - const string input_name = placeholder->name(); - Node* constant = ops::Const(constant_tensor, b.opts()); - const string output_name = - ops::MatMul(placeholder, constant, b.opts())->name(); + auto root = Scope::NewRootScope().ExitOnError(); + auto placeholder = + ops::Placeholder(root, DT_FLOAT, ops::Placeholder::Shape(input_shape)); + const string input_name = placeholder.node()->name(); + auto m = ops::MatMul(root, placeholder, constant_tensor); + const string output_name = m.node()->name(); GraphDef graph_def; - TF_ASSERT_OK(b.ToGraphDef(&graph_def)); + TF_ASSERT_OK(root.ToGraphDef(&graph_def)); string graph_def_serialized; graph_def.SerializeToString(&graph_def_serialized); TF_ASSERT_OK( |