Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include <algorithm>
#include <array>
#include <string_view>
 
namespace onnxruntime {
 
// The current model versions for saving the ort format models
// This version is NOT onnxruntime version
// Once this model version is updated, the kSupportedOrtModelVersions in IsOrtModelVersionSupported
// below will also need to be updated.
// See onnxruntime/core/flatbuffers/schema/README.md for more details on versioning.
// Version 1 - history begins
// Version 2 - add serialization/deserialization of sparse_initializer
// Version 3 - add `graph_doc_string` to Model
// Version 4 - update kernel def hashing to not depend on ordering of type constraint types (NOT BACKWARDS COMPATIBLE)
// Version 5 - deprecate kernel def hashes and add KernelTypeStrResolver info to replace them (NOT BACKWARDS COMPATIBLE)
// Version 6 - add float 8 types
constexpr const int kOrtModelVersion = 6;
 
// Check if the given ort model version is supported in this build
inline bool IsOrtModelVersionSupported(const int ort_model_version) {
  // The ort model versions we will support in this build
  // This may contain more versions than the kOrtModelVersion, based on the compatibilities
  constexpr std::array kSupportedOrtModelVersions{
      kOrtModelVersion - 1,
      kOrtModelVersion,
  };
 
  const auto it = std::find(kSupportedOrtModelVersions.begin(), kSupportedOrtModelVersions.end(), ort_model_version);
  return it != kSupportedOrtModelVersions.cend();
}
 
}  // namespace onnxruntime