Add "element_shape" attr to TensorListConcat and use it in _GraphTensorArrayV2.
When using while_v2, this change prevents errors like this: All except the first dimension must be fully defined when concating an empty tensor list. element_shape: <unknown> Previously, TensorListConcat op could only determine the element size from the TensorList object at runtime. In the case of a while loop that executes zero times, it wouldn't be able to determine the size since no element was ever seen by the runtime. However, we may have determined the element size during graph construction, so we use the attribute to tell the runtime what the element size is. Note that the original TensorArray implementation already does this. PiperOrigin-RevId: 227750868
Loading
Please sign in to comment