From 965f4b71f0c719f5466fe0f25f326593ae9e220a Mon Sep 17 00:00:00 2001 From: Tres Popp Date: Wed, 6 Nov 2019 08:46:12 -0800 Subject: [PATCH] [TF:XLA] Allow fallback to TF:Classic when resource variables have changed shape or type. PiperOrigin-RevId: 278868665 Change-Id: Iaec795c460cf7c34160ad503cd9e704fd7453fb4 --- tensorflow/compiler/tf2xla/xla_resource.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tensorflow/compiler/tf2xla/xla_resource.cc b/tensorflow/compiler/tf2xla/xla_resource.cc index 48a3c012727..32d42cb8a42 100644 --- a/tensorflow/compiler/tf2xla/xla_resource.cc +++ b/tensorflow/compiler/tf2xla/xla_resource.cc @@ -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;