From 8fc05e0373bb481e36b53c650f2dc00acf1b32a5 Mon Sep 17 00:00:00 2001 From: Wu Yi Date: Tue, 6 Nov 2018 14:34:50 +0800 Subject: [PATCH] fix cpu build test=develop (#14260) --- paddle/fluid/operators/ref_by_trainer_id_op.h | 3 +-- python/paddle/fluid/transpiler/distribute_transpiler.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/paddle/fluid/operators/ref_by_trainer_id_op.h b/paddle/fluid/operators/ref_by_trainer_id_op.h index d84c22ff614..2ce577544ae 100644 --- a/paddle/fluid/operators/ref_by_trainer_id_op.h +++ b/paddle/fluid/operators/ref_by_trainer_id_op.h @@ -26,7 +26,7 @@ class RefByTrainerIdKernel : public framework::OpKernel { auto* out = context.Output("Out"); auto in_list = context.MultiInput("X"); auto* trainer_id_t = context.Input("TrainerId"); - int64_t trainer_id; + int64_t trainer_id = 0; auto* trainer_id_data = trainer_id_t->data(); if (platform::is_gpu_place(context.GetPlace())) { #ifdef PADDLE_WITH_CUDA @@ -38,7 +38,6 @@ class RefByTrainerIdKernel : public framework::OpKernel { } else { trainer_id = *trainer_id_data; } - printf("after get trainer_id %lu\n", trainer_id); PADDLE_ENFORCE_LT(trainer_id, in_list.size()); out->mutable_data(context.GetPlace()); out->ShareDataWith(*(in_list[trainer_id])); diff --git a/python/paddle/fluid/transpiler/distribute_transpiler.py b/python/paddle/fluid/transpiler/distribute_transpiler.py index 6ef799a1f42..7c7fba76718 100644 --- a/python/paddle/fluid/transpiler/distribute_transpiler.py +++ b/python/paddle/fluid/transpiler/distribute_transpiler.py @@ -1588,7 +1588,6 @@ to transpile() call.") ref_inputs = [] for p, p_bak in self.param_bak_list: if p.name == param_var.name: - print("#### ref inputs: ", param_var.name, p_bak.name) ref_inputs.append(p_bak) block.append_op( type="ref_by_trainer_id", -- GitLab