[TF:XLA] Allow fallback to TF:Classic when resource variables have changed shape or type.

PiperOrigin-RevId: 278868665
Change-Id: Iaec795c460cf7c34160ad503cd9e704fd7453fb4
This commit is contained in:
Tres Popp 2019-11-06 08:46:12 -08:00 committed by TensorFlower Gardener
parent b9be248fd3
commit 965f4b71f0

View File

@ -92,18 +92,18 @@ Status XlaResource::SetTypeAndShape(DataType type, const TensorShape& shape) {
"'' to an invalid type");
}
if (initialized() && type_ != type) {
return errors::InvalidArgument("Type of resource ", name_,
" cannot be changed after initialization: "
"old type was ",
DataTypeString(type_), ", new type is ",
DataTypeString(type));
return errors::Unimplemented("Type of resource ", name_,
" cannot be changed after initialization: "
"old type was ",
DataTypeString(type_), ", new type is ",
DataTypeString(type));
}
if (initialized() && shape_ != shape) {
return errors::InvalidArgument("Shape of resource ", name_,
" cannot be changed after initialization: "
"old shape was ",
shape_.DebugString(), ", new shape is ",
shape.DebugString());
return errors::Unimplemented("Shape of resource ", name_,
" cannot be changed after initialization: "
"old shape was ",
shape_.DebugString(), ", new shape is ",
shape.DebugString());
}
type_ = type;
shape_ = shape;