From 76c79d79a1734d2c05238d3125b72252b62af20b Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 7 Sep 2020 15:36:59 +0800 Subject: [PATCH] fix(mgb/opr): fix ConvBias not passing on prep_filter GitOrigin-RevId: 0dc9f9d1331d48f6e8198472332316ef273f80e7 --- src/opr/impl/dnn/convolution.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/opr/impl/dnn/convolution.cpp b/src/opr/impl/dnn/convolution.cpp index 39f8f4a85..bd2338123 100644 --- a/src/opr/impl/dnn/convolution.cpp +++ b/src/opr/impl/dnn/convolution.cpp @@ -1039,10 +1039,7 @@ void ConvolutionForward::init_output_format() { } void ConvolutionForward::scn_do_execute() { - if (input(1)->contain_flag(VarNode::Flag::PERSISTENT_DEVICE_VALUE) && - cg::is_const_var_value(input(1))) { - update_preprocessed_filter(); - } + update_preprocessed_filter(); megdnn_opr()->exec(input(0)->dev_tensor().as_megdnn(), input(1)->dev_tensor().as_megdnn(), output(0)->dev_tensor().as_megdnn(), @@ -1606,8 +1603,7 @@ void ConvBiasForward::scn_do_execute() { megdnn::TensorND z_tensor{nullptr, z_layout}; mo->exec(inp[0]->dev_tensor().as_megdnn(), inp[1]->dev_tensor().as_megdnn(), bias_tensor, z_tensor, - output(0)->dev_tensor().as_megdnn(), - nullptr, + output(0)->dev_tensor().as_megdnn(), preprocessed_filter(), intl::get_megdnn_workspace_from_var(output().back())); } else if (inp.size() == 3) { @@ -1619,8 +1615,7 @@ void ConvBiasForward::scn_do_execute() { mo->exec(inp[0]->dev_tensor().as_megdnn(), inp[1]->dev_tensor().as_megdnn(), inp[2]->dev_tensor().as_megdnn(), z_tensor, - output(0)->dev_tensor().as_megdnn(), - nullptr, + output(0)->dev_tensor().as_megdnn(), preprocessed_filter(), intl::get_megdnn_workspace_from_var(output().back())); } else { mgb_assert(inp.size() == 4); @@ -1628,8 +1623,7 @@ void ConvBiasForward::scn_do_execute() { inp[1]->dev_tensor().as_megdnn(), inp[2]->dev_tensor().as_megdnn(), inp[3]->dev_tensor().as_megdnn(), - output(0)->dev_tensor().as_megdnn(), - nullptr, + output(0)->dev_tensor().as_megdnn(), preprocessed_filter(), intl::get_megdnn_workspace_from_var(output().back())); } } @@ -2389,4 +2383,4 @@ void BatchConvBiasForward::init_output_format() { #undef IMPL_CONV #undef MGB_FOREACH_FASTRUN_OPR -// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}} \ No newline at end of file +// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}} -- GitLab