提交 f0efc244 编写于 作者: M Michal Gallus 提交者: Tomasz Patejko

MKLDNN conv + elementwise_add fusion: Fix transpiler integration to predict...

MKLDNN conv + elementwise_add fusion: Fix transpiler integration to predict skip connection input of eltwise_add
上级 fb7a50b2
......@@ -455,11 +455,15 @@ class InferenceTranspiler(object):
:type eltwise_op: Operator
'''
residual_var = self.block.var(eltwise_op.input("X")[0])
out_var = self.block.var(eltwise_op.output("Out")[0])
filter_var = self.block.var(conv_op.input("Filter")[0])
in_var = self.block.var(conv_op.input("Input")[0])
bias_var = self.block.var(conv_op.input("Bias")[0])
eltwise_input = "X"
if eltwise_op.input("X")[0] == conv_op.output("Output")[0]:
eltwise_input = "Y"
residual_var = self.block.vars[eltwise_op.input(eltwise_input)[0]]
out_var = self.block.vars[eltwise_op.output("Out")[0]]
filter_var = self.block.vars[conv_op.input("Filter")[0]]
in_var = self.block.vars[conv_op.input("Input")[0]]
bias_var = self.block.vars[conv_op.input("Bias")[0]]
conv_op.set_attr("fuse_eltwise", True)
attrs = {name: conv_op.attr(name) for name in conv_op.attr_names}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册