Исходный код СУБД 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
59
60
61
62
63
64
65
66
67
68
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include <string>
namespace onnxruntime {
namespace lazytensor {
// This file contains environment variables that control
// the behavior of ORT as LazyTensor's backend.
// Most variables are for debug purpose.
// Example:
//   LORT_CHECK_TENSOR_CONTENT=1 LORT_DUMP_GRAPH=1
//   LORT_DUMP_INPUTS_OUTPUTS=1 LORT_CHECK_BASELINE=1
//   LORT_RELATIVE_TOLERANCE=1e-3 python main.py
 
// When returing true, we dump the inputs and outputs
// when ORT (and Pytorch when ORTLTCHECKBASELINE is set to 1)
// executes the subgraph.
bool DumpInputsOutputs();
// Returns true to dump the torch::jit::Graph ORT receives
// from LazyTensor.
bool DumpGraph();
// If returned value is true, run torch::jit::GraphExecutor
// and compare its outputs with ORT's outputs.
// Only types and shapes are compared. The user can control
// the checking mechanism. For example, set
// LORT_CHECK_TENSOR_CONTENT=1 to compare tensor elements.
//
// Related functions' dependency graph:
//  CheckBaseline -> CheckTensorContent -> AbsoluteTolerance
//                                   '---> RelativeTolerance
// bool CheckBaseline();
std::string RunType();
// If this function returns true, all aten ops seen by ORT
// will be printed. We also tag if these are supported or not.
bool DumpAtenOpHistory();
// If this function returns true, check tensor's elements
// when CheckBaseline() returns true.
bool CheckTensorContent();
// The "absolute_tol" in
// |value-expected| <= |expected| * relative_tol + absolute_tol
double AbsoluteTolerance();
// The "relative_tol" in
// |value-expected| <= |expected| * relative_tol + absolute_tol
double RelativeTolerance();
bool DumpOnnxFusion();
 
class DynamicSettings {
 public:
  static DynamicSettings& GetInstance() {
    static DynamicSettings instance;
    return instance;
  }
  DynamicSettings(DynamicSettings const&) = delete;
  void operator=(DynamicSettings const&) = delete;
  bool GetOnnxFusionFlag() const {
    return onnx_fusion_status_;
  }
  void SetOnnxFusionFlag(bool status) {
    onnx_fusion_status_ = status;
  }
 
 private:
  DynamicSettings() : onnx_fusion_status_(true) {};
  bool onnx_fusion_status_;
};
 
}  // namespace lazytensor
}  // namespace onnxruntime