Fix shape inference bug in tensorlist
authorAlexandre Passos <apassos@google.com>
Mon, 12 Feb 2018 18:27:18 +0000 (10:27 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 12 Feb 2018 18:30:51 +0000 (10:30 -0800)
PiperOrigin-RevId: 185397219

tensorflow/core/ops/list_ops.cc

index fa40f41..3487c95 100644 (file)
@@ -241,6 +241,7 @@ REGISTER_OP("TensorListSetItem")
       DataType t;
       TF_RETURN_IF_ERROR(c->GetAttr("element_dtype", &t));
       auto* handle_data = c->input_handle_shapes_and_types(0);
+      c->set_output(0, c->Scalar());
       if (handle_data == nullptr) {
         c->set_output_handle_shapes_and_types(0, {{c->UnknownShape(), t}});
         return Status::OK();