GraphRuntimeFactoryModule has no attribute 'imported'_modules

I want to use mod.imported_modules[0].get_source() to print the cuda kernel fuction.

I insert print(mod.imported_modules[0].get_source()) below line 387 in build_module.py. https://github.com/apache/tvm/blob/3d8fd2a2e7c39216482275d04e71aa131216e4c2/python/tvm/relay/build_module.py#L387

image

But the following errro will appear. AttributeError:GraphRuntimeFactoryModule has no attribute ‘imported’_modules

Which function should I call to print the kernel fuction correctly?

You should work call mod.get_lib().imported_modules[0].get_source()

Thank you for your help, this problem is solved.