tflite-schema.js 100 KB

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