From 7d8784b4b89a4251800eaf678801ae7b27303a0d Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 1 Oct 2019 13:26:13 -0700 Subject: [PATCH] Fix alter layout x86 --- topi/python/topi/x86/conv2d_alter_op.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/topi/python/topi/x86/conv2d_alter_op.py b/topi/python/topi/x86/conv2d_alter_op.py index a6333d8940f1..495b480533ca 100644 --- a/topi/python/topi/x86/conv2d_alter_op.py +++ b/topi/python/topi/x86/conv2d_alter_op.py @@ -98,6 +98,12 @@ def _alter_conv2d_layout(attrs, inputs, tinfo, F): ic_bn, oc_bn = cfg["tile_ic"].size[-1], cfg["tile_oc"].size[-1] new_attrs[layout_name] = 'NCHW%dc' % ic_bn new_attrs['out_layout'] = 'NCHW%dc' % oc_bn + + # Remove attached compilation target because conv2d_NCHWc needs to create + # a conv2d_nchwc op and target is not one of conv2d's parameters. + if "target" in new_attrs: + del new_attrs["target"] + new_data = tvm.placeholder((batch_size, in_channel//ic_bn, height, width, ic_bn), dtype=data_dtype)