Refine an error message when MLIR converter encounters mutable variable cases

PiperOrigin-RevId: 351454938
Change-Id: I46c8ef3f6cb8fc0449f01dabbd19d028fc5474a0
This commit is contained in:
Jaesung Chung 2021-01-12 14:51:59 -08:00 committed by TensorFlower Gardener
parent eaf998c965
commit 09f12c0399

View File

@ -70,9 +70,10 @@ void FreezeGlobalTensorsPass::runOnOperation() {
// previous optimize global tensors pass). If not, this pass has to fail // previous optimize global tensors pass). If not, this pass has to fail
// since it cannot perform one of its goals. // since it cannot perform one of its goals.
if (global_tensor.is_mutable()) { if (global_tensor.is_mutable()) {
global_tensor.emitError() << "is not immutable, try running " global_tensor.emitError()
"tf-saved-model-optimize-global-tensors " << "is not immutable, try removing mutable variables in your model "
"to prove tensors are immutable"; "since mutable variables are currently not supported through "
"this converter";
return signalPassFailure(); return signalPassFailure();
} }