[XLA] Make not having is_dynamic_dimensions a warning rather than an error

Since we currently don't require this field, and accept protos that don't have it, it's probably better not to spam the ERROR logs if the field is empty.

PiperOrigin-RevId: 233442644
This commit is contained in:
Michael Kuperstein 2019-02-11 11:16:58 -08:00 committed by TensorFlower Gardener
parent 35455c2b06
commit 734e10d80b

View File

@ -34,8 +34,12 @@ Shape::Shape(const ShapeProto& shape_proto) {
// instead of a constructor.
if (shape_proto.dimensions_size() !=
shape_proto.is_dynamic_dimension_size()) {
LOG(ERROR) << "Malformed shape proto: number of is_dynamic_dimension "
"fields does not match number of dimension fields";
if (shape_proto.is_dynamic_dimension_size() != 0) {
LOG(ERROR) << "Malformed shape proto: number of is_dynamic_dimension "
"fields does not match number of dimension fields";
} else {
LOG(WARNING) << "Malformed shape proto: is_dynamic_dimension is empty";
}
}
int64 num_dynamic_dimension_fields = std::min(
shape_proto.dimensions_size(), shape_proto.is_dynamic_dimension_size());