提交 92daace5 编写于 作者: M Michal Gallus

MKL-DNN Concat: Fix segfault related to referencing deleter memory primitive

test=develop
上级 87eb8b0e
...@@ -80,8 +80,8 @@ class ConcatPrimitiveFactory { ...@@ -80,8 +80,8 @@ class ConcatPrimitiveFactory {
concat CreateConcatPrimitive(const concat::primitive_desc& concat_pd, concat CreateConcatPrimitive(const concat::primitive_desc& concat_pd,
Tensor* output, platform::CPUPlace place) { Tensor* output, platform::CPUPlace place) {
CreateSourcePrimitiveAts(); CreateSourcePrimitiveAts();
auto dst_mem = CreateDstMemory(concat_pd, output, place); dst_mem = CreateDstMemory(concat_pd, output, place);
return concat(concat_pd, inputs, dst_mem); return concat(concat_pd, inputs, dst_mem.get());
} }
private: private:
...@@ -118,7 +118,8 @@ class ConcatPrimitiveFactory { ...@@ -118,7 +118,8 @@ class ConcatPrimitiveFactory {
std::vector<memory::primitive_desc> srcs_pd; std::vector<memory::primitive_desc> srcs_pd;
std::vector<memory> srcs; std::vector<memory> srcs;
std::vector<primitive::at> inputs; std::vector<primitive::at> inputs;
}; boost::optional<memory> dst_mem; // TODO(mgallus): change to std::optional
}; // upon introduction of C++17 to paddle
template <typename T> template <typename T>
class ConcatMKLDNNOpKernel : public paddle::framework::OpKernel<T> { class ConcatMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册