Skip to content

Commit cb0858d

Browse files
authored
Move the definition of the singleton DomainToVersionRange to .cc file (#1469)
1 parent ea8f697 commit cb0858d

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

onnx/defs/schema.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ std::ostream& operator<<(std::ostream& out, const OpSchema& schema) {
722722
return out;
723723
}
724724

725+
OpSchemaRegistry::DomainToVersionRange& OpSchemaRegistry::DomainToVersionRange::Instance() {
726+
static DomainToVersionRange domain_to_version_range;
727+
return domain_to_version_range;
728+
};
729+
725730
// Private method used by OpSchemaRegisterOnce and OpSchemaRegistry::map()
726731
OpName_Domain_Version_Schema_Map&
727732
OpSchemaRegistry::GetMapWithoutEnsuringRegistration() {

onnx/defs/schema.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,7 @@ class OpSchemaRegistry final : public ISchemaRegistry {
624624
map_[domain] = std::make_pair(min_version, max_version);
625625
}
626626

627-
static DomainToVersionRange& Instance() {
628-
static DomainToVersionRange domain_to_version_range;
629-
return domain_to_version_range;
630-
}
627+
static DomainToVersionRange& Instance();
631628

632629
private:
633630
// Key: domain. Value: <lowest version, highest version> pair.

0 commit comments

Comments
 (0)