aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/ops/control_flow_ops.cc
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2018-06-14 11:16:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-14 11:19:19 -0700
commiteb979013aebe040567e436fd9228033f6fd98f2b (patch)
treeda9b424b6bfe4f2a77e22f36b9bb78551dc54ada /tensorflow/core/ops/control_flow_ops.cc
parentdf9dd2280fca67d6c261536bc9c459388f108da5 (diff)
Propagate the non-resource part of a resource tensor's shape in Enter's shape function.
PiperOrigin-RevId: 200587374
Diffstat (limited to 'tensorflow/core/ops/control_flow_ops.cc')
-rw-r--r--tensorflow/core/ops/control_flow_ops.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/tensorflow/core/ops/control_flow_ops.cc b/tensorflow/core/ops/control_flow_ops.cc
index 81e9fcfa95..b8028291b4 100644
--- a/tensorflow/core/ops/control_flow_ops.cc
+++ b/tensorflow/core/ops/control_flow_ops.cc
@@ -145,13 +145,12 @@ REGISTER_OP("Enter")
auto* handle_data = c->input_handle_shapes_and_types(0);
if (handle_data != nullptr) {
c->set_output_handle_shapes_and_types(0, *handle_data);
- } else {
- // Otherwise, propagate shape if output is a constant.
- bool is_constant;
- TF_RETURN_IF_ERROR(c->GetAttr("is_constant", &is_constant));
- if (is_constant) {
- c->set_output(0, c->input(0));
- }
+ }
+ // Propagate shape if output is a constant.
+ bool is_constant;
+ TF_RETURN_IF_ERROR(c->GetAttr("is_constant", &is_constant));
+ if (is_constant) {
+ c->set_output(0, c->input(0));
}
return Status::OK();