Preserve error type from EagerCopyToDevice.

PiperOrigin-RevId: 337945081
Change-Id: Ia7109d4e1532db489d8914309267928867d73036
This commit is contained in:
Haoyu Zhang 2020-10-19 15:19:34 -07:00 committed by TensorFlower Gardener
parent 06384d97df
commit b915de19fe

View File

@ -172,10 +172,11 @@ Status CopyInputToExpectedDevice(EagerContext* ctx, EagerOperation* op,
/* mirror= */ true, &result_handle); /* mirror= */ true, &result_handle);
activity.Stop(); activity.Stop();
if (!status.ok()) { if (!status.ok()) {
return errors::Internal("Failed copying input tensor from ", return Status(
handle_device->name(), " to ", status.code(),
expected_input_device->name(), " in order to run ", absl::StrCat("Failed copying input tensor from ", handle_device->name(),
op->Name(), ": ", status.error_message()); " to ", expected_input_device->name(), " in order to run ",
op->Name(), ": ", status.error_message()));
} }
*result = result_handle; *result = result_handle;