HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
basic_types.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 
4 #pragma once
5 
6 #include <unordered_map>
7 #include <unordered_set>
8 #include <string>
9 #include <cstdint>
10 #include <memory>
11 #include <functional>
12 
14 #include "core/common/status.h"
15 
16 namespace ONNX_NAMESPACE {
17 class ValueInfoProto;
18 class TensorProto;
19 class SparseTensorProto;
20 class TypeProto;
21 class AttributeProto;
22 // define types that would come from the ONNX library if we were building against it.
23 #if defined(ORT_MINIMAL_BUILD)
24 using OperatorSetVersion = int;
25 #endif
26 
27 } // namespace ONNX_NAMESPACE
28 
29 namespace onnxruntime {
30 using NodeIndex = size_t;
31 using Version = int64_t;
32 using NodeArgInfo = ONNX_NAMESPACE::ValueInfoProto;
33 using InitializedTensorSet = std::unordered_map<std::string, const ONNX_NAMESPACE::TensorProto*>;
34 using ArgNameToTypeMap = std::unordered_map<std::string, ONNX_NAMESPACE::TypeProto>;
35 using ProviderType = const std::string&;
36 
37 // TODO - Evaluate switching the types below to support transparent comparators and enable
38 // lookups based on gsl::cstring_span<> and std::string_view. This would reduces allocations
39 // converting to std::string, but requires conversion to std::map<std::string, foo, std::less<>>
40 // instead of std::unordered_map<std::string, foo, [std::less<foo>]>.
41 
42 using NodeAttributes = std::unordered_map<std::string, ONNX_NAMESPACE::AttributeProto>;
44 using IOnnxRuntimeOpSchemaCollectionPtr = std::shared_ptr<IOnnxRuntimeOpSchemaCollection>;
45 
46 class OpKernel;
47 class OpKernelInfo;
48 class FuncManager;
49 using KernelCreateFn = std::function<onnxruntime::common::Status(FuncManager& func_mgr, const OpKernelInfo& info, std::unique_ptr<OpKernel>& out)>;
50 } // namespace onnxruntime
std::unordered_map< std::string, const ONNX_NAMESPACE::TensorProto * > InitializedTensorSet
Definition: basic_types.h:33
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
const std::string & ProviderType
Definition: basic_types.h:35
std::shared_ptr< IOnnxRuntimeOpSchemaCollection > IOnnxRuntimeOpSchemaCollectionPtr
Definition: basic_types.h:44
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
std::unordered_map< std::string, ONNX_NAMESPACE::AttributeProto > NodeAttributes
Definition: basic_types.h:42
std::function< Status(FuncManager &func_mgr, const OpKernelInfo &info, std::unique_ptr< OpKernel > &out)> KernelCreateFn
Definition: op_kernel.h:142
int64_t Version
Definition: basic_types.h:31
ONNX_NAMESPACE::ValueInfoProto NodeArgInfo
Definition: basic_types.h:32
std::unordered_map< std::string, ONNX_NAMESPACE::TypeProto > ArgNameToTypeMap
Definition: basic_types.h:34
size_t NodeIndex
Definition: basic_types.h:30