Return NOT_FOUND error if we cannot find a device for a kernel.

PiperOrigin-RevId: 257099659
This commit is contained in:
Xiao Yu 2019-07-08 18:32:28 -07:00 committed by TensorFlower Gardener
parent 4c131dc3f7
commit bdfa6ed2d2

View File

@ -243,7 +243,7 @@ Status SelectDevice(EagerOperation* op, const NodeDef& ndef, EagerContext* ctx,
TF_RETURN_IF_ERROR(SupportedDeviceTypesForNode(
ctx->prioritized_device_type_list(), ndef, &supported_devs));
if (supported_devs.empty()) {
return errors::Internal("Could not find valid device for node.\nNode:",
return errors::NotFound("Could not find valid device for node.\nNode:",
FormatNodeDefForError(ndef),
"\nAll kernels registered for op ", ndef.op(),
" :\n", KernelsRegisteredForOp(ndef.op()));