tflite-schema.js 106 KB

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