mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-03 23:49:44 +00:00
Namespace change on ort flatbuffers schema (#4886)
* correct some errors in the flatbuffers schema, move flatbuffers submodule to cmake/external * update the ort flatbuffers schema to use less namespace * minor update Co-authored-by: gwang0000 <62914304+gwang0000@users.noreply.github.com>
This commit is contained in:
parent
fdd0926d00
commit
82bc21e35e
5 changed files with 42 additions and 44 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -62,6 +62,6 @@
|
|||
[submodule "cmake/external/onnx-tensorrt"]
|
||||
path = cmake/external/onnx-tensorrt
|
||||
url = https://github.com/onnx/onnx-tensorrt.git
|
||||
[submodule "flatbuffers"]
|
||||
path = flatbuffers
|
||||
[submodule "cmake/external/flatbuffers"]
|
||||
path = cmake/external/flatbuffers
|
||||
url = https://github.com/google/flatbuffers.git
|
||||
|
|
|
|||
|
|
@ -81,6 +81,16 @@
|
|||
"comments": "git submodule at cmake/external/eigen"
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"commitHash": "db2aa9b4eca0edc94aea9e2059c21ce8786fc762",
|
||||
"repositoryUrl": "https://github.com/google/flatbuffers.git"
|
||||
},
|
||||
"comments": "git submodule at cmake/external/flatbuffers"
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
|
|
@ -531,16 +541,6 @@
|
|||
"comments": "git submodule at cmake/external/wil"
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"commitHash": "f3003e08d02ca4810924a53ca463a8b3150926d8",
|
||||
"repositoryUrl": "https://github.com/google/flatbuffers.git"
|
||||
},
|
||||
"comments": "git submodule at flatbuffers"
|
||||
}
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
|
|
|
|||
1
cmake/external/flatbuffers
vendored
Submodule
1
cmake/external/flatbuffers
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit db2aa9b4eca0edc94aea9e2059c21ce8786fc762
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit f3003e08d02ca4810924a53ca463a8b3150926d8
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
namespace onnxruntime.experimental.fbs.Attribute;
|
||||
namespace onnxruntime.experimental.fbs;
|
||||
|
||||
enum Type : int {
|
||||
// Attribute
|
||||
enum AttributeType : int {
|
||||
UNDEFINED = 0,
|
||||
FLOAT = 1,
|
||||
INT = 2,
|
||||
|
|
@ -19,9 +20,8 @@ enum Type : int {
|
|||
SPARSE_TENSORS = 12,
|
||||
}
|
||||
|
||||
namespace onnxruntime.experimental.fbs.Tensor.Shape;
|
||||
|
||||
table Info {
|
||||
// Shape
|
||||
table Shape {
|
||||
dim:[Dimension];
|
||||
}
|
||||
|
||||
|
|
@ -35,9 +35,8 @@ table DimensionValue {
|
|||
dim_param:string;
|
||||
}
|
||||
|
||||
namespace onnxruntime.experimental.fbs.Tensor;
|
||||
|
||||
enum DataType : int {
|
||||
// Tensor
|
||||
enum TensorDataType : int {
|
||||
UNDEFINED = 0,
|
||||
FLOAT = 1,
|
||||
UINT8 = 2,
|
||||
|
|
@ -57,13 +56,12 @@ enum DataType : int {
|
|||
BFLOAT16 = 16,
|
||||
}
|
||||
|
||||
table TypeInfo{
|
||||
elem_type:DataType;
|
||||
shape:Shape.Info;
|
||||
table TensorTypeAndShape{
|
||||
elem_type:TensorDataType;
|
||||
shape:Shape;
|
||||
}
|
||||
|
||||
namespace onnxruntime.experimental.fbs.Graph;
|
||||
|
||||
// Node
|
||||
enum NodeType : int {
|
||||
Primitive = 0,
|
||||
Fused = 1,
|
||||
|
|
@ -85,7 +83,7 @@ table Node {
|
|||
op_type:string;
|
||||
type:NodeType;
|
||||
execution_provider_type:string;
|
||||
|
||||
|
||||
inputs:[string];
|
||||
outputs:[string];
|
||||
attributes:[onnxruntime.experimental.fbs.Attribute];
|
||||
|
|
@ -94,13 +92,7 @@ table Node {
|
|||
implicit_inputs:[string];
|
||||
}
|
||||
|
||||
namespace onnxruntime.experimental.fbs;
|
||||
|
||||
table OperatorSetId {
|
||||
domain:string;
|
||||
version:long;
|
||||
}
|
||||
|
||||
// ValueInfo
|
||||
table ValueInfo {
|
||||
name:string;
|
||||
doc_string:string;
|
||||
|
|
@ -109,7 +101,7 @@ table ValueInfo {
|
|||
|
||||
// TODO add support of Sequence/Map/SparseTensor/Opaque
|
||||
union TypeInfoValue {
|
||||
tensor_type:Tensor.TypeInfo,
|
||||
tensor_type:TensorTypeAndShape,
|
||||
}
|
||||
|
||||
table TypeInfo {
|
||||
|
|
@ -117,15 +109,21 @@ table TypeInfo {
|
|||
value:TypeInfoValue;
|
||||
}
|
||||
|
||||
// OpSetId
|
||||
table OperatorSetId {
|
||||
domain:string;
|
||||
version:long;
|
||||
}
|
||||
|
||||
// For simplicity, we will have only two data fields
|
||||
// - string_data for string
|
||||
// - raw_data for all other types
|
||||
table Tensor {
|
||||
name:string;
|
||||
doc_string:string;
|
||||
|
||||
|
||||
dims:[long];
|
||||
data_type:Tensor.DataType;
|
||||
data_type:TensorDataType;
|
||||
|
||||
raw_data:[ubyte];
|
||||
|
||||
|
|
@ -136,15 +134,15 @@ table Tensor {
|
|||
table Attribute{
|
||||
name:string;
|
||||
doc_string:string;
|
||||
|
||||
type:Attribute.Type;
|
||||
|
||||
|
||||
type:AttributeType;
|
||||
|
||||
f:float;
|
||||
i:long;
|
||||
s:[ubyte];
|
||||
t:Tensor;
|
||||
g:Graph;
|
||||
|
||||
|
||||
floats:[float];
|
||||
ints:[long];
|
||||
strings:[string];
|
||||
|
|
@ -156,11 +154,11 @@ table Graph{
|
|||
initializers:[Tensor];
|
||||
|
||||
node_args:[ValueInfo];
|
||||
nodes:[Graph.Node];
|
||||
nodes:[Node];
|
||||
max_node_index:uint;
|
||||
|
||||
input_edges:[Graph.EdgeEnd];
|
||||
output_edges:[Graph.EdgeEnd];
|
||||
input_edges:[EdgeEnd];
|
||||
output_edges:[EdgeEnd];
|
||||
|
||||
inputs:[string];
|
||||
outputs:[string];
|
||||
|
|
|
|||
Loading…
Reference in a new issue