[TF2XLA] Correct misleading error message about var placement

PiperOrigin-RevId: 332964336
Change-Id: I94076a38ac8735a8478e2aceadebd0d2a6ec592a
This commit is contained in:
George Karpenkov 2020-09-21 16:44:42 -07:00 committed by TensorFlower Gardener
parent fc71ca2675
commit 64e3dda496

View File

@ -89,9 +89,9 @@ Status GetVariableInfosFromInputs(ResourceMgr* rm, DeviceBase* dev,
Var* variable = nullptr;
ResourceHandle handle = inputs[var_idx]->flat<ResourceHandle>()(0);
if (handle.device() != dev->attributes().name()) {
return errors::InvalidArgument("Trying to access resource ",
handle.name(), " located in device ",
dev->name());
return errors::InvalidArgument(
"Trying to access resource ", handle.name(), " located in device ",
handle.device(), " from device ", dev->attributes().name());
}
TF_RETURN_IF_ERROR(rm->LookupOrCreate<Var>(
handle.container(), handle.name(), &variable, [](Var** ptr) {