Send list as argument to schedule_conv2d (#4358)
authormiheer vaidya <v.miheer@gmail.com>
Mon, 18 Nov 2019 00:39:36 +0000 (17:39 -0700)
committerTianqi Chen <tqchen@users.noreply.github.com>
Mon, 18 Nov 2019 00:39:36 +0000 (16:39 -0800)
When getting cuda schedule passing single tensor seem to work but after changing target to "llvm" causes assert.
Sending list on other hand makes both cuda and llvm targets happy.
See https://discuss.tvm.ai/t/solved-simple-example-error-attributeerror-tensorslice-object-has-no-attribute-op/2245/3

tutorials/topi/intro_topi.py

index 6c7bb6a..390085e 100644 (file)
@@ -135,7 +135,7 @@ kernel = tvm.placeholder((10, 3, 5, 5))
 with tvm.target.create("cuda"):
     conv = topi.nn.conv2d(data, kernel, strides=1, padding=2, dilation=1)
     out = topi.nn.relu(conv)
-    sconv = topi.generic.nn.schedule_conv2d_nchw(out)
+    sconv = topi.generic.nn.schedule_conv2d_nchw([out])
     print(tvm.lower(sconv, [data, kernel], simple_mode=True))
 
 ######################################################################