mnn-schema.js 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725
  1. var $root = flatbuffers.get('mnn');
  2. $root.MNN = $root.MNN || {};
  3. $root.MNN.OpType = {
  4. AbsVal: 0,
  5. QuantizedAdd: 1,
  6. ArgMax: 2,
  7. AsString: 3,
  8. InstanceNorm: 4,
  9. BatchToSpaceND: 5,
  10. Bias: 6,
  11. BinaryOp: 7,
  12. Bnll: 8,
  13. Cast: 9,
  14. Concat: 10,
  15. Const: 11,
  16. Convolution: 12,
  17. ConvolutionDepthwise: 13,
  18. Crop: 14,
  19. CropAndResize: 15,
  20. Cubic: 16,
  21. Deconvolution: 17,
  22. DeconvolutionDepthwise: 18,
  23. Dequantize: 19,
  24. DetectionOutput: 20,
  25. Dropout: 21,
  26. Eltwise: 22,
  27. ELU: 23,
  28. Embed: 24,
  29. Exp: 25,
  30. ExpandDims: 26,
  31. Fill: 27,
  32. Flatten: 28,
  33. FloorMod: 29,
  34. Gather: 30,
  35. GatherV2: 31,
  36. Im2Seq: 32,
  37. InnerProduct: 33,
  38. Input: 34,
  39. Interp: 35,
  40. Log: 36,
  41. LRN: 37,
  42. LSTM: 38,
  43. MatMul: 39,
  44. MVN: 40,
  45. NonMaxSuppression: 41,
  46. NonMaxSuppressionV2: 42,
  47. Normalize: 43,
  48. Pack: 44,
  49. Padding: 45,
  50. Permute: 46,
  51. Pooling: 47,
  52. Power: 48,
  53. PReLU: 49,
  54. PriorBox: 50,
  55. Proposal: 51,
  56. QuantizedAvgPool: 52,
  57. QuantizedBiasAdd: 53,
  58. QuantizedConcat: 54,
  59. QuantizedDepthwiseConv2D: 55,
  60. QuantizedLogistic: 56,
  61. QuantizedMatMul: 57,
  62. QuantizedMaxPool: 58,
  63. QuantizedRelu: 59,
  64. QuantizedRelu6: 60,
  65. QuantizedReshape: 61,
  66. QuantizedSoftmax: 62,
  67. QuantizeMaxMin: 63,
  68. QuantizeV2: 64,
  69. Range: 65,
  70. Rank: 66,
  71. ReduceJoin: 67,
  72. Reduction: 68,
  73. ReLU: 69,
  74. ReLU6: 70,
  75. RequantizationRange: 71,
  76. Requantize: 72,
  77. Reshape: 73,
  78. Resize: 74,
  79. RNN: 75,
  80. ROIPooling: 76,
  81. Scale: 77,
  82. Selu: 78,
  83. Seq2Out: 79,
  84. Shape: 80,
  85. Sigmoid: 81,
  86. Size: 82,
  87. Slice: 83,
  88. SliceTf: 84,
  89. Softmax: 85,
  90. SpaceToBatchND: 86,
  91. SpatialProduct: 87,
  92. Split: 88,
  93. SPP: 89,
  94. Squeeze: 90,
  95. StridedSlice: 91,
  96. StringJoin: 92,
  97. StringSplit: 93,
  98. StringToNumber: 94,
  99. TanH: 95,
  100. TfQuantizedConv2D: 96,
  101. Threshold: 97,
  102. Tile: 98,
  103. TopKV2: 99,
  104. Transpose: 100,
  105. UnaryOp: 101,
  106. Unpack: 102,
  107. Where: 103,
  108. Moments: 104,
  109. RNNSequenceGRU: 105,
  110. BatchMatMul: 106,
  111. Unsqueeze: 107,
  112. CosineSimilarity: 108,
  113. DepthToSpace: 109,
  114. SpaceToDepth: 110,
  115. ReverseSequence: 111,
  116. Pooling3D: 112,
  117. Convolution3D: 113,
  118. MatrixBandPart: 114,
  119. GatherND: 115,
  120. DetectionPostProcess: 116,
  121. UnravelIndex: 117,
  122. ScatterNd: 118,
  123. OneHot: 119,
  124. BroadcastTo: 120,
  125. Dilation2D: 121,
  126. MaxLayerCount: 128,
  127. ConvertTensor: 129,
  128. ArgMin: 130,
  129. LinSpace: 131,
  130. Plugin: 256,
  131. Select: 257,
  132. ZerosLike: 258,
  133. Broastcast: 259,
  134. SetDiff1D: 260,
  135. ReluGrad: 261,
  136. Relu6Grad: 262,
  137. PoolGrad: 263,
  138. SoftmaxGrad: 264,
  139. Conv2DBackPropFilter: 265,
  140. TrainableParam: 266,
  141. BatchNorm: 267,
  142. ZeroGrad: 268,
  143. Extra: 512,
  144. ConvInt8: 513,
  145. Int8ToFloat: 514,
  146. DepthwiseConvInt8: 515,
  147. PoolInt8: 516,
  148. FloatToInt8: 517,
  149. EltwiseInt8: 518
  150. };
  151. $root.MNN.Plugin = class Plugin {
  152. static decode(reader, position) {
  153. const $ = new $root.MNN.Plugin();
  154. $.type = reader.string_(position, 4, null);
  155. $.attr = reader.tableArray(position, 6, $root.MNN.Attribute.decode);
  156. return $;
  157. }
  158. };
  159. $root.MNN.Extra = class Extra {
  160. static decode(reader, position) {
  161. const $ = new $root.MNN.Extra();
  162. $.type = reader.string_(position, 4, null);
  163. $.engine = reader.string_(position, 6, null);
  164. $.info = reader.typedArray(position, 8, Int8Array);
  165. $.attr = reader.tableArray(position, 10, $root.MNN.Attribute.decode);
  166. return $;
  167. }
  168. };
  169. $root.MNN.OpParameter = class {
  170. static decode(reader, position, type) {
  171. switch (type) {
  172. case 1: return $root.MNN.QuantizedAdd.decode(reader, position);
  173. case 2: return $root.MNN.ArgMax.decode(reader, position);
  174. case 3: return $root.MNN.AsString.decode(reader, position);
  175. case 4: return $root.MNN.Axis.decode(reader, position);
  176. case 5: return $root.MNN.BatchNorm.decode(reader, position);
  177. case 6: return $root.MNN.BinaryOp.decode(reader, position);
  178. case 7: return $root.MNN.Blob.decode(reader, position);
  179. case 8: return $root.MNN.CastParam.decode(reader, position);
  180. case 9: return $root.MNN.Convolution2D.decode(reader, position);
  181. case 10: return $root.MNN.Crop.decode(reader, position);
  182. case 11: return $root.MNN.CropAndResize.decode(reader, position);
  183. case 12: return $root.MNN.Dequantize.decode(reader, position);
  184. case 13: return $root.MNN.DetectionOutput.decode(reader, position);
  185. case 14: return $root.MNN.Eltwise.decode(reader, position);
  186. case 15: return $root.MNN.ExpandDims.decode(reader, position);
  187. case 16: return $root.MNN.Fill.decode(reader, position);
  188. case 17: return $root.MNN.Flatten.decode(reader, position);
  189. case 18: return $root.MNN.Gather.decode(reader, position);
  190. case 19: return $root.MNN.GatherV2.decode(reader, position);
  191. case 20: return $root.MNN.InnerProduct.decode(reader, position);
  192. case 21: return $root.MNN.Input.decode(reader, position);
  193. case 22: return $root.MNN.Interp.decode(reader, position);
  194. case 23: return $root.MNN.LRN.decode(reader, position);
  195. case 24: return $root.MNN.LSTM.decode(reader, position);
  196. case 25: return $root.MNN.MatMul.decode(reader, position);
  197. case 26: return $root.MNN.NonMaxSuppressionV2.decode(reader, position);
  198. case 27: return $root.MNN.Normalize.decode(reader, position);
  199. case 28: return $root.MNN.PackParam.decode(reader, position);
  200. case 29: return $root.MNN.Permute.decode(reader, position);
  201. case 30: return $root.MNN.Plugin.decode(reader, position);
  202. case 31: return $root.MNN.Pool.decode(reader, position);
  203. case 32: return $root.MNN.PRelu.decode(reader, position);
  204. case 33: return $root.MNN.PriorBox.decode(reader, position);
  205. case 34: return $root.MNN.Proposal.decode(reader, position);
  206. case 35: return $root.MNN.QuantizedAvgPool.decode(reader, position);
  207. case 36: return $root.MNN.QuantizedBiasAdd.decode(reader, position);
  208. case 37: return $root.MNN.QuantizedConcat.decode(reader, position);
  209. case 38: return $root.MNN.QuantizedLogistic.decode(reader, position);
  210. case 39: return $root.MNN.QuantizedMatMul.decode(reader, position);
  211. case 40: return $root.MNN.QuantizedMaxPool.decode(reader, position);
  212. case 41: return $root.MNN.QuantizedRelu.decode(reader, position);
  213. case 42: return $root.MNN.QuantizedRelu6.decode(reader, position);
  214. case 43: return $root.MNN.QuantizedReshape.decode(reader, position);
  215. case 44: return $root.MNN.QuantizedSoftmax.decode(reader, position);
  216. case 45: return $root.MNN.QuantizeMaxMin.decode(reader, position);
  217. case 46: return $root.MNN.QuantizeV2.decode(reader, position);
  218. case 47: return $root.MNN.Range.decode(reader, position);
  219. case 48: return $root.MNN.Rank.decode(reader, position);
  220. case 49: return $root.MNN.ReduceJoin.decode(reader, position);
  221. case 50: return $root.MNN.ReductionParam.decode(reader, position);
  222. case 51: return $root.MNN.Relu.decode(reader, position);
  223. case 52: return $root.MNN.Relu6.decode(reader, position);
  224. case 53: return $root.MNN.RequantizationRange.decode(reader, position);
  225. case 54: return $root.MNN.Requantize.decode(reader, position);
  226. case 55: return $root.MNN.Reshape.decode(reader, position);
  227. case 56: return $root.MNN.Resize.decode(reader, position);
  228. case 57: return $root.MNN.RoiPooling.decode(reader, position);
  229. case 58: return $root.MNN.Scale.decode(reader, position);
  230. case 59: return $root.MNN.Selu.decode(reader, position);
  231. case 60: return $root.MNN.Size.decode(reader, position);
  232. case 61: return $root.MNN.Slice.decode(reader, position);
  233. case 62: return $root.MNN.SliceTf.decode(reader, position);
  234. case 63: return $root.MNN.SpaceBatch.decode(reader, position);
  235. case 64: return $root.MNN.SqueezeParam.decode(reader, position);
  236. case 65: return $root.MNN.StridedSliceParam.decode(reader, position);
  237. case 66: return $root.MNN.TensorConvertInfo.decode(reader, position);
  238. case 67: return $root.MNN.TfQuantizedConv2D.decode(reader, position);
  239. case 68: return $root.MNN.TopKV2.decode(reader, position);
  240. case 69: return $root.MNN.Transpose.decode(reader, position);
  241. case 70: return $root.MNN.UnaryOp.decode(reader, position);
  242. case 71: return $root.MNN.MomentsParam.decode(reader, position);
  243. case 72: return $root.MNN.RNNParam.decode(reader, position);
  244. case 73: return $root.MNN.BatchMatMulParam.decode(reader, position);
  245. case 74: return $root.MNN.QuantizedFloatParam.decode(reader, position);
  246. case 75: return $root.MNN.DepthSpaceParam.decode(reader, position);
  247. case 76: return $root.MNN.EltwiseInt8.decode(reader, position);
  248. case 77: return $root.MNN.ReverseSequenceParam.decode(reader, position);
  249. case 78: return $root.MNN.Extra.decode(reader, position);
  250. case 79: return $root.MNN.Pool3D.decode(reader, position);
  251. case 80: return $root.MNN.Convolution3D.decode(reader, position);
  252. case 81: return $root.MNN.ELU.decode(reader, position);
  253. case 82: return $root.MNN.DetectionPostProcessParam.decode(reader, position);
  254. case 83: return $root.MNN.OneHotParam.decode(reader, position);
  255. case 84: return $root.MNN.PadParam.decode(reader, position);
  256. }
  257. return undefined;
  258. }
  259. static decodeText(reader, json, type) {
  260. switch (type) {
  261. case 'QuantizedAdd': return $root.MNN.QuantizedAdd.decodeText(reader, json);
  262. case 'ArgMax': return $root.MNN.ArgMax.decodeText(reader, json);
  263. case 'AsString': return $root.MNN.AsString.decodeText(reader, json);
  264. case 'Axis': return $root.MNN.Axis.decodeText(reader, json);
  265. case 'BatchNorm': return $root.MNN.BatchNorm.decodeText(reader, json);
  266. case 'BinaryOp': return $root.MNN.BinaryOp.decodeText(reader, json);
  267. case 'Blob': return $root.MNN.Blob.decodeText(reader, json);
  268. case 'CastParam': return $root.MNN.CastParam.decodeText(reader, json);
  269. case 'Convolution2D': return $root.MNN.Convolution2D.decodeText(reader, json);
  270. case 'Crop': return $root.MNN.Crop.decodeText(reader, json);
  271. case 'CropAndResize': return $root.MNN.CropAndResize.decodeText(reader, json);
  272. case 'Dequantize': return $root.MNN.Dequantize.decodeText(reader, json);
  273. case 'DetectionOutput': return $root.MNN.DetectionOutput.decodeText(reader, json);
  274. case 'Eltwise': return $root.MNN.Eltwise.decodeText(reader, json);
  275. case 'ExpandDims': return $root.MNN.ExpandDims.decodeText(reader, json);
  276. case 'Fill': return $root.MNN.Fill.decodeText(reader, json);
  277. case 'Flatten': return $root.MNN.Flatten.decodeText(reader, json);
  278. case 'Gather': return $root.MNN.Gather.decodeText(reader, json);
  279. case 'GatherV2': return $root.MNN.GatherV2.decodeText(reader, json);
  280. case 'InnerProduct': return $root.MNN.InnerProduct.decodeText(reader, json);
  281. case 'Input': return $root.MNN.Input.decodeText(reader, json);
  282. case 'Interp': return $root.MNN.Interp.decodeText(reader, json);
  283. case 'LRN': return $root.MNN.LRN.decodeText(reader, json);
  284. case 'LSTM': return $root.MNN.LSTM.decodeText(reader, json);
  285. case 'MatMul': return $root.MNN.MatMul.decodeText(reader, json);
  286. case 'NonMaxSuppressionV2': return $root.MNN.NonMaxSuppressionV2.decodeText(reader, json);
  287. case 'Normalize': return $root.MNN.Normalize.decodeText(reader, json);
  288. case 'PackParam': return $root.MNN.PackParam.decodeText(reader, json);
  289. case 'Permute': return $root.MNN.Permute.decodeText(reader, json);
  290. case 'Plugin': return $root.MNN.Plugin.decodeText(reader, json);
  291. case 'Pool': return $root.MNN.Pool.decodeText(reader, json);
  292. case 'PRelu': return $root.MNN.PRelu.decodeText(reader, json);
  293. case 'PriorBox': return $root.MNN.PriorBox.decodeText(reader, json);
  294. case 'Proposal': return $root.MNN.Proposal.decodeText(reader, json);
  295. case 'QuantizedAvgPool': return $root.MNN.QuantizedAvgPool.decodeText(reader, json);
  296. case 'QuantizedBiasAdd': return $root.MNN.QuantizedBiasAdd.decodeText(reader, json);
  297. case 'QuantizedConcat': return $root.MNN.QuantizedConcat.decodeText(reader, json);
  298. case 'QuantizedLogistic': return $root.MNN.QuantizedLogistic.decodeText(reader, json);
  299. case 'QuantizedMatMul': return $root.MNN.QuantizedMatMul.decodeText(reader, json);
  300. case 'QuantizedMaxPool': return $root.MNN.QuantizedMaxPool.decodeText(reader, json);
  301. case 'QuantizedRelu': return $root.MNN.QuantizedRelu.decodeText(reader, json);
  302. case 'QuantizedRelu6': return $root.MNN.QuantizedRelu6.decodeText(reader, json);
  303. case 'QuantizedReshape': return $root.MNN.QuantizedReshape.decodeText(reader, json);
  304. case 'QuantizedSoftmax': return $root.MNN.QuantizedSoftmax.decodeText(reader, json);
  305. case 'QuantizeMaxMin': return $root.MNN.QuantizeMaxMin.decodeText(reader, json);
  306. case 'QuantizeV2': return $root.MNN.QuantizeV2.decodeText(reader, json);
  307. case 'Range': return $root.MNN.Range.decodeText(reader, json);
  308. case 'Rank': return $root.MNN.Rank.decodeText(reader, json);
  309. case 'ReduceJoin': return $root.MNN.ReduceJoin.decodeText(reader, json);
  310. case 'ReductionParam': return $root.MNN.ReductionParam.decodeText(reader, json);
  311. case 'Relu': return $root.MNN.Relu.decodeText(reader, json);
  312. case 'Relu6': return $root.MNN.Relu6.decodeText(reader, json);
  313. case 'RequantizationRange': return $root.MNN.RequantizationRange.decodeText(reader, json);
  314. case 'Requantize': return $root.MNN.Requantize.decodeText(reader, json);
  315. case 'Reshape': return $root.MNN.Reshape.decodeText(reader, json);
  316. case 'Resize': return $root.MNN.Resize.decodeText(reader, json);
  317. case 'RoiPooling': return $root.MNN.RoiPooling.decodeText(reader, json);
  318. case 'Scale': return $root.MNN.Scale.decodeText(reader, json);
  319. case 'Selu': return $root.MNN.Selu.decodeText(reader, json);
  320. case 'Size': return $root.MNN.Size.decodeText(reader, json);
  321. case 'Slice': return $root.MNN.Slice.decodeText(reader, json);
  322. case 'SliceTf': return $root.MNN.SliceTf.decodeText(reader, json);
  323. case 'SpaceBatch': return $root.MNN.SpaceBatch.decodeText(reader, json);
  324. case 'SqueezeParam': return $root.MNN.SqueezeParam.decodeText(reader, json);
  325. case 'StridedSliceParam': return $root.MNN.StridedSliceParam.decodeText(reader, json);
  326. case 'TensorConvertInfo': return $root.MNN.TensorConvertInfo.decodeText(reader, json);
  327. case 'TfQuantizedConv2D': return $root.MNN.TfQuantizedConv2D.decodeText(reader, json);
  328. case 'TopKV2': return $root.MNN.TopKV2.decodeText(reader, json);
  329. case 'Transpose': return $root.MNN.Transpose.decodeText(reader, json);
  330. case 'UnaryOp': return $root.MNN.UnaryOp.decodeText(reader, json);
  331. case 'MomentsParam': return $root.MNN.MomentsParam.decodeText(reader, json);
  332. case 'RNNParam': return $root.MNN.RNNParam.decodeText(reader, json);
  333. case 'BatchMatMulParam': return $root.MNN.BatchMatMulParam.decodeText(reader, json);
  334. case 'QuantizedFloatParam': return $root.MNN.QuantizedFloatParam.decodeText(reader, json);
  335. case 'DepthSpaceParam': return $root.MNN.DepthSpaceParam.decodeText(reader, json);
  336. case 'EltwiseInt8': return $root.MNN.EltwiseInt8.decodeText(reader, json);
  337. case 'ReverseSequenceParam': return $root.MNN.ReverseSequenceParam.decodeText(reader, json);
  338. case 'Extra': return $root.MNN.Extra.decodeText(reader, json);
  339. case 'Pool3D': return $root.MNN.Pool3D.decodeText(reader, json);
  340. case 'Convolution3D': return $root.MNN.Convolution3D.decodeText(reader, json);
  341. case 'ELU': return $root.MNN.ELU.decodeText(reader, json);
  342. case 'DetectionPostProcessParam': return $root.MNN.DetectionPostProcessParam.decodeText(reader, json);
  343. case 'OneHotParam': return $root.MNN.OneHotParam.decodeText(reader, json);
  344. case 'PadParam': return $root.MNN.PadParam.decodeText(reader, json);
  345. }
  346. return undefined;
  347. }
  348. };
  349. $root.MNN.Op = class Op {
  350. static decode(reader, position) {
  351. const $ = new $root.MNN.Op();
  352. $.inputIndexes = reader.typedArray(position, 4, Int32Array);
  353. $.main = reader.union(position, 6, $root.MNN.OpParameter.decode);
  354. $.name = reader.string_(position, 10, null);
  355. $.outputIndexes = reader.typedArray(position, 12, Int32Array);
  356. $.type = reader.int32_(position, 14, 0);
  357. $.defaultDimentionFormat = reader.int8_(position, 16, undefined);
  358. return $;
  359. }
  360. };
  361. $root.MNN.TensorDescribe = class TensorDescribe {
  362. static decode(reader, position) {
  363. const $ = new $root.MNN.TensorDescribe();
  364. $.blob = reader.table(position, 4, $root.MNN.Blob.decode);
  365. $.index = reader.int32_(position, 6, 0);
  366. $.name = reader.string_(position, 8, null);
  367. return $;
  368. }
  369. };
  370. $root.MNN.ForwardType = {
  371. CPU: 0,
  372. METAL: 1,
  373. OPENCL: 2,
  374. OPENGLES: 3,
  375. VULKAN: 4
  376. };
  377. $root.MNN.Usage = {
  378. INFERENCE: 0,
  379. TRAIN: 1
  380. };
  381. $root.MNN.Net = class Net {
  382. static create(reader) {
  383. return $root.MNN.Net.decode(reader, reader.root);
  384. }
  385. static decode(reader, position) {
  386. const $ = new $root.MNN.Net();
  387. $.bizCode = reader.string_(position, 4, null);
  388. $.extraTensorDescribe = reader.tableArray(position, 6, $root.MNN.TensorDescribe.decode);
  389. $.gpulibrary = reader.table(position, 8, $root.MNN.GpuLibrary.decode);
  390. $.oplists = reader.tableArray(position, 10, $root.MNN.Op.decode);
  391. $.outputName = reader.strings_(position, 12);
  392. $.preferForwardType = reader.int8_(position, 14, 0);
  393. $.sourceType = reader.int8_(position, 16, 0);
  394. $.tensorName = reader.strings_(position, 18);
  395. $.tensorNumber = reader.int32_(position, 20, 0);
  396. $.usage = reader.int8_(position, 22, 0);
  397. return $;
  398. }
  399. };
  400. $root.MNN.PadMode = {
  401. CAFFE: 0,
  402. VALID: 1,
  403. SAME: 2
  404. };
  405. $root.MNN.Convolution2DCommon = class Convolution2DCommon {
  406. static decode(reader, position) {
  407. const $ = new $root.MNN.Convolution2DCommon();
  408. $.padX = reader.int32_(position, 4, 0);
  409. $.padY = reader.int32_(position, 6, 0);
  410. $.kernelX = reader.int32_(position, 8, 1);
  411. $.kernelY = reader.int32_(position, 10, 1);
  412. $.strideX = reader.int32_(position, 12, 1);
  413. $.strideY = reader.int32_(position, 14, 1);
  414. $.dilateX = reader.int32_(position, 16, 1);
  415. $.dilateY = reader.int32_(position, 18, 1);
  416. $.padMode = reader.int8_(position, 20, 0);
  417. $.group = reader.int32_(position, 22, 1);
  418. $.outputCount = reader.int32_(position, 24, 0);
  419. $.inputCount = reader.int32_(position, 26, 0);
  420. $.relu = reader.bool_(position, 28, false);
  421. $.relu6 = reader.bool_(position, 30, false);
  422. $.pads = reader.typedArray(position, 32, Int32Array);
  423. return $;
  424. }
  425. };
  426. $root.MNN.Convolution3DCommon = class Convolution3DCommon {
  427. static decode(reader, position) {
  428. const $ = new $root.MNN.Convolution3DCommon();
  429. $.dilates = reader.typedArray(position, 4, Int32Array);
  430. $.strides = reader.typedArray(position, 6, Int32Array);
  431. $.kernels = reader.typedArray(position, 8, Int32Array);
  432. $.pads = reader.typedArray(position, 10, Int32Array);
  433. $.padMode = reader.int8_(position, 12, 0);
  434. $.inputCount = reader.int32_(position, 14, 0);
  435. $.outputCount = reader.int32_(position, 16, 0);
  436. $.relu = reader.bool_(position, 18, false);
  437. $.relu6 = reader.bool_(position, 20, false);
  438. return $;
  439. }
  440. };
  441. $root.MNN.IDSTQuan = class IDSTQuan {
  442. static decode(reader, position) {
  443. const $ = new $root.MNN.IDSTQuan();
  444. $.buffer = reader.typedArray(position, 4, Int8Array);
  445. $.alpha = reader.typedArray(position, 6, Float32Array);
  446. $.type = reader.int32_(position, 8, 0);
  447. $.useInt32 = reader.bool_(position, 10, false);
  448. $.quantScale = reader.float32_(position, 12, 0);
  449. $.scaleIn = reader.float32_(position, 14, 0);
  450. $.scaleOut = reader.float32_(position, 16, 0);
  451. $.aMax = reader.int32_(position, 18, 0);
  452. $.aMin = reader.int32_(position, 20, 0);
  453. $.readType = reader.int32_(position, 22, 0);
  454. $.has_scaleInt = reader.bool_(position, 24, false);
  455. return $;
  456. }
  457. };
  458. $root.MNN.QuantizeAlgo = {
  459. DEFAULT: 0,
  460. OVERFLOW_AWARE: 1
  461. };
  462. $root.MNN.QuantizedFloatParam = class QuantizedFloatParam {
  463. static decode(reader, position) {
  464. const $ = new $root.MNN.QuantizedFloatParam();
  465. $.weight = reader.typedArray(position, 4, Int8Array);
  466. $.bias = reader.typedArray(position, 6, Int32Array);
  467. $.scale = reader.typedArray(position, 8, Float32Array);
  468. $.tensorScale = reader.typedArray(position, 10, Float32Array);
  469. $.method = reader.int8_(position, 12, 0);
  470. return $;
  471. }
  472. };
  473. $root.MNN.Convolution2D = class Convolution2D {
  474. static decode(reader, position) {
  475. const $ = new $root.MNN.Convolution2D();
  476. $.common = reader.table(position, 4, $root.MNN.Convolution2DCommon.decode);
  477. $.weight = reader.typedArray(position, 6, Float32Array);
  478. $.bias = reader.typedArray(position, 8, Float32Array);
  479. $.quanParameter = reader.table(position, 10, $root.MNN.IDSTQuan.decode);
  480. $.symmetricQuan = reader.table(position, 12, $root.MNN.QuantizedFloatParam.decode);
  481. return $;
  482. }
  483. };
  484. $root.MNN.Convolution3D = class Convolution3D {
  485. static decode(reader, position) {
  486. const $ = new $root.MNN.Convolution3D();
  487. $.common = reader.table(position, 4, $root.MNN.Convolution3DCommon.decode);
  488. $.weight = reader.typedArray(position, 6, Float32Array);
  489. $.bias = reader.typedArray(position, 8, Float32Array);
  490. return $;
  491. }
  492. };
  493. $root.MNN.InnerProduct = class InnerProduct {
  494. static decode(reader, position) {
  495. const $ = new $root.MNN.InnerProduct();
  496. $.outputCount = reader.int32_(position, 4, 0);
  497. $.biasTerm = reader.int32_(position, 6, 0);
  498. $.weightSize = reader.int32_(position, 8, 0);
  499. $.weight = reader.typedArray(position, 10, Float32Array);
  500. $.bias = reader.typedArray(position, 12, Float32Array);
  501. $.axis = reader.int32_(position, 14, 0);
  502. $.transpose = reader.bool_(position, 16, false);
  503. $.quanParameter = reader.table(position, 18, $root.MNN.IDSTQuan.decode);
  504. return $;
  505. }
  506. };
  507. $root.MNN.PoolType = {
  508. MAXPOOL: 0,
  509. AVEPOOL: 1
  510. };
  511. $root.MNN.PoolPadType = {
  512. CAFFE: 0,
  513. VALID: 1,
  514. SAME: 2
  515. };
  516. $root.MNN.Pool = class Pool {
  517. static decode(reader, position) {
  518. const $ = new $root.MNN.Pool();
  519. $.padX = reader.int32_(position, 4, 0);
  520. $.padY = reader.int32_(position, 6, 0);
  521. $.isGlobal = reader.bool_(position, 8, false);
  522. $.kernelX = reader.int32_(position, 10, 0);
  523. $.kernelY = reader.int32_(position, 12, 0);
  524. $.strideX = reader.int32_(position, 14, 0);
  525. $.strideY = reader.int32_(position, 16, 0);
  526. $.type = reader.int8_(position, 18, 0);
  527. $.padType = reader.int8_(position, 20, 0);
  528. $.dataType = reader.int32_(position, 22, 1);
  529. $.ceilModel = reader.bool_(position, 24, true);
  530. $.pads = reader.typedArray(position, 26, Int32Array);
  531. return $;
  532. }
  533. };
  534. $root.MNN.Pool3D = class Pool3D {
  535. static decode(reader, position) {
  536. const $ = new $root.MNN.Pool3D();
  537. $.strides = reader.typedArray(position, 4, Int32Array);
  538. $.kernels = reader.typedArray(position, 6, Int32Array);
  539. $.pads = reader.typedArray(position, 8, Int32Array);
  540. $.type = reader.int8_(position, 10, 0);
  541. $.padType = reader.int8_(position, 12, 0);
  542. return $;
  543. }
  544. };
  545. $root.MNN.Relu = class Relu {
  546. static decode(reader, position) {
  547. const $ = new $root.MNN.Relu();
  548. $.slope = reader.float32_(position, 4, 0);
  549. return $;
  550. }
  551. };
  552. $root.MNN.Relu6 = class Relu6 {
  553. static decode(reader, position) {
  554. const $ = new $root.MNN.Relu6();
  555. $.minValue = reader.float32_(position, 4, 0);
  556. $.maxValue = reader.float32_(position, 6, 6);
  557. return $;
  558. }
  559. };
  560. $root.MNN.PRelu = class PRelu {
  561. static decode(reader, position) {
  562. const $ = new $root.MNN.PRelu();
  563. $.slopeCount = reader.int32_(position, 4, 0);
  564. $.slope = reader.typedArray(position, 6, Float32Array);
  565. return $;
  566. }
  567. };
  568. $root.MNN.ELU = class ELU {
  569. static decode(reader, position) {
  570. const $ = new $root.MNN.ELU();
  571. $.alpha = reader.float32_(position, 4, 0);
  572. return $;
  573. }
  574. };
  575. $root.MNN.LRN = class LRN {
  576. static decode(reader, position) {
  577. const $ = new $root.MNN.LRN();
  578. $.regionType = reader.int32_(position, 4, 0);
  579. $.localSize = reader.int32_(position, 6, 0);
  580. $.alpha = reader.float32_(position, 8, 0);
  581. $.beta = reader.float32_(position, 10, 0);
  582. return $;
  583. }
  584. };
  585. $root.MNN.ArgMax = class ArgMax {
  586. static decode(reader, position) {
  587. const $ = new $root.MNN.ArgMax();
  588. $.outMaxVal = reader.int32_(position, 4, 0);
  589. $.topK = reader.int32_(position, 6, 0);
  590. $.axis = reader.int32_(position, 8, 0);
  591. $.softmaxThreshold = reader.int32_(position, 10, 0);
  592. return $;
  593. }
  594. };
  595. $root.MNN.Axis = class Axis {
  596. static decode(reader, position) {
  597. const $ = new $root.MNN.Axis();
  598. $.axis = reader.int32_(position, 4, 0);
  599. return $;
  600. }
  601. };
  602. $root.MNN.Input = class Input {
  603. static decode(reader, position) {
  604. const $ = new $root.MNN.Input();
  605. $.dims = reader.typedArray(position, 4, Int32Array);
  606. $.dtype = reader.int32_(position, 6, 1);
  607. $.dformat = reader.int8_(position, 8, undefined);
  608. return $;
  609. }
  610. };
  611. $root.MNN.LSTM = class LSTM {
  612. static decode(reader, position) {
  613. const $ = new $root.MNN.LSTM();
  614. $.outputCount = reader.int32_(position, 4, 0);
  615. $.weightSize = reader.int32_(position, 6, 0);
  616. $.clippingThreshold = reader.float32_(position, 8, 0);
  617. $.weightI = reader.table(position, 10, $root.MNN.Blob.decode);
  618. $.weightH = reader.table(position, 12, $root.MNN.Blob.decode);
  619. $.bias = reader.table(position, 14, $root.MNN.Blob.decode);
  620. $.weightIQ = reader.table(position, 16, $root.MNN.Blob.decode);
  621. $.weightIA = reader.table(position, 18, $root.MNN.Blob.decode);
  622. $.quantScale = reader.float32_(position, 20, 0);
  623. return $;
  624. }
  625. };
  626. $root.MNN.Slice = class Slice {
  627. static decode(reader, position) {
  628. const $ = new $root.MNN.Slice();
  629. $.axis = reader.int32_(position, 4, 0);
  630. $.slicePoints = reader.typedArray(position, 6, Int32Array);
  631. $.sourceType = reader.int8_(position, 8, 0);
  632. return $;
  633. }
  634. };
  635. $root.MNN.BatchNorm = class BatchNorm {
  636. static decode(reader, position) {
  637. const $ = new $root.MNN.BatchNorm();
  638. $.channels = reader.int32_(position, 4, 0);
  639. $.slopeData = reader.typedArray(position, 6, Float32Array);
  640. $.meanData = reader.typedArray(position, 8, Float32Array);
  641. $.varData = reader.typedArray(position, 10, Float32Array);
  642. $.biasData = reader.typedArray(position, 12, Float32Array);
  643. $.Adata = reader.typedArray(position, 14, Float32Array);
  644. $.Bdata = reader.typedArray(position, 16, Float32Array);
  645. $.epsilon = reader.float32_(position, 18, 0.001);
  646. return $;
  647. }
  648. };
  649. $root.MNN.Scale = class Scale {
  650. static decode(reader, position) {
  651. const $ = new $root.MNN.Scale();
  652. $.channels = reader.int32_(position, 4, 0);
  653. $.scaleData = reader.typedArray(position, 6, Float32Array);
  654. $.biasData = reader.typedArray(position, 8, Float32Array);
  655. return $;
  656. }
  657. };
  658. $root.MNN.EltwiseType = {
  659. PROD: 0,
  660. SUM: 1,
  661. MAXIMUM: 2,
  662. SUB: 3
  663. };
  664. $root.MNN.Eltwise = class Eltwise {
  665. static decode(reader, position) {
  666. const $ = new $root.MNN.Eltwise();
  667. $.type = reader.int8_(position, 4, 0);
  668. $.coeff = reader.typedArray(position, 6, Float32Array);
  669. return $;
  670. }
  671. };
  672. $root.MNN.Flatten = class Flatten {
  673. static decode(reader, position) {
  674. const $ = new $root.MNN.Flatten();
  675. $.axis = reader.int32_(position, 4, 0);
  676. $.endAxis = reader.int32_(position, 6, 0);
  677. return $;
  678. }
  679. };
  680. $root.MNN.Permute = class Permute {
  681. static decode(reader, position) {
  682. const $ = new $root.MNN.Permute();
  683. $.dims = reader.typedArray(position, 4, Int32Array);
  684. return $;
  685. }
  686. };
  687. $root.MNN.Reshape = class Reshape {
  688. static decode(reader, position) {
  689. const $ = new $root.MNN.Reshape();
  690. $.dims = reader.typedArray(position, 4, Int32Array);
  691. $.dimType = reader.int8_(position, 6, undefined);
  692. return $;
  693. }
  694. };
  695. $root.MNN.DetectionOutput = class DetectionOutput {
  696. static decode(reader, position) {
  697. const $ = new $root.MNN.DetectionOutput();
  698. $.classCount = reader.int32_(position, 4, 0);
  699. $.nmsThresholdold = reader.float32_(position, 6, 0);
  700. $.nmsTopK = reader.int32_(position, 8, 0);
  701. $.keepTopK = reader.int32_(position, 10, 0);
  702. $.confidenceThreshold = reader.float32_(position, 12, 0);
  703. $.shareLocation = reader.int32_(position, 14, 0);
  704. $.backgroundLable = reader.int32_(position, 16, 0);
  705. $.varianceEncodedTarget = reader.int32_(position, 18, 0);
  706. $.codeType = reader.int32_(position, 20, 0);
  707. $.objectnessScore = reader.float32_(position, 22, 0.01);
  708. return $;
  709. }
  710. };
  711. $root.MNN.RoiPooling = class RoiPooling {
  712. static decode(reader, position) {
  713. const $ = new $root.MNN.RoiPooling();
  714. $.pooledWidth = reader.int32_(position, 4, 0);
  715. $.pooledHeight = reader.int32_(position, 6, 0);
  716. $.spatialScale = reader.float32_(position, 8, 0);
  717. return $;
  718. }
  719. };
  720. $root.MNN.Proposal = class Proposal {
  721. static decode(reader, position) {
  722. const $ = new $root.MNN.Proposal();
  723. $.featStride = reader.int32_(position, 4, 0);
  724. $.baseSize = reader.int32_(position, 6, 0);
  725. $.preNmsTopN = reader.int32_(position, 8, 0);
  726. $.afterNmsTopN = reader.int32_(position, 10, 0);
  727. $.nmsThreshold = reader.float32_(position, 12, 0);
  728. $.minSize = reader.int32_(position, 14, 0);
  729. $.ratios = reader.table(position, 16, $root.MNN.Blob.decode);
  730. $.scales = reader.table(position, 18, $root.MNN.Blob.decode);
  731. $.anchors = reader.table(position, 20, $root.MNN.Blob.decode);
  732. return $;
  733. }
  734. };
  735. $root.MNN.Interp = class Interp {
  736. static decode(reader, position) {
  737. const $ = new $root.MNN.Interp();
  738. $.widthScale = reader.float32_(position, 4, 0);
  739. $.heightScale = reader.float32_(position, 6, 0);
  740. $.outputWidth = reader.int32_(position, 8, 0);
  741. $.outputHeight = reader.int32_(position, 10, 0);
  742. $.resizeType = reader.int32_(position, 12, 0);
  743. $.alignCorners = reader.bool_(position, 14, false);
  744. $.halfPixelCenters = reader.bool_(position, 16, false);
  745. return $;
  746. }
  747. };
  748. $root.MNN.Resize = class Resize {
  749. static decode(reader, position) {
  750. const $ = new $root.MNN.Resize();
  751. $.xScale = reader.float32_(position, 4, 0);
  752. $.yScale = reader.float32_(position, 6, 0);
  753. return $;
  754. }
  755. };
  756. $root.MNN.PriorBox = class PriorBox {
  757. static decode(reader, position) {
  758. const $ = new $root.MNN.PriorBox();
  759. $.minSizes = reader.typedArray(position, 4, Float32Array);
  760. $.maxSizes = reader.typedArray(position, 6, Float32Array);
  761. $.aspectRatios = reader.typedArray(position, 8, Float32Array);
  762. $.variances = reader.typedArray(position, 10, Float32Array);
  763. $.flip = reader.bool_(position, 12, false);
  764. $.clip = reader.bool_(position, 14, false);
  765. $.imageWidth = reader.int32_(position, 16, 0);
  766. $.imageHeight = reader.int32_(position, 18, 0);
  767. $.stepWidth = reader.int32_(position, 20, 0);
  768. $.stepHeight = reader.int32_(position, 22, 0);
  769. $.offset = reader.float32_(position, 24, 0);
  770. return $;
  771. }
  772. };
  773. $root.MNN.Normalize = class Normalize {
  774. static decode(reader, position) {
  775. const $ = new $root.MNN.Normalize();
  776. $.acrossSpatial = reader.int32_(position, 4, 0);
  777. $.channelShared = reader.int32_(position, 6, 0);
  778. $.eps = reader.float32_(position, 8, 0);
  779. $.scale = reader.typedArray(position, 10, Float32Array);
  780. return $;
  781. }
  782. };
  783. $root.MNN.EltwiseInt8 = class EltwiseInt8 {
  784. static decode(reader, position) {
  785. const $ = new $root.MNN.EltwiseInt8();
  786. $.type = reader.int8_(position, 4, 0);
  787. $.inputQuan0 = reader.table(position, 6, $root.MNN.QuantizedFloatParam.decode);
  788. $.inputQuan1 = reader.table(position, 8, $root.MNN.QuantizedFloatParam.decode);
  789. $.outputQuan = reader.table(position, 10, $root.MNN.QuantizedFloatParam.decode);
  790. return $;
  791. }
  792. };
  793. $root.MNN.MNN_DATA_FORMAT = {
  794. NCHW: 0,
  795. NHWC: 1,
  796. NC4HW4: 2,
  797. NHWC4: 3,
  798. UNKNOWN: 4
  799. };
  800. $root.MNN.Blob = class Blob {
  801. static decode(reader, position) {
  802. const $ = new $root.MNN.Blob();
  803. $.dims = reader.typedArray(position, 4, Int32Array);
  804. $.dataFormat = reader.int8_(position, 6, 0);
  805. $.dataType = reader.int32_(position, 8, 1);
  806. $.uint8s = reader.typedArray(position, 10, Uint8Array);
  807. $.int8s = reader.typedArray(position, 12, Int8Array);
  808. $.int32s = reader.typedArray(position, 14, Int32Array);
  809. $.int64s = reader.int64s_(position, 16);
  810. $.float32s = reader.typedArray(position, 18, Float32Array);
  811. $.strings = reader.strings_(position, 20);
  812. return $;
  813. }
  814. };
  815. $root.MNN.ListValue = class ListValue {
  816. static decode(reader, position) {
  817. const $ = new $root.MNN.ListValue();
  818. $.s = reader.strings_(position, 4);
  819. $.i = reader.typedArray(position, 6, Int32Array);
  820. $.f = reader.typedArray(position, 8, Float32Array);
  821. $.b = reader.bools_(position, 10);
  822. $.type = reader.typedArray(position, 12, Int32Array);
  823. return $;
  824. }
  825. };
  826. $root.MNN.Attribute = class Attribute {
  827. static decode(reader, position) {
  828. const $ = new $root.MNN.Attribute();
  829. $.s = reader.string_(position, 4, null);
  830. $.i = reader.int32_(position, 6, 0);
  831. $.b = reader.bool_(position, 8, false);
  832. $.key = reader.string_(position, 10, null);
  833. $.type = reader.int32_(position, 12, undefined);
  834. $.f = reader.float32_(position, 14, 0);
  835. $.tensor = reader.table(position, 16, $root.MNN.Blob.decode);
  836. $.list = reader.table(position, 18, $root.MNN.ListValue.decode);
  837. return $;
  838. }
  839. };
  840. $root.MNN.NetSource = {
  841. CAFFE: 0,
  842. TENSORFLOW: 1,
  843. TFLITE: 2,
  844. ONNX: 3
  845. };
  846. $root.MNN.DataType = {
  847. DT_INVALID: 0,
  848. DT_FLOAT: 1,
  849. DT_DOUBLE: 2,
  850. DT_INT32: 3,
  851. DT_UINT8: 4,
  852. DT_INT16: 5,
  853. DT_INT8: 6,
  854. DT_STRING: 7,
  855. DT_COMPLEX64: 8,
  856. DT_INT64: 9,
  857. DT_BOOL: 10,
  858. DT_QINT8: 11,
  859. DT_QUINT8: 12,
  860. DT_QINT32: 13,
  861. DT_BFLOAT16: 14,
  862. DT_QINT16: 15,
  863. DT_QUINT16: 16,
  864. DT_UINT16: 17,
  865. DT_COMPLEX128: 18,
  866. DT_HALF: 19,
  867. DT_RESOURCE: 20,
  868. DT_VARIANT: 21
  869. };
  870. $root.MNN.BinaryOpOperation = {
  871. ADD: 0,
  872. SUB: 1,
  873. MUL: 2,
  874. DIV: 3,
  875. MAX_TEMP: 4,
  876. MIN_TEMP: 5,
  877. POW: 6,
  878. REALDIV: 7,
  879. MINIMUM: 8,
  880. MAXIMUM: 9,
  881. GREATER: 10,
  882. GREATER_EQUAL: 11,
  883. LESS: 12,
  884. FLOORDIV: 13,
  885. SquaredDifference: 14,
  886. EQUAL: 15,
  887. LESS_EQUAL: 16,
  888. FLOORMOD: 17,
  889. MOD: 19,
  890. ATAN2: 20,
  891. LOGICALOR: 21,
  892. NOTEQUAL: 22
  893. };
  894. $root.MNN.BinaryOp = class BinaryOp {
  895. static decode(reader, position) {
  896. const $ = new $root.MNN.BinaryOp();
  897. $.opType = reader.int32_(position, 4, 0);
  898. $.T = reader.int32_(position, 6, 1);
  899. return $;
  900. }
  901. };
  902. $root.MNN.PackParam = class PackParam {
  903. static decode(reader, position) {
  904. const $ = new $root.MNN.PackParam();
  905. $.dataType = reader.int32_(position, 4, 0);
  906. $.axis = reader.int32_(position, 6, 0);
  907. return $;
  908. }
  909. };
  910. $root.MNN.StridedSliceParam = class StridedSliceParam {
  911. static decode(reader, position) {
  912. const $ = new $root.MNN.StridedSliceParam();
  913. $.Index = reader.int32_(position, 4, 0);
  914. $.T = reader.int32_(position, 6, 0);
  915. $.beginMask = reader.int32_(position, 8, 0);
  916. $.endMask = reader.int32_(position, 10, 0);
  917. $.ellipsisMask = reader.int32_(position, 12, 0);
  918. $.newAxisMask = reader.int32_(position, 14, 0);
  919. $.shrinkAxisMask = reader.int32_(position, 16, 0);
  920. return $;
  921. }
  922. };
  923. $root.MNN.SqueezeParam = class SqueezeParam {
  924. static decode(reader, position) {
  925. const $ = new $root.MNN.SqueezeParam();
  926. $.squeezeDims = reader.typedArray(position, 4, Int32Array);
  927. return $;
  928. }
  929. };
  930. $root.MNN.CastParam = class CastParam {
  931. static decode(reader, position) {
  932. const $ = new $root.MNN.CastParam();
  933. $.srcT = reader.int32_(position, 4, 0);
  934. $.dstT = reader.int32_(position, 6, 0);
  935. return $;
  936. }
  937. };
  938. $root.MNN.ReductionType = {
  939. SUM: 0,
  940. ASUM: 1,
  941. SUMSQ: 2,
  942. MEAN: 3,
  943. MAXIMUM: 4,
  944. MINIMUM: 5,
  945. PROD: 6,
  946. ANY: 7,
  947. ALL: 8
  948. };
  949. $root.MNN.ReductionParam = class ReductionParam {
  950. static decode(reader, position) {
  951. const $ = new $root.MNN.ReductionParam();
  952. $.operation = reader.int8_(position, 4, 0);
  953. $.dim = reader.typedArray(position, 6, Int32Array);
  954. $.coeff = reader.float32_(position, 8, 0);
  955. $.keepDims = reader.bool_(position, 10, false);
  956. $.dType = reader.int32_(position, 12, 1);
  957. return $;
  958. }
  959. };
  960. $root.MNN.Gather = class Gather {
  961. static decode(reader, position) {
  962. const $ = new $root.MNN.Gather();
  963. $.Tindices = reader.int32_(position, 4, 0);
  964. $.Tparams = reader.int32_(position, 6, 0);
  965. $.validateIndices = reader.bool_(position, 8, false);
  966. $.axis = reader.int32_(position, 10, 0);
  967. return $;
  968. }
  969. };
  970. $root.MNN.ExpandDims = class ExpandDims {
  971. static decode(reader, position) {
  972. const $ = new $root.MNN.ExpandDims();
  973. $.T = reader.int32_(position, 4, 0);
  974. $.Tdim = reader.int32_(position, 6, 0);
  975. $.axis = reader.int32_(position, 8, 0);
  976. return $;
  977. }
  978. };
  979. $root.MNN.Selu = class Selu {
  980. static decode(reader, position) {
  981. const $ = new $root.MNN.Selu();
  982. $.scale = reader.float32_(position, 4, 0);
  983. $.alpha = reader.float32_(position, 6, 0);
  984. return $;
  985. }
  986. };
  987. $root.MNN.AsString = class AsString {
  988. static decode(reader, position) {
  989. const $ = new $root.MNN.AsString();
  990. $.T = reader.int32_(position, 4, 0);
  991. $.precision = reader.int32_(position, 6, 0);
  992. $.scientific = reader.bool_(position, 8, false);
  993. $.shortest = reader.bool_(position, 10, false);
  994. $.width = reader.int32_(position, 12, 0);
  995. $.fillString = reader.string_(position, 14, null);
  996. return $;
  997. }
  998. };
  999. $root.MNN.ReduceJoin = class ReduceJoin {
  1000. static decode(reader, position) {
  1001. const $ = new $root.MNN.ReduceJoin();
  1002. $.keepDims = reader.bool_(position, 4, false);
  1003. $.separator = reader.string_(position, 6, null);
  1004. return $;
  1005. }
  1006. };
  1007. $root.MNN.UnaryOpOperation = {
  1008. ABS: 0,
  1009. NEG: 1,
  1010. FLOOR: 2,
  1011. CEIL: 3,
  1012. SQUARE: 4,
  1013. SQRT: 5,
  1014. RSQRT: 6,
  1015. EXP: 7,
  1016. LOG: 8,
  1017. SIN: 9,
  1018. COS: 10,
  1019. TAN: 11,
  1020. ASIN: 12,
  1021. ACOS: 13,
  1022. ATAN: 14,
  1023. RECIPROCAL: 15,
  1024. LOG1P: 16,
  1025. BNLL: 17,
  1026. ACOSH: 18,
  1027. SINH: 19,
  1028. ASINH: 20,
  1029. ATANH: 21,
  1030. SIGN: 22,
  1031. ROUND: 23,
  1032. COSH: 24,
  1033. ERF: 25,
  1034. ERFC: 26,
  1035. ERFINV: 27,
  1036. EXPM1: 28
  1037. };
  1038. $root.MNN.UnaryOp = class UnaryOp {
  1039. static decode(reader, position) {
  1040. const $ = new $root.MNN.UnaryOp();
  1041. $.opType = reader.int32_(position, 4, 0);
  1042. $.T = reader.int32_(position, 6, 0);
  1043. return $;
  1044. }
  1045. };
  1046. $root.MNN.TopKV2 = class TopKV2 {
  1047. static decode(reader, position) {
  1048. const $ = new $root.MNN.TopKV2();
  1049. $.T = reader.int32_(position, 4, 1);
  1050. $.sorted = reader.bool_(position, 6, false);
  1051. return $;
  1052. }
  1053. };
  1054. $root.MNN.CropAndResizeMethod = {
  1055. BILINEAR: 0,
  1056. NEAREST: 1
  1057. };
  1058. $root.MNN.CropAndResize = class CropAndResize {
  1059. static decode(reader, position) {
  1060. const $ = new $root.MNN.CropAndResize();
  1061. $.extrapolationValue = reader.float32_(position, 4, 0);
  1062. $.method = reader.int8_(position, 6, 0);
  1063. return $;
  1064. }
  1065. };
  1066. $root.MNN.Fill = class Fill {
  1067. static decode(reader, position) {
  1068. const $ = new $root.MNN.Fill();
  1069. return $;
  1070. }
  1071. };
  1072. $root.MNN.GatherV2 = class GatherV2 {
  1073. static decode(reader, position) {
  1074. const $ = new $root.MNN.GatherV2();
  1075. $.Taxis = reader.int32_(position, 4, 0);
  1076. $.Tindices = reader.int32_(position, 6, 0);
  1077. $.Tparams = reader.int32_(position, 8, 0);
  1078. return $;
  1079. }
  1080. };
  1081. $root.MNN.NonMaxSuppressionV2 = class NonMaxSuppressionV2 {
  1082. static decode(reader, position) {
  1083. const $ = new $root.MNN.NonMaxSuppressionV2();
  1084. return $;
  1085. }
  1086. };
  1087. $root.MNN.Range = class Range {
  1088. static decode(reader, position) {
  1089. const $ = new $root.MNN.Range();
  1090. $.Tidx = reader.int32_(position, 4, 0);
  1091. return $;
  1092. }
  1093. };
  1094. $root.MNN.Rank = class Rank {
  1095. static decode(reader, position) {
  1096. const $ = new $root.MNN.Rank();
  1097. return $;
  1098. }
  1099. };
  1100. $root.MNN.Size = class Size {
  1101. static decode(reader, position) {
  1102. const $ = new $root.MNN.Size();
  1103. $.outputDataType = reader.int32_(position, 4, 0);
  1104. return $;
  1105. }
  1106. };
  1107. $root.MNN.Transpose = class Transpose {
  1108. static decode(reader, position) {
  1109. const $ = new $root.MNN.Transpose();
  1110. $.Tperm = reader.int32_(position, 4, 0);
  1111. return $;
  1112. }
  1113. };
  1114. $root.MNN.SliceTf = class SliceTf {
  1115. static decode(reader, position) {
  1116. const $ = new $root.MNN.SliceTf();
  1117. $.T = reader.int32_(position, 4, 0);
  1118. return $;
  1119. }
  1120. };
  1121. $root.MNN.QuantizeMaxMin = class QuantizeMaxMin {
  1122. static decode(reader, position) {
  1123. const $ = new $root.MNN.QuantizeMaxMin();
  1124. $.T = reader.int32_(position, 4, 0);
  1125. return $;
  1126. }
  1127. };
  1128. $root.MNN.Crop = class Crop {
  1129. static decode(reader, position) {
  1130. const $ = new $root.MNN.Crop();
  1131. $.axis = reader.int32_(position, 4, 2);
  1132. $.offset = reader.typedArray(position, 6, Int32Array);
  1133. return $;
  1134. }
  1135. };
  1136. $root.MNN.SpaceBatch = class SpaceBatch {
  1137. static decode(reader, position) {
  1138. const $ = new $root.MNN.SpaceBatch();
  1139. $.blockShape = reader.table(position, 4, $root.MNN.Blob.decode);
  1140. $.padding = reader.table(position, 6, $root.MNN.Blob.decode);
  1141. return $;
  1142. }
  1143. };
  1144. $root.MNN.MatMul = class MatMul {
  1145. static decode(reader, position) {
  1146. const $ = new $root.MNN.MatMul();
  1147. $.T = reader.int32_(position, 4, 0);
  1148. $.transposeA = reader.bool_(position, 6, false);
  1149. $.transposeB = reader.bool_(position, 8, false);
  1150. $.weight = reader.typedArray(position, 10, Float32Array);
  1151. $.bias = reader.typedArray(position, 12, Float32Array);
  1152. return $;
  1153. }
  1154. };
  1155. $root.MNN.MomentsParam = class MomentsParam {
  1156. static decode(reader, position) {
  1157. const $ = new $root.MNN.MomentsParam();
  1158. $.dim = reader.typedArray(position, 4, Int32Array);
  1159. $.keepDims = reader.bool_(position, 6, true);
  1160. $.dType = reader.int32_(position, 8, 1);
  1161. return $;
  1162. }
  1163. };
  1164. $root.MNN.RNNParam = class RNNParam {
  1165. static decode(reader, position) {
  1166. const $ = new $root.MNN.RNNParam();
  1167. $.numUnits = reader.int32_(position, 4, 0);
  1168. $.isBidirectionalRNN = reader.bool_(position, 6, false);
  1169. $.keepAllOutputs = reader.bool_(position, 8, false);
  1170. $.fwGateWeight = reader.table(position, 10, $root.MNN.Blob.decode);
  1171. $.fwGateBias = reader.table(position, 12, $root.MNN.Blob.decode);
  1172. $.fwCandidateWeight = reader.table(position, 14, $root.MNN.Blob.decode);
  1173. $.fwCandidateBias = reader.table(position, 16, $root.MNN.Blob.decode);
  1174. $.bwGateWeight = reader.table(position, 18, $root.MNN.Blob.decode);
  1175. $.bwGateBias = reader.table(position, 20, $root.MNN.Blob.decode);
  1176. $.bwCandidateWeight = reader.table(position, 22, $root.MNN.Blob.decode);
  1177. $.bwCandidateBias = reader.table(position, 24, $root.MNN.Blob.decode);
  1178. return $;
  1179. }
  1180. };
  1181. $root.MNN.BatchMatMulParam = class BatchMatMulParam {
  1182. static decode(reader, position) {
  1183. const $ = new $root.MNN.BatchMatMulParam();
  1184. $.adjX = reader.bool_(position, 4, false);
  1185. $.adjY = reader.bool_(position, 6, false);
  1186. return $;
  1187. }
  1188. };
  1189. $root.MNN.DepthSpaceParam = class DepthSpaceParam {
  1190. static decode(reader, position) {
  1191. const $ = new $root.MNN.DepthSpaceParam();
  1192. $.blockSize = reader.int32_(position, 4, 0);
  1193. return $;
  1194. }
  1195. };
  1196. $root.MNN.ReverseSequenceParam = class ReverseSequenceParam {
  1197. static decode(reader, position) {
  1198. const $ = new $root.MNN.ReverseSequenceParam();
  1199. $.batchDim = reader.int32_(position, 4, 0);
  1200. $.seqDim = reader.int32_(position, 6, 0);
  1201. return $;
  1202. }
  1203. };
  1204. $root.MNN.DetectionPostProcessParam = class DetectionPostProcessParam {
  1205. static decode(reader, position) {
  1206. const $ = new $root.MNN.DetectionPostProcessParam();
  1207. $.maxDetections = reader.int32_(position, 4, 0);
  1208. $.maxClassesPerDetection = reader.int32_(position, 6, 0);
  1209. $.detectionsPerClass = reader.int32_(position, 8, 0);
  1210. $.nmsScoreThreshold = reader.float32_(position, 10, 0);
  1211. $.iouThreshold = reader.float32_(position, 12, 0);
  1212. $.numClasses = reader.int32_(position, 14, 0);
  1213. $.useRegularNMS = reader.bool_(position, 16, false);
  1214. $.centerSizeEncoding = reader.typedArray(position, 18, Float32Array);
  1215. return $;
  1216. }
  1217. };
  1218. $root.MNN.OneHotParam = class OneHotParam {
  1219. static decode(reader, position) {
  1220. const $ = new $root.MNN.OneHotParam();
  1221. $.dType = reader.int32_(position, 4, 1);
  1222. $.axis = reader.int32_(position, 6, -1);
  1223. return $;
  1224. }
  1225. };
  1226. $root.MNN.PadValueMode = {
  1227. CONSTANT: 0,
  1228. REFLECT: 1,
  1229. SYMMETRIC: 2
  1230. };
  1231. $root.MNN.PadParam = class PadParam {
  1232. static decode(reader, position) {
  1233. const $ = new $root.MNN.PadParam();
  1234. $.mode = reader.int8_(position, 4, 0);
  1235. return $;
  1236. }
  1237. };
  1238. $root.MNN.FusedActivation = {
  1239. kTfLiteActNone: 0,
  1240. kTfLiteActRelu: 1,
  1241. kTfLiteActRelu1: 2,
  1242. kTfLiteActRelu6: 3,
  1243. kTfLiteActTanh: 4,
  1244. kTfLiteActSignBit: 5,
  1245. kTfLiteActSigmoid: 6
  1246. };
  1247. $root.MNN.QuantizedParam = class QuantizedParam {
  1248. static decode(reader, position) {
  1249. const $ = new $root.MNN.QuantizedParam();
  1250. $.zeroPoint = reader.int32_(position, 4, 0);
  1251. $.scale = reader.float32_(position, 6, 0);
  1252. return $;
  1253. }
  1254. };
  1255. $root.MNN.QuantizedAdd = class QuantizedAdd {
  1256. static decode(reader, position) {
  1257. const $ = new $root.MNN.QuantizedAdd();
  1258. $.activationType = reader.int8_(position, 4, 0);
  1259. $.input1QuantizedParam = reader.table(position, 6, $root.MNN.QuantizedParam.decode);
  1260. $.input2QuantizedParam = reader.table(position, 8, $root.MNN.QuantizedParam.decode);
  1261. $.outputQuantizedParam = reader.table(position, 10, $root.MNN.QuantizedParam.decode);
  1262. return $;
  1263. }
  1264. };
  1265. $root.MNN.ModeFormat = {
  1266. TENSORFLOW: 0,
  1267. TFLITE: 1
  1268. };
  1269. $root.MNN.QuantizeMode = {
  1270. MIN_COMBINED: 0,
  1271. MIN_FIRST: 1,
  1272. SCALED: 2
  1273. };
  1274. $root.MNN.Dequantize = class Dequantize {
  1275. static decode(reader, position) {
  1276. const $ = new $root.MNN.Dequantize();
  1277. $.inputQuantizedParam = reader.table(position, 4, $root.MNN.QuantizedParam.decode);
  1278. $.mode = reader.int8_(position, 6, 0);
  1279. $.modelFormat = reader.int8_(position, 8, 0);
  1280. $.type = reader.int32_(position, 10, 0);
  1281. return $;
  1282. }
  1283. };
  1284. $root.MNN.QuantizedAvgPool = class QuantizedAvgPool {
  1285. static decode(reader, position) {
  1286. const $ = new $root.MNN.QuantizedAvgPool();
  1287. $.kernelX = reader.int32_(position, 4, 0);
  1288. $.kernelY = reader.int32_(position, 6, 0);
  1289. $.modelFormat = reader.int8_(position, 8, 0);
  1290. $.outputActivationMax = reader.int32_(position, 10, 0);
  1291. $.outputActivationMin = reader.int32_(position, 12, 0);
  1292. $.padType = reader.int8_(position, 14, 0);
  1293. $.padX = reader.int32_(position, 16, 0);
  1294. $.padY = reader.int32_(position, 18, 0);
  1295. $.strideX = reader.int32_(position, 20, 0);
  1296. $.strideY = reader.int32_(position, 22, 0);
  1297. $.type = reader.int32_(position, 24, 0);
  1298. return $;
  1299. }
  1300. };
  1301. $root.MNN.QuantizedBiasAdd = class QuantizedBiasAdd {
  1302. static decode(reader, position) {
  1303. const $ = new $root.MNN.QuantizedBiasAdd();
  1304. $.bias = reader.typedArray(position, 4, Int32Array);
  1305. $.inputType = reader.int32_(position, 6, 0);
  1306. $.max = reader.int32_(position, 8, 0);
  1307. $.min = reader.int32_(position, 10, 0);
  1308. $.outputType = reader.int32_(position, 12, 0);
  1309. return $;
  1310. }
  1311. };
  1312. $root.MNN.QuantizedConcat = class QuantizedConcat {
  1313. static decode(reader, position) {
  1314. const $ = new $root.MNN.QuantizedConcat();
  1315. $.activationType = reader.int8_(position, 4, 0);
  1316. $.axis = reader.int32_(position, 6, 0);
  1317. $.inputScale = reader.typedArray(position, 8, Float32Array);
  1318. $.inputZeroPoint = reader.typedArray(position, 10, Int32Array);
  1319. $.outputQuantizedParam = reader.table(position, 12, $root.MNN.QuantizedParam.decode);
  1320. return $;
  1321. }
  1322. };
  1323. $root.MNN.QuantizedLogistic = class QuantizedLogistic {
  1324. static decode(reader, position) {
  1325. const $ = new $root.MNN.QuantizedLogistic();
  1326. $.inputQuantizedParam = reader.table(position, 4, $root.MNN.QuantizedParam.decode);
  1327. $.outputQuantizedParam = reader.table(position, 6, $root.MNN.QuantizedParam.decode);
  1328. return $;
  1329. }
  1330. };
  1331. $root.MNN.QuantizedMatMul = class QuantizedMatMul {
  1332. static decode(reader, position) {
  1333. const $ = new $root.MNN.QuantizedMatMul();
  1334. $.transposeA = reader.bool_(position, 4, false);
  1335. $.transposeB = reader.bool_(position, 6, false);
  1336. return $;
  1337. }
  1338. };
  1339. $root.MNN.QuantizedMaxPool = class QuantizedMaxPool {
  1340. static decode(reader, position) {
  1341. const $ = new $root.MNN.QuantizedMaxPool();
  1342. $.kernelX = reader.int32_(position, 4, 0);
  1343. $.kernelY = reader.int32_(position, 6, 0);
  1344. $.modelFormat = reader.int8_(position, 8, 0);
  1345. $.outputActivationMax = reader.int32_(position, 10, 0);
  1346. $.outputActivationMin = reader.int32_(position, 12, 0);
  1347. $.padType = reader.int8_(position, 14, 0);
  1348. $.padX = reader.int32_(position, 16, 0);
  1349. $.padY = reader.int32_(position, 18, 0);
  1350. $.strideX = reader.int32_(position, 20, 0);
  1351. $.strideY = reader.int32_(position, 22, 0);
  1352. $.type = reader.int32_(position, 24, 0);
  1353. return $;
  1354. }
  1355. };
  1356. $root.MNN.QuantizedRelu = class QuantizedRelu {
  1357. static decode(reader, position) {
  1358. const $ = new $root.MNN.QuantizedRelu();
  1359. $.type = reader.int32_(position, 4, 0);
  1360. return $;
  1361. }
  1362. };
  1363. $root.MNN.QuantizedRelu6 = class QuantizedRelu6 {
  1364. static decode(reader, position) {
  1365. const $ = new $root.MNN.QuantizedRelu6();
  1366. $.type = reader.int32_(position, 4, 0);
  1367. return $;
  1368. }
  1369. };
  1370. $root.MNN.QuantizedReshape = class QuantizedReshape {
  1371. static decode(reader, position) {
  1372. const $ = new $root.MNN.QuantizedReshape();
  1373. $.dims = reader.typedArray(position, 4, Int32Array);
  1374. $.modelFormat = reader.int8_(position, 6, 0);
  1375. return $;
  1376. }
  1377. };
  1378. $root.MNN.QuantizedSoftmax = class QuantizedSoftmax {
  1379. static decode(reader, position) {
  1380. const $ = new $root.MNN.QuantizedSoftmax();
  1381. $.beta = reader.float32_(position, 4, 0);
  1382. $.inputScale = reader.float32_(position, 6, 0);
  1383. return $;
  1384. }
  1385. };
  1386. $root.MNN.QuantizeRoundMode = {
  1387. HALF_AWAY_FROM_ZERO: 0,
  1388. HALF_TO_EVEN: 1
  1389. };
  1390. $root.MNN.QuantizeV2 = class QuantizeV2 {
  1391. static decode(reader, position) {
  1392. const $ = new $root.MNN.QuantizeV2();
  1393. $.type = reader.int32_(position, 4, 0);
  1394. $.mode = reader.int8_(position, 6, 0);
  1395. $.roundMode = reader.int8_(position, 8, 0);
  1396. return $;
  1397. }
  1398. };
  1399. $root.MNN.RequantizationRange = class RequantizationRange {
  1400. static decode(reader, position) {
  1401. const $ = new $root.MNN.RequantizationRange();
  1402. return $;
  1403. }
  1404. };
  1405. $root.MNN.Requantize = class Requantize {
  1406. static decode(reader, position) {
  1407. const $ = new $root.MNN.Requantize();
  1408. return $;
  1409. }
  1410. };
  1411. $root.MNN.TfQuantizedConv2D = class TfQuantizedConv2D {
  1412. static decode(reader, position) {
  1413. const $ = new $root.MNN.TfQuantizedConv2D();
  1414. $.bias = reader.typedArray(position, 4, Int32Array);
  1415. $.biasflag = reader.bool_(position, 6, false);
  1416. $.common = reader.table(position, 8, $root.MNN.Convolution2DCommon.decode);
  1417. $.weight = reader.typedArray(position, 10, Uint8Array);
  1418. $.activationType = reader.int8_(position, 12, 0);
  1419. $.multiplier = reader.int32_(position, 14, 0);
  1420. $.outMax = reader.int32_(position, 16, 0);
  1421. $.outMin = reader.int32_(position, 18, 0);
  1422. $.shift = reader.int32_(position, 20, 0);
  1423. $.biasQuantizedParam = reader.table(position, 22, $root.MNN.QuantizedParam.decode);
  1424. $.depthMultiplier = reader.int32_(position, 24, 0);
  1425. $.filterQuantizedParam = reader.table(position, 26, $root.MNN.QuantizedParam.decode);
  1426. $.inputQuantizedParam = reader.table(position, 28, $root.MNN.QuantizedParam.decode);
  1427. $.modelFormat = reader.int8_(position, 30, 0);
  1428. $.outputQuantizedParam = reader.table(position, 32, $root.MNN.QuantizedParam.decode);
  1429. return $;
  1430. }
  1431. };
  1432. $root.MNN.STORAGE_TYPE = {
  1433. BUFFER: 0,
  1434. UNIFORM: 1,
  1435. IMAGE: 2
  1436. };
  1437. $root.MNN.ACCESS_TYPE = {
  1438. READ_ONLY: 0,
  1439. WRITE_ONLY: 1,
  1440. READ_WRITE: 2
  1441. };
  1442. $root.MNN.GpuBuffer = class GpuBuffer {
  1443. static decode(reader, position) {
  1444. const $ = new $root.MNN.GpuBuffer();
  1445. $.access = reader.int8_(position, 4, 0);
  1446. $.storage = reader.int8_(position, 6, 0);
  1447. $.content = reader.table(position, 8, $root.MNN.Blob.decode);
  1448. return $;
  1449. }
  1450. };
  1451. $root.MNN.GpuPipeline = class GpuPipeline {
  1452. static decode(reader, position) {
  1453. const $ = new $root.MNN.GpuPipeline();
  1454. $.localSize = reader.typedArray(position, 4, Int32Array);
  1455. $.key = reader.string_(position, 6, null);
  1456. $.metal = reader.typedArray(position, 8, Int8Array);
  1457. $.vulkan = reader.typedArray(position, 10, Int8Array);
  1458. $.openglComputeShader = reader.string_(position, 12, null);
  1459. $.openclKernel = reader.string_(position, 14, null);
  1460. return $;
  1461. }
  1462. };
  1463. $root.MNN.GpuStage = class GpuStage {
  1464. static decode(reader, position) {
  1465. const $ = new $root.MNN.GpuStage();
  1466. $.pipeline = reader.string_(position, 4, null);
  1467. $.groupSize = reader.typedArray(position, 6, Int32Array);
  1468. $.inputIndexes = reader.typedArray(position, 8, Int32Array);
  1469. $.outputIndexes = reader.typedArray(position, 10, Int32Array);
  1470. $.middleBuffer = reader.tableArray(position, 12, $root.MNN.GpuBuffer.decode);
  1471. $.constBuffer = reader.tableArray(position, 14, $root.MNN.GpuBuffer.decode);
  1472. $.globalSizeIndex = reader.int32_(position, 16, 0);
  1473. $.globalSizeDivide = reader.typedArray(position, 18, Int32Array);
  1474. $.requireSize = reader.bool_(position, 20, false);
  1475. return $;
  1476. }
  1477. };
  1478. $root.MNN.GpuFunction = class GpuFunction {
  1479. static decode(reader, position) {
  1480. const $ = new $root.MNN.GpuFunction();
  1481. $.stags = reader.tableArray(position, 4, $root.MNN.GpuStage.decode);
  1482. $.name = reader.string_(position, 6, null);
  1483. return $;
  1484. }
  1485. };
  1486. $root.MNN.GpuLibrary = class GpuLibrary {
  1487. static decode(reader, position) {
  1488. const $ = new $root.MNN.GpuLibrary();
  1489. $.functions = reader.tableArray(position, 4, $root.MNN.GpuFunction.decode);
  1490. $.pipeline = reader.tableArray(position, 6, $root.MNN.GpuPipeline.decode);
  1491. $.name = reader.string_(position, 8, null);
  1492. return $;
  1493. }
  1494. };
  1495. $root.MNN.TensorConvertInfo = class TensorConvertInfo {
  1496. static decode(reader, position) {
  1497. const $ = new $root.MNN.TensorConvertInfo();
  1498. $.source = reader.int8_(position, 4, 0);
  1499. $.dest = reader.int8_(position, 6, 0);
  1500. return $;
  1501. }
  1502. };