Исходный код СУБД 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "testPch.h"
#include "onnxruntime_cxx_api.h"
 
namespace OrtValueHelpers {
winml::ITensor LoadTensorFromOrtValue(Ort::Value& val);
 
Ort::Value CreateOrtValueFromITensor(winml::ITensor winmlTensor);
}  // namespace OrtValueHelpers
 
template <ONNXTensorElementDataType T>
struct ONNXTensorElementDataTypeToWinMLTensorKind {
  // Invalid ONNXTensorElementDataType to TensorKind
  static_assert(sizeof(T) == -1, "No WinML TensorKind mapped for given ONNX Tensor Element type!");
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT> {
  typedef winml::TensorFloat Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8> {
  typedef winml::TensorUInt8Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8> {
  typedef winml::TensorInt8Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16> {
  typedef winml::TensorUInt16Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16> {
  typedef winml::TensorInt16Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32> {
  typedef winml::TensorInt32Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64> {
  typedef winml::TensorInt64Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING> {
  typedef winml::TensorString Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL> {
  typedef winml::TensorBoolean Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16> {
  typedef winml::TensorFloat16Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE> {
  typedef winml::TensorDouble Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32> {
  typedef winml::TensorUInt32Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64> {
  typedef winml::TensorUInt64Bit Type;
};
 
template <>
struct ONNXTensorElementDataTypeToWinMLTensorKind<ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16> {
  typedef winml::TensorFloat16Bit Type;
};