Hi. I’m a new user of TVM.
I’m currently trying to print the HalideIR from Conv2d layer. To do this, I first imported the VGG-16 and write the code as shown below.
def ModifyIR( IR ):
print(IR.node)
return IR
target = tvm.target.cuda()
batch_size = 1
num_class = 1000
image_shape = (3, 224, 224)
data_shape = (batch_size,) + image_shape
out_shape = (batch_size, num_class)
mod, params = relay.testing.vgg.get_workload( num_layers=16,
batch_size = batch_size , image_shpae = image_shape)
print( mod['main'].body )
with tvm.relay.transform.build_config( opt_level=0 ):
with tvm.build_config(add_lower_pass=[ (0 , ModifyIR) ] ) as cfg:
g_j , module , params = tvm.relay.build_module.build( mod , target='cuda',params=params )
when i Running the code produces the following output
// print( mod[‘main’].body ) part
andThe output from “print(mod [‘main’]. body)” clearly shows the conv2d layer, but if i print it via add_lower_pass, i can’t see the name conv. I guess “compute(tesnor, addr)” is the conv layer. Am I guessing right?