提交 87288850 编写于 作者: Y Yang Yu

Revert debug code

上级 44ec8725
......@@ -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]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册