Skip to content

Commit

Permalink
[CircleEditor] Add files for making Circle model object (#1307)
Browse files Browse the repository at this point in the history
* [CircleEditor] Add files for making Circle model object

This commit adds files for making Circle model object.
- circle_schema_generated.ts
- CircleType.ts
ONE-vscode-DCO-1.0-Signed-off-by: Taeyoon Jeong <[email protected]>

* [CircleEditor] seperate comment
  • Loading branch information
tanficial authored Sep 30, 2022
1 parent ec807d2 commit de79cf6
Show file tree
Hide file tree
Showing 6 changed files with 12,246 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ node_modules/

# External open source project files which are not modified.
media/CircleGraph/external/

# Automatically generated files
src/CircleEditor/circle_schema_generated.ts
6 changes: 6 additions & 0 deletions infra/license/package-judgment.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
"permitted": "yes"
},

"[email protected]": {
"licenses": "Apache-2.0",
"repository": "https://github.com/google/flatbuffers",
"permitted": "yes"
},

"[email protected]": {
"licenses": "(BSD-2-Clause OR MIT OR Apache-2.0)",
"repository": "https://github.com/dominictarr/rc",
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
"@vscode/codicons": "^0.0.29",
"@vscode/webview-ui-toolkit": "^0.9.3",
"configparser": "^0.3.9",
"flatbuffers": "2.0.7",
"ini": "^2.0.0",
"which": "^2.0.2"
}
Expand Down
316 changes: 316 additions & 0 deletions src/CircleEditor/CircleType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,316 @@
/*
* Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* eslint-disable @typescript-eslint/naming-convention*/
import * as Circle from './circle_schema_generated';

/**
* BuiltinOptionsType with uppercase to resolve naming convention conflict.
*/
export enum BuiltinOptionsType {
NONE = 0,
CONV2DOPTIONS = 1,
DEPTHWISECONV2DOPTIONS = 2,
CONCATEMBEDDINGSOPTIONS = 3,
LSHPROJECTIONOPTIONS = 4,
POOL2DOPTIONS = 5,
SVDFOPTIONS = 6,
RNNOPTIONS = 7,
FULLYCONNECTEDOPTIONS = 8,
SOFTMAXOPTIONS = 9,
CONCATENATIONOPTIONS = 10,
ADDOPTIONS = 11,
L2NORMOPTIONS = 12,
LOCALRESPONSENORMALIZATIONOPTIONS = 13,
LSTMOPTIONS = 14,
RESIZEBILINEAROPTIONS = 15,
CALLOPTIONS = 16,
RESHAPEOPTIONS = 17,
SKIPGRAMOPTIONS = 18,
SPACETODEPTHOPTIONS = 19,
EMBEDDINGLOOKUPSPARSEOPTIONS = 20,
MULOPTIONS = 21,
PADOPTIONS = 22,
GATHEROPTIONS = 23,
BATCHTOSPACENDOPTIONS = 24,
SPACETOBATCHNDOPTIONS = 25,
TRANSPOSEOPTIONS = 26,
REDUCEROPTIONS = 27,
SUBOPTIONS = 28,
DIVOPTIONS = 29,
SQUEEZEOPTIONS = 30,
SEQUENCERNNOPTIONS = 31,
STRIDEDSLICEOPTIONS = 32,
EXPOPTIONS = 33,
TOPKV2OPTIONS = 34,
SPLITOPTIONS = 35,
LOGSOFTMAXOPTIONS = 36,
CASTOPTIONS = 37,
DEQUANTIZEOPTIONS = 38,
MAXIMUMMINIMUMOPTIONS = 39,
ARGMAXOPTIONS = 40,
LESSOPTIONS = 41,
NEGOPTIONS = 42,
PADV2OPTIONS = 43,
GREATEROPTIONS = 44,
GREATEREQUALOPTIONS = 45,
LESSEQUALOPTIONS = 46,
SELECTOPTIONS = 47,
SLICEOPTIONS = 48,
TRANSPOSECONVOPTIONS = 49,
SPARSETODENSEOPTIONS = 50,
TILEOPTIONS = 51,
EXPANDDIMSOPTIONS = 52,
EQUALOPTIONS = 53,
NOTEQUALOPTIONS = 54,
SHAPEOPTIONS = 55,
POWOPTIONS = 56,
ARGMINOPTIONS = 57,
FAKEQUANTOPTIONS = 58,
PACKOPTIONS = 59,
LOGICALOROPTIONS = 60,
ONEHOTOPTIONS = 61,
LOGICALANDOPTIONS = 62,
LOGICALNOTOPTIONS = 63,
UNPACKOPTIONS = 64,
FLOORDIVOPTIONS = 65,
SQUAREOPTIONS = 66,
ZEROSLIKEOPTIONS = 67,
FILLOPTIONS = 68,
BIDIRECTIONALSEQUENCELSTMOPTIONS = 69,
BIDIRECTIONALSEQUENCERNNOPTIONS = 70,
UNIDIRECTIONALSEQUENCELSTMOPTIONS = 71,
FLOORMODOPTIONS = 72,
RANGEOPTIONS = 73,
RESIZENEARESTNEIGHBOROPTIONS = 74,
LEAKYRELUOPTIONS = 75,
SQUAREDDIFFERENCEOPTIONS = 76,
MIRRORPADOPTIONS = 77,
ABSOPTIONS = 78,
SPLITVOPTIONS = 79,
UNIQUEOPTIONS = 80,
REVERSEV2OPTIONS = 81,
ADDNOPTIONS = 82,
GATHERNDOPTIONS = 83,
COSOPTIONS = 84,
WHEREOPTIONS = 85,
RANKOPTIONS = 86,
REVERSESEQUENCEOPTIONS = 87,
MATRIXDIAGOPTIONS = 88,
QUANTIZEOPTIONS = 89,
MATRIXSETDIAGOPTIONS = 90,
HARDSWISHOPTIONS = 91,
IFOPTIONS = 92,
WHILEOPTIONS = 93,
DEPTHTOSPACEOPTIONS = 94,
NONMAXSUPPRESSIONV4OPTIONS = 95,
NONMAXSUPPRESSIONV5OPTIONS = 96,
SCATTERNDOPTIONS = 97,
SELECTV2OPTIONS = 98,
DENSIFYOPTIONS = 99,
SEGMENTSUMOPTIONS = 100,
BATCHMATMULOPTIONS = 101,
CUMSUMOPTIONS = 102,
CALLONCEOPTIONS = 103,
BROADCASTTOOPTIONS = 104,
RFFT2DOPTIONS = 105,
CONV3DOPTIONS = 106,
HASHTABLEOPTIONS = 107,
HASHTABLEFINDOPTIONS = 108,
HASHTABLEIMPORTOPTIONS = 109,
HASHTABLESIZEOPTIONS = 110,
VARHANDLEOPTIONS = 111,
READVARIABLEOPTIONS = 112,
ASSIGNVARIABLEOPTIONS = 113,
RANDOMOPTIONS = 114,
BCQGATHEROPTIONS = 252,
BCQFULLYCONNECTEDOPTIONS = 253,
INSTANCENORMOPTIONS = 254,
}

