File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,17 @@ static runtime::Module CreateCppMetadataModule(
124124 target_module = const_loader_mod;
125125 }
126126
127- runtime::metadata::Metadata runtime_metadata = ConvertMetaData (metadata);
128-
129- if (metadata->executor == runtime::kTvmExecutorAot && runtime->name == relay::kTvmRuntimeCpp ) {
130- if (target->kind ->name == " c" ) {
131- auto metadata_module = CreateCSourceCppMetadataModule (runtime_metadata);
132- metadata_module->Import (target_module);
133- target_module = metadata_module;
134- } else {
135- CHECK (false ) << " Don't know how to create MetadataModule for target type " << target->str ();
127+ if (metadata.defined ()) {
128+ runtime::metadata::Metadata runtime_metadata = ConvertMetaData (metadata);
129+
130+ if (metadata->executor == runtime::kTvmExecutorAot && runtime->name == relay::kTvmRuntimeCpp ) {
131+ if (target->kind ->name == " c" ) {
132+ auto metadata_module = CreateCSourceCppMetadataModule (runtime_metadata);
133+ metadata_module->Import (target_module);
134+ target_module = metadata_module;
135+ } else {
136+ CHECK (false ) << " Don't know how to create MetadataModule for target type " << target->str ();
137+ }
136138 }
137139 }
138140
Original file line number Diff line number Diff line change @@ -700,8 +700,7 @@ class MetadataSerializer : public AttrVisitor {
700700 if (key != nullptr ) {
701701 address_.push_back (key);
702702 }
703- code_ << address_from_parts (address_) << " , " << arr->array .size () << " /* " << key
704- << " _size */" ;
703+ code_ << address_from_parts (address_);
705704 if (key != nullptr ) {
706705 address_.pop_back ();
707706 }
You can’t perform that action at this time.
0 commit comments