Исходный код СУБД 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include <string>
#include <unordered_map>
#include <vector>
 
#include "core/common/path_string.h"
#include "core/common/status.h"
#include "core/framework/data_transfer_manager.h"
#include "core/framework/data_types.h"
#include "core/framework/framework_common.h"
 
namespace onnxruntime {
namespace training {
 
/**
 * A checkpoint is a directory of files:
 * checkpoint/
 *   tensors.pbseq - tensor protobuf messages
 *   tensors.bin - tensor binary data
 *   properties.pbseq - property protobuf messages
 */
 
/**
 * Saves a model checkpoint in the specified location.
 *
 * @param checkpoint_path The checkpoint location.
 * @param data_transfer_manager The DataTransferManager instance.
 * @param runtime_tensors The tensors to persist.
 * @param properties The properties to persist.
 * @return The status of the operation.
 */
common::Status SaveModelCheckpoint(
    const PathString& checkpoint_path,
    const DataTransferManager& data_transfer_manager,
    const NameMLValMap& runtime_tensors,
    const std::unordered_map<std::string, std::string>& properties);
 
/**
 * Loads a model checkpoint from the specified location.
 *
 * @param checkpoint_path The checkpoint location.
 * @param model_path The model location.
 * @param tensor_protos The loaded tensors.
 * @param properties The loaded properties.
 * @return The status of the operation.
 */
common::Status LoadModelCheckpoint(
    const PathString& checkpoint_path,
    const PathString& model_path,
    std::vector<ONNX_NAMESPACE::TensorProto>& tensor_protos,
    std::unordered_map<std::string, std::string>& properties);
 
}  // namespace training
}  // namespace onnxruntime