/**
* map CircleType string to CircleType class.
*/
export const CircleType: any = {
'TensorType': Circle.TensorType,
'DimensionType': Circle.DimensionType,
'Padding': Circle.Padding,
'ActivationFunctionType': Circle.ActivationFunctionType,
'LSHProjectionType': Circle.LSHProjectionType,
'FullyConnectedOptionsWeightsFormat': Circle.FullyConnectedOptionsWeightsFormat,
'LSTMKernelType': Circle.LSTMKernelType,
'CombinerType': Circle.CombinerType,
'MirrorPadMode': Circle.MirrorPadMode,
'CustomOptionsFormat': Circle.CustomOptionsFormat,
'DataFormat': Circle.DataFormat,
};

/**
* map normal type to typescript type.
*/
export const NormalType: any = {
'int': Number,
'int32': Number,
'string': String,
'byte': Number,
'ubyte': Number,
'uint': Number,
'int64': Number,
'int16': Number,
'uint16': Number,
'uint32': Number,
'uint64': Number,
'int32[]': Int32Array,
'int16[]': Int16Array,
'uint32[]': Uint32Array,
'uint16[]': Uint16Array,
'float32[]': Float32Array,
'float64[]': Float64Array,
};

/**
* map BuilinOptionsType enum to BuiltInOptions class.
*/
export const NumberToBuiltinOptions = {
0: null,
1: Circle.Conv2DOptionsT,
2: Circle.DepthwiseConv2DOptionsT,
3: Circle.ConcatEmbeddingsOptionsT,
4: Circle.LSHProjectionOptionsT,
5: Circle.Pool2DOptionsT,
6: Circle.SVDFOptionsT,
7: Circle.RNNOptionsT,
8: Circle.FullyConnectedOptionsT,
9: Circle.SoftmaxOptionsT,
10: Circle.ConcatenationOptionsT,
11: Circle.AddOptionsT,
12: Circle.L2NormOptionsT,
13: Circle.LocalResponseNormalizationOptionsT,
14: Circle.LSTMOptionsT,
15: Circle.ResizeBilinearOptionsT,
16: Circle.CallOptionsT,
17: Circle.ReshapeOptionsT,
18: Circle.SkipGramOptionsT,
19: Circle.SpaceToDepthOptionsT,
20: Circle.EmbeddingLookupSparseOptionsT,
21: Circle.MulOptionsT,
22: Circle.PadOptionsT,
23: Circle.GatherOptionsT,
24: Circle.BatchToSpaceNDOptionsT,
25: Circle.SpaceToBatchNDOptionsT,
26: Circle.TransposeOptionsT,
27: Circle.ReducerOptionsT,
28: Circle.SubOptionsT,
29: Circle.DivOptionsT,
30: Circle.SqueezeOptionsT,
31: Circle.SequenceRNNOptionsT,
32: Circle.StridedSliceOptionsT,
33: Circle.ExpOptionsT,
34: Circle.TopKV2OptionsT,
35: Circle.SplitOptionsT,
36: Circle.LogSoftmaxOptionsT,
37: Circle.CastOptionsT,
38: Circle.DequantizeOptionsT,
39: Circle.MaximumMinimumOptionsT,
40: Circle.ArgMaxOptionsT,
41: Circle.LessOptionsT,
42: Circle.NegOptionsT,
43: Circle.PadV2OptionsT,
44: Circle.GreaterOptionsT,
45: Circle.GreaterEqualOptionsT,
46: Circle.LessEqualOptionsT,
47: Circle.SelectOptionsT,
48: Circle.SliceOptionsT,
49: Circle.TransposeConvOptionsT,
50: Circle.SparseToDenseOptionsT,
51: Circle.TileOptionsT,
52: Circle.ExpandDimsOptionsT,
53: Circle.EqualOptionsT,
54: Circle.NotEqualOptionsT,
55: Circle.ShapeOptionsT,
56: Circle.PowOptionsT,
57: Circle.ArgMinOptionsT,
58: Circle.FakeQuantOptionsT,
59: Circle.PackOptionsT,
60: Circle.LogicalOrOptionsT,
61: Circle.OneHotOptionsT,
62: Circle.LogicalAndOptionsT,
63: Circle.LogicalNotOptionsT,
64: Circle.UnpackOptionsT,
65: Circle.FloorDivOptionsT,
66: Circle.SquareOptionsT,
67: Circle.ZerosLikeOptionsT,
68: Circle.FillOptionsT,
69: Circle.BidirectionalSequenceLSTMOptionsT,
70: Circle.BidirectionalSequenceRNNOptionsT,
71: Circle.UnidirectionalSequenceLSTMOptionsT,
72: Circle.FloorModOptionsT,
73: Circle.RangeOptionsT,
74: Circle.ResizeNearestNeighborOptionsT,
75: Circle.LeakyReluOptionsT,
76: Circle.SquaredDifferenceOptionsT,
77: Circle.MirrorPadOptionsT,
78: Circle.AbsOptionsT,
79: Circle.SplitVOptionsT,
80: Circle.UniqueOptionsT,
81: Circle.ReverseV2OptionsT,
82: Circle.AddNOptionsT,
83: Circle.GatherNdOptionsT,
84: Circle.CosOptionsT,
85: Circle.WhereOptionsT,
86: Circle.RankOptionsT,
87: Circle.ReverseSequenceOptionsT,
88: Circle.MatrixDiagOptionsT,
89: Circle.QuantizeOptionsT,
90: Circle.MatrixSetDiagOptionsT,
91: Circle.HardSwishOptionsT,
92: Circle.IfOptionsT,
93: Circle.WhileOptionsT,
94: Circle.DepthToSpaceOptionsT,
95: Circle.NonMaxSuppressionV4OptionsT,
96: Circle.NonMaxSuppressionV5OptionsT,
97: Circle.ScatterNdOptionsT,
98: Circle.SelectV2OptionsT,
99: Circle.DensifyOptionsT,
100: Circle.SegmentSumOptionsT,
101: Circle.BatchMatMulOptionsT,
102: Circle.CumsumOptionsT,
103: Circle.CallOnceOptionsT,
104: Circle.BroadcastToOptionsT,
105: Circle.Rfft2dOptionsT,
106: Circle.Conv3DOptionsT,
107: Circle.HashtableOptionsT,
108: Circle.HashtableFindOptionsT,
109: Circle.HashtableImportOptionsT,
110: Circle.HashtableSizeOptionsT,
111: Circle.VarHandleOptionsT,
112: Circle.ReadVariableOptionsT,
113: Circle.AssignVariableOptionsT,
114: Circle.RandomOptionsT,
252: Circle.BCQGatherOptionsT,
253: Circle.BCQFullyConnectedOptionsT,
254: Circle.InstanceNormOptionsT,
};

/**
* map SparseIndexVector enum to VectorClass.
*/
export const SparseVector = {
0: null,
1: Circle.Int32VectorT,
2: Circle.Uint16VectorT,
3: Circle.Uint8VectorT,
};
Loading

0 comments on commit de79cf6

Please sign in to comment.