diff options
author | 2017-01-26 10:15:22 -0800 | |
---|---|---|
committer | 2017-01-26 10:27:31 -0800 | |
commit | c36c8248302f4733cca445df4e8b3e198320a63a (patch) | |
tree | be18f0946926798a779f35e967cb5b2f702e6e86 /tensorflow/core/ops/function_ops.cc | |
parent | 5d01efff08bd80f1e6476a07c95c40edc2f0914b (diff) |
Add shape inference functions for _Arg and _Retval.
The shape inference function for _Arg just returns UnknownShape, but the presence of a shape inference function makes ShapeRefiner happy.
Change: 145688141
Diffstat (limited to 'tensorflow/core/ops/function_ops.cc')
-rw-r--r-- | tensorflow/core/ops/function_ops.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/core/ops/function_ops.cc b/tensorflow/core/ops/function_ops.cc index 8de6123943..9fbebdb088 100644 --- a/tensorflow/core/ops/function_ops.cc +++ b/tensorflow/core/ops/function_ops.cc @@ -14,6 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/core/framework/op.h" +#include "tensorflow/core/framework/shape_inference.h" namespace tensorflow { @@ -22,6 +23,10 @@ REGISTER_OP("_Arg") .Attr("T: type") .Attr("index: int >= 0") .SetIsStateful() + .SetShapeFn([](shape_inference::InferenceContext* context) { + context->set_output(0, context->UnknownShape()); + return Status::OK(); + }) .Doc(R"doc( A graph node which represents an argument to a function. @@ -34,6 +39,9 @@ REGISTER_OP("_Retval") .Attr("T: type") .Attr("index: int >= 0") .SetIsStateful() + .SetShapeFn([](shape_inference::InferenceContext* context) { + return Status::OK(); + }) .Doc(R"doc( A graph node which represents a return value of a function. |