From f8bd3aa8f239df106054d70443ed39081cef7917 Mon Sep 17 00:00:00 2001 From: Jianmin Chen Date: Fri, 1 Jul 2016 12:37:51 -0800 Subject: Add conv2d to testlib. Change: 126441771 --- tensorflow/core/graph/testlib.cc | 12 ++++++++++++ tensorflow/core/graph/testlib.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/tensorflow/core/graph/testlib.cc b/tensorflow/core/graph/testlib.cc index f27229631d..2c49e088c6 100644 --- a/tensorflow/core/graph/testlib.cc +++ b/tensorflow/core/graph/testlib.cc @@ -422,6 +422,18 @@ Node* BiasAdd(Graph* g, Node* value, Node* bias) { return ret; } +Node* Conv2D(Graph* g, Node* in0, Node* in1) { + Node* ret; + TF_CHECK_OK(NodeBuilder(g->NewName("n"), "Conv2D") + .Input(in0) + .Input(in1) + .Attr("T", DT_FLOAT) + .Attr("strides", {1, 1, 1, 1}) + .Attr("padding", "SAME") + .Finalize(g, &ret)); + return ret; +} + void ToGraphDef(Graph* g, GraphDef* gdef) { g->ToGraphDef(gdef); } } // end namespace graph diff --git a/tensorflow/core/graph/testlib.h b/tensorflow/core/graph/testlib.h index 852e786ef5..f605e39723 100644 --- a/tensorflow/core/graph/testlib.h +++ b/tensorflow/core/graph/testlib.h @@ -182,6 +182,9 @@ Node* Relu6(Graph* g, Node* in); // Add a BiasAdd node in "g". Node* BiasAdd(Graph* g, Node* value, Node* bias); +// Add a Conv2D node in "g". +Node* Conv2D(Graph* g, Node* in0, Node* in1); + } // end namespace graph } // end namespace test } // end namespace tensorflow -- cgit v1.2.3