Fix TensorList decoding bug. Thanks to Alexandre Passos for finding this.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 29 Mar 2018 04:11:16 +0000 (21:11 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 29 Mar 2018 04:13:50 +0000 (21:13 -0700)
PiperOrigin-RevId: 190879840

tensorflow/core/kernels/list_kernels.cc
tensorflow/core/kernels/list_kernels.h

index baf0a4a..9e7786f 100644 (file)
@@ -112,6 +112,7 @@ bool TensorList::Decode(const VariantTensorData& data) {
       dims.push_back(scratch);
     }
   }
+  element_shape = PartialTensorShape(dims);
   return true;
 }
 
index 9733883..8af48f0 100644 (file)
@@ -83,7 +83,8 @@ class TensorListStack : public OpKernel {
                                         DataTypeString(l->element_dtype)));
     OP_REQUIRES(c, l->element_shape.IsFullyDefined(),
                 errors::InvalidArgument("Tried to stack elements from a list "
-                                        "with non-fully-defined shape."));
+                                        "with non-fully-defined shape: ",
+                                        l->element_shape.DebugString()));
     if (num_elements_ != -1) {
       OP_REQUIRES(c, l->tensors.size() == num_elements_,
                   errors::InvalidArgument("Operation expected a list with ",