From: Alexandre Passos Date: Sat, 24 Feb 2018 01:19:00 +0000 (-0800) Subject: Dropped from previous change. X-Git-Tag: upstream/v1.7.0~31^2~389 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1cc57604cadb4251efeb764074c9138d4e24521;p=platform%2Fupstream%2Ftensorflow.git Dropped from previous change. PiperOrigin-RevId: 186846681 --- diff --git a/tensorflow/c/eager/c_api.cc b/tensorflow/c/eager/c_api.cc index f615e3f..c27a712 100644 --- a/tensorflow/c/eager/c_api.cc +++ b/tensorflow/c/eager/c_api.cc @@ -303,11 +303,9 @@ void TFE_OpSetXLACompilation(TFE_Op* op, unsigned char enable) { void TFE_OpAddInput(TFE_Op* op, TFE_TensorHandle* h, TF_Status* status) { // Questionable heuristic ... - // - // Motivation: After an 'op' is placed on GPU because some of its earlier - // inputs are on GPU, we want to keep the 'op' there, even if some later - // inputs of it are not on GPU. - if (IsCPU(op->device) && !IsCPU(h->d)) { + // - If a device was explicitly set on the op, always use that. + // - If not, place on the first non-host device seen. + if (op->device == nullptr && !IsCPU(h->d)) { op->device = h->d; } if (!status->status.ok()) return;