diff options
author | 2018-09-10 13:23:35 -0700 | |
---|---|---|
committer | 2018-09-10 13:27:43 -0700 | |
commit | d274948444a1edc846d4b488f14ed029bfc569dd (patch) | |
tree | 8987e92c301ba418a6bdb479e5310e3394982771 /tensorflow/core/framework | |
parent | 44f1fa1841f616b1b47a01f9aefbf52edcde481c (diff) |
Add experimental grappler plugin to selection function implementation at run time.
PiperOrigin-RevId: 212321238
Diffstat (limited to 'tensorflow/core/framework')
-rw-r--r-- | tensorflow/core/framework/function_testlib.cc | 16 | ||||
-rw-r--r-- | tensorflow/core/framework/function_testlib.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tensorflow/core/framework/function_testlib.cc b/tensorflow/core/framework/function_testlib.cc index 46b169dddc..c5a4f661d2 100644 --- a/tensorflow/core/framework/function_testlib.cc +++ b/tensorflow/core/framework/function_testlib.cc @@ -110,6 +110,22 @@ FunctionDef XTimesTwo() { }); } +FunctionDef XAddX() { + return FDH::Define( + // Name + "XAddX", + // Args + {"x: T"}, + // Return values + {"y: T"}, + // Attr def + {"T: {float, double, int32, int64}"}, + // Nodes + { + {{"y"}, "Add", {"x", "x"}, {{"T", "$T"}}}, + }); +} + FunctionDef XTimesTwoInt32() { const Tensor kTwo = test::AsScalar<int64>(2); return FDH::Define( diff --git a/tensorflow/core/framework/function_testlib.h b/tensorflow/core/framework/function_testlib.h index 6d6476b936..ad61a76f16 100644 --- a/tensorflow/core/framework/function_testlib.h +++ b/tensorflow/core/framework/function_testlib.h @@ -63,6 +63,9 @@ GraphDef GDef(gtl::ArraySlice<NodeDef> nodes, // x:T -> x * 2. FunctionDef XTimesTwo(); +// x:T -> x + x. +FunctionDef XAddX(); + // x:T -> x * 2, where x is int32. FunctionDef XTimesTwoInt32(); |