File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -469,9 +469,19 @@ def compile_model(
469469 lib = graph_module .lib if use_vm else graph_module .get_lib ()
470470 # TODO lib.get_source call have inconsistent behavior for unsupported
471471 # formats (@leandron).
472- dumps [source_type ] = lib .get_source (source_type )
472+ try :
473+ dumps [source_type ] = lib .get_source (source_type )
474+ except tvm .TVMError :
475+ pass
473476 for smod in lib .imported_modules :
474- dumps [smod .type_key ] = smod .get_source ()
477+ try :
478+ if smod .type_key not in dumps :
479+ dumps [smod .type_key ] = ""
480+ else :
481+ dumps [smod .type_key ] += "\n "
482+ dumps [smod .type_key ] += smod .get_source ()
483+ except tvm .TVMError :
484+ print (f"Imported module { smod .type_key } doesn't support source dump" )
475485
476486 # Create a new tvmc model package object from the graph definition.
477487 package_path = tvmc_model .export_package (
You can’t perform that action at this time.
0 commit comments