tflite-schema.js 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604
  1. var $root = flatbuffers.get('tflite');
  2. $root.tflite = $root.tflite || {};
  3. $root.tflite.TensorType = {
  4. FLOAT32: 0,
  5. FLOAT16: 1,
  6. INT32: 2,
  7. UINT8: 3,
  8. INT64: 4,
  9. STRING: 5,
  10. BOOL: 6,
  11. INT16: 7,
  12. COMPLEX64: 8,
  13. INT8: 9,
  14. FLOAT64: 10,
  15. COMPLEX128: 11
  16. };
  17. $root.tflite.CustomQuantization = class CustomQuantization {
  18. static decode(reader, position) {
  19. const $ = new $root.tflite.CustomQuantization();
  20. $.custom = reader.typedArray(position, 4, Uint8Array);
  21. return $;
  22. }
  23. static decodeText(reader, json) {
  24. const $ = new $root.tflite.CustomQuantization();
  25. $.custom = reader.typedArray(json.custom, Uint8Array);
  26. return $;
  27. }
  28. };
  29. $root.tflite.QuantizationDetails = class {
  30. static decode(reader, position, type) {
  31. switch (type) {
  32. case 1: return $root.tflite.CustomQuantization.decode(reader, position);
  33. }
  34. return undefined;
  35. }
  36. static decodeText(reader, json, type) {
  37. switch (type) {
  38. case 'CustomQuantization': return $root.tflite.CustomQuantization.decodeText(reader, json);
  39. }
  40. return undefined;
  41. }
  42. };
  43. $root.tflite.QuantizationParameters = class QuantizationParameters {
  44. static decode(reader, position) {
  45. const $ = new $root.tflite.QuantizationParameters();
  46. $.min = reader.typedArray(position, 4, Float32Array);
  47. $.max = reader.typedArray(position, 6, Float32Array);
  48. $.scale = reader.typedArray(position, 8, Float32Array);
  49. $.zero_point = reader.int64s_(position, 10);
  50. $.details = reader.union(position, 12, $root.tflite.QuantizationDetails.decode);
  51. $.quantized_dimension = reader.int32_(position, 16, 0);
  52. return $;
  53. }
  54. static decodeText(reader, json) {
  55. const $ = new $root.tflite.QuantizationParameters();
  56. $.min = reader.typedArray(json.min, Float32Array);
  57. $.max = reader.typedArray(json.max, Float32Array);
  58. $.scale = reader.typedArray(json.scale, Float32Array);
  59. $.zero_point = reader.array(json.zero_point);
  60. $.details = $root.tflite.QuantizationDetails.decodeText(reader, json.details, json.details_type);
  61. $.quantized_dimension = reader.value(json.quantized_dimension, 0);
  62. return $;
  63. }
  64. };
  65. $root.tflite.DimensionType = {
  66. DENSE: 0,
  67. SPARSE_CSR: 1
  68. };
  69. $root.tflite.Int32Vector = class Int32Vector {
  70. static decode(reader, position) {
  71. const $ = new $root.tflite.Int32Vector();
  72. $.values = reader.typedArray(position, 4, Int32Array);
  73. return $;
  74. }
  75. static decodeText(reader, json) {
  76. const $ = new $root.tflite.Int32Vector();
  77. $.values = reader.typedArray(json.values, Int32Array);
  78. return $;
  79. }
  80. };
  81. $root.tflite.Uint16Vector = class Uint16Vector {
  82. static decode(reader, position) {
  83. const $ = new $root.tflite.Uint16Vector();
  84. $.values = reader.typedArray(position, 4, Uint16Array);
  85. return $;
  86. }
  87. static decodeText(reader, json) {
  88. const $ = new $root.tflite.Uint16Vector();
  89. $.values = reader.typedArray(json.values, Uint16Array);
  90. return $;
  91. }
  92. };
  93. $root.tflite.Uint8Vector = class Uint8Vector {
  94. static decode(reader, position) {
  95. const $ = new $root.tflite.Uint8Vector();
  96. $.values = reader.typedArray(position, 4, Uint8Array);
  97. return $;
  98. }
  99. static decodeText(reader, json) {
  100. const $ = new $root.tflite.Uint8Vector();
  101. $.values = reader.typedArray(json.values, Uint8Array);
  102. return $;
  103. }
  104. };
  105. $root.tflite.SparseIndexVector = class {
  106. static decode(reader, position, type) {
  107. switch (type) {
  108. case 1: return $root.tflite.Int32Vector.decode(reader, position);
  109. case 2: return $root.tflite.Uint16Vector.decode(reader, position);
  110. case 3: return $root.tflite.Uint8Vector.decode(reader, position);
  111. }
  112. return undefined;
  113. }
  114. static decodeText(reader, json, type) {
  115. switch (type) {
  116. case 'Int32Vector': return $root.tflite.Int32Vector.decodeText(reader, json);
  117. case 'Uint16Vector': return $root.tflite.Uint16Vector.decodeText(reader, json);
  118. case 'Uint8Vector': return $root.tflite.Uint8Vector.decodeText(reader, json);
  119. }
  120. return undefined;
  121. }
  122. };
  123. $root.tflite.DimensionMetadata = class DimensionMetadata {
  124. static decode(reader, position) {
  125. const $ = new $root.tflite.DimensionMetadata();
  126. $.format = reader.int8_(position, 4, 0);
  127. $.dense_size = reader.int32_(position, 6, 0);
  128. $.array_segments = reader.union(position, 8, $root.tflite.SparseIndexVector.decode);
  129. $.array_indices = reader.union(position, 12, $root.tflite.SparseIndexVector.decode);
  130. return $;
  131. }
  132. static decodeText(reader, json) {
  133. const $ = new $root.tflite.DimensionMetadata();
  134. $.format = $root.tflite.DimensionType[json.format];
  135. $.dense_size = reader.value(json.dense_size, 0);
  136. $.array_segments = $root.tflite.SparseIndexVector.decodeText(reader, json.array_segments, json.array_segments_type);
  137. $.array_indices = $root.tflite.SparseIndexVector.decodeText(reader, json.array_indices, json.array_indices_type);
  138. return $;
  139. }
  140. };
  141. $root.tflite.SparsityParameters = class SparsityParameters {
  142. static decode(reader, position) {
  143. const $ = new $root.tflite.SparsityParameters();
  144. $.traversal_order = reader.typedArray(position, 4, Int32Array);
  145. $.block_map = reader.typedArray(position, 6, Int32Array);
  146. $.dim_metadata = reader.tableArray(position, 8, $root.tflite.DimensionMetadata.decode);
  147. return $;
  148. }
  149. static decodeText(reader, json) {
  150. const $ = new $root.tflite.SparsityParameters();
  151. $.traversal_order = reader.typedArray(json.traversal_order, Int32Array);
  152. $.block_map = reader.typedArray(json.block_map, Int32Array);
  153. $.dim_metadata = reader.objectArray(json.dim_metadata, $root.tflite.DimensionMetadata.decodeText);
  154. return $;
  155. }
  156. };
  157. $root.tflite.Tensor = class Tensor {
  158. static decode(reader, position) {
  159. const $ = new $root.tflite.Tensor();
  160. $.shape = reader.typedArray(position, 4, Int32Array);
  161. $.type = reader.int8_(position, 6, 0);
  162. $.buffer = reader.uint32_(position, 8, 0);
  163. $.name = reader.string_(position, 10, null);
  164. $.quantization = reader.table(position, 12, $root.tflite.QuantizationParameters.decode);
  165. $.is_variable = reader.bool_(position, 14, false);
  166. $.sparsity = reader.table(position, 16, $root.tflite.SparsityParameters.decode);
  167. $.shape_signature = reader.typedArray(position, 18, Int32Array);
  168. return $;
  169. }
  170. static decodeText(reader, json) {
  171. const $ = new $root.tflite.Tensor();
  172. $.shape = reader.typedArray(json.shape, Int32Array);
  173. $.type = $root.tflite.TensorType[json.type];
  174. $.buffer = reader.value(json.buffer, 0);
  175. $.name = reader.value(json.name, null);
  176. $.quantization = reader.object(json.quantization, $root.tflite.QuantizationParameters.decodeText);
  177. $.is_variable = reader.value(json.is_variable, false);
  178. $.sparsity = reader.object(json.sparsity, $root.tflite.SparsityParameters.decodeText);
  179. $.shape_signature = reader.typedArray(json.shape_signature, Int32Array);
  180. return $;
  181. }
  182. };
  183. $root.tflite.BuiltinOperator = {
  184. ADD: 0,
  185. AVERAGE_POOL_2D: 1,
  186. CONCATENATION: 2,
  187. CONV_2D: 3,
  188. DEPTHWISE_CONV_2D: 4,
  189. DEPTH_TO_SPACE: 5,
  190. DEQUANTIZE: 6,
  191. EMBEDDING_LOOKUP: 7,
  192. FLOOR: 8,
  193. FULLY_CONNECTED: 9,
  194. HASHTABLE_LOOKUP: 10,
  195. L2_NORMALIZATION: 11,
  196. L2_POOL_2D: 12,
  197. LOCAL_RESPONSE_NORMALIZATION: 13,
  198. LOGISTIC: 14,
  199. LSH_PROJECTION: 15,
  200. LSTM: 16,
  201. MAX_POOL_2D: 17,
  202. MUL: 18,
  203. RELU: 19,
  204. RELU_N1_TO_1: 20,
  205. RELU6: 21,
  206. RESHAPE: 22,
  207. RESIZE_BILINEAR: 23,
  208. RNN: 24,
  209. SOFTMAX: 25,
  210. SPACE_TO_DEPTH: 26,
  211. SVDF: 27,
  212. TANH: 28,
  213. CONCAT_EMBEDDINGS: 29,
  214. SKIP_GRAM: 30,
  215. CALL: 31,
  216. CUSTOM: 32,
  217. EMBEDDING_LOOKUP_SPARSE: 33,
  218. PAD: 34,
  219. UNIDIRECTIONAL_SEQUENCE_RNN: 35,
  220. GATHER: 36,
  221. BATCH_TO_SPACE_ND: 37,
  222. SPACE_TO_BATCH_ND: 38,
  223. TRANSPOSE: 39,
  224. MEAN: 40,
  225. SUB: 41,
  226. DIV: 42,
  227. SQUEEZE: 43,
  228. UNIDIRECTIONAL_SEQUENCE_LSTM: 44,
  229. STRIDED_SLICE: 45,
  230. BIDIRECTIONAL_SEQUENCE_RNN: 46,
  231. EXP: 47,
  232. TOPK_V2: 48,
  233. SPLIT: 49,
  234. LOG_SOFTMAX: 50,
  235. DELEGATE: 51,
  236. BIDIRECTIONAL_SEQUENCE_LSTM: 52,
  237. CAST: 53,
  238. PRELU: 54,
  239. MAXIMUM: 55,
  240. ARG_MAX: 56,
  241. MINIMUM: 57,
  242. LESS: 58,
  243. NEG: 59,
  244. PADV2: 60,
  245. GREATER: 61,
  246. GREATER_EQUAL: 62,
  247. LESS_EQUAL: 63,
  248. SELECT: 64,
  249. SLICE: 65,
  250. SIN: 66,
  251. TRANSPOSE_CONV: 67,
  252. SPARSE_TO_DENSE: 68,
  253. TILE: 69,
  254. EXPAND_DIMS: 70,
  255. EQUAL: 71,
  256. NOT_EQUAL: 72,
  257. LOG: 73,
  258. SUM: 74,
  259. SQRT: 75,
  260. RSQRT: 76,
  261. SHAPE: 77,
  262. POW: 78,
  263. ARG_MIN: 79,
  264. FAKE_QUANT: 80,
  265. REDUCE_PROD: 81,
  266. REDUCE_MAX: 82,
  267. PACK: 83,
  268. LOGICAL_OR: 84,
  269. ONE_HOT: 85,
  270. LOGICAL_AND: 86,
  271. LOGICAL_NOT: 87,
  272. UNPACK: 88,
  273. REDUCE_MIN: 89,
  274. FLOOR_DIV: 90,
  275. REDUCE_ANY: 91,
  276. SQUARE: 92,
  277. ZEROS_LIKE: 93,
  278. FILL: 94,
  279. FLOOR_MOD: 95,
  280. RANGE: 96,
  281. RESIZE_NEAREST_NEIGHBOR: 97,
  282. LEAKY_RELU: 98,
  283. SQUARED_DIFFERENCE: 99,
  284. MIRROR_PAD: 100,
  285. ABS: 101,
  286. SPLIT_V: 102,
  287. UNIQUE: 103,
  288. CEIL: 104,
  289. REVERSE_V2: 105,
  290. ADD_N: 106,
  291. GATHER_ND: 107,
  292. COS: 108,
  293. WHERE: 109,
  294. RANK: 110,
  295. ELU: 111,
  296. REVERSE_SEQUENCE: 112,
  297. MATRIX_DIAG: 113,
  298. QUANTIZE: 114,
  299. MATRIX_SET_DIAG: 115,
  300. ROUND: 116,
  301. HARD_SWISH: 117,
  302. IF: 118,
  303. WHILE: 119,
  304. NON_MAX_SUPPRESSION_V4: 120,
  305. NON_MAX_SUPPRESSION_V5: 121,
  306. SCATTER_ND: 122,
  307. SELECT_V2: 123,
  308. DENSIFY: 124,
  309. SEGMENT_SUM: 125,
  310. BATCH_MATMUL: 126
  311. };
  312. $root.tflite.BuiltinOptions = class {
  313. static decode(reader, position, type) {
  314. switch (type) {
  315. case 1: return $root.tflite.Conv2DOptions.decode(reader, position);
  316. case 2: return $root.tflite.DepthwiseConv2DOptions.decode(reader, position);
  317. case 3: return $root.tflite.ConcatEmbeddingsOptions.decode(reader, position);
  318. case 4: return $root.tflite.LSHProjectionOptions.decode(reader, position);
  319. case 5: return $root.tflite.Pool2DOptions.decode(reader, position);
  320. case 6: return $root.tflite.SVDFOptions.decode(reader, position);
  321. case 7: return $root.tflite.RNNOptions.decode(reader, position);
  322. case 8: return $root.tflite.FullyConnectedOptions.decode(reader, position);
  323. case 9: return $root.tflite.SoftmaxOptions.decode(reader, position);
  324. case 10: return $root.tflite.ConcatenationOptions.decode(reader, position);
  325. case 11: return $root.tflite.AddOptions.decode(reader, position);
  326. case 12: return $root.tflite.L2NormOptions.decode(reader, position);
  327. case 13: return $root.tflite.LocalResponseNormalizationOptions.decode(reader, position);
  328. case 14: return $root.tflite.LSTMOptions.decode(reader, position);
  329. case 15: return $root.tflite.ResizeBilinearOptions.decode(reader, position);
  330. case 16: return $root.tflite.CallOptions.decode(reader, position);
  331. case 17: return $root.tflite.ReshapeOptions.decode(reader, position);
  332. case 18: return $root.tflite.SkipGramOptions.decode(reader, position);
  333. case 19: return $root.tflite.SpaceToDepthOptions.decode(reader, position);
  334. case 20: return $root.tflite.EmbeddingLookupSparseOptions.decode(reader, position);
  335. case 21: return $root.tflite.MulOptions.decode(reader, position);
  336. case 22: return $root.tflite.PadOptions.decode(reader, position);
  337. case 23: return $root.tflite.GatherOptions.decode(reader, position);
  338. case 24: return $root.tflite.BatchToSpaceNDOptions.decode(reader, position);
  339. case 25: return $root.tflite.SpaceToBatchNDOptions.decode(reader, position);
  340. case 26: return $root.tflite.TransposeOptions.decode(reader, position);
  341. case 27: return $root.tflite.ReducerOptions.decode(reader, position);
  342. case 28: return $root.tflite.SubOptions.decode(reader, position);
  343. case 29: return $root.tflite.DivOptions.decode(reader, position);
  344. case 30: return $root.tflite.SqueezeOptions.decode(reader, position);
  345. case 31: return $root.tflite.SequenceRNNOptions.decode(reader, position);
  346. case 32: return $root.tflite.StridedSliceOptions.decode(reader, position);
  347. case 33: return $root.tflite.ExpOptions.decode(reader, position);
  348. case 34: return $root.tflite.TopKV2Options.decode(reader, position);
  349. case 35: return $root.tflite.SplitOptions.decode(reader, position);
  350. case 36: return $root.tflite.LogSoftmaxOptions.decode(reader, position);
  351. case 37: return $root.tflite.CastOptions.decode(reader, position);
  352. case 38: return $root.tflite.DequantizeOptions.decode(reader, position);
  353. case 39: return $root.tflite.MaximumMinimumOptions.decode(reader, position);
  354. case 40: return $root.tflite.ArgMaxOptions.decode(reader, position);
  355. case 41: return $root.tflite.LessOptions.decode(reader, position);
  356. case 42: return $root.tflite.NegOptions.decode(reader, position);
  357. case 43: return $root.tflite.PadV2Options.decode(reader, position);
  358. case 44: return $root.tflite.GreaterOptions.decode(reader, position);
  359. case 45: return $root.tflite.GreaterEqualOptions.decode(reader, position);
  360. case 46: return $root.tflite.LessEqualOptions.decode(reader, position);
  361. case 47: return $root.tflite.SelectOptions.decode(reader, position);
  362. case 48: return $root.tflite.SliceOptions.decode(reader, position);
  363. case 49: return $root.tflite.TransposeConvOptions.decode(reader, position);
  364. case 50: return $root.tflite.SparseToDenseOptions.decode(reader, position);
  365. case 51: return $root.tflite.TileOptions.decode(reader, position);
  366. case 52: return $root.tflite.ExpandDimsOptions.decode(reader, position);
  367. case 53: return $root.tflite.EqualOptions.decode(reader, position);
  368. case 54: return $root.tflite.NotEqualOptions.decode(reader, position);
  369. case 55: return $root.tflite.ShapeOptions.decode(reader, position);
  370. case 56: return $root.tflite.PowOptions.decode(reader, position);
  371. case 57: return $root.tflite.ArgMinOptions.decode(reader, position);
  372. case 58: return $root.tflite.FakeQuantOptions.decode(reader, position);
  373. case 59: return $root.tflite.PackOptions.decode(reader, position);
  374. case 60: return $root.tflite.LogicalOrOptions.decode(reader, position);
  375. case 61: return $root.tflite.OneHotOptions.decode(reader, position);
  376. case 62: return $root.tflite.LogicalAndOptions.decode(reader, position);
  377. case 63: return $root.tflite.LogicalNotOptions.decode(reader, position);
  378. case 64: return $root.tflite.UnpackOptions.decode(reader, position);
  379. case 65: return $root.tflite.FloorDivOptions.decode(reader, position);
  380. case 66: return $root.tflite.SquareOptions.decode(reader, position);
  381. case 67: return $root.tflite.ZerosLikeOptions.decode(reader, position);
  382. case 68: return $root.tflite.FillOptions.decode(reader, position);
  383. case 69: return $root.tflite.BidirectionalSequenceLSTMOptions.decode(reader, position);
  384. case 70: return $root.tflite.BidirectionalSequenceRNNOptions.decode(reader, position);
  385. case 71: return $root.tflite.UnidirectionalSequenceLSTMOptions.decode(reader, position);
  386. case 72: return $root.tflite.FloorModOptions.decode(reader, position);
  387. case 73: return $root.tflite.RangeOptions.decode(reader, position);
  388. case 74: return $root.tflite.ResizeNearestNeighborOptions.decode(reader, position);
  389. case 75: return $root.tflite.LeakyReluOptions.decode(reader, position);
  390. case 76: return $root.tflite.SquaredDifferenceOptions.decode(reader, position);
  391. case 77: return $root.tflite.MirrorPadOptions.decode(reader, position);
  392. case 78: return $root.tflite.AbsOptions.decode(reader, position);
  393. case 79: return $root.tflite.SplitVOptions.decode(reader, position);
  394. case 80: return $root.tflite.UniqueOptions.decode(reader, position);
  395. case 81: return $root.tflite.ReverseV2Options.decode(reader, position);
  396. case 82: return $root.tflite.AddNOptions.decode(reader, position);
  397. case 83: return $root.tflite.GatherNdOptions.decode(reader, position);
  398. case 84: return $root.tflite.CosOptions.decode(reader, position);
  399. case 85: return $root.tflite.WhereOptions.decode(reader, position);
  400. case 86: return $root.tflite.RankOptions.decode(reader, position);
  401. case 87: return $root.tflite.ReverseSequenceOptions.decode(reader, position);
  402. case 88: return $root.tflite.MatrixDiagOptions.decode(reader, position);
  403. case 89: return $root.tflite.QuantizeOptions.decode(reader, position);
  404. case 90: return $root.tflite.MatrixSetDiagOptions.decode(reader, position);
  405. case 91: return $root.tflite.HardSwishOptions.decode(reader, position);
  406. case 92: return $root.tflite.IfOptions.decode(reader, position);
  407. case 93: return $root.tflite.WhileOptions.decode(reader, position);
  408. case 94: return $root.tflite.DepthToSpaceOptions.decode(reader, position);
  409. case 95: return $root.tflite.NonMaxSuppressionV4Options.decode(reader, position);
  410. case 96: return $root.tflite.NonMaxSuppressionV5Options.decode(reader, position);
  411. case 97: return $root.tflite.ScatterNdOptions.decode(reader, position);
  412. case 98: return $root.tflite.SelectV2Options.decode(reader, position);
  413. case 99: return $root.tflite.DensifyOptions.decode(reader, position);
  414. case 100: return $root.tflite.SegmentSumOptions.decode(reader, position);
  415. case 101: return $root.tflite.BatchMatMulOptions.decode(reader, position);
  416. }
  417. return undefined;
  418. }
  419. static decodeText(reader, json, type) {
  420. switch (type) {
  421. case 'Conv2DOptions': return $root.tflite.Conv2DOptions.decodeText(reader, json);
  422. case 'DepthwiseConv2DOptions': return $root.tflite.DepthwiseConv2DOptions.decodeText(reader, json);
  423. case 'ConcatEmbeddingsOptions': return $root.tflite.ConcatEmbeddingsOptions.decodeText(reader, json);
  424. case 'LSHProjectionOptions': return $root.tflite.LSHProjectionOptions.decodeText(reader, json);
  425. case 'Pool2DOptions': return $root.tflite.Pool2DOptions.decodeText(reader, json);
  426. case 'SVDFOptions': return $root.tflite.SVDFOptions.decodeText(reader, json);
  427. case 'RNNOptions': return $root.tflite.RNNOptions.decodeText(reader, json);
  428. case 'FullyConnectedOptions': return $root.tflite.FullyConnectedOptions.decodeText(reader, json);
  429. case 'SoftmaxOptions': return $root.tflite.SoftmaxOptions.decodeText(reader, json);
  430. case 'ConcatenationOptions': return $root.tflite.ConcatenationOptions.decodeText(reader, json);
  431. case 'AddOptions': return $root.tflite.AddOptions.decodeText(reader, json);
  432. case 'L2NormOptions': return $root.tflite.L2NormOptions.decodeText(reader, json);
  433. case 'LocalResponseNormalizationOptions': return $root.tflite.LocalResponseNormalizationOptions.decodeText(reader, json);
  434. case 'LSTMOptions': return $root.tflite.LSTMOptions.decodeText(reader, json);
  435. case 'ResizeBilinearOptions': return $root.tflite.ResizeBilinearOptions.decodeText(reader, json);
  436. case 'CallOptions': return $root.tflite.CallOptions.decodeText(reader, json);
  437. case 'ReshapeOptions': return $root.tflite.ReshapeOptions.decodeText(reader, json);
  438. case 'SkipGramOptions': return $root.tflite.SkipGramOptions.decodeText(reader, json);
  439. case 'SpaceToDepthOptions': return $root.tflite.SpaceToDepthOptions.decodeText(reader, json);
  440. case 'EmbeddingLookupSparseOptions': return $root.tflite.EmbeddingLookupSparseOptions.decodeText(reader, json);
  441. case 'MulOptions': return $root.tflite.MulOptions.decodeText(reader, json);
  442. case 'PadOptions': return $root.tflite.PadOptions.decodeText(reader, json);
  443. case 'GatherOptions': return $root.tflite.GatherOptions.decodeText(reader, json);
  444. case 'BatchToSpaceNDOptions': return $root.tflite.BatchToSpaceNDOptions.decodeText(reader, json);
  445. case 'SpaceToBatchNDOptions': return $root.tflite.SpaceToBatchNDOptions.decodeText(reader, json);
  446. case 'TransposeOptions': return $root.tflite.TransposeOptions.decodeText(reader, json);
  447. case 'ReducerOptions': return $root.tflite.ReducerOptions.decodeText(reader, json);
  448. case 'SubOptions': return $root.tflite.SubOptions.decodeText(reader, json);
  449. case 'DivOptions': return $root.tflite.DivOptions.decodeText(reader, json);
  450. case 'SqueezeOptions': return $root.tflite.SqueezeOptions.decodeText(reader, json);
  451. case 'SequenceRNNOptions': return $root.tflite.SequenceRNNOptions.decodeText(reader, json);
  452. case 'StridedSliceOptions': return $root.tflite.StridedSliceOptions.decodeText(reader, json);
  453. case 'ExpOptions': return $root.tflite.ExpOptions.decodeText(reader, json);
  454. case 'TopKV2Options': return $root.tflite.TopKV2Options.decodeText(reader, json);
  455. case 'SplitOptions': return $root.tflite.SplitOptions.decodeText(reader, json);
  456. case 'LogSoftmaxOptions': return $root.tflite.LogSoftmaxOptions.decodeText(reader, json);
  457. case 'CastOptions': return $root.tflite.CastOptions.decodeText(reader, json);
  458. case 'DequantizeOptions': return $root.tflite.DequantizeOptions.decodeText(reader, json);
  459. case 'MaximumMinimumOptions': return $root.tflite.MaximumMinimumOptions.decodeText(reader, json);
  460. case 'ArgMaxOptions': return $root.tflite.ArgMaxOptions.decodeText(reader, json);
  461. case 'LessOptions': return $root.tflite.LessOptions.decodeText(reader, json);
  462. case 'NegOptions': return $root.tflite.NegOptions.decodeText(reader, json);
  463. case 'PadV2Options': return $root.tflite.PadV2Options.decodeText(reader, json);
  464. case 'GreaterOptions': return $root.tflite.GreaterOptions.decodeText(reader, json);
  465. case 'GreaterEqualOptions': return $root.tflite.GreaterEqualOptions.decodeText(reader, json);
  466. case 'LessEqualOptions': return $root.tflite.LessEqualOptions.decodeText(reader, json);
  467. case 'SelectOptions': return $root.tflite.SelectOptions.decodeText(reader, json);
  468. case 'SliceOptions': return $root.tflite.SliceOptions.decodeText(reader, json);
  469. case 'TransposeConvOptions': return $root.tflite.TransposeConvOptions.decodeText(reader, json);
  470. case 'SparseToDenseOptions': return $root.tflite.SparseToDenseOptions.decodeText(reader, json);
  471. case 'TileOptions': return $root.tflite.TileOptions.decodeText(reader, json);
  472. case 'ExpandDimsOptions': return $root.tflite.ExpandDimsOptions.decodeText(reader, json);
  473. case 'EqualOptions': return $root.tflite.EqualOptions.decodeText(reader, json);
  474. case 'NotEqualOptions': return $root.tflite.NotEqualOptions.decodeText(reader, json);
  475. case 'ShapeOptions': return $root.tflite.ShapeOptions.decodeText(reader, json);
  476. case 'PowOptions': return $root.tflite.PowOptions.decodeText(reader, json);
  477. case 'ArgMinOptions': return $root.tflite.ArgMinOptions.decodeText(reader, json);
  478. case 'FakeQuantOptions': return $root.tflite.FakeQuantOptions.decodeText(reader, json);
  479. case 'PackOptions': return $root.tflite.PackOptions.decodeText(reader, json);
  480. case 'LogicalOrOptions': return $root.tflite.LogicalOrOptions.decodeText(reader, json);
  481. case 'OneHotOptions': return $root.tflite.OneHotOptions.decodeText(reader, json);
  482. case 'LogicalAndOptions': return $root.tflite.LogicalAndOptions.decodeText(reader, json);
  483. case 'LogicalNotOptions': return $root.tflite.LogicalNotOptions.decodeText(reader, json);
  484. case 'UnpackOptions': return $root.tflite.UnpackOptions.decodeText(reader, json);
  485. case 'FloorDivOptions': return $root.tflite.FloorDivOptions.decodeText(reader, json);
  486. case 'SquareOptions': return $root.tflite.SquareOptions.decodeText(reader, json);
  487. case 'ZerosLikeOptions': return $root.tflite.ZerosLikeOptions.decodeText(reader, json);
  488. case 'FillOptions': return $root.tflite.FillOptions.decodeText(reader, json);
  489. case 'BidirectionalSequenceLSTMOptions': return $root.tflite.BidirectionalSequenceLSTMOptions.decodeText(reader, json);
  490. case 'BidirectionalSequenceRNNOptions': return $root.tflite.BidirectionalSequenceRNNOptions.decodeText(reader, json);
  491. case 'UnidirectionalSequenceLSTMOptions': return $root.tflite.UnidirectionalSequenceLSTMOptions.decodeText(reader, json);
  492. case 'FloorModOptions': return $root.tflite.FloorModOptions.decodeText(reader, json);
  493. case 'RangeOptions': return $root.tflite.RangeOptions.decodeText(reader, json);
  494. case 'ResizeNearestNeighborOptions': return $root.tflite.ResizeNearestNeighborOptions.decodeText(reader, json);
  495. case 'LeakyReluOptions': return $root.tflite.LeakyReluOptions.decodeText(reader, json);
  496. case 'SquaredDifferenceOptions': return $root.tflite.SquaredDifferenceOptions.decodeText(reader, json);
  497. case 'MirrorPadOptions': return $root.tflite.MirrorPadOptions.decodeText(reader, json);
  498. case 'AbsOptions': return $root.tflite.AbsOptions.decodeText(reader, json);
  499. case 'SplitVOptions': return $root.tflite.SplitVOptions.decodeText(reader, json);
  500. case 'UniqueOptions': return $root.tflite.UniqueOptions.decodeText(reader, json);
  501. case 'ReverseV2Options': return $root.tflite.ReverseV2Options.decodeText(reader, json);
  502. case 'AddNOptions': return $root.tflite.AddNOptions.decodeText(reader, json);
  503. case 'GatherNdOptions': return $root.tflite.GatherNdOptions.decodeText(reader, json);
  504. case 'CosOptions': return $root.tflite.CosOptions.decodeText(reader, json);
  505. case 'WhereOptions': return $root.tflite.WhereOptions.decodeText(reader, json);
  506. case 'RankOptions': return $root.tflite.RankOptions.decodeText(reader, json);
  507. case 'ReverseSequenceOptions': return $root.tflite.ReverseSequenceOptions.decodeText(reader, json);
  508. case 'MatrixDiagOptions': return $root.tflite.MatrixDiagOptions.decodeText(reader, json);
  509. case 'QuantizeOptions': return $root.tflite.QuantizeOptions.decodeText(reader, json);
  510. case 'MatrixSetDiagOptions': return $root.tflite.MatrixSetDiagOptions.decodeText(reader, json);
  511. case 'HardSwishOptions': return $root.tflite.HardSwishOptions.decodeText(reader, json);
  512. case 'IfOptions': return $root.tflite.IfOptions.decodeText(reader, json);
  513. case 'WhileOptions': return $root.tflite.WhileOptions.decodeText(reader, json);
  514. case 'DepthToSpaceOptions': return $root.tflite.DepthToSpaceOptions.decodeText(reader, json);
  515. case 'NonMaxSuppressionV4Options': return $root.tflite.NonMaxSuppressionV4Options.decodeText(reader, json);
  516. case 'NonMaxSuppressionV5Options': return $root.tflite.NonMaxSuppressionV5Options.decodeText(reader, json);
  517. case 'ScatterNdOptions': return $root.tflite.ScatterNdOptions.decodeText(reader, json);
  518. case 'SelectV2Options': return $root.tflite.SelectV2Options.decodeText(reader, json);
  519. case 'DensifyOptions': return $root.tflite.DensifyOptions.decodeText(reader, json);
  520. case 'SegmentSumOptions': return $root.tflite.SegmentSumOptions.decodeText(reader, json);
  521. case 'BatchMatMulOptions': return $root.tflite.BatchMatMulOptions.decodeText(reader, json);
  522. }
  523. return undefined;
  524. }
  525. };
  526. $root.tflite.Padding = {
  527. SAME: 0,
  528. VALID: 1
  529. };
  530. $root.tflite.ActivationFunctionType = {
  531. NONE: 0,
  532. RELU: 1,
  533. RELU_N1_TO_1: 2,
  534. RELU6: 3,
  535. TANH: 4,
  536. SIGN_BIT: 5
  537. };
  538. $root.tflite.Conv2DOptions = class Conv2DOptions {
  539. static decode(reader, position) {
  540. const $ = new $root.tflite.Conv2DOptions();
  541. $.padding = reader.int8_(position, 4, 0);
  542. $.stride_w = reader.int32_(position, 6, 0);
  543. $.stride_h = reader.int32_(position, 8, 0);
  544. $.fused_activation_function = reader.int8_(position, 10, 0);
  545. $.dilation_w_factor = reader.int32_(position, 12, 1);
  546. $.dilation_h_factor = reader.int32_(position, 14, 1);
  547. return $;
  548. }
  549. static decodeText(reader, json) {
  550. const $ = new $root.tflite.Conv2DOptions();
  551. $.padding = $root.tflite.Padding[json.padding];
  552. $.stride_w = reader.value(json.stride_w, 0);
  553. $.stride_h = reader.value(json.stride_h, 0);
  554. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  555. $.dilation_w_factor = reader.value(json.dilation_w_factor, 1);
  556. $.dilation_h_factor = reader.value(json.dilation_h_factor, 1);
  557. return $;
  558. }
  559. };
  560. $root.tflite.Pool2DOptions = class Pool2DOptions {
  561. static decode(reader, position) {
  562. const $ = new $root.tflite.Pool2DOptions();
  563. $.padding = reader.int8_(position, 4, 0);
  564. $.stride_w = reader.int32_(position, 6, 0);
  565. $.stride_h = reader.int32_(position, 8, 0);
  566. $.filter_width = reader.int32_(position, 10, 0);
  567. $.filter_height = reader.int32_(position, 12, 0);
  568. $.fused_activation_function = reader.int8_(position, 14, 0);
  569. return $;
  570. }
  571. static decodeText(reader, json) {
  572. const $ = new $root.tflite.Pool2DOptions();
  573. $.padding = $root.tflite.Padding[json.padding];
  574. $.stride_w = reader.value(json.stride_w, 0);
  575. $.stride_h = reader.value(json.stride_h, 0);
  576. $.filter_width = reader.value(json.filter_width, 0);
  577. $.filter_height = reader.value(json.filter_height, 0);
  578. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  579. return $;
  580. }
  581. };
  582. $root.tflite.DepthwiseConv2DOptions = class DepthwiseConv2DOptions {
  583. static decode(reader, position) {
  584. const $ = new $root.tflite.DepthwiseConv2DOptions();
  585. $.padding = reader.int8_(position, 4, 0);
  586. $.stride_w = reader.int32_(position, 6, 0);
  587. $.stride_h = reader.int32_(position, 8, 0);
  588. $.depth_multiplier = reader.int32_(position, 10, 0);
  589. $.fused_activation_function = reader.int8_(position, 12, 0);
  590. $.dilation_w_factor = reader.int32_(position, 14, 1);
  591. $.dilation_h_factor = reader.int32_(position, 16, 1);
  592. return $;
  593. }
  594. static decodeText(reader, json) {
  595. const $ = new $root.tflite.DepthwiseConv2DOptions();
  596. $.padding = $root.tflite.Padding[json.padding];
  597. $.stride_w = reader.value(json.stride_w, 0);
  598. $.stride_h = reader.value(json.stride_h, 0);
  599. $.depth_multiplier = reader.value(json.depth_multiplier, 0);
  600. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  601. $.dilation_w_factor = reader.value(json.dilation_w_factor, 1);
  602. $.dilation_h_factor = reader.value(json.dilation_h_factor, 1);
  603. return $;
  604. }
  605. };
  606. $root.tflite.ConcatEmbeddingsOptions = class ConcatEmbeddingsOptions {
  607. static decode(reader, position) {
  608. const $ = new $root.tflite.ConcatEmbeddingsOptions();
  609. $.num_channels = reader.int32_(position, 4, 0);
  610. $.num_columns_per_channel = reader.typedArray(position, 6, Int32Array);
  611. $.embedding_dim_per_channel = reader.typedArray(position, 8, Int32Array);
  612. return $;
  613. }
  614. static decodeText(reader, json) {
  615. const $ = new $root.tflite.ConcatEmbeddingsOptions();
  616. $.num_channels = reader.value(json.num_channels, 0);
  617. $.num_columns_per_channel = reader.typedArray(json.num_columns_per_channel, Int32Array);
  618. $.embedding_dim_per_channel = reader.typedArray(json.embedding_dim_per_channel, Int32Array);
  619. return $;
  620. }
  621. };
  622. $root.tflite.LSHProjectionType = {
  623. UNKNOWN: 0,
  624. SPARSE: 1,
  625. DENSE: 2
  626. };
  627. $root.tflite.LSHProjectionOptions = class LSHProjectionOptions {
  628. static decode(reader, position) {
  629. const $ = new $root.tflite.LSHProjectionOptions();
  630. $.type = reader.int8_(position, 4, 0);
  631. return $;
  632. }
  633. static decodeText(reader, json) {
  634. const $ = new $root.tflite.LSHProjectionOptions();
  635. $.type = $root.tflite.LSHProjectionType[json.type];
  636. return $;
  637. }
  638. };
  639. $root.tflite.SVDFOptions = class SVDFOptions {
  640. static decode(reader, position) {
  641. const $ = new $root.tflite.SVDFOptions();
  642. $.rank = reader.int32_(position, 4, 0);
  643. $.fused_activation_function = reader.int8_(position, 6, 0);
  644. $.asymmetric_quantize_inputs = reader.bool_(position, 8, false);
  645. return $;
  646. }
  647. static decodeText(reader, json) {
  648. const $ = new $root.tflite.SVDFOptions();
  649. $.rank = reader.value(json.rank, 0);
  650. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  651. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  652. return $;
  653. }
  654. };
  655. $root.tflite.RNNOptions = class RNNOptions {
  656. static decode(reader, position) {
  657. const $ = new $root.tflite.RNNOptions();
  658. $.fused_activation_function = reader.int8_(position, 4, 0);
  659. $.asymmetric_quantize_inputs = reader.bool_(position, 6, false);
  660. return $;
  661. }
  662. static decodeText(reader, json) {
  663. const $ = new $root.tflite.RNNOptions();
  664. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  665. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  666. return $;
  667. }
  668. };
  669. $root.tflite.SequenceRNNOptions = class SequenceRNNOptions {
  670. static decode(reader, position) {
  671. const $ = new $root.tflite.SequenceRNNOptions();
  672. $.time_major = reader.bool_(position, 4, false);
  673. $.fused_activation_function = reader.int8_(position, 6, 0);
  674. $.asymmetric_quantize_inputs = reader.bool_(position, 8, false);
  675. return $;
  676. }
  677. static decodeText(reader, json) {
  678. const $ = new $root.tflite.SequenceRNNOptions();
  679. $.time_major = reader.value(json.time_major, false);
  680. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  681. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  682. return $;
  683. }
  684. };
  685. $root.tflite.BidirectionalSequenceRNNOptions = class BidirectionalSequenceRNNOptions {
  686. static decode(reader, position) {
  687. const $ = new $root.tflite.BidirectionalSequenceRNNOptions();
  688. $.time_major = reader.bool_(position, 4, false);
  689. $.fused_activation_function = reader.int8_(position, 6, 0);
  690. $.merge_outputs = reader.bool_(position, 8, false);
  691. $.asymmetric_quantize_inputs = reader.bool_(position, 10, false);
  692. return $;
  693. }
  694. static decodeText(reader, json) {
  695. const $ = new $root.tflite.BidirectionalSequenceRNNOptions();
  696. $.time_major = reader.value(json.time_major, false);
  697. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  698. $.merge_outputs = reader.value(json.merge_outputs, false);
  699. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  700. return $;
  701. }
  702. };
  703. $root.tflite.FullyConnectedOptionsWeightsFormat = {
  704. DEFAULT: 0,
  705. SHUFFLED4x16INT8: 1
  706. };
  707. $root.tflite.FullyConnectedOptions = class FullyConnectedOptions {
  708. static decode(reader, position) {
  709. const $ = new $root.tflite.FullyConnectedOptions();
  710. $.fused_activation_function = reader.int8_(position, 4, 0);
  711. $.weights_format = reader.int8_(position, 6, 0);
  712. $.keep_num_dims = reader.bool_(position, 8, false);
  713. $.asymmetric_quantize_inputs = reader.bool_(position, 10, false);
  714. return $;
  715. }
  716. static decodeText(reader, json) {
  717. const $ = new $root.tflite.FullyConnectedOptions();
  718. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  719. $.weights_format = $root.tflite.FullyConnectedOptionsWeightsFormat[json.weights_format];
  720. $.keep_num_dims = reader.value(json.keep_num_dims, false);
  721. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  722. return $;
  723. }
  724. };
  725. $root.tflite.SoftmaxOptions = class SoftmaxOptions {
  726. static decode(reader, position) {
  727. const $ = new $root.tflite.SoftmaxOptions();
  728. $.beta = reader.float32_(position, 4, 0);
  729. return $;
  730. }
  731. static decodeText(reader, json) {
  732. const $ = new $root.tflite.SoftmaxOptions();
  733. $.beta = reader.value(json.beta, 0);
  734. return $;
  735. }
  736. };
  737. $root.tflite.ConcatenationOptions = class ConcatenationOptions {
  738. static decode(reader, position) {
  739. const $ = new $root.tflite.ConcatenationOptions();
  740. $.axis = reader.int32_(position, 4, 0);
  741. $.fused_activation_function = reader.int8_(position, 6, 0);
  742. return $;
  743. }
  744. static decodeText(reader, json) {
  745. const $ = new $root.tflite.ConcatenationOptions();
  746. $.axis = reader.value(json.axis, 0);
  747. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  748. return $;
  749. }
  750. };
  751. $root.tflite.AddOptions = class AddOptions {
  752. static decode(reader, position) {
  753. const $ = new $root.tflite.AddOptions();
  754. $.fused_activation_function = reader.int8_(position, 4, 0);
  755. $.pot_scale_int16 = reader.bool_(position, 6, true);
  756. return $;
  757. }
  758. static decodeText(reader, json) {
  759. const $ = new $root.tflite.AddOptions();
  760. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  761. $.pot_scale_int16 = reader.value(json.pot_scale_int16, true);
  762. return $;
  763. }
  764. };
  765. $root.tflite.MulOptions = class MulOptions {
  766. static decode(reader, position) {
  767. const $ = new $root.tflite.MulOptions();
  768. $.fused_activation_function = reader.int8_(position, 4, 0);
  769. return $;
  770. }
  771. static decodeText(reader, json) {
  772. const $ = new $root.tflite.MulOptions();
  773. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  774. return $;
  775. }
  776. };
  777. $root.tflite.L2NormOptions = class L2NormOptions {
  778. static decode(reader, position) {
  779. const $ = new $root.tflite.L2NormOptions();
  780. $.fused_activation_function = reader.int8_(position, 4, 0);
  781. return $;
  782. }
  783. static decodeText(reader, json) {
  784. const $ = new $root.tflite.L2NormOptions();
  785. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  786. return $;
  787. }
  788. };
  789. $root.tflite.LocalResponseNormalizationOptions = class LocalResponseNormalizationOptions {
  790. static decode(reader, position) {
  791. const $ = new $root.tflite.LocalResponseNormalizationOptions();
  792. $.radius = reader.int32_(position, 4, 0);
  793. $.bias = reader.float32_(position, 6, 0);
  794. $.alpha = reader.float32_(position, 8, 0);
  795. $.beta = reader.float32_(position, 10, 0);
  796. return $;
  797. }
  798. static decodeText(reader, json) {
  799. const $ = new $root.tflite.LocalResponseNormalizationOptions();
  800. $.radius = reader.value(json.radius, 0);
  801. $.bias = reader.value(json.bias, 0);
  802. $.alpha = reader.value(json.alpha, 0);
  803. $.beta = reader.value(json.beta, 0);
  804. return $;
  805. }
  806. };
  807. $root.tflite.LSTMKernelType = {
  808. FULL: 0,
  809. BASIC: 1
  810. };
  811. $root.tflite.LSTMOptions = class LSTMOptions {
  812. static decode(reader, position) {
  813. const $ = new $root.tflite.LSTMOptions();
  814. $.fused_activation_function = reader.int8_(position, 4, 0);
  815. $.cell_clip = reader.float32_(position, 6, 0);
  816. $.proj_clip = reader.float32_(position, 8, 0);
  817. $.kernel_type = reader.int8_(position, 10, 0);
  818. $.asymmetric_quantize_inputs = reader.bool_(position, 12, false);
  819. return $;
  820. }
  821. static decodeText(reader, json) {
  822. const $ = new $root.tflite.LSTMOptions();
  823. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  824. $.cell_clip = reader.value(json.cell_clip, 0);
  825. $.proj_clip = reader.value(json.proj_clip, 0);
  826. $.kernel_type = $root.tflite.LSTMKernelType[json.kernel_type];
  827. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  828. return $;
  829. }
  830. };
  831. $root.tflite.UnidirectionalSequenceLSTMOptions = class UnidirectionalSequenceLSTMOptions {
  832. static decode(reader, position) {
  833. const $ = new $root.tflite.UnidirectionalSequenceLSTMOptions();
  834. $.fused_activation_function = reader.int8_(position, 4, 0);
  835. $.cell_clip = reader.float32_(position, 6, 0);
  836. $.proj_clip = reader.float32_(position, 8, 0);
  837. $.time_major = reader.bool_(position, 10, false);
  838. $.asymmetric_quantize_inputs = reader.bool_(position, 12, false);
  839. return $;
  840. }
  841. static decodeText(reader, json) {
  842. const $ = new $root.tflite.UnidirectionalSequenceLSTMOptions();
  843. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  844. $.cell_clip = reader.value(json.cell_clip, 0);
  845. $.proj_clip = reader.value(json.proj_clip, 0);
  846. $.time_major = reader.value(json.time_major, false);
  847. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  848. return $;
  849. }
  850. };
  851. $root.tflite.BidirectionalSequenceLSTMOptions = class BidirectionalSequenceLSTMOptions {
  852. static decode(reader, position) {
  853. const $ = new $root.tflite.BidirectionalSequenceLSTMOptions();
  854. $.fused_activation_function = reader.int8_(position, 4, 0);
  855. $.cell_clip = reader.float32_(position, 6, 0);
  856. $.proj_clip = reader.float32_(position, 8, 0);
  857. $.merge_outputs = reader.bool_(position, 10, false);
  858. $.time_major = reader.bool_(position, 12, true);
  859. $.asymmetric_quantize_inputs = reader.bool_(position, 14, false);
  860. return $;
  861. }
  862. static decodeText(reader, json) {
  863. const $ = new $root.tflite.BidirectionalSequenceLSTMOptions();
  864. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  865. $.cell_clip = reader.value(json.cell_clip, 0);
  866. $.proj_clip = reader.value(json.proj_clip, 0);
  867. $.merge_outputs = reader.value(json.merge_outputs, false);
  868. $.time_major = reader.value(json.time_major, true);
  869. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  870. return $;
  871. }
  872. };
  873. $root.tflite.ResizeBilinearOptions = class ResizeBilinearOptions {
  874. static decode(reader, position) {
  875. const $ = new $root.tflite.ResizeBilinearOptions();
  876. $.new_height = reader.int32_(position, 4, 0);
  877. $.new_width = reader.int32_(position, 6, 0);
  878. $.align_corners = reader.bool_(position, 8, false);
  879. $.half_pixel_centers = reader.bool_(position, 10, false);
  880. return $;
  881. }
  882. static decodeText(reader, json) {
  883. const $ = new $root.tflite.ResizeBilinearOptions();
  884. $.new_height = reader.value(json.new_height, 0);
  885. $.new_width = reader.value(json.new_width, 0);
  886. $.align_corners = reader.value(json.align_corners, false);
  887. $.half_pixel_centers = reader.value(json.half_pixel_centers, false);
  888. return $;
  889. }
  890. };
  891. $root.tflite.ResizeNearestNeighborOptions = class ResizeNearestNeighborOptions {
  892. static decode(reader, position) {
  893. const $ = new $root.tflite.ResizeNearestNeighborOptions();
  894. $.align_corners = reader.bool_(position, 4, false);
  895. $.half_pixel_centers = reader.bool_(position, 6, false);
  896. return $;
  897. }
  898. static decodeText(reader, json) {
  899. const $ = new $root.tflite.ResizeNearestNeighborOptions();
  900. $.align_corners = reader.value(json.align_corners, false);
  901. $.half_pixel_centers = reader.value(json.half_pixel_centers, false);
  902. return $;
  903. }
  904. };
  905. $root.tflite.CallOptions = class CallOptions {
  906. static decode(reader, position) {
  907. const $ = new $root.tflite.CallOptions();
  908. $.subgraph = reader.uint32_(position, 4, 0);
  909. return $;
  910. }
  911. static decodeText(reader, json) {
  912. const $ = new $root.tflite.CallOptions();
  913. $.subgraph = reader.value(json.subgraph, 0);
  914. return $;
  915. }
  916. };
  917. $root.tflite.PadOptions = class PadOptions {
  918. static decode(reader, position) {
  919. const $ = new $root.tflite.PadOptions();
  920. return $;
  921. }
  922. static decodeText(reader, json) {
  923. const $ = new $root.tflite.PadOptions();
  924. return $;
  925. }
  926. };
  927. $root.tflite.PadV2Options = class PadV2Options {
  928. static decode(reader, position) {
  929. const $ = new $root.tflite.PadV2Options();
  930. return $;
  931. }
  932. static decodeText(reader, json) {
  933. const $ = new $root.tflite.PadV2Options();
  934. return $;
  935. }
  936. };
  937. $root.tflite.ReshapeOptions = class ReshapeOptions {
  938. static decode(reader, position) {
  939. const $ = new $root.tflite.ReshapeOptions();
  940. $.new_shape = reader.typedArray(position, 4, Int32Array);
  941. return $;
  942. }
  943. static decodeText(reader, json) {
  944. const $ = new $root.tflite.ReshapeOptions();
  945. $.new_shape = reader.typedArray(json.new_shape, Int32Array);
  946. return $;
  947. }
  948. };
  949. $root.tflite.SpaceToBatchNDOptions = class SpaceToBatchNDOptions {
  950. static decode(reader, position) {
  951. const $ = new $root.tflite.SpaceToBatchNDOptions();
  952. return $;
  953. }
  954. static decodeText(reader, json) {
  955. const $ = new $root.tflite.SpaceToBatchNDOptions();
  956. return $;
  957. }
  958. };
  959. $root.tflite.BatchToSpaceNDOptions = class BatchToSpaceNDOptions {
  960. static decode(reader, position) {
  961. const $ = new $root.tflite.BatchToSpaceNDOptions();
  962. return $;
  963. }
  964. static decodeText(reader, json) {
  965. const $ = new $root.tflite.BatchToSpaceNDOptions();
  966. return $;
  967. }
  968. };
  969. $root.tflite.SkipGramOptions = class SkipGramOptions {
  970. static decode(reader, position) {
  971. const $ = new $root.tflite.SkipGramOptions();
  972. $.ngram_size = reader.int32_(position, 4, 0);
  973. $.max_skip_size = reader.int32_(position, 6, 0);
  974. $.include_all_ngrams = reader.bool_(position, 8, false);
  975. return $;
  976. }
  977. static decodeText(reader, json) {
  978. const $ = new $root.tflite.SkipGramOptions();
  979. $.ngram_size = reader.value(json.ngram_size, 0);
  980. $.max_skip_size = reader.value(json.max_skip_size, 0);
  981. $.include_all_ngrams = reader.value(json.include_all_ngrams, false);
  982. return $;
  983. }
  984. };
  985. $root.tflite.SpaceToDepthOptions = class SpaceToDepthOptions {
  986. static decode(reader, position) {
  987. const $ = new $root.tflite.SpaceToDepthOptions();
  988. $.block_size = reader.int32_(position, 4, 0);
  989. return $;
  990. }
  991. static decodeText(reader, json) {
  992. const $ = new $root.tflite.SpaceToDepthOptions();
  993. $.block_size = reader.value(json.block_size, 0);
  994. return $;
  995. }
  996. };
  997. $root.tflite.DepthToSpaceOptions = class DepthToSpaceOptions {
  998. static decode(reader, position) {
  999. const $ = new $root.tflite.DepthToSpaceOptions();
  1000. $.block_size = reader.int32_(position, 4, 0);
  1001. return $;
  1002. }
  1003. static decodeText(reader, json) {
  1004. const $ = new $root.tflite.DepthToSpaceOptions();
  1005. $.block_size = reader.value(json.block_size, 0);
  1006. return $;
  1007. }
  1008. };
  1009. $root.tflite.SubOptions = class SubOptions {
  1010. static decode(reader, position) {
  1011. const $ = new $root.tflite.SubOptions();
  1012. $.fused_activation_function = reader.int8_(position, 4, 0);
  1013. $.pot_scale_int16 = reader.bool_(position, 6, true);
  1014. return $;
  1015. }
  1016. static decodeText(reader, json) {
  1017. const $ = new $root.tflite.SubOptions();
  1018. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  1019. $.pot_scale_int16 = reader.value(json.pot_scale_int16, true);
  1020. return $;
  1021. }
  1022. };
  1023. $root.tflite.DivOptions = class DivOptions {
  1024. static decode(reader, position) {
  1025. const $ = new $root.tflite.DivOptions();
  1026. $.fused_activation_function = reader.int8_(position, 4, 0);
  1027. return $;
  1028. }
  1029. static decodeText(reader, json) {
  1030. const $ = new $root.tflite.DivOptions();
  1031. $.fused_activation_function = $root.tflite.ActivationFunctionType[json.fused_activation_function];
  1032. return $;
  1033. }
  1034. };
  1035. $root.tflite.TopKV2Options = class TopKV2Options {
  1036. static decode(reader, position) {
  1037. const $ = new $root.tflite.TopKV2Options();
  1038. return $;
  1039. }
  1040. static decodeText(reader, json) {
  1041. const $ = new $root.tflite.TopKV2Options();
  1042. return $;
  1043. }
  1044. };
  1045. $root.tflite.CombinerType = {
  1046. SUM: 0,
  1047. MEAN: 1,
  1048. SQRTN: 2
  1049. };
  1050. $root.tflite.EmbeddingLookupSparseOptions = class EmbeddingLookupSparseOptions {
  1051. static decode(reader, position) {
  1052. const $ = new $root.tflite.EmbeddingLookupSparseOptions();
  1053. $.combiner = reader.int8_(position, 4, 0);
  1054. return $;
  1055. }
  1056. static decodeText(reader, json) {
  1057. const $ = new $root.tflite.EmbeddingLookupSparseOptions();
  1058. $.combiner = $root.tflite.CombinerType[json.combiner];
  1059. return $;
  1060. }
  1061. };
  1062. $root.tflite.GatherOptions = class GatherOptions {
  1063. static decode(reader, position) {
  1064. const $ = new $root.tflite.GatherOptions();
  1065. $.axis = reader.int32_(position, 4, 0);
  1066. return $;
  1067. }
  1068. static decodeText(reader, json) {
  1069. const $ = new $root.tflite.GatherOptions();
  1070. $.axis = reader.value(json.axis, 0);
  1071. return $;
  1072. }
  1073. };
  1074. $root.tflite.TransposeOptions = class TransposeOptions {
  1075. static decode(reader, position) {
  1076. const $ = new $root.tflite.TransposeOptions();
  1077. return $;
  1078. }
  1079. static decodeText(reader, json) {
  1080. const $ = new $root.tflite.TransposeOptions();
  1081. return $;
  1082. }
  1083. };
  1084. $root.tflite.ExpOptions = class ExpOptions {
  1085. static decode(reader, position) {
  1086. const $ = new $root.tflite.ExpOptions();
  1087. return $;
  1088. }
  1089. static decodeText(reader, json) {
  1090. const $ = new $root.tflite.ExpOptions();
  1091. return $;
  1092. }
  1093. };
  1094. $root.tflite.CosOptions = class CosOptions {
  1095. static decode(reader, position) {
  1096. const $ = new $root.tflite.CosOptions();
  1097. return $;
  1098. }
  1099. static decodeText(reader, json) {
  1100. const $ = new $root.tflite.CosOptions();
  1101. return $;
  1102. }
  1103. };
  1104. $root.tflite.ReducerOptions = class ReducerOptions {
  1105. static decode(reader, position) {
  1106. const $ = new $root.tflite.ReducerOptions();
  1107. $.keep_dims = reader.bool_(position, 4, false);
  1108. return $;
  1109. }
  1110. static decodeText(reader, json) {
  1111. const $ = new $root.tflite.ReducerOptions();
  1112. $.keep_dims = reader.value(json.keep_dims, false);
  1113. return $;
  1114. }
  1115. };
  1116. $root.tflite.SqueezeOptions = class SqueezeOptions {
  1117. static decode(reader, position) {
  1118. const $ = new $root.tflite.SqueezeOptions();
  1119. $.squeeze_dims = reader.typedArray(position, 4, Int32Array);
  1120. return $;
  1121. }
  1122. static decodeText(reader, json) {
  1123. const $ = new $root.tflite.SqueezeOptions();
  1124. $.squeeze_dims = reader.typedArray(json.squeeze_dims, Int32Array);
  1125. return $;
  1126. }
  1127. };
  1128. $root.tflite.SplitOptions = class SplitOptions {
  1129. static decode(reader, position) {
  1130. const $ = new $root.tflite.SplitOptions();
  1131. $.num_splits = reader.int32_(position, 4, 0);
  1132. return $;
  1133. }
  1134. static decodeText(reader, json) {
  1135. const $ = new $root.tflite.SplitOptions();
  1136. $.num_splits = reader.value(json.num_splits, 0);
  1137. return $;
  1138. }
  1139. };
  1140. $root.tflite.SplitVOptions = class SplitVOptions {
  1141. static decode(reader, position) {
  1142. const $ = new $root.tflite.SplitVOptions();
  1143. $.num_splits = reader.int32_(position, 4, 0);
  1144. return $;
  1145. }
  1146. static decodeText(reader, json) {
  1147. const $ = new $root.tflite.SplitVOptions();
  1148. $.num_splits = reader.value(json.num_splits, 0);
  1149. return $;
  1150. }
  1151. };
  1152. $root.tflite.StridedSliceOptions = class StridedSliceOptions {
  1153. static decode(reader, position) {
  1154. const $ = new $root.tflite.StridedSliceOptions();
  1155. $.begin_mask = reader.int32_(position, 4, 0);
  1156. $.end_mask = reader.int32_(position, 6, 0);
  1157. $.ellipsis_mask = reader.int32_(position, 8, 0);
  1158. $.new_axis_mask = reader.int32_(position, 10, 0);
  1159. $.shrink_axis_mask = reader.int32_(position, 12, 0);
  1160. return $;
  1161. }
  1162. static decodeText(reader, json) {
  1163. const $ = new $root.tflite.StridedSliceOptions();
  1164. $.begin_mask = reader.value(json.begin_mask, 0);
  1165. $.end_mask = reader.value(json.end_mask, 0);
  1166. $.ellipsis_mask = reader.value(json.ellipsis_mask, 0);
  1167. $.new_axis_mask = reader.value(json.new_axis_mask, 0);
  1168. $.shrink_axis_mask = reader.value(json.shrink_axis_mask, 0);
  1169. return $;
  1170. }
  1171. };
  1172. $root.tflite.LogSoftmaxOptions = class LogSoftmaxOptions {
  1173. static decode(reader, position) {
  1174. const $ = new $root.tflite.LogSoftmaxOptions();
  1175. return $;
  1176. }
  1177. static decodeText(reader, json) {
  1178. const $ = new $root.tflite.LogSoftmaxOptions();
  1179. return $;
  1180. }
  1181. };
  1182. $root.tflite.CastOptions = class CastOptions {
  1183. static decode(reader, position) {
  1184. const $ = new $root.tflite.CastOptions();
  1185. $.in_data_type = reader.int8_(position, 4, 0);
  1186. $.out_data_type = reader.int8_(position, 6, 0);
  1187. return $;
  1188. }
  1189. static decodeText(reader, json) {
  1190. const $ = new $root.tflite.CastOptions();
  1191. $.in_data_type = $root.tflite.TensorType[json.in_data_type];
  1192. $.out_data_type = $root.tflite.TensorType[json.out_data_type];
  1193. return $;
  1194. }
  1195. };
  1196. $root.tflite.DequantizeOptions = class DequantizeOptions {
  1197. static decode(reader, position) {
  1198. const $ = new $root.tflite.DequantizeOptions();
  1199. return $;
  1200. }
  1201. static decodeText(reader, json) {
  1202. const $ = new $root.tflite.DequantizeOptions();
  1203. return $;
  1204. }
  1205. };
  1206. $root.tflite.MaximumMinimumOptions = class MaximumMinimumOptions {
  1207. static decode(reader, position) {
  1208. const $ = new $root.tflite.MaximumMinimumOptions();
  1209. return $;
  1210. }
  1211. static decodeText(reader, json) {
  1212. const $ = new $root.tflite.MaximumMinimumOptions();
  1213. return $;
  1214. }
  1215. };
  1216. $root.tflite.TileOptions = class TileOptions {
  1217. static decode(reader, position) {
  1218. const $ = new $root.tflite.TileOptions();
  1219. return $;
  1220. }
  1221. static decodeText(reader, json) {
  1222. const $ = new $root.tflite.TileOptions();
  1223. return $;
  1224. }
  1225. };
  1226. $root.tflite.ArgMaxOptions = class ArgMaxOptions {
  1227. static decode(reader, position) {
  1228. const $ = new $root.tflite.ArgMaxOptions();
  1229. $.output_type = reader.int8_(position, 4, 0);
  1230. return $;
  1231. }
  1232. static decodeText(reader, json) {
  1233. const $ = new $root.tflite.ArgMaxOptions();
  1234. $.output_type = $root.tflite.TensorType[json.output_type];
  1235. return $;
  1236. }
  1237. };
  1238. $root.tflite.ArgMinOptions = class ArgMinOptions {
  1239. static decode(reader, position) {
  1240. const $ = new $root.tflite.ArgMinOptions();
  1241. $.output_type = reader.int8_(position, 4, 0);
  1242. return $;
  1243. }
  1244. static decodeText(reader, json) {
  1245. const $ = new $root.tflite.ArgMinOptions();
  1246. $.output_type = $root.tflite.TensorType[json.output_type];
  1247. return $;
  1248. }
  1249. };
  1250. $root.tflite.GreaterOptions = class GreaterOptions {
  1251. static decode(reader, position) {
  1252. const $ = new $root.tflite.GreaterOptions();
  1253. return $;
  1254. }
  1255. static decodeText(reader, json) {
  1256. const $ = new $root.tflite.GreaterOptions();
  1257. return $;
  1258. }
  1259. };
  1260. $root.tflite.GreaterEqualOptions = class GreaterEqualOptions {
  1261. static decode(reader, position) {
  1262. const $ = new $root.tflite.GreaterEqualOptions();
  1263. return $;
  1264. }
  1265. static decodeText(reader, json) {
  1266. const $ = new $root.tflite.GreaterEqualOptions();
  1267. return $;
  1268. }
  1269. };
  1270. $root.tflite.LessOptions = class LessOptions {
  1271. static decode(reader, position) {
  1272. const $ = new $root.tflite.LessOptions();
  1273. return $;
  1274. }
  1275. static decodeText(reader, json) {
  1276. const $ = new $root.tflite.LessOptions();
  1277. return $;
  1278. }
  1279. };
  1280. $root.tflite.LessEqualOptions = class LessEqualOptions {
  1281. static decode(reader, position) {
  1282. const $ = new $root.tflite.LessEqualOptions();
  1283. return $;
  1284. }
  1285. static decodeText(reader, json) {
  1286. const $ = new $root.tflite.LessEqualOptions();
  1287. return $;
  1288. }
  1289. };
  1290. $root.tflite.NegOptions = class NegOptions {
  1291. static decode(reader, position) {
  1292. const $ = new $root.tflite.NegOptions();
  1293. return $;
  1294. }
  1295. static decodeText(reader, json) {
  1296. const $ = new $root.tflite.NegOptions();
  1297. return $;
  1298. }
  1299. };
  1300. $root.tflite.SelectOptions = class SelectOptions {
  1301. static decode(reader, position) {
  1302. const $ = new $root.tflite.SelectOptions();
  1303. return $;
  1304. }
  1305. static decodeText(reader, json) {
  1306. const $ = new $root.tflite.SelectOptions();
  1307. return $;
  1308. }
  1309. };
  1310. $root.tflite.SliceOptions = class SliceOptions {
  1311. static decode(reader, position) {
  1312. const $ = new $root.tflite.SliceOptions();
  1313. return $;
  1314. }
  1315. static decodeText(reader, json) {
  1316. const $ = new $root.tflite.SliceOptions();
  1317. return $;
  1318. }
  1319. };
  1320. $root.tflite.TransposeConvOptions = class TransposeConvOptions {
  1321. static decode(reader, position) {
  1322. const $ = new $root.tflite.TransposeConvOptions();
  1323. $.padding = reader.int8_(position, 4, 0);
  1324. $.stride_w = reader.int32_(position, 6, 0);
  1325. $.stride_h = reader.int32_(position, 8, 0);
  1326. return $;
  1327. }
  1328. static decodeText(reader, json) {
  1329. const $ = new $root.tflite.TransposeConvOptions();
  1330. $.padding = $root.tflite.Padding[json.padding];
  1331. $.stride_w = reader.value(json.stride_w, 0);
  1332. $.stride_h = reader.value(json.stride_h, 0);
  1333. return $;
  1334. }
  1335. };
  1336. $root.tflite.ExpandDimsOptions = class ExpandDimsOptions {
  1337. static decode(reader, position) {
  1338. const $ = new $root.tflite.ExpandDimsOptions();
  1339. return $;
  1340. }
  1341. static decodeText(reader, json) {
  1342. const $ = new $root.tflite.ExpandDimsOptions();
  1343. return $;
  1344. }
  1345. };
  1346. $root.tflite.SparseToDenseOptions = class SparseToDenseOptions {
  1347. static decode(reader, position) {
  1348. const $ = new $root.tflite.SparseToDenseOptions();
  1349. $.validate_indices = reader.bool_(position, 4, false);
  1350. return $;
  1351. }
  1352. static decodeText(reader, json) {
  1353. const $ = new $root.tflite.SparseToDenseOptions();
  1354. $.validate_indices = reader.value(json.validate_indices, false);
  1355. return $;
  1356. }
  1357. };
  1358. $root.tflite.EqualOptions = class EqualOptions {
  1359. static decode(reader, position) {
  1360. const $ = new $root.tflite.EqualOptions();
  1361. return $;
  1362. }
  1363. static decodeText(reader, json) {
  1364. const $ = new $root.tflite.EqualOptions();
  1365. return $;
  1366. }
  1367. };
  1368. $root.tflite.NotEqualOptions = class NotEqualOptions {
  1369. static decode(reader, position) {
  1370. const $ = new $root.tflite.NotEqualOptions();
  1371. return $;
  1372. }
  1373. static decodeText(reader, json) {
  1374. const $ = new $root.tflite.NotEqualOptions();
  1375. return $;
  1376. }
  1377. };
  1378. $root.tflite.ShapeOptions = class ShapeOptions {
  1379. static decode(reader, position) {
  1380. const $ = new $root.tflite.ShapeOptions();
  1381. $.out_type = reader.int8_(position, 4, 0);
  1382. return $;
  1383. }
  1384. static decodeText(reader, json) {
  1385. const $ = new $root.tflite.ShapeOptions();
  1386. $.out_type = $root.tflite.TensorType[json.out_type];
  1387. return $;
  1388. }
  1389. };
  1390. $root.tflite.RankOptions = class RankOptions {
  1391. static decode(reader, position) {
  1392. const $ = new $root.tflite.RankOptions();
  1393. return $;
  1394. }
  1395. static decodeText(reader, json) {
  1396. const $ = new $root.tflite.RankOptions();
  1397. return $;
  1398. }
  1399. };
  1400. $root.tflite.PowOptions = class PowOptions {
  1401. static decode(reader, position) {
  1402. const $ = new $root.tflite.PowOptions();
  1403. return $;
  1404. }
  1405. static decodeText(reader, json) {
  1406. const $ = new $root.tflite.PowOptions();
  1407. return $;
  1408. }
  1409. };
  1410. $root.tflite.FakeQuantOptions = class FakeQuantOptions {
  1411. static decode(reader, position) {
  1412. const $ = new $root.tflite.FakeQuantOptions();
  1413. $.min = reader.float32_(position, 4, 0);
  1414. $.max = reader.float32_(position, 6, 0);
  1415. $.num_bits = reader.int32_(position, 8, 0);
  1416. $.narrow_range = reader.bool_(position, 10, false);
  1417. return $;
  1418. }
  1419. static decodeText(reader, json) {
  1420. const $ = new $root.tflite.FakeQuantOptions();
  1421. $.min = reader.value(json.min, 0);
  1422. $.max = reader.value(json.max, 0);
  1423. $.num_bits = reader.value(json.num_bits, 0);
  1424. $.narrow_range = reader.value(json.narrow_range, false);
  1425. return $;
  1426. }
  1427. };
  1428. $root.tflite.PackOptions = class PackOptions {
  1429. static decode(reader, position) {
  1430. const $ = new $root.tflite.PackOptions();
  1431. $.values_count = reader.int32_(position, 4, 0);
  1432. $.axis = reader.int32_(position, 6, 0);
  1433. return $;
  1434. }
  1435. static decodeText(reader, json) {
  1436. const $ = new $root.tflite.PackOptions();
  1437. $.values_count = reader.value(json.values_count, 0);
  1438. $.axis = reader.value(json.axis, 0);
  1439. return $;
  1440. }
  1441. };
  1442. $root.tflite.LogicalOrOptions = class LogicalOrOptions {
  1443. static decode(reader, position) {
  1444. const $ = new $root.tflite.LogicalOrOptions();
  1445. return $;
  1446. }
  1447. static decodeText(reader, json) {
  1448. const $ = new $root.tflite.LogicalOrOptions();
  1449. return $;
  1450. }
  1451. };
  1452. $root.tflite.OneHotOptions = class OneHotOptions {
  1453. static decode(reader, position) {
  1454. const $ = new $root.tflite.OneHotOptions();
  1455. $.axis = reader.int32_(position, 4, 0);
  1456. return $;
  1457. }
  1458. static decodeText(reader, json) {
  1459. const $ = new $root.tflite.OneHotOptions();
  1460. $.axis = reader.value(json.axis, 0);
  1461. return $;
  1462. }
  1463. };
  1464. $root.tflite.AbsOptions = class AbsOptions {
  1465. static decode(reader, position) {
  1466. const $ = new $root.tflite.AbsOptions();
  1467. return $;
  1468. }
  1469. static decodeText(reader, json) {
  1470. const $ = new $root.tflite.AbsOptions();
  1471. return $;
  1472. }
  1473. };
  1474. $root.tflite.HardSwishOptions = class HardSwishOptions {
  1475. static decode(reader, position) {
  1476. const $ = new $root.tflite.HardSwishOptions();
  1477. return $;
  1478. }
  1479. static decodeText(reader, json) {
  1480. const $ = new $root.tflite.HardSwishOptions();
  1481. return $;
  1482. }
  1483. };
  1484. $root.tflite.LogicalAndOptions = class LogicalAndOptions {
  1485. static decode(reader, position) {
  1486. const $ = new $root.tflite.LogicalAndOptions();
  1487. return $;
  1488. }
  1489. static decodeText(reader, json) {
  1490. const $ = new $root.tflite.LogicalAndOptions();
  1491. return $;
  1492. }
  1493. };
  1494. $root.tflite.LogicalNotOptions = class LogicalNotOptions {
  1495. static decode(reader, position) {
  1496. const $ = new $root.tflite.LogicalNotOptions();
  1497. return $;
  1498. }
  1499. static decodeText(reader, json) {
  1500. const $ = new $root.tflite.LogicalNotOptions();
  1501. return $;
  1502. }
  1503. };
  1504. $root.tflite.UnpackOptions = class UnpackOptions {
  1505. static decode(reader, position) {
  1506. const $ = new $root.tflite.UnpackOptions();
  1507. $.num = reader.int32_(position, 4, 0);
  1508. $.axis = reader.int32_(position, 6, 0);
  1509. return $;
  1510. }
  1511. static decodeText(reader, json) {
  1512. const $ = new $root.tflite.UnpackOptions();
  1513. $.num = reader.value(json.num, 0);
  1514. $.axis = reader.value(json.axis, 0);
  1515. return $;
  1516. }
  1517. };
  1518. $root.tflite.FloorDivOptions = class FloorDivOptions {
  1519. static decode(reader, position) {
  1520. const $ = new $root.tflite.FloorDivOptions();
  1521. return $;
  1522. }
  1523. static decodeText(reader, json) {
  1524. const $ = new $root.tflite.FloorDivOptions();
  1525. return $;
  1526. }
  1527. };
  1528. $root.tflite.SquareOptions = class SquareOptions {
  1529. static decode(reader, position) {
  1530. const $ = new $root.tflite.SquareOptions();
  1531. return $;
  1532. }
  1533. static decodeText(reader, json) {
  1534. const $ = new $root.tflite.SquareOptions();
  1535. return $;
  1536. }
  1537. };
  1538. $root.tflite.ZerosLikeOptions = class ZerosLikeOptions {
  1539. static decode(reader, position) {
  1540. const $ = new $root.tflite.ZerosLikeOptions();
  1541. return $;
  1542. }
  1543. static decodeText(reader, json) {
  1544. const $ = new $root.tflite.ZerosLikeOptions();
  1545. return $;
  1546. }
  1547. };
  1548. $root.tflite.FillOptions = class FillOptions {
  1549. static decode(reader, position) {
  1550. const $ = new $root.tflite.FillOptions();
  1551. return $;
  1552. }
  1553. static decodeText(reader, json) {
  1554. const $ = new $root.tflite.FillOptions();
  1555. return $;
  1556. }
  1557. };
  1558. $root.tflite.FloorModOptions = class FloorModOptions {
  1559. static decode(reader, position) {
  1560. const $ = new $root.tflite.FloorModOptions();
  1561. return $;
  1562. }
  1563. static decodeText(reader, json) {
  1564. const $ = new $root.tflite.FloorModOptions();
  1565. return $;
  1566. }
  1567. };
  1568. $root.tflite.RangeOptions = class RangeOptions {
  1569. static decode(reader, position) {
  1570. const $ = new $root.tflite.RangeOptions();
  1571. return $;
  1572. }
  1573. static decodeText(reader, json) {
  1574. const $ = new $root.tflite.RangeOptions();
  1575. return $;
  1576. }
  1577. };
  1578. $root.tflite.LeakyReluOptions = class LeakyReluOptions {
  1579. static decode(reader, position) {
  1580. const $ = new $root.tflite.LeakyReluOptions();
  1581. $.alpha = reader.float32_(position, 4, 0);
  1582. return $;
  1583. }
  1584. static decodeText(reader, json) {
  1585. const $ = new $root.tflite.LeakyReluOptions();
  1586. $.alpha = reader.value(json.alpha, 0);
  1587. return $;
  1588. }
  1589. };
  1590. $root.tflite.SquaredDifferenceOptions = class SquaredDifferenceOptions {
  1591. static decode(reader, position) {
  1592. const $ = new $root.tflite.SquaredDifferenceOptions();
  1593. return $;
  1594. }
  1595. static decodeText(reader, json) {
  1596. const $ = new $root.tflite.SquaredDifferenceOptions();
  1597. return $;
  1598. }
  1599. };
  1600. $root.tflite.MirrorPadMode = {
  1601. REFLECT: 0,
  1602. SYMMETRIC: 1
  1603. };
  1604. $root.tflite.MirrorPadOptions = class MirrorPadOptions {
  1605. static decode(reader, position) {
  1606. const $ = new $root.tflite.MirrorPadOptions();
  1607. $.mode = reader.int8_(position, 4, 0);
  1608. return $;
  1609. }
  1610. static decodeText(reader, json) {
  1611. const $ = new $root.tflite.MirrorPadOptions();
  1612. $.mode = $root.tflite.MirrorPadMode[json.mode];
  1613. return $;
  1614. }
  1615. };
  1616. $root.tflite.UniqueOptions = class UniqueOptions {
  1617. static decode(reader, position) {
  1618. const $ = new $root.tflite.UniqueOptions();
  1619. $.idx_out_type = reader.int8_(position, 4, 2);
  1620. return $;
  1621. }
  1622. static decodeText(reader, json) {
  1623. const $ = new $root.tflite.UniqueOptions();
  1624. $.idx_out_type = $root.tflite.TensorType[json.idx_out_type];
  1625. return $;
  1626. }
  1627. };
  1628. $root.tflite.ReverseV2Options = class ReverseV2Options {
  1629. static decode(reader, position) {
  1630. const $ = new $root.tflite.ReverseV2Options();
  1631. return $;
  1632. }
  1633. static decodeText(reader, json) {
  1634. const $ = new $root.tflite.ReverseV2Options();
  1635. return $;
  1636. }
  1637. };
  1638. $root.tflite.AddNOptions = class AddNOptions {
  1639. static decode(reader, position) {
  1640. const $ = new $root.tflite.AddNOptions();
  1641. return $;
  1642. }
  1643. static decodeText(reader, json) {
  1644. const $ = new $root.tflite.AddNOptions();
  1645. return $;
  1646. }
  1647. };
  1648. $root.tflite.GatherNdOptions = class GatherNdOptions {
  1649. static decode(reader, position) {
  1650. const $ = new $root.tflite.GatherNdOptions();
  1651. return $;
  1652. }
  1653. static decodeText(reader, json) {
  1654. const $ = new $root.tflite.GatherNdOptions();
  1655. return $;
  1656. }
  1657. };
  1658. $root.tflite.WhereOptions = class WhereOptions {
  1659. static decode(reader, position) {
  1660. const $ = new $root.tflite.WhereOptions();
  1661. return $;
  1662. }
  1663. static decodeText(reader, json) {
  1664. const $ = new $root.tflite.WhereOptions();
  1665. return $;
  1666. }
  1667. };
  1668. $root.tflite.ReverseSequenceOptions = class ReverseSequenceOptions {
  1669. static decode(reader, position) {
  1670. const $ = new $root.tflite.ReverseSequenceOptions();
  1671. $.seq_dim = reader.int32_(position, 4, 0);
  1672. $.batch_dim = reader.int32_(position, 6, 0);
  1673. return $;
  1674. }
  1675. static decodeText(reader, json) {
  1676. const $ = new $root.tflite.ReverseSequenceOptions();
  1677. $.seq_dim = reader.value(json.seq_dim, 0);
  1678. $.batch_dim = reader.value(json.batch_dim, 0);
  1679. return $;
  1680. }
  1681. };
  1682. $root.tflite.MatrixDiagOptions = class MatrixDiagOptions {
  1683. static decode(reader, position) {
  1684. const $ = new $root.tflite.MatrixDiagOptions();
  1685. return $;
  1686. }
  1687. static decodeText(reader, json) {
  1688. const $ = new $root.tflite.MatrixDiagOptions();
  1689. return $;
  1690. }
  1691. };
  1692. $root.tflite.QuantizeOptions = class QuantizeOptions {
  1693. static decode(reader, position) {
  1694. const $ = new $root.tflite.QuantizeOptions();
  1695. return $;
  1696. }
  1697. static decodeText(reader, json) {
  1698. const $ = new $root.tflite.QuantizeOptions();
  1699. return $;
  1700. }
  1701. };
  1702. $root.tflite.MatrixSetDiagOptions = class MatrixSetDiagOptions {
  1703. static decode(reader, position) {
  1704. const $ = new $root.tflite.MatrixSetDiagOptions();
  1705. return $;
  1706. }
  1707. static decodeText(reader, json) {
  1708. const $ = new $root.tflite.MatrixSetDiagOptions();
  1709. return $;
  1710. }
  1711. };
  1712. $root.tflite.IfOptions = class IfOptions {
  1713. static decode(reader, position) {
  1714. const $ = new $root.tflite.IfOptions();
  1715. $.then_subgraph_index = reader.int32_(position, 4, 0);
  1716. $.else_subgraph_index = reader.int32_(position, 6, 0);
  1717. return $;
  1718. }
  1719. static decodeText(reader, json) {
  1720. const $ = new $root.tflite.IfOptions();
  1721. $.then_subgraph_index = reader.value(json.then_subgraph_index, 0);
  1722. $.else_subgraph_index = reader.value(json.else_subgraph_index, 0);
  1723. return $;
  1724. }
  1725. };
  1726. $root.tflite.WhileOptions = class WhileOptions {
  1727. static decode(reader, position) {
  1728. const $ = new $root.tflite.WhileOptions();
  1729. $.cond_subgraph_index = reader.int32_(position, 4, 0);
  1730. $.body_subgraph_index = reader.int32_(position, 6, 0);
  1731. return $;
  1732. }
  1733. static decodeText(reader, json) {
  1734. const $ = new $root.tflite.WhileOptions();
  1735. $.cond_subgraph_index = reader.value(json.cond_subgraph_index, 0);
  1736. $.body_subgraph_index = reader.value(json.body_subgraph_index, 0);
  1737. return $;
  1738. }
  1739. };
  1740. $root.tflite.NonMaxSuppressionV4Options = class NonMaxSuppressionV4Options {
  1741. static decode(reader, position) {
  1742. const $ = new $root.tflite.NonMaxSuppressionV4Options();
  1743. return $;
  1744. }
  1745. static decodeText(reader, json) {
  1746. const $ = new $root.tflite.NonMaxSuppressionV4Options();
  1747. return $;
  1748. }
  1749. };
  1750. $root.tflite.NonMaxSuppressionV5Options = class NonMaxSuppressionV5Options {
  1751. static decode(reader, position) {
  1752. const $ = new $root.tflite.NonMaxSuppressionV5Options();
  1753. return $;
  1754. }
  1755. static decodeText(reader, json) {
  1756. const $ = new $root.tflite.NonMaxSuppressionV5Options();
  1757. return $;
  1758. }
  1759. };
  1760. $root.tflite.ScatterNdOptions = class ScatterNdOptions {
  1761. static decode(reader, position) {
  1762. const $ = new $root.tflite.ScatterNdOptions();
  1763. return $;
  1764. }
  1765. static decodeText(reader, json) {
  1766. const $ = new $root.tflite.ScatterNdOptions();
  1767. return $;
  1768. }
  1769. };
  1770. $root.tflite.SelectV2Options = class SelectV2Options {
  1771. static decode(reader, position) {
  1772. const $ = new $root.tflite.SelectV2Options();
  1773. return $;
  1774. }
  1775. static decodeText(reader, json) {
  1776. const $ = new $root.tflite.SelectV2Options();
  1777. return $;
  1778. }
  1779. };
  1780. $root.tflite.DensifyOptions = class DensifyOptions {
  1781. static decode(reader, position) {
  1782. const $ = new $root.tflite.DensifyOptions();
  1783. return $;
  1784. }
  1785. static decodeText(reader, json) {
  1786. const $ = new $root.tflite.DensifyOptions();
  1787. return $;
  1788. }
  1789. };
  1790. $root.tflite.SegmentSumOptions = class SegmentSumOptions {
  1791. static decode(reader, position) {
  1792. const $ = new $root.tflite.SegmentSumOptions();
  1793. return $;
  1794. }
  1795. static decodeText(reader, json) {
  1796. const $ = new $root.tflite.SegmentSumOptions();
  1797. return $;
  1798. }
  1799. };
  1800. $root.tflite.BatchMatMulOptions = class BatchMatMulOptions {
  1801. static decode(reader, position) {
  1802. const $ = new $root.tflite.BatchMatMulOptions();
  1803. $.adj_x = reader.bool_(position, 4, false);
  1804. $.adj_y = reader.bool_(position, 6, false);
  1805. return $;
  1806. }
  1807. static decodeText(reader, json) {
  1808. const $ = new $root.tflite.BatchMatMulOptions();
  1809. $.adj_x = reader.value(json.adj_x, false);
  1810. $.adj_y = reader.value(json.adj_y, false);
  1811. return $;
  1812. }
  1813. };
  1814. $root.tflite.OperatorCode = class OperatorCode {
  1815. static decode(reader, position) {
  1816. const $ = new $root.tflite.OperatorCode();
  1817. $.builtin_code = reader.int8_(position, 4, 0);
  1818. $.custom_code = reader.string_(position, 6, null);
  1819. $.version = reader.int32_(position, 8, 1);
  1820. return $;
  1821. }
  1822. static decodeText(reader, json) {
  1823. const $ = new $root.tflite.OperatorCode();
  1824. $.builtin_code = $root.tflite.BuiltinOperator[json.builtin_code];
  1825. $.custom_code = reader.value(json.custom_code, null);
  1826. $.version = reader.value(json.version, 1);
  1827. return $;
  1828. }
  1829. };
  1830. $root.tflite.CustomOptionsFormat = {
  1831. FLEXBUFFERS: 0
  1832. };
  1833. $root.tflite.Operator = class Operator {
  1834. static decode(reader, position) {
  1835. const $ = new $root.tflite.Operator();
  1836. $.opcode_index = reader.uint32_(position, 4, 0);
  1837. $.inputs = reader.typedArray(position, 6, Int32Array);
  1838. $.outputs = reader.typedArray(position, 8, Int32Array);
  1839. $.builtin_options = reader.union(position, 10, $root.tflite.BuiltinOptions.decode);
  1840. $.custom_options = reader.typedArray(position, 14, Uint8Array);
  1841. $.custom_options_format = reader.int8_(position, 16, 0);
  1842. $.mutating_variable_inputs = reader.bools_(position, 18);
  1843. $.intermediates = reader.typedArray(position, 20, Int32Array);
  1844. return $;
  1845. }
  1846. static decodeText(reader, json) {
  1847. const $ = new $root.tflite.Operator();
  1848. $.opcode_index = reader.value(json.opcode_index, 0);
  1849. $.inputs = reader.typedArray(json.inputs, Int32Array);
  1850. $.outputs = reader.typedArray(json.outputs, Int32Array);
  1851. $.builtin_options = $root.tflite.BuiltinOptions.decodeText(reader, json.builtin_options, json.builtin_options_type);
  1852. $.custom_options = reader.typedArray(json.custom_options, Uint8Array);
  1853. $.custom_options_format = $root.tflite.CustomOptionsFormat[json.custom_options_format];
  1854. $.mutating_variable_inputs = reader.array(json.mutating_variable_inputs);
  1855. $.intermediates = reader.typedArray(json.intermediates, Int32Array);
  1856. return $;
  1857. }
  1858. };
  1859. $root.tflite.SubGraph = class SubGraph {
  1860. static decode(reader, position) {
  1861. const $ = new $root.tflite.SubGraph();
  1862. $.tensors = reader.tableArray(position, 4, $root.tflite.Tensor.decode);
  1863. $.inputs = reader.typedArray(position, 6, Int32Array);
  1864. $.outputs = reader.typedArray(position, 8, Int32Array);
  1865. $.operators = reader.tableArray(position, 10, $root.tflite.Operator.decode);
  1866. $.name = reader.string_(position, 12, null);
  1867. return $;
  1868. }
  1869. static decodeText(reader, json) {
  1870. const $ = new $root.tflite.SubGraph();
  1871. $.tensors = reader.objectArray(json.tensors, $root.tflite.Tensor.decodeText);
  1872. $.inputs = reader.typedArray(json.inputs, Int32Array);
  1873. $.outputs = reader.typedArray(json.outputs, Int32Array);
  1874. $.operators = reader.objectArray(json.operators, $root.tflite.Operator.decodeText);
  1875. $.name = reader.value(json.name, null);
  1876. return $;
  1877. }
  1878. };
  1879. $root.tflite.Buffer = class Buffer {
  1880. static decode(reader, position) {
  1881. const $ = new $root.tflite.Buffer();
  1882. $.data = reader.typedArray(position, 4, Uint8Array);
  1883. return $;
  1884. }
  1885. static decodeText(reader, json) {
  1886. const $ = new $root.tflite.Buffer();
  1887. $.data = reader.typedArray(json.data, Uint8Array);
  1888. return $;
  1889. }
  1890. };
  1891. $root.tflite.Metadata = class Metadata {
  1892. static decode(reader, position) {
  1893. const $ = new $root.tflite.Metadata();
  1894. $.name = reader.string_(position, 4, null);
  1895. $.buffer = reader.uint32_(position, 6, 0);
  1896. return $;
  1897. }
  1898. static decodeText(reader, json) {
  1899. const $ = new $root.tflite.Metadata();
  1900. $.name = reader.value(json.name, null);
  1901. $.buffer = reader.value(json.buffer, 0);
  1902. return $;
  1903. }
  1904. };
  1905. $root.tflite.Model = class Model {
  1906. static identifier(reader) {
  1907. return reader.identifier('TFL3');
  1908. }
  1909. static create(reader) {
  1910. return $root.tflite.Model.decode(reader, reader.root);
  1911. }
  1912. static createText(reader) {
  1913. return $root.tflite.Model.decodeText(reader, reader.root);
  1914. }
  1915. static decode(reader, position) {
  1916. const $ = new $root.tflite.Model();
  1917. $.version = reader.uint32_(position, 4, 0);
  1918. $.operator_codes = reader.tableArray(position, 6, $root.tflite.OperatorCode.decode);
  1919. $.subgraphs = reader.tableArray(position, 8, $root.tflite.SubGraph.decode);
  1920. $.description = reader.string_(position, 10, null);
  1921. $.buffers = reader.tableArray(position, 12, $root.tflite.Buffer.decode);
  1922. $.metadata_buffer = reader.typedArray(position, 14, Int32Array);
  1923. $.metadata = reader.tableArray(position, 16, $root.tflite.Metadata.decode);
  1924. return $;
  1925. }
  1926. static decodeText(reader, json) {
  1927. const $ = new $root.tflite.Model();
  1928. $.version = reader.value(json.version, 0);
  1929. $.operator_codes = reader.objectArray(json.operator_codes, $root.tflite.OperatorCode.decodeText);
  1930. $.subgraphs = reader.objectArray(json.subgraphs, $root.tflite.SubGraph.decodeText);
  1931. $.description = reader.value(json.description, null);
  1932. $.buffers = reader.objectArray(json.buffers, $root.tflite.Buffer.decodeText);
  1933. $.metadata_buffer = reader.typedArray(json.metadata_buffer, Int32Array);
  1934. $.metadata = reader.objectArray(json.metadata, $root.tflite.Metadata.decodeText);
  1935. return $;
  1936. }
  1937. };
  1938. $root.tflite = $root.tflite || {};
  1939. $root.tflite.AssociatedFileType = {
  1940. UNKNOWN: 0,
  1941. DESCRIPTIONS: 1,
  1942. TENSOR_AXIS_LABELS: 2,
  1943. TENSOR_VALUE_LABELS: 3,
  1944. TENSOR_AXIS_SCORE_CALIBRATION: 4,
  1945. VOCABULARY: 5
  1946. };
  1947. $root.tflite.AssociatedFile = class AssociatedFile {
  1948. static decode(reader, position) {
  1949. const $ = new $root.tflite.AssociatedFile();
  1950. $.name = reader.string_(position, 4, null);
  1951. $.description = reader.string_(position, 6, null);
  1952. $.type = reader.int8_(position, 8, 0);
  1953. $.locale = reader.string_(position, 10, null);
  1954. return $;
  1955. }
  1956. };
  1957. $root.tflite.FeatureProperties = class FeatureProperties {
  1958. static decode(reader, position) {
  1959. const $ = new $root.tflite.FeatureProperties();
  1960. return $;
  1961. }
  1962. };
  1963. $root.tflite.ColorSpaceType = {
  1964. UNKNOWN: 0,
  1965. RGB: 1,
  1966. GRAYSCALE: 2
  1967. };
  1968. $root.tflite.ImageSize = class ImageSize {
  1969. static decode(reader, position) {
  1970. const $ = new $root.tflite.ImageSize();
  1971. $.width = reader.uint32_(position, 4, 0);
  1972. $.height = reader.uint32_(position, 6, 0);
  1973. return $;
  1974. }
  1975. };
  1976. $root.tflite.ImageProperties = class ImageProperties {
  1977. static decode(reader, position) {
  1978. const $ = new $root.tflite.ImageProperties();
  1979. $.color_space = reader.int8_(position, 4, 0);
  1980. $.default_size = reader.table(position, 6, $root.tflite.ImageSize.decode);
  1981. return $;
  1982. }
  1983. };
  1984. $root.tflite.BoundingBoxType = {
  1985. UNKNOWN: 0,
  1986. BOUNDARIES: 1,
  1987. UPPER_LEFT: 2,
  1988. CENTER: 3
  1989. };
  1990. $root.tflite.CoordinateType = {
  1991. RATIO: 0,
  1992. PIXEL: 1
  1993. };
  1994. $root.tflite.BoundingBoxProperties = class BoundingBoxProperties {
  1995. static decode(reader, position) {
  1996. const $ = new $root.tflite.BoundingBoxProperties();
  1997. $.index = reader.typedArray(position, 4, Uint32Array);
  1998. $.type = reader.int8_(position, 6, 0);
  1999. $.coordinate_type = reader.int8_(position, 8, 0);
  2000. return $;
  2001. }
  2002. };
  2003. $root.tflite.ContentProperties = class {
  2004. static decode(reader, position, type) {
  2005. switch (type) {
  2006. case 1: return $root.tflite.FeatureProperties.decode(reader, position);
  2007. case 2: return $root.tflite.ImageProperties.decode(reader, position);
  2008. case 3: return $root.tflite.BoundingBoxProperties.decode(reader, position);
  2009. }
  2010. return undefined;
  2011. }
  2012. static decodeText(reader, json, type) {
  2013. switch (type) {
  2014. case 'FeatureProperties': return $root.tflite.FeatureProperties.decodeText(reader, json);
  2015. case 'ImageProperties': return $root.tflite.ImageProperties.decodeText(reader, json);
  2016. case 'BoundingBoxProperties': return $root.tflite.BoundingBoxProperties.decodeText(reader, json);
  2017. }
  2018. return undefined;
  2019. }
  2020. };
  2021. $root.tflite.ValueRange = class ValueRange {
  2022. static decode(reader, position) {
  2023. const $ = new $root.tflite.ValueRange();
  2024. $.min = reader.int32_(position, 4, 0);
  2025. $.max = reader.int32_(position, 6, 0);
  2026. return $;
  2027. }
  2028. };
  2029. $root.tflite.Content = class Content {
  2030. static decode(reader, position) {
  2031. const $ = new $root.tflite.Content();
  2032. $.content_properties = reader.union(position, 4, $root.tflite.ContentProperties.decode);
  2033. $.range = reader.table(position, 8, $root.tflite.ValueRange.decode);
  2034. return $;
  2035. }
  2036. };
  2037. $root.tflite.NormalizationOptions = class NormalizationOptions {
  2038. static decode(reader, position) {
  2039. const $ = new $root.tflite.NormalizationOptions();
  2040. $.mean = reader.typedArray(position, 4, Float32Array);
  2041. $.std = reader.typedArray(position, 6, Float32Array);
  2042. return $;
  2043. }
  2044. };
  2045. $root.tflite.ScoreTransformationType = {
  2046. IDENTITY: 0,
  2047. LOG: 1,
  2048. INVERSE_LOGISTIC: 2
  2049. };
  2050. $root.tflite.ScoreCalibrationOptions = class ScoreCalibrationOptions {
  2051. static decode(reader, position) {
  2052. const $ = new $root.tflite.ScoreCalibrationOptions();
  2053. $.score_transformation = reader.int8_(position, 4, 0);
  2054. $.default_score = reader.float32_(position, 6, 0);
  2055. return $;
  2056. }
  2057. };
  2058. $root.tflite.ScoreThresholdingOptions = class ScoreThresholdingOptions {
  2059. static decode(reader, position) {
  2060. const $ = new $root.tflite.ScoreThresholdingOptions();
  2061. $.global_score_threshold = reader.float32_(position, 4, 0);
  2062. return $;
  2063. }
  2064. };
  2065. $root.tflite.BertTokenizerOptions = class BertTokenizerOptions {
  2066. static decode(reader, position) {
  2067. const $ = new $root.tflite.BertTokenizerOptions();
  2068. $.vocab_file = reader.tableArray(position, 4, $root.tflite.AssociatedFile.decode);
  2069. return $;
  2070. }
  2071. };
  2072. $root.tflite.SentencePieceTokenizerOptions = class SentencePieceTokenizerOptions {
  2073. static decode(reader, position) {
  2074. const $ = new $root.tflite.SentencePieceTokenizerOptions();
  2075. $.sentencePiece_model = reader.tableArray(position, 4, $root.tflite.AssociatedFile.decode);
  2076. $.vocab_file = reader.tableArray(position, 6, $root.tflite.AssociatedFile.decode);
  2077. return $;
  2078. }
  2079. };
  2080. $root.tflite.RegexTokenizerOptions = class RegexTokenizerOptions {
  2081. static decode(reader, position) {
  2082. const $ = new $root.tflite.RegexTokenizerOptions();
  2083. $.delim_regex_pattern = reader.string_(position, 4, null);
  2084. $.vocab_file = reader.tableArray(position, 6, $root.tflite.AssociatedFile.decode);
  2085. return $;
  2086. }
  2087. };
  2088. $root.tflite.ProcessUnitOptions = class {
  2089. static decode(reader, position, type) {
  2090. switch (type) {
  2091. case 1: return $root.tflite.NormalizationOptions.decode(reader, position);
  2092. case 2: return $root.tflite.ScoreCalibrationOptions.decode(reader, position);
  2093. case 3: return $root.tflite.ScoreThresholdingOptions.decode(reader, position);
  2094. case 4: return $root.tflite.BertTokenizerOptions.decode(reader, position);
  2095. case 5: return $root.tflite.SentencePieceTokenizerOptions.decode(reader, position);
  2096. case 6: return $root.tflite.RegexTokenizerOptions.decode(reader, position);
  2097. }
  2098. return undefined;
  2099. }
  2100. static decodeText(reader, json, type) {
  2101. switch (type) {
  2102. case 'NormalizationOptions': return $root.tflite.NormalizationOptions.decodeText(reader, json);
  2103. case 'ScoreCalibrationOptions': return $root.tflite.ScoreCalibrationOptions.decodeText(reader, json);
  2104. case 'ScoreThresholdingOptions': return $root.tflite.ScoreThresholdingOptions.decodeText(reader, json);
  2105. case 'BertTokenizerOptions': return $root.tflite.BertTokenizerOptions.decodeText(reader, json);
  2106. case 'SentencePieceTokenizerOptions': return $root.tflite.SentencePieceTokenizerOptions.decodeText(reader, json);
  2107. case 'RegexTokenizerOptions': return $root.tflite.RegexTokenizerOptions.decodeText(reader, json);
  2108. }
  2109. return undefined;
  2110. }
  2111. };
  2112. $root.tflite.ProcessUnit = class ProcessUnit {
  2113. static decode(reader, position) {
  2114. const $ = new $root.tflite.ProcessUnit();
  2115. $.options = reader.union(position, 4, $root.tflite.ProcessUnitOptions.decode);
  2116. return $;
  2117. }
  2118. };
  2119. $root.tflite.Stats = class Stats {
  2120. static decode(reader, position) {
  2121. const $ = new $root.tflite.Stats();
  2122. $.max = reader.typedArray(position, 4, Float32Array);
  2123. $.min = reader.typedArray(position, 6, Float32Array);
  2124. return $;
  2125. }
  2126. };
  2127. $root.tflite.TensorGroup = class TensorGroup {
  2128. static decode(reader, position) {
  2129. const $ = new $root.tflite.TensorGroup();
  2130. $.name = reader.string_(position, 4, null);
  2131. $.tensor_names = reader.strings_(position, 6);
  2132. return $;
  2133. }
  2134. };
  2135. $root.tflite.TensorMetadata = class TensorMetadata {
  2136. static decode(reader, position) {
  2137. const $ = new $root.tflite.TensorMetadata();
  2138. $.name = reader.string_(position, 4, null);
  2139. $.description = reader.string_(position, 6, null);
  2140. $.dimension_names = reader.strings_(position, 8);
  2141. $.content = reader.table(position, 10, $root.tflite.Content.decode);
  2142. $.process_units = reader.tableArray(position, 12, $root.tflite.ProcessUnit.decode);
  2143. $.stats = reader.table(position, 14, $root.tflite.Stats.decode);
  2144. $.associated_files = reader.tableArray(position, 16, $root.tflite.AssociatedFile.decode);
  2145. return $;
  2146. }
  2147. };
  2148. $root.tflite.SubGraphMetadata = class SubGraphMetadata {
  2149. static decode(reader, position) {
  2150. const $ = new $root.tflite.SubGraphMetadata();
  2151. $.name = reader.string_(position, 4, null);
  2152. $.description = reader.string_(position, 6, null);
  2153. $.input_tensor_metadata = reader.tableArray(position, 8, $root.tflite.TensorMetadata.decode);
  2154. $.output_tensor_metadata = reader.tableArray(position, 10, $root.tflite.TensorMetadata.decode);
  2155. $.associated_files = reader.tableArray(position, 12, $root.tflite.AssociatedFile.decode);
  2156. $.input_process_units = reader.tableArray(position, 14, $root.tflite.ProcessUnit.decode);
  2157. $.output_process_units = reader.tableArray(position, 16, $root.tflite.ProcessUnit.decode);
  2158. $.input_tensor_groups = reader.tableArray(position, 18, $root.tflite.TensorGroup.decode);
  2159. $.output_tensor_groups = reader.tableArray(position, 20, $root.tflite.TensorGroup.decode);
  2160. return $;
  2161. }
  2162. };
  2163. $root.tflite.ModelMetadata = class ModelMetadata {
  2164. static identifier(reader) {
  2165. return reader.identifier('M001');
  2166. }
  2167. static create(reader) {
  2168. return $root.tflite.ModelMetadata.decode(reader, reader.root);
  2169. }
  2170. static decode(reader, position) {
  2171. const $ = new $root.tflite.ModelMetadata();
  2172. $.name = reader.string_(position, 4, null);
  2173. $.description = reader.string_(position, 6, null);
  2174. $.version = reader.string_(position, 8, null);
  2175. $.subgraph_metadata = reader.tableArray(position, 10, $root.tflite.SubGraphMetadata.decode);
  2176. $.author = reader.string_(position, 12, null);
  2177. $.license = reader.string_(position, 14, null);
  2178. $.associated_files = reader.tableArray(position, 16, $root.tflite.AssociatedFile.decode);
  2179. $.min_parser_version = reader.string_(position, 18, null);
  2180. return $;
  2181. }
  2182. };