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)