tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] alexbooth commented on a change in pull request #5272: [BYOC] Add example of Composite + Annotate for DNNL fused op
Date Thu, 09 Apr 2020 18:04:23 GMT
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```.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message