aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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