aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jianmin Chen <jmchen@google.com>2016-07-01 12:37:51 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-07-01 13:54:18 -0700
commitf8bd3aa8f239df106054d70443ed39081cef7917 (patch)
tree5eeadd1393500097f1df81be6a508d99ea030723
parent88f125b7d182a755d28e2c5d08acd5b4d9da6795 (diff)
Add conv2d to testlib.
Change: 126441771
-rw-r--r--tensorflow/core/graph/testlib.cc12
-rw-r--r--tensorflow/core/graph/testlib.h3
2 files changed, 15 insertions, 0 deletions
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