Do not access ResourceManager of remote devices in clearing resource container.

PiperOrigin-RevId: 343604092
Change-Id: I2c1bd34e643233d0564b914c1175670499245fe7
This commit is contained in:
Haoyu Zhang 2020-11-20 18:47:08 -08:00 committed by TensorFlower Gardener
parent 993da876ad
commit e971a25b8d

View File

@ -993,12 +993,6 @@ void EagerContext::ClearResourceContainer(const string& name) {
// Only ignore container not found errors.
device->resource_manager()->Cleanup(name).IgnoreError();
}
if (remote_device_mgr() != nullptr) {
auto remote_devices = remote_device_mgr()->ListDevices();
for (Device* device : remote_devices) {
device->resource_manager()->Cleanup(name).IgnoreError();
}
}
}
namespace {