More descriptive error message for Concat.

PiperOrigin-RevId: 316125402
Change-Id: I4f86104f4197fc1d2387d1914d5a9a54e965f31c
This commit is contained in:
A. Unique TensorFlower 2020-06-12 10:10:31 -07:00 committed by TensorFlower Gardener
parent b58a02c186
commit 615cedf9d2

View File

@ -75,7 +75,9 @@ Status Concat(const gtl::ArraySlice<Tensor>& tensors, Tensor* result) {
for (int i = 1; i < tensors.size(); ++i) {
if (tensors[i].dtype() != dtype) {
return errors::InvalidArgument(
"Cannot concatenate tensors that have different data types");
"Cannot concatenate tensors that have different data types.", " Got ",
DataTypeString(dtype), " and ", DataTypeString(tensors[i].dtype()),
".");
}
}
*result = Tensor(dtype, shape);