[XLA] Move a CHECK into Layout verification

Sparse layouts that specify tiling should fail verification, not CHECK-fail in ToString.

PiperOrigin-RevId: 233483254
This commit is contained in:
Michael Kuperstein 2019-02-11 14:47:28 -08:00 committed by TensorFlower Gardener
parent d584984e82
commit f5463b160c

View File

@ -247,6 +247,10 @@ Layout CreateDefaultLayoutForRank(int64 rank) {
}
dimensions_in_layout[dim] = true;
}
} else {
if (layout.tiles_size() != 0) {
return InvalidArgument("Only dense layouts can be tiled.");
}
}
return Status::OK();