From 8728885031be996588520373cf3eec8fab0efee3 Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Tue, 26 Dec 2017 17:09:57 +0800 Subject: [PATCH] Revert debug code --- paddle/framework/tensor_impl.h | 8 -------- paddle/operators/sum_op.h | 2 -- 2 files changed, 10 deletions(-) diff --git a/paddle/framework/tensor_impl.h b/paddle/framework/tensor_impl.h index 46ea3b881..6c6f298ed 100644 --- a/paddle/framework/tensor_impl.h +++ b/paddle/framework/tensor_impl.h @@ -134,14 +134,6 @@ inline void* Tensor::mutable_data(platform::Place place, std::type_index type) { #endif offset_ = 0; } - - if (typeid(float).hash_code() == type.hash_code()) { - auto buf = reinterpret_cast( - reinterpret_cast(holder_->ptr()) + offset_); - for (int64_t i = 0; i < this->numel(); ++i) { - buf[i] = NAN; - } - } return reinterpret_cast(reinterpret_cast(holder_->ptr()) + offset_); } diff --git a/paddle/operators/sum_op.h b/paddle/operators/sum_op.h index cbde9976d..eaa36aa1a 100644 --- a/paddle/operators/sum_op.h +++ b/paddle/operators/sum_op.h @@ -107,12 +107,10 @@ class SumKernel : public framework::OpKernel { out_array.resize(i + 1); } if (out_array[i].numel() == 0) { - VLOG(10) << context.op().Output("Out") << " just copy"; framework::CopyFrom(in_array[i], in_array[i].place(), context.device_context(), &out_array[i]); out_array[i].set_lod(in_array[i].lod()); } else { - VLOG(10) << context.op().Output("Out") << " merged"; PADDLE_ENFORCE(out_array[i].lod() == in_array[i].lod()); auto in = EigenVector::Flatten(in_array[i]); auto result = EigenVector::Flatten(out_array[i]); -- GitLab