alexbooth commented on a change in pull request #5272: [BYOC] Add example of
Composite + Annotate for DNNL fused op
URL: https://github.com/apache/incubator-tvm/pull/5272#discussion_r406382408
##########
File path: tests/python/relay/test_pass_partition_graph.py
##########
@@ -856,6 +857,128 @@ def expected():
partitioned = transform.PartitionGraph()(mod)
assert tvm.ir.structural_equal(partitioned, ref_mod, map_free_vars=True)
+
+def test_dnnl_fuse():
+ def make_pattern(with_bias=True):
+ data = relay.var("data", relay.TensorType((1, 3, 224, 224), "float32"))
+ weight = relay.var("weight")
+ bias = relay.var("bias")
+ conv = relay.nn.conv2d(data=data, weight=weight, kernel_size=(3, 3),
+ channels=8, padding=(1, 1))
+ if with_bias:
+ conv_out = relay.add(conv, bias)
Review comment:
Should this be ```relay.nn.bias_add```? On my side, I had ```nn.bias_add```
after conv2d and noticed that the GetRootCall would fail unless I changed
```add``` to ```nn.bias_add``` in the expected op list.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services