Revert debug code

del_some_in_makelist
Yang Yu 7 years ago
parent 44ec872531
commit 8728885031

@ -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<float*>(
reinterpret_cast<uintptr_t>(holder_->ptr()) + offset_);
for (int64_t i = 0; i < this->numel(); ++i) {
buf[i] = NAN;
}
}
return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(holder_->ptr()) +
offset_);
}

@ -107,12 +107,10 @@ class SumKernel : public framework::OpKernel<T> {
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<T>::Flatten(in_array[i]);
auto result = EigenVector<T>::Flatten(out_array[i]);

Loading…
Cancel
Save