tflite-schema.js 137 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012
  1. export const tflite = {};
  2. tflite.TensorType = {
  3. FLOAT32: 0,
  4. FLOAT16: 1,
  5. INT32: 2,
  6. UINT8: 3,
  7. INT64: 4,
  8. STRING: 5,
  9. BOOL: 6,
  10. INT16: 7,
  11. COMPLEX64: 8,
  12. INT8: 9,
  13. FLOAT64: 10,
  14. COMPLEX128: 11,
  15. UINT64: 12,
  16. RESOURCE: 13,
  17. VARIANT: 14,
  18. UINT32: 15,
  19. UINT16: 16,
  20. INT4: 17,
  21. BFLOAT16: 18,
  22. INT2: 19,
  23. UINT4: 20
  24. };
  25. tflite.CustomQuantization = class CustomQuantization {
  26. static decode(reader, position) {
  27. const $ = new tflite.CustomQuantization();
  28. $.custom = reader.array(position, 4, Uint8Array);
  29. return $;
  30. }
  31. static decodeText(reader, json) {
  32. const $ = new tflite.CustomQuantization();
  33. $.custom = reader.array(json.custom, Uint8Array);
  34. return $;
  35. }
  36. };
  37. tflite.QuantizationDetails = class {
  38. static decode(reader, position, type) {
  39. switch (type) {
  40. case 1: return tflite.CustomQuantization.decode(reader, position);
  41. case 2: return tflite.BlockwiseQuantization.decode(reader, position);
  42. default: return undefined;
  43. }
  44. }
  45. static decodeText(reader, json, type) {
  46. switch (type) {
  47. case 'CustomQuantization': return tflite.CustomQuantization.decodeText(reader, json);
  48. case 'BlockwiseQuantization': return tflite.BlockwiseQuantization.decodeText(reader, json);
  49. default: return undefined;
  50. }
  51. }
  52. };
  53. tflite.BlockwiseQuantization = class BlockwiseQuantization {
  54. static decode(reader, position) {
  55. const $ = new tflite.BlockwiseQuantization();
  56. $.scales = reader.int32_(position, 4, 0);
  57. $.zero_points = reader.int32_(position, 6, 0);
  58. $.block_size = reader.int32_(position, 8, 0);
  59. return $;
  60. }
  61. static decodeText(reader, json) {
  62. const $ = new tflite.BlockwiseQuantization();
  63. $.scales = reader.value(json.scales, 0);
  64. $.zero_points = reader.value(json.zero_points, 0);
  65. $.block_size = reader.value(json.block_size, 0);
  66. return $;
  67. }
  68. };
  69. tflite.QuantizationParameters = class QuantizationParameters {
  70. static decode(reader, position) {
  71. const $ = new tflite.QuantizationParameters();
  72. $.min = reader.array(position, 4, Float32Array);
  73. $.max = reader.array(position, 6, Float32Array);
  74. $.scale = reader.array(position, 8, Float32Array);
  75. $.zero_point = reader.int64s_(position, 10);
  76. $.details = reader.union(position, 12, tflite.QuantizationDetails);
  77. $.quantized_dimension = reader.int32_(position, 16, 0);
  78. return $;
  79. }
  80. static decodeText(reader, json) {
  81. const $ = new tflite.QuantizationParameters();
  82. $.min = reader.array(json.min, Float32Array);
  83. $.max = reader.array(json.max, Float32Array);
  84. $.scale = reader.array(json.scale, Float32Array);
  85. $.zero_point = reader.array(json.zero_point);
  86. $.details = tflite.QuantizationDetails.decodeText(reader, json.details, json.details_type);
  87. $.quantized_dimension = reader.value(json.quantized_dimension, 0);
  88. return $;
  89. }
  90. };
  91. tflite.DimensionType = {
  92. DENSE: 0,
  93. SPARSE_CSR: 1
  94. };
  95. tflite.Int32Vector = class Int32Vector {
  96. static decode(reader, position) {
  97. const $ = new tflite.Int32Vector();
  98. $.values = reader.array(position, 4, Int32Array);
  99. return $;
  100. }
  101. static decodeText(reader, json) {
  102. const $ = new tflite.Int32Vector();
  103. $.values = reader.array(json.values, Int32Array);
  104. return $;
  105. }
  106. };
  107. tflite.Uint16Vector = class Uint16Vector {
  108. static decode(reader, position) {
  109. const $ = new tflite.Uint16Vector();
  110. $.values = reader.array(position, 4, Uint16Array);
  111. return $;
  112. }
  113. static decodeText(reader, json) {
  114. const $ = new tflite.Uint16Vector();
  115. $.values = reader.array(json.values, Uint16Array);
  116. return $;
  117. }
  118. };
  119. tflite.Uint8Vector = class Uint8Vector {
  120. static decode(reader, position) {
  121. const $ = new tflite.Uint8Vector();
  122. $.values = reader.array(position, 4, Uint8Array);
  123. return $;
  124. }
  125. static decodeText(reader, json) {
  126. const $ = new tflite.Uint8Vector();
  127. $.values = reader.array(json.values, Uint8Array);
  128. return $;
  129. }
  130. };
  131. tflite.SparseIndexVector = class {
  132. static decode(reader, position, type) {
  133. switch (type) {
  134. case 1: return tflite.Int32Vector.decode(reader, position);
  135. case 2: return tflite.Uint16Vector.decode(reader, position);
  136. case 3: return tflite.Uint8Vector.decode(reader, position);
  137. default: return undefined;
  138. }
  139. }
  140. static decodeText(reader, json, type) {
  141. switch (type) {
  142. case 'Int32Vector': return tflite.Int32Vector.decodeText(reader, json);
  143. case 'Uint16Vector': return tflite.Uint16Vector.decodeText(reader, json);
  144. case 'Uint8Vector': return tflite.Uint8Vector.decodeText(reader, json);
  145. default: return undefined;
  146. }
  147. }
  148. };
  149. tflite.DimensionMetadata = class DimensionMetadata {
  150. static decode(reader, position) {
  151. const $ = new tflite.DimensionMetadata();
  152. $.format = reader.int8_(position, 4, 0);
  153. $.dense_size = reader.int32_(position, 6, 0);
  154. $.array_segments = reader.union(position, 8, tflite.SparseIndexVector);
  155. $.array_indices = reader.union(position, 12, tflite.SparseIndexVector);
  156. return $;
  157. }
  158. static decodeText(reader, json) {
  159. const $ = new tflite.DimensionMetadata();
  160. $.format = tflite.DimensionType[json.format];
  161. $.dense_size = reader.value(json.dense_size, 0);
  162. $.array_segments = tflite.SparseIndexVector.decodeText(reader, json.array_segments, json.array_segments_type);
  163. $.array_indices = tflite.SparseIndexVector.decodeText(reader, json.array_indices, json.array_indices_type);
  164. return $;
  165. }
  166. };
  167. tflite.SparsityParameters = class SparsityParameters {
  168. static decode(reader, position) {
  169. const $ = new tflite.SparsityParameters();
  170. $.traversal_order = reader.array(position, 4, Int32Array);
  171. $.block_map = reader.array(position, 6, Int32Array);
  172. $.dim_metadata = reader.tables(position, 8, tflite.DimensionMetadata);
  173. return $;
  174. }
  175. static decodeText(reader, json) {
  176. const $ = new tflite.SparsityParameters();
  177. $.traversal_order = reader.array(json.traversal_order, Int32Array);
  178. $.block_map = reader.array(json.block_map, Int32Array);
  179. $.dim_metadata = reader.objects(json.dim_metadata, tflite.DimensionMetadata);
  180. return $;
  181. }
  182. };
  183. tflite.VariantSubType = class VariantSubType {
  184. static decode(reader, position) {
  185. const $ = new tflite.VariantSubType();
  186. $.shape = reader.array(position, 4, Int32Array);
  187. $.type = reader.int8_(position, 6, 0);
  188. $.has_rank = reader.bool_(position, 8, false);
  189. return $;
  190. }
  191. static decodeText(reader, json) {
  192. const $ = new tflite.VariantSubType();
  193. $.shape = reader.array(json.shape, Int32Array);
  194. $.type = tflite.TensorType[json.type];
  195. $.has_rank = reader.value(json.has_rank, false);
  196. return $;
  197. }
  198. };
  199. tflite.Tensor = class Tensor {
  200. static decode(reader, position) {
  201. const $ = new tflite.Tensor();
  202. $.shape = reader.array(position, 4, Int32Array);
  203. $.type = reader.int8_(position, 6, 0);
  204. $.buffer = reader.uint32_(position, 8, 0);
  205. $.name = reader.string_(position, 10, null);
  206. $.quantization = reader.table(position, 12, tflite.QuantizationParameters);
  207. $.is_variable = reader.bool_(position, 14, false);
  208. $.sparsity = reader.table(position, 16, tflite.SparsityParameters);
  209. $.shape_signature = reader.array(position, 18, Int32Array);
  210. $.has_rank = reader.bool_(position, 20, false);
  211. $.variant_tensors = reader.tables(position, 22, tflite.VariantSubType);
  212. $.external_buffer = reader.uint32_(position, 24, 0);
  213. return $;
  214. }
  215. static decodeText(reader, json) {
  216. const $ = new tflite.Tensor();
  217. $.shape = reader.array(json.shape, Int32Array);
  218. $.type = tflite.TensorType[json.type];
  219. $.buffer = reader.value(json.buffer, 0);
  220. $.name = reader.value(json.name, null);
  221. $.quantization = reader.object(json.quantization, tflite.QuantizationParameters);
  222. $.is_variable = reader.value(json.is_variable, false);
  223. $.sparsity = reader.object(json.sparsity, tflite.SparsityParameters);
  224. $.shape_signature = reader.array(json.shape_signature, Int32Array);
  225. $.has_rank = reader.value(json.has_rank, false);
  226. $.variant_tensors = reader.objects(json.variant_tensors, tflite.VariantSubType);
  227. $.external_buffer = reader.value(json.external_buffer, 0);
  228. return $;
  229. }
  230. };
  231. tflite.BuiltinOperator = {
  232. ADD: 0,
  233. AVERAGE_POOL_2D: 1,
  234. CONCATENATION: 2,
  235. CONV_2D: 3,
  236. DEPTHWISE_CONV_2D: 4,
  237. DEPTH_TO_SPACE: 5,
  238. DEQUANTIZE: 6,
  239. EMBEDDING_LOOKUP: 7,
  240. FLOOR: 8,
  241. FULLY_CONNECTED: 9,
  242. HASHTABLE_LOOKUP: 10,
  243. L2_NORMALIZATION: 11,
  244. L2_POOL_2D: 12,
  245. LOCAL_RESPONSE_NORMALIZATION: 13,
  246. LOGISTIC: 14,
  247. LSH_PROJECTION: 15,
  248. LSTM: 16,
  249. MAX_POOL_2D: 17,
  250. MUL: 18,
  251. RELU: 19,
  252. RELU_N1_TO_1: 20,
  253. RELU6: 21,
  254. RESHAPE: 22,
  255. RESIZE_BILINEAR: 23,
  256. RNN: 24,
  257. SOFTMAX: 25,
  258. SPACE_TO_DEPTH: 26,
  259. SVDF: 27,
  260. TANH: 28,
  261. CONCAT_EMBEDDINGS: 29,
  262. SKIP_GRAM: 30,
  263. CALL: 31,
  264. CUSTOM: 32,
  265. EMBEDDING_LOOKUP_SPARSE: 33,
  266. PAD: 34,
  267. UNIDIRECTIONAL_SEQUENCE_RNN: 35,
  268. GATHER: 36,
  269. BATCH_TO_SPACE_ND: 37,
  270. SPACE_TO_BATCH_ND: 38,
  271. TRANSPOSE: 39,
  272. MEAN: 40,
  273. SUB: 41,
  274. DIV: 42,
  275. SQUEEZE: 43,
  276. UNIDIRECTIONAL_SEQUENCE_LSTM: 44,
  277. STRIDED_SLICE: 45,
  278. BIDIRECTIONAL_SEQUENCE_RNN: 46,
  279. EXP: 47,
  280. TOPK_V2: 48,
  281. SPLIT: 49,
  282. LOG_SOFTMAX: 50,
  283. DELEGATE: 51,
  284. BIDIRECTIONAL_SEQUENCE_LSTM: 52,
  285. CAST: 53,
  286. PRELU: 54,
  287. MAXIMUM: 55,
  288. ARG_MAX: 56,
  289. MINIMUM: 57,
  290. LESS: 58,
  291. NEG: 59,
  292. PADV2: 60,
  293. GREATER: 61,
  294. GREATER_EQUAL: 62,
  295. LESS_EQUAL: 63,
  296. SELECT: 64,
  297. SLICE: 65,
  298. SIN: 66,
  299. TRANSPOSE_CONV: 67,
  300. SPARSE_TO_DENSE: 68,
  301. TILE: 69,
  302. EXPAND_DIMS: 70,
  303. EQUAL: 71,
  304. NOT_EQUAL: 72,
  305. LOG: 73,
  306. SUM: 74,
  307. SQRT: 75,
  308. RSQRT: 76,
  309. SHAPE: 77,
  310. POW: 78,
  311. ARG_MIN: 79,
  312. FAKE_QUANT: 80,
  313. REDUCE_PROD: 81,
  314. REDUCE_MAX: 82,
  315. PACK: 83,
  316. LOGICAL_OR: 84,
  317. ONE_HOT: 85,
  318. LOGICAL_AND: 86,
  319. LOGICAL_NOT: 87,
  320. UNPACK: 88,
  321. REDUCE_MIN: 89,
  322. FLOOR_DIV: 90,
  323. REDUCE_ANY: 91,
  324. SQUARE: 92,
  325. ZEROS_LIKE: 93,
  326. FILL: 94,
  327. FLOOR_MOD: 95,
  328. RANGE: 96,
  329. RESIZE_NEAREST_NEIGHBOR: 97,
  330. LEAKY_RELU: 98,
  331. SQUARED_DIFFERENCE: 99,
  332. MIRROR_PAD: 100,
  333. ABS: 101,
  334. SPLIT_V: 102,
  335. UNIQUE: 103,
  336. CEIL: 104,
  337. REVERSE_V2: 105,
  338. ADD_N: 106,
  339. GATHER_ND: 107,
  340. COS: 108,
  341. WHERE: 109,
  342. RANK: 110,
  343. ELU: 111,
  344. REVERSE_SEQUENCE: 112,
  345. MATRIX_DIAG: 113,
  346. QUANTIZE: 114,
  347. MATRIX_SET_DIAG: 115,
  348. ROUND: 116,
  349. HARD_SWISH: 117,
  350. IF: 118,
  351. WHILE: 119,
  352. NON_MAX_SUPPRESSION_V4: 120,
  353. NON_MAX_SUPPRESSION_V5: 121,
  354. SCATTER_ND: 122,
  355. SELECT_V2: 123,
  356. DENSIFY: 124,
  357. SEGMENT_SUM: 125,
  358. BATCH_MATMUL: 126,
  359. PLACEHOLDER_FOR_GREATER_OP_CODES: 127,
  360. CUMSUM: 128,
  361. CALL_ONCE: 129,
  362. BROADCAST_TO: 130,
  363. RFFT2D: 131,
  364. CONV_3D: 132,
  365. IMAG: 133,
  366. REAL: 134,
  367. COMPLEX_ABS: 135,
  368. HASHTABLE: 136,
  369. HASHTABLE_FIND: 137,
  370. HASHTABLE_IMPORT: 138,
  371. HASHTABLE_SIZE: 139,
  372. REDUCE_ALL: 140,
  373. CONV_3D_TRANSPOSE: 141,
  374. VAR_HANDLE: 142,
  375. READ_VARIABLE: 143,
  376. ASSIGN_VARIABLE: 144,
  377. BROADCAST_ARGS: 145,
  378. RANDOM_STANDARD_NORMAL: 146,
  379. BUCKETIZE: 147,
  380. RANDOM_UNIFORM: 148,
  381. MULTINOMIAL: 149,
  382. GELU: 150,
  383. DYNAMIC_UPDATE_SLICE: 151,
  384. RELU_0_TO_1: 152,
  385. UNSORTED_SEGMENT_PROD: 153,
  386. UNSORTED_SEGMENT_MAX: 154,
  387. UNSORTED_SEGMENT_SUM: 155,
  388. ATAN2: 156,
  389. UNSORTED_SEGMENT_MIN: 157,
  390. SIGN: 158,
  391. BITCAST: 159,
  392. BITWISE_XOR: 160,
  393. RIGHT_SHIFT: 161,
  394. STABLEHLO_LOGISTIC: 162,
  395. STABLEHLO_ADD: 163,
  396. STABLEHLO_DIVIDE: 164,
  397. STABLEHLO_MULTIPLY: 165,
  398. STABLEHLO_MAXIMUM: 166,
  399. STABLEHLO_RESHAPE: 167,
  400. STABLEHLO_CLAMP: 168,
  401. STABLEHLO_CONCATENATE: 169,
  402. STABLEHLO_BROADCAST_IN_DIM: 170,
  403. STABLEHLO_CONVOLUTION: 171,
  404. STABLEHLO_SLICE: 172,
  405. STABLEHLO_CUSTOM_CALL: 173,
  406. STABLEHLO_REDUCE: 174,
  407. STABLEHLO_ABS: 175,
  408. STABLEHLO_AND: 176,
  409. STABLEHLO_COSINE: 177,
  410. STABLEHLO_EXPONENTIAL: 178,
  411. STABLEHLO_FLOOR: 179,
  412. STABLEHLO_LOG: 180,
  413. STABLEHLO_MINIMUM: 181,
  414. STABLEHLO_NEGATE: 182,
  415. STABLEHLO_OR: 183,
  416. STABLEHLO_POWER: 184,
  417. STABLEHLO_REMAINDER: 185,
  418. STABLEHLO_RSQRT: 186,
  419. STABLEHLO_SELECT: 187,
  420. STABLEHLO_SUBTRACT: 188,
  421. STABLEHLO_TANH: 189,
  422. STABLEHLO_SCATTER: 190,
  423. STABLEHLO_COMPARE: 191,
  424. STABLEHLO_CONVERT: 192,
  425. STABLEHLO_DYNAMIC_SLICE: 193,
  426. STABLEHLO_DYNAMIC_UPDATE_SLICE: 194,
  427. STABLEHLO_PAD: 195,
  428. STABLEHLO_IOTA: 196,
  429. STABLEHLO_DOT_GENERAL: 197,
  430. STABLEHLO_REDUCE_WINDOW: 198,
  431. STABLEHLO_SORT: 199,
  432. STABLEHLO_WHILE: 200,
  433. STABLEHLO_GATHER: 201,
  434. STABLEHLO_TRANSPOSE: 202,
  435. DILATE: 203,
  436. STABLEHLO_RNG_BIT_GENERATOR: 204,
  437. REDUCE_WINDOW: 205,
  438. STABLEHLO_COMPOSITE: 206,
  439. STABLEHLO_SHIFT_LEFT: 207,
  440. STABLEHLO_CBRT: 208,
  441. STABLEHLO_CASE: 209
  442. };
  443. tflite.BuiltinOptions = class {
  444. static decode(reader, position, type) {
  445. switch (type) {
  446. case 1: return tflite.Conv2DOptions.decode(reader, position);
  447. case 2: return tflite.DepthwiseConv2DOptions.decode(reader, position);
  448. case 3: return tflite.ConcatEmbeddingsOptions.decode(reader, position);
  449. case 4: return tflite.LSHProjectionOptions.decode(reader, position);
  450. case 5: return tflite.Pool2DOptions.decode(reader, position);
  451. case 6: return tflite.SVDFOptions.decode(reader, position);
  452. case 7: return tflite.RNNOptions.decode(reader, position);
  453. case 8: return tflite.FullyConnectedOptions.decode(reader, position);
  454. case 9: return tflite.SoftmaxOptions.decode(reader, position);
  455. case 10: return tflite.ConcatenationOptions.decode(reader, position);
  456. case 11: return tflite.AddOptions.decode(reader, position);
  457. case 12: return tflite.L2NormOptions.decode(reader, position);
  458. case 13: return tflite.LocalResponseNormalizationOptions.decode(reader, position);
  459. case 14: return tflite.LSTMOptions.decode(reader, position);
  460. case 15: return tflite.ResizeBilinearOptions.decode(reader, position);
  461. case 16: return tflite.CallOptions.decode(reader, position);
  462. case 17: return tflite.ReshapeOptions.decode(reader, position);
  463. case 18: return tflite.SkipGramOptions.decode(reader, position);
  464. case 19: return tflite.SpaceToDepthOptions.decode(reader, position);
  465. case 20: return tflite.EmbeddingLookupSparseOptions.decode(reader, position);
  466. case 21: return tflite.MulOptions.decode(reader, position);
  467. case 22: return tflite.PadOptions.decode(reader, position);
  468. case 23: return tflite.GatherOptions.decode(reader, position);
  469. case 24: return tflite.BatchToSpaceNDOptions.decode(reader, position);
  470. case 25: return tflite.SpaceToBatchNDOptions.decode(reader, position);
  471. case 26: return tflite.TransposeOptions.decode(reader, position);
  472. case 27: return tflite.ReducerOptions.decode(reader, position);
  473. case 28: return tflite.SubOptions.decode(reader, position);
  474. case 29: return tflite.DivOptions.decode(reader, position);
  475. case 30: return tflite.SqueezeOptions.decode(reader, position);
  476. case 31: return tflite.SequenceRNNOptions.decode(reader, position);
  477. case 32: return tflite.StridedSliceOptions.decode(reader, position);
  478. case 33: return tflite.ExpOptions.decode(reader, position);
  479. case 34: return tflite.TopKV2Options.decode(reader, position);
  480. case 35: return tflite.SplitOptions.decode(reader, position);
  481. case 36: return tflite.LogSoftmaxOptions.decode(reader, position);
  482. case 37: return tflite.CastOptions.decode(reader, position);
  483. case 38: return tflite.DequantizeOptions.decode(reader, position);
  484. case 39: return tflite.MaximumMinimumOptions.decode(reader, position);
  485. case 40: return tflite.ArgMaxOptions.decode(reader, position);
  486. case 41: return tflite.LessOptions.decode(reader, position);
  487. case 42: return tflite.NegOptions.decode(reader, position);
  488. case 43: return tflite.PadV2Options.decode(reader, position);
  489. case 44: return tflite.GreaterOptions.decode(reader, position);
  490. case 45: return tflite.GreaterEqualOptions.decode(reader, position);
  491. case 46: return tflite.LessEqualOptions.decode(reader, position);
  492. case 47: return tflite.SelectOptions.decode(reader, position);
  493. case 48: return tflite.SliceOptions.decode(reader, position);
  494. case 49: return tflite.TransposeConvOptions.decode(reader, position);
  495. case 50: return tflite.SparseToDenseOptions.decode(reader, position);
  496. case 51: return tflite.TileOptions.decode(reader, position);
  497. case 52: return tflite.ExpandDimsOptions.decode(reader, position);
  498. case 53: return tflite.EqualOptions.decode(reader, position);
  499. case 54: return tflite.NotEqualOptions.decode(reader, position);
  500. case 55: return tflite.ShapeOptions.decode(reader, position);
  501. case 56: return tflite.PowOptions.decode(reader, position);
  502. case 57: return tflite.ArgMinOptions.decode(reader, position);
  503. case 58: return tflite.FakeQuantOptions.decode(reader, position);
  504. case 59: return tflite.PackOptions.decode(reader, position);
  505. case 60: return tflite.LogicalOrOptions.decode(reader, position);
  506. case 61: return tflite.OneHotOptions.decode(reader, position);
  507. case 62: return tflite.LogicalAndOptions.decode(reader, position);
  508. case 63: return tflite.LogicalNotOptions.decode(reader, position);
  509. case 64: return tflite.UnpackOptions.decode(reader, position);
  510. case 65: return tflite.FloorDivOptions.decode(reader, position);
  511. case 66: return tflite.SquareOptions.decode(reader, position);
  512. case 67: return tflite.ZerosLikeOptions.decode(reader, position);
  513. case 68: return tflite.FillOptions.decode(reader, position);
  514. case 69: return tflite.BidirectionalSequenceLSTMOptions.decode(reader, position);
  515. case 70: return tflite.BidirectionalSequenceRNNOptions.decode(reader, position);
  516. case 71: return tflite.UnidirectionalSequenceLSTMOptions.decode(reader, position);
  517. case 72: return tflite.FloorModOptions.decode(reader, position);
  518. case 73: return tflite.RangeOptions.decode(reader, position);
  519. case 74: return tflite.ResizeNearestNeighborOptions.decode(reader, position);
  520. case 75: return tflite.LeakyReluOptions.decode(reader, position);
  521. case 76: return tflite.SquaredDifferenceOptions.decode(reader, position);
  522. case 77: return tflite.MirrorPadOptions.decode(reader, position);
  523. case 78: return tflite.AbsOptions.decode(reader, position);
  524. case 79: return tflite.SplitVOptions.decode(reader, position);
  525. case 80: return tflite.UniqueOptions.decode(reader, position);
  526. case 81: return tflite.ReverseV2Options.decode(reader, position);
  527. case 82: return tflite.AddNOptions.decode(reader, position);
  528. case 83: return tflite.GatherNdOptions.decode(reader, position);
  529. case 84: return tflite.CosOptions.decode(reader, position);
  530. case 85: return tflite.WhereOptions.decode(reader, position);
  531. case 86: return tflite.RankOptions.decode(reader, position);
  532. case 87: return tflite.ReverseSequenceOptions.decode(reader, position);
  533. case 88: return tflite.MatrixDiagOptions.decode(reader, position);
  534. case 89: return tflite.QuantizeOptions.decode(reader, position);
  535. case 90: return tflite.MatrixSetDiagOptions.decode(reader, position);
  536. case 91: return tflite.HardSwishOptions.decode(reader, position);
  537. case 92: return tflite.IfOptions.decode(reader, position);
  538. case 93: return tflite.WhileOptions.decode(reader, position);
  539. case 94: return tflite.DepthToSpaceOptions.decode(reader, position);
  540. case 95: return tflite.NonMaxSuppressionV4Options.decode(reader, position);
  541. case 96: return tflite.NonMaxSuppressionV5Options.decode(reader, position);
  542. case 97: return tflite.ScatterNdOptions.decode(reader, position);
  543. case 98: return tflite.SelectV2Options.decode(reader, position);
  544. case 99: return tflite.DensifyOptions.decode(reader, position);
  545. case 100: return tflite.SegmentSumOptions.decode(reader, position);
  546. case 101: return tflite.BatchMatMulOptions.decode(reader, position);
  547. case 102: return tflite.CumsumOptions.decode(reader, position);
  548. case 103: return tflite.CallOnceOptions.decode(reader, position);
  549. case 104: return tflite.BroadcastToOptions.decode(reader, position);
  550. case 105: return tflite.Rfft2dOptions.decode(reader, position);
  551. case 106: return tflite.Conv3DOptions.decode(reader, position);
  552. case 107: return tflite.HashtableOptions.decode(reader, position);
  553. case 108: return tflite.HashtableFindOptions.decode(reader, position);
  554. case 109: return tflite.HashtableImportOptions.decode(reader, position);
  555. case 110: return tflite.HashtableSizeOptions.decode(reader, position);
  556. case 111: return tflite.VarHandleOptions.decode(reader, position);
  557. case 112: return tflite.ReadVariableOptions.decode(reader, position);
  558. case 113: return tflite.AssignVariableOptions.decode(reader, position);
  559. case 114: return tflite.RandomOptions.decode(reader, position);
  560. case 115: return tflite.BucketizeOptions.decode(reader, position);
  561. case 116: return tflite.GeluOptions.decode(reader, position);
  562. case 117: return tflite.DynamicUpdateSliceOptions.decode(reader, position);
  563. case 118: return tflite.UnsortedSegmentProdOptions.decode(reader, position);
  564. case 119: return tflite.UnsortedSegmentMaxOptions.decode(reader, position);
  565. case 120: return tflite.UnsortedSegmentMinOptions.decode(reader, position);
  566. case 121: return tflite.UnsortedSegmentSumOptions.decode(reader, position);
  567. case 122: return tflite.ATan2Options.decode(reader, position);
  568. case 123: return tflite.SignOptions.decode(reader, position);
  569. case 124: return tflite.BitcastOptions.decode(reader, position);
  570. case 125: return tflite.BitwiseXorOptions.decode(reader, position);
  571. case 126: return tflite.RightShiftOptions.decode(reader, position);
  572. default: return undefined;
  573. }
  574. }
  575. static decodeText(reader, json, type) {
  576. switch (type) {
  577. case 'Conv2DOptions': return tflite.Conv2DOptions.decodeText(reader, json);
  578. case 'DepthwiseConv2DOptions': return tflite.DepthwiseConv2DOptions.decodeText(reader, json);
  579. case 'ConcatEmbeddingsOptions': return tflite.ConcatEmbeddingsOptions.decodeText(reader, json);
  580. case 'LSHProjectionOptions': return tflite.LSHProjectionOptions.decodeText(reader, json);
  581. case 'Pool2DOptions': return tflite.Pool2DOptions.decodeText(reader, json);
  582. case 'SVDFOptions': return tflite.SVDFOptions.decodeText(reader, json);
  583. case 'RNNOptions': return tflite.RNNOptions.decodeText(reader, json);
  584. case 'FullyConnectedOptions': return tflite.FullyConnectedOptions.decodeText(reader, json);
  585. case 'SoftmaxOptions': return tflite.SoftmaxOptions.decodeText(reader, json);
  586. case 'ConcatenationOptions': return tflite.ConcatenationOptions.decodeText(reader, json);
  587. case 'AddOptions': return tflite.AddOptions.decodeText(reader, json);
  588. case 'L2NormOptions': return tflite.L2NormOptions.decodeText(reader, json);
  589. case 'LocalResponseNormalizationOptions': return tflite.LocalResponseNormalizationOptions.decodeText(reader, json);
  590. case 'LSTMOptions': return tflite.LSTMOptions.decodeText(reader, json);
  591. case 'ResizeBilinearOptions': return tflite.ResizeBilinearOptions.decodeText(reader, json);
  592. case 'CallOptions': return tflite.CallOptions.decodeText(reader, json);
  593. case 'ReshapeOptions': return tflite.ReshapeOptions.decodeText(reader, json);
  594. case 'SkipGramOptions': return tflite.SkipGramOptions.decodeText(reader, json);
  595. case 'SpaceToDepthOptions': return tflite.SpaceToDepthOptions.decodeText(reader, json);
  596. case 'EmbeddingLookupSparseOptions': return tflite.EmbeddingLookupSparseOptions.decodeText(reader, json);
  597. case 'MulOptions': return tflite.MulOptions.decodeText(reader, json);
  598. case 'PadOptions': return tflite.PadOptions.decodeText(reader, json);
  599. case 'GatherOptions': return tflite.GatherOptions.decodeText(reader, json);
  600. case 'BatchToSpaceNDOptions': return tflite.BatchToSpaceNDOptions.decodeText(reader, json);
  601. case 'SpaceToBatchNDOptions': return tflite.SpaceToBatchNDOptions.decodeText(reader, json);
  602. case 'TransposeOptions': return tflite.TransposeOptions.decodeText(reader, json);
  603. case 'ReducerOptions': return tflite.ReducerOptions.decodeText(reader, json);
  604. case 'SubOptions': return tflite.SubOptions.decodeText(reader, json);
  605. case 'DivOptions': return tflite.DivOptions.decodeText(reader, json);
  606. case 'SqueezeOptions': return tflite.SqueezeOptions.decodeText(reader, json);
  607. case 'SequenceRNNOptions': return tflite.SequenceRNNOptions.decodeText(reader, json);
  608. case 'StridedSliceOptions': return tflite.StridedSliceOptions.decodeText(reader, json);
  609. case 'ExpOptions': return tflite.ExpOptions.decodeText(reader, json);
  610. case 'TopKV2Options': return tflite.TopKV2Options.decodeText(reader, json);
  611. case 'SplitOptions': return tflite.SplitOptions.decodeText(reader, json);
  612. case 'LogSoftmaxOptions': return tflite.LogSoftmaxOptions.decodeText(reader, json);
  613. case 'CastOptions': return tflite.CastOptions.decodeText(reader, json);
  614. case 'DequantizeOptions': return tflite.DequantizeOptions.decodeText(reader, json);
  615. case 'MaximumMinimumOptions': return tflite.MaximumMinimumOptions.decodeText(reader, json);
  616. case 'ArgMaxOptions': return tflite.ArgMaxOptions.decodeText(reader, json);
  617. case 'LessOptions': return tflite.LessOptions.decodeText(reader, json);
  618. case 'NegOptions': return tflite.NegOptions.decodeText(reader, json);
  619. case 'PadV2Options': return tflite.PadV2Options.decodeText(reader, json);
  620. case 'GreaterOptions': return tflite.GreaterOptions.decodeText(reader, json);
  621. case 'GreaterEqualOptions': return tflite.GreaterEqualOptions.decodeText(reader, json);
  622. case 'LessEqualOptions': return tflite.LessEqualOptions.decodeText(reader, json);
  623. case 'SelectOptions': return tflite.SelectOptions.decodeText(reader, json);
  624. case 'SliceOptions': return tflite.SliceOptions.decodeText(reader, json);
  625. case 'TransposeConvOptions': return tflite.TransposeConvOptions.decodeText(reader, json);
  626. case 'SparseToDenseOptions': return tflite.SparseToDenseOptions.decodeText(reader, json);
  627. case 'TileOptions': return tflite.TileOptions.decodeText(reader, json);
  628. case 'ExpandDimsOptions': return tflite.ExpandDimsOptions.decodeText(reader, json);
  629. case 'EqualOptions': return tflite.EqualOptions.decodeText(reader, json);
  630. case 'NotEqualOptions': return tflite.NotEqualOptions.decodeText(reader, json);
  631. case 'ShapeOptions': return tflite.ShapeOptions.decodeText(reader, json);
  632. case 'PowOptions': return tflite.PowOptions.decodeText(reader, json);
  633. case 'ArgMinOptions': return tflite.ArgMinOptions.decodeText(reader, json);
  634. case 'FakeQuantOptions': return tflite.FakeQuantOptions.decodeText(reader, json);
  635. case 'PackOptions': return tflite.PackOptions.decodeText(reader, json);
  636. case 'LogicalOrOptions': return tflite.LogicalOrOptions.decodeText(reader, json);
  637. case 'OneHotOptions': return tflite.OneHotOptions.decodeText(reader, json);
  638. case 'LogicalAndOptions': return tflite.LogicalAndOptions.decodeText(reader, json);
  639. case 'LogicalNotOptions': return tflite.LogicalNotOptions.decodeText(reader, json);
  640. case 'UnpackOptions': return tflite.UnpackOptions.decodeText(reader, json);
  641. case 'FloorDivOptions': return tflite.FloorDivOptions.decodeText(reader, json);
  642. case 'SquareOptions': return tflite.SquareOptions.decodeText(reader, json);
  643. case 'ZerosLikeOptions': return tflite.ZerosLikeOptions.decodeText(reader, json);
  644. case 'FillOptions': return tflite.FillOptions.decodeText(reader, json);
  645. case 'BidirectionalSequenceLSTMOptions': return tflite.BidirectionalSequenceLSTMOptions.decodeText(reader, json);
  646. case 'BidirectionalSequenceRNNOptions': return tflite.BidirectionalSequenceRNNOptions.decodeText(reader, json);
  647. case 'UnidirectionalSequenceLSTMOptions': return tflite.UnidirectionalSequenceLSTMOptions.decodeText(reader, json);
  648. case 'FloorModOptions': return tflite.FloorModOptions.decodeText(reader, json);
  649. case 'RangeOptions': return tflite.RangeOptions.decodeText(reader, json);
  650. case 'ResizeNearestNeighborOptions': return tflite.ResizeNearestNeighborOptions.decodeText(reader, json);
  651. case 'LeakyReluOptions': return tflite.LeakyReluOptions.decodeText(reader, json);
  652. case 'SquaredDifferenceOptions': return tflite.SquaredDifferenceOptions.decodeText(reader, json);
  653. case 'MirrorPadOptions': return tflite.MirrorPadOptions.decodeText(reader, json);
  654. case 'AbsOptions': return tflite.AbsOptions.decodeText(reader, json);
  655. case 'SplitVOptions': return tflite.SplitVOptions.decodeText(reader, json);
  656. case 'UniqueOptions': return tflite.UniqueOptions.decodeText(reader, json);
  657. case 'ReverseV2Options': return tflite.ReverseV2Options.decodeText(reader, json);
  658. case 'AddNOptions': return tflite.AddNOptions.decodeText(reader, json);
  659. case 'GatherNdOptions': return tflite.GatherNdOptions.decodeText(reader, json);
  660. case 'CosOptions': return tflite.CosOptions.decodeText(reader, json);
  661. case 'WhereOptions': return tflite.WhereOptions.decodeText(reader, json);
  662. case 'RankOptions': return tflite.RankOptions.decodeText(reader, json);
  663. case 'ReverseSequenceOptions': return tflite.ReverseSequenceOptions.decodeText(reader, json);
  664. case 'MatrixDiagOptions': return tflite.MatrixDiagOptions.decodeText(reader, json);
  665. case 'QuantizeOptions': return tflite.QuantizeOptions.decodeText(reader, json);
  666. case 'MatrixSetDiagOptions': return tflite.MatrixSetDiagOptions.decodeText(reader, json);
  667. case 'HardSwishOptions': return tflite.HardSwishOptions.decodeText(reader, json);
  668. case 'IfOptions': return tflite.IfOptions.decodeText(reader, json);
  669. case 'WhileOptions': return tflite.WhileOptions.decodeText(reader, json);
  670. case 'DepthToSpaceOptions': return tflite.DepthToSpaceOptions.decodeText(reader, json);
  671. case 'NonMaxSuppressionV4Options': return tflite.NonMaxSuppressionV4Options.decodeText(reader, json);
  672. case 'NonMaxSuppressionV5Options': return tflite.NonMaxSuppressionV5Options.decodeText(reader, json);
  673. case 'ScatterNdOptions': return tflite.ScatterNdOptions.decodeText(reader, json);
  674. case 'SelectV2Options': return tflite.SelectV2Options.decodeText(reader, json);
  675. case 'DensifyOptions': return tflite.DensifyOptions.decodeText(reader, json);
  676. case 'SegmentSumOptions': return tflite.SegmentSumOptions.decodeText(reader, json);
  677. case 'BatchMatMulOptions': return tflite.BatchMatMulOptions.decodeText(reader, json);
  678. case 'CumsumOptions': return tflite.CumsumOptions.decodeText(reader, json);
  679. case 'CallOnceOptions': return tflite.CallOnceOptions.decodeText(reader, json);
  680. case 'BroadcastToOptions': return tflite.BroadcastToOptions.decodeText(reader, json);
  681. case 'Rfft2dOptions': return tflite.Rfft2dOptions.decodeText(reader, json);
  682. case 'Conv3DOptions': return tflite.Conv3DOptions.decodeText(reader, json);
  683. case 'HashtableOptions': return tflite.HashtableOptions.decodeText(reader, json);
  684. case 'HashtableFindOptions': return tflite.HashtableFindOptions.decodeText(reader, json);
  685. case 'HashtableImportOptions': return tflite.HashtableImportOptions.decodeText(reader, json);
  686. case 'HashtableSizeOptions': return tflite.HashtableSizeOptions.decodeText(reader, json);
  687. case 'VarHandleOptions': return tflite.VarHandleOptions.decodeText(reader, json);
  688. case 'ReadVariableOptions': return tflite.ReadVariableOptions.decodeText(reader, json);
  689. case 'AssignVariableOptions': return tflite.AssignVariableOptions.decodeText(reader, json);
  690. case 'RandomOptions': return tflite.RandomOptions.decodeText(reader, json);
  691. case 'BucketizeOptions': return tflite.BucketizeOptions.decodeText(reader, json);
  692. case 'GeluOptions': return tflite.GeluOptions.decodeText(reader, json);
  693. case 'DynamicUpdateSliceOptions': return tflite.DynamicUpdateSliceOptions.decodeText(reader, json);
  694. case 'UnsortedSegmentProdOptions': return tflite.UnsortedSegmentProdOptions.decodeText(reader, json);
  695. case 'UnsortedSegmentMaxOptions': return tflite.UnsortedSegmentMaxOptions.decodeText(reader, json);
  696. case 'UnsortedSegmentMinOptions': return tflite.UnsortedSegmentMinOptions.decodeText(reader, json);
  697. case 'UnsortedSegmentSumOptions': return tflite.UnsortedSegmentSumOptions.decodeText(reader, json);
  698. case 'ATan2Options': return tflite.ATan2Options.decodeText(reader, json);
  699. case 'SignOptions': return tflite.SignOptions.decodeText(reader, json);
  700. case 'BitcastOptions': return tflite.BitcastOptions.decodeText(reader, json);
  701. case 'BitwiseXorOptions': return tflite.BitwiseXorOptions.decodeText(reader, json);
  702. case 'RightShiftOptions': return tflite.RightShiftOptions.decodeText(reader, json);
  703. default: return undefined;
  704. }
  705. }
  706. };
  707. tflite.BuiltinOptions2 = class {
  708. static decode(reader, position, type) {
  709. switch (type) {
  710. case 1: return tflite.StablehloConcatenateOptions.decode(reader, position);
  711. case 2: return tflite.StablehloBroadcastInDimOptions.decode(reader, position);
  712. case 3: return tflite.StablehloSliceOptions.decode(reader, position);
  713. case 4: return tflite.StablehloConvolutionOptions.decode(reader, position);
  714. case 5: return tflite.StablehloCustomCallOptions.decode(reader, position);
  715. case 6: return tflite.StablehloReduceOptions.decode(reader, position);
  716. case 7: return tflite.StablehloScatterOptions.decode(reader, position);
  717. case 8: return tflite.StablehloCompareOptions.decode(reader, position);
  718. case 9: return tflite.StablehloDynamicSliceOptions.decode(reader, position);
  719. case 10: return tflite.StablehloPadOptions.decode(reader, position);
  720. case 11: return tflite.StablehloIotaOptions.decode(reader, position);
  721. case 12: return tflite.StablehloDotGeneralOptions.decode(reader, position);
  722. case 13: return tflite.StablehloReduceWindowOptions.decode(reader, position);
  723. case 14: return tflite.StablehloSortOptions.decode(reader, position);
  724. case 15: return tflite.StablehloWhileOptions.decode(reader, position);
  725. case 16: return tflite.StablehloGatherOptions.decode(reader, position);
  726. case 17: return tflite.StablehloTransposeOptions.decode(reader, position);
  727. case 18: return tflite.DilateOptions.decode(reader, position);
  728. case 19: return tflite.StablehloRngBitGeneratorOptions.decode(reader, position);
  729. case 20: return tflite.ReduceWindowOptions.decode(reader, position);
  730. case 21: return tflite.StableHLOCompositeOptions.decode(reader, position);
  731. case 22: return tflite.StablehloShiftLeftOptions.decode(reader, position);
  732. case 23: return tflite.StablehloCaseOptions.decode(reader, position);
  733. default: return undefined;
  734. }
  735. }
  736. static decodeText(reader, json, type) {
  737. switch (type) {
  738. case 'StablehloConcatenateOptions': return tflite.StablehloConcatenateOptions.decodeText(reader, json);
  739. case 'StablehloBroadcastInDimOptions': return tflite.StablehloBroadcastInDimOptions.decodeText(reader, json);
  740. case 'StablehloSliceOptions': return tflite.StablehloSliceOptions.decodeText(reader, json);
  741. case 'StablehloConvolutionOptions': return tflite.StablehloConvolutionOptions.decodeText(reader, json);
  742. case 'StablehloCustomCallOptions': return tflite.StablehloCustomCallOptions.decodeText(reader, json);
  743. case 'StablehloReduceOptions': return tflite.StablehloReduceOptions.decodeText(reader, json);
  744. case 'StablehloScatterOptions': return tflite.StablehloScatterOptions.decodeText(reader, json);
  745. case 'StablehloCompareOptions': return tflite.StablehloCompareOptions.decodeText(reader, json);
  746. case 'StablehloDynamicSliceOptions': return tflite.StablehloDynamicSliceOptions.decodeText(reader, json);
  747. case 'StablehloPadOptions': return tflite.StablehloPadOptions.decodeText(reader, json);
  748. case 'StablehloIotaOptions': return tflite.StablehloIotaOptions.decodeText(reader, json);
  749. case 'StablehloDotGeneralOptions': return tflite.StablehloDotGeneralOptions.decodeText(reader, json);
  750. case 'StablehloReduceWindowOptions': return tflite.StablehloReduceWindowOptions.decodeText(reader, json);
  751. case 'StablehloSortOptions': return tflite.StablehloSortOptions.decodeText(reader, json);
  752. case 'StablehloWhileOptions': return tflite.StablehloWhileOptions.decodeText(reader, json);
  753. case 'StablehloGatherOptions': return tflite.StablehloGatherOptions.decodeText(reader, json);
  754. case 'StablehloTransposeOptions': return tflite.StablehloTransposeOptions.decodeText(reader, json);
  755. case 'DilateOptions': return tflite.DilateOptions.decodeText(reader, json);
  756. case 'StablehloRngBitGeneratorOptions': return tflite.StablehloRngBitGeneratorOptions.decodeText(reader, json);
  757. case 'ReduceWindowOptions': return tflite.ReduceWindowOptions.decodeText(reader, json);
  758. case 'StableHLOCompositeOptions': return tflite.StableHLOCompositeOptions.decodeText(reader, json);
  759. case 'StablehloShiftLeftOptions': return tflite.StablehloShiftLeftOptions.decodeText(reader, json);
  760. case 'StablehloCaseOptions': return tflite.StablehloCaseOptions.decodeText(reader, json);
  761. default: return undefined;
  762. }
  763. }
  764. };
  765. tflite.StablehloGatherOptions = class StablehloGatherOptions {
  766. static decode(reader, position) {
  767. const $ = new tflite.StablehloGatherOptions();
  768. $.offset_dims = reader.int64s_(position, 4);
  769. $.collapsed_slice_dims = reader.int64s_(position, 6);
  770. $.start_index_map = reader.int64s_(position, 8);
  771. $.index_vector_dim = reader.int64_(position, 10, 0n);
  772. $.slice_sizes = reader.int64s_(position, 12);
  773. $.indices_are_sorted = reader.bool_(position, 14, false);
  774. return $;
  775. }
  776. static decodeText(reader, json) {
  777. const $ = new tflite.StablehloGatherOptions();
  778. $.offset_dims = reader.array(json.offset_dims);
  779. $.collapsed_slice_dims = reader.array(json.collapsed_slice_dims);
  780. $.start_index_map = reader.array(json.start_index_map);
  781. $.index_vector_dim = reader.int64(json.index_vector_dim, 0n);
  782. $.slice_sizes = reader.array(json.slice_sizes);
  783. $.indices_are_sorted = reader.value(json.indices_are_sorted, false);
  784. return $;
  785. }
  786. };
  787. tflite.StablehloTransposeOptions = class StablehloTransposeOptions {
  788. static decode(reader, position) {
  789. const $ = new tflite.StablehloTransposeOptions();
  790. $.permutation = reader.int64s_(position, 4);
  791. return $;
  792. }
  793. static decodeText(reader, json) {
  794. const $ = new tflite.StablehloTransposeOptions();
  795. $.permutation = reader.array(json.permutation);
  796. return $;
  797. }
  798. };
  799. tflite.StablehloPrecisionConfig = {
  800. DEFAULT: 0,
  801. HIGH: 1,
  802. HIGHEST: 2
  803. };
  804. tflite.StablehloDotGeneralOptions = class StablehloDotGeneralOptions {
  805. static decode(reader, position) {
  806. const $ = new tflite.StablehloDotGeneralOptions();
  807. $.lhs_batching_dimensions = reader.int64s_(position, 4);
  808. $.rhs_batching_dimensions = reader.int64s_(position, 6);
  809. $.lhs_contracting_dimensions = reader.int64s_(position, 8);
  810. $.rhs_contracting_dimensions = reader.int64s_(position, 10);
  811. $.precision_config = reader.array(position, 12, Uint32Array);
  812. return $;
  813. }
  814. static decodeText(reader, json) {
  815. const $ = new tflite.StablehloDotGeneralOptions();
  816. $.lhs_batching_dimensions = reader.array(json.lhs_batching_dimensions);
  817. $.rhs_batching_dimensions = reader.array(json.rhs_batching_dimensions);
  818. $.lhs_contracting_dimensions = reader.array(json.lhs_contracting_dimensions);
  819. $.rhs_contracting_dimensions = reader.array(json.rhs_contracting_dimensions);
  820. $.precision_config = reader.objects(json.precision_config, tflite.StablehloPrecisionConfig);
  821. return $;
  822. }
  823. };
  824. tflite.StablehloReduceWindowOptions = class StablehloReduceWindowOptions {
  825. static decode(reader, position) {
  826. const $ = new tflite.StablehloReduceWindowOptions();
  827. $.window_dimensions = reader.int64s_(position, 4);
  828. $.window_strides = reader.int64s_(position, 6);
  829. $.base_dilations = reader.int64s_(position, 8);
  830. $.window_dilations = reader.int64s_(position, 10);
  831. $.padding = reader.int64s_(position, 12);
  832. $.body_subgraph_index = reader.int32_(position, 14, 0);
  833. return $;
  834. }
  835. static decodeText(reader, json) {
  836. const $ = new tflite.StablehloReduceWindowOptions();
  837. $.window_dimensions = reader.array(json.window_dimensions);
  838. $.window_strides = reader.array(json.window_strides);
  839. $.base_dilations = reader.array(json.base_dilations);
  840. $.window_dilations = reader.array(json.window_dilations);
  841. $.padding = reader.array(json.padding);
  842. $.body_subgraph_index = reader.value(json.body_subgraph_index, 0);
  843. return $;
  844. }
  845. };
  846. tflite.StablehloWhileOptions = class StablehloWhileOptions {
  847. static decode(reader, position) {
  848. const $ = new tflite.StablehloWhileOptions();
  849. $.cond_subgraph_index = reader.int32_(position, 4, 0);
  850. $.body_subgraph_index = reader.int32_(position, 6, 0);
  851. return $;
  852. }
  853. static decodeText(reader, json) {
  854. const $ = new tflite.StablehloWhileOptions();
  855. $.cond_subgraph_index = reader.value(json.cond_subgraph_index, 0);
  856. $.body_subgraph_index = reader.value(json.body_subgraph_index, 0);
  857. return $;
  858. }
  859. };
  860. tflite.StablehloSortOptions = class StablehloSortOptions {
  861. static decode(reader, position) {
  862. const $ = new tflite.StablehloSortOptions();
  863. $.dimension = reader.int64_(position, 4, 0n);
  864. $.is_stable = reader.bool_(position, 6, false);
  865. $.comparator_subgraph_index = reader.int32_(position, 8, 0);
  866. return $;
  867. }
  868. static decodeText(reader, json) {
  869. const $ = new tflite.StablehloSortOptions();
  870. $.dimension = reader.int64(json.dimension, 0n);
  871. $.is_stable = reader.value(json.is_stable, false);
  872. $.comparator_subgraph_index = reader.value(json.comparator_subgraph_index, 0);
  873. return $;
  874. }
  875. };
  876. tflite.StablehloConcatenateOptions = class StablehloConcatenateOptions {
  877. static decode(reader, position) {
  878. const $ = new tflite.StablehloConcatenateOptions();
  879. $.dimension = reader.int64_(position, 4, 0n);
  880. return $;
  881. }
  882. static decodeText(reader, json) {
  883. const $ = new tflite.StablehloConcatenateOptions();
  884. $.dimension = reader.int64(json.dimension, 0n);
  885. return $;
  886. }
  887. };
  888. tflite.StablehloBroadcastInDimOptions = class StablehloBroadcastInDimOptions {
  889. static decode(reader, position) {
  890. const $ = new tflite.StablehloBroadcastInDimOptions();
  891. $.broadcast_dimensions = reader.int64s_(position, 4);
  892. return $;
  893. }
  894. static decodeText(reader, json) {
  895. const $ = new tflite.StablehloBroadcastInDimOptions();
  896. $.broadcast_dimensions = reader.array(json.broadcast_dimensions);
  897. return $;
  898. }
  899. };
  900. tflite.StablehloComparisonDirection = {
  901. STABLEHLO_COMPARISON_DIRECTION_EQ: 0,
  902. STABLEHLO_COMPARISON_DIRECTION_NE: 1,
  903. STABLEHLO_COMPARISON_DIRECTION_GE: 2,
  904. STABLEHLO_COMPARISON_DIRECTION_GT: 3,
  905. STABLEHLO_COMPARISON_DIRECTION_LE: 4,
  906. STABLEHLO_COMPARISON_DIRECTION_LT: 5
  907. };
  908. tflite.StablehloComparisonType = {
  909. STABLEHLO_COMPARISON_TYPE_NOTYPE: 0,
  910. STABLEHLO_COMPARISON_TYPE_FLOAT: 1,
  911. STABLEHLO_COMPARISON_TYPE_FLOAT_TOTAL_ORDER: 2,
  912. STABLEHLO_COMPARISON_TYPE_SIGNED: 3,
  913. STABLEHLO_COMPARISON_TYPE_UNSIGNED: 4
  914. };
  915. tflite.StablehloCompareOptions = class StablehloCompareOptions {
  916. static decode(reader, position) {
  917. const $ = new tflite.StablehloCompareOptions();
  918. $.comparison_direction = reader.uint32_(position, 4, 0);
  919. $.compare_type = reader.uint32_(position, 6, 0);
  920. return $;
  921. }
  922. static decodeText(reader, json) {
  923. const $ = new tflite.StablehloCompareOptions();
  924. $.comparison_direction = tflite.StablehloComparisonDirection[json.comparison_direction];
  925. $.compare_type = tflite.StablehloComparisonType[json.compare_type];
  926. return $;
  927. }
  928. };
  929. tflite.StablehloDynamicSliceOptions = class StablehloDynamicSliceOptions {
  930. static decode(reader, position) {
  931. const $ = new tflite.StablehloDynamicSliceOptions();
  932. $.slice_sizes = reader.int64s_(position, 4);
  933. return $;
  934. }
  935. static decodeText(reader, json) {
  936. const $ = new tflite.StablehloDynamicSliceOptions();
  937. $.slice_sizes = reader.array(json.slice_sizes);
  938. return $;
  939. }
  940. };
  941. tflite.StablehloPadOptions = class StablehloPadOptions {
  942. static decode(reader, position) {
  943. const $ = new tflite.StablehloPadOptions();
  944. $.edge_padding_low = reader.int64s_(position, 4);
  945. $.edge_padding_high = reader.int64s_(position, 6);
  946. $.interior_padding = reader.int64s_(position, 8);
  947. return $;
  948. }
  949. static decodeText(reader, json) {
  950. const $ = new tflite.StablehloPadOptions();
  951. $.edge_padding_low = reader.array(json.edge_padding_low);
  952. $.edge_padding_high = reader.array(json.edge_padding_high);
  953. $.interior_padding = reader.array(json.interior_padding);
  954. return $;
  955. }
  956. };
  957. tflite.StablehloIotaOptions = class StablehloIotaOptions {
  958. static decode(reader, position) {
  959. const $ = new tflite.StablehloIotaOptions();
  960. $.iota_dimension = reader.int64_(position, 4, 0n);
  961. return $;
  962. }
  963. static decodeText(reader, json) {
  964. const $ = new tflite.StablehloIotaOptions();
  965. $.iota_dimension = reader.int64(json.iota_dimension, 0n);
  966. return $;
  967. }
  968. };
  969. tflite.StablehloCustomCallOptions = class StablehloCustomCallOptions {
  970. static decode(reader, position) {
  971. const $ = new tflite.StablehloCustomCallOptions();
  972. $.call_target_name = reader.string_(position, 4, null);
  973. $.has_side_effect = reader.bool_(position, 6, false);
  974. $.backend_config = reader.string_(position, 8, null);
  975. $.api_version = reader.int32_(position, 10, 0);
  976. $.called_computations = reader.array(position, 12, Int32Array);
  977. $.custom_attributes = reader.array(position, 14, Uint8Array);
  978. return $;
  979. }
  980. static decodeText(reader, json) {
  981. const $ = new tflite.StablehloCustomCallOptions();
  982. $.call_target_name = reader.value(json.call_target_name, null);
  983. $.has_side_effect = reader.value(json.has_side_effect, false);
  984. $.backend_config = reader.value(json.backend_config, null);
  985. $.api_version = reader.value(json.api_version, 0);
  986. $.called_computations = reader.array(json.called_computations, Int32Array);
  987. $.custom_attributes = reader.array(json.custom_attributes, Uint8Array);
  988. return $;
  989. }
  990. };
  991. tflite.StablehloReduceOptions = class StablehloReduceOptions {
  992. static decode(reader, position) {
  993. const $ = new tflite.StablehloReduceOptions();
  994. $.dimensions = reader.int64s_(position, 4);
  995. $.body_subgraph_index = reader.int32_(position, 6, 0);
  996. return $;
  997. }
  998. static decodeText(reader, json) {
  999. const $ = new tflite.StablehloReduceOptions();
  1000. $.dimensions = reader.array(json.dimensions);
  1001. $.body_subgraph_index = reader.value(json.body_subgraph_index, 0);
  1002. return $;
  1003. }
  1004. };
  1005. tflite.StablehloSliceOptions = class StablehloSliceOptions {
  1006. static decode(reader, position) {
  1007. const $ = new tflite.StablehloSliceOptions();
  1008. $.start_indices = reader.int64s_(position, 4);
  1009. $.limit_indices = reader.int64s_(position, 6);
  1010. $.strides = reader.int64s_(position, 8);
  1011. return $;
  1012. }
  1013. static decodeText(reader, json) {
  1014. const $ = new tflite.StablehloSliceOptions();
  1015. $.start_indices = reader.array(json.start_indices);
  1016. $.limit_indices = reader.array(json.limit_indices);
  1017. $.strides = reader.array(json.strides);
  1018. return $;
  1019. }
  1020. };
  1021. tflite.StablehloConvolutionOptions = class StablehloConvolutionOptions {
  1022. static decode(reader, position) {
  1023. const $ = new tflite.StablehloConvolutionOptions();
  1024. $.window_strides = reader.int64s_(position, 4);
  1025. $.padding = reader.int64s_(position, 6);
  1026. $.lhs_dilation = reader.int64s_(position, 8);
  1027. $.rhs_dilation = reader.int64s_(position, 10);
  1028. $.window_reversal = reader.bools_(position, 12);
  1029. $.input_batch_dimension = reader.int64_(position, 14, 0n);
  1030. $.input_feature_dimension = reader.int64_(position, 16, 0n);
  1031. $.input_spatial_dimensions = reader.int64s_(position, 18);
  1032. $.kernel_input_feature_dimension = reader.int64_(position, 20, 0n);
  1033. $.kernel_output_feature_dimension = reader.int64_(position, 22, 0n);
  1034. $.kernel_spatial_dimensions = reader.int64s_(position, 24);
  1035. $.output_batch_dimension = reader.int64_(position, 26, 0n);
  1036. $.output_feature_dimension = reader.int64_(position, 28, 0n);
  1037. $.output_spatial_dimensions = reader.int64s_(position, 30);
  1038. $.feature_group_count = reader.int64_(position, 32, 0n);
  1039. $.batch_group_count = reader.int64_(position, 34, 0n);
  1040. $.precision_config = reader.array(position, 36, Uint32Array);
  1041. return $;
  1042. }
  1043. static decodeText(reader, json) {
  1044. const $ = new tflite.StablehloConvolutionOptions();
  1045. $.window_strides = reader.array(json.window_strides);
  1046. $.padding = reader.array(json.padding);
  1047. $.lhs_dilation = reader.array(json.lhs_dilation);
  1048. $.rhs_dilation = reader.array(json.rhs_dilation);
  1049. $.window_reversal = reader.array(json.window_reversal);
  1050. $.input_batch_dimension = reader.int64(json.input_batch_dimension, 0n);
  1051. $.input_feature_dimension = reader.int64(json.input_feature_dimension, 0n);
  1052. $.input_spatial_dimensions = reader.array(json.input_spatial_dimensions);
  1053. $.kernel_input_feature_dimension = reader.int64(json.kernel_input_feature_dimension, 0n);
  1054. $.kernel_output_feature_dimension = reader.int64(json.kernel_output_feature_dimension, 0n);
  1055. $.kernel_spatial_dimensions = reader.array(json.kernel_spatial_dimensions);
  1056. $.output_batch_dimension = reader.int64(json.output_batch_dimension, 0n);
  1057. $.output_feature_dimension = reader.int64(json.output_feature_dimension, 0n);
  1058. $.output_spatial_dimensions = reader.array(json.output_spatial_dimensions);
  1059. $.feature_group_count = reader.int64(json.feature_group_count, 0n);
  1060. $.batch_group_count = reader.int64(json.batch_group_count, 0n);
  1061. $.precision_config = reader.objects(json.precision_config, tflite.StablehloPrecisionConfig);
  1062. return $;
  1063. }
  1064. };
  1065. tflite.StablehloScatterOptions = class StablehloScatterOptions {
  1066. static decode(reader, position) {
  1067. const $ = new tflite.StablehloScatterOptions();
  1068. $.indices_are_sorted = reader.bool_(position, 4, false);
  1069. $.update_window_dims = reader.int64s_(position, 6);
  1070. $.inserted_window_dims = reader.int64s_(position, 8);
  1071. $.scatter_dims_to_operand_dims = reader.int64s_(position, 10);
  1072. $.index_vector_dim = reader.int64_(position, 12, 0n);
  1073. $.unique_indices = reader.bool_(position, 14, false);
  1074. $.update_computation_subgraph_index = reader.int32_(position, 16, 0);
  1075. return $;
  1076. }
  1077. static decodeText(reader, json) {
  1078. const $ = new tflite.StablehloScatterOptions();
  1079. $.indices_are_sorted = reader.value(json.indices_are_sorted, false);
  1080. $.update_window_dims = reader.array(json.update_window_dims);
  1081. $.inserted_window_dims = reader.array(json.inserted_window_dims);
  1082. $.scatter_dims_to_operand_dims = reader.array(json.scatter_dims_to_operand_dims);
  1083. $.index_vector_dim = reader.int64(json.index_vector_dim, 0n);
  1084. $.unique_indices = reader.value(json.unique_indices, false);
  1085. $.update_computation_subgraph_index = reader.value(json.update_computation_subgraph_index, 0);
  1086. return $;
  1087. }
  1088. };
  1089. tflite.StablehloCaseOptions = class StablehloCaseOptions {
  1090. static decode(reader, position) {
  1091. const $ = new tflite.StablehloCaseOptions();
  1092. $.branch_subgraph_indices = reader.array(position, 4, Int32Array);
  1093. return $;
  1094. }
  1095. static decodeText(reader, json) {
  1096. const $ = new tflite.StablehloCaseOptions();
  1097. $.branch_subgraph_indices = reader.array(json.branch_subgraph_indices, Int32Array);
  1098. return $;
  1099. }
  1100. };
  1101. tflite.RngAlgorithm = {
  1102. DEFAULT: 0,
  1103. PHILOX: 1,
  1104. THREEFRY: 2
  1105. };
  1106. tflite.StablehloRngBitGeneratorOptions = class StablehloRngBitGeneratorOptions {
  1107. static decode(reader, position) {
  1108. const $ = new tflite.StablehloRngBitGeneratorOptions();
  1109. $.algorithm = reader.int8_(position, 4, 0);
  1110. return $;
  1111. }
  1112. static decodeText(reader, json) {
  1113. const $ = new tflite.StablehloRngBitGeneratorOptions();
  1114. $.algorithm = tflite.RngAlgorithm[json.algorithm];
  1115. return $;
  1116. }
  1117. };
  1118. tflite.Padding = {
  1119. SAME: 0,
  1120. VALID: 1
  1121. };
  1122. tflite.ActivationFunctionType = {
  1123. NONE: 0,
  1124. RELU: 1,
  1125. RELU_N1_TO_1: 2,
  1126. RELU6: 3,
  1127. TANH: 4,
  1128. SIGN_BIT: 5
  1129. };
  1130. tflite.Conv2DOptions = class Conv2DOptions {
  1131. static decode(reader, position) {
  1132. const $ = new tflite.Conv2DOptions();
  1133. $.padding = reader.int8_(position, 4, 0);
  1134. $.stride_w = reader.int32_(position, 6, 0);
  1135. $.stride_h = reader.int32_(position, 8, 0);
  1136. $.fused_activation_function = reader.int8_(position, 10, 0);
  1137. $.dilation_w_factor = reader.int32_(position, 12, 1);
  1138. $.dilation_h_factor = reader.int32_(position, 14, 1);
  1139. $.quantized_bias_type = reader.int8_(position, 16, 0);
  1140. return $;
  1141. }
  1142. static decodeText(reader, json) {
  1143. const $ = new tflite.Conv2DOptions();
  1144. $.padding = tflite.Padding[json.padding];
  1145. $.stride_w = reader.value(json.stride_w, 0);
  1146. $.stride_h = reader.value(json.stride_h, 0);
  1147. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1148. $.dilation_w_factor = reader.value(json.dilation_w_factor, 1);
  1149. $.dilation_h_factor = reader.value(json.dilation_h_factor, 1);
  1150. $.quantized_bias_type = tflite.TensorType[json.quantized_bias_type];
  1151. return $;
  1152. }
  1153. };
  1154. tflite.Conv3DOptions = class Conv3DOptions {
  1155. static decode(reader, position) {
  1156. const $ = new tflite.Conv3DOptions();
  1157. $.padding = reader.int8_(position, 4, 0);
  1158. $.stride_d = reader.int32_(position, 6, 0);
  1159. $.stride_w = reader.int32_(position, 8, 0);
  1160. $.stride_h = reader.int32_(position, 10, 0);
  1161. $.fused_activation_function = reader.int8_(position, 12, 0);
  1162. $.dilation_d_factor = reader.int32_(position, 14, 1);
  1163. $.dilation_w_factor = reader.int32_(position, 16, 1);
  1164. $.dilation_h_factor = reader.int32_(position, 18, 1);
  1165. return $;
  1166. }
  1167. static decodeText(reader, json) {
  1168. const $ = new tflite.Conv3DOptions();
  1169. $.padding = tflite.Padding[json.padding];
  1170. $.stride_d = reader.value(json.stride_d, 0);
  1171. $.stride_w = reader.value(json.stride_w, 0);
  1172. $.stride_h = reader.value(json.stride_h, 0);
  1173. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1174. $.dilation_d_factor = reader.value(json.dilation_d_factor, 1);
  1175. $.dilation_w_factor = reader.value(json.dilation_w_factor, 1);
  1176. $.dilation_h_factor = reader.value(json.dilation_h_factor, 1);
  1177. return $;
  1178. }
  1179. };
  1180. tflite.Pool2DOptions = class Pool2DOptions {
  1181. static decode(reader, position) {
  1182. const $ = new tflite.Pool2DOptions();
  1183. $.padding = reader.int8_(position, 4, 0);
  1184. $.stride_w = reader.int32_(position, 6, 0);
  1185. $.stride_h = reader.int32_(position, 8, 0);
  1186. $.filter_width = reader.int32_(position, 10, 0);
  1187. $.filter_height = reader.int32_(position, 12, 0);
  1188. $.fused_activation_function = reader.int8_(position, 14, 0);
  1189. return $;
  1190. }
  1191. static decodeText(reader, json) {
  1192. const $ = new tflite.Pool2DOptions();
  1193. $.padding = tflite.Padding[json.padding];
  1194. $.stride_w = reader.value(json.stride_w, 0);
  1195. $.stride_h = reader.value(json.stride_h, 0);
  1196. $.filter_width = reader.value(json.filter_width, 0);
  1197. $.filter_height = reader.value(json.filter_height, 0);
  1198. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1199. return $;
  1200. }
  1201. };
  1202. tflite.DepthwiseConv2DOptions = class DepthwiseConv2DOptions {
  1203. static decode(reader, position) {
  1204. const $ = new tflite.DepthwiseConv2DOptions();
  1205. $.padding = reader.int8_(position, 4, 0);
  1206. $.stride_w = reader.int32_(position, 6, 0);
  1207. $.stride_h = reader.int32_(position, 8, 0);
  1208. $.depth_multiplier = reader.int32_(position, 10, 0);
  1209. $.fused_activation_function = reader.int8_(position, 12, 0);
  1210. $.dilation_w_factor = reader.int32_(position, 14, 1);
  1211. $.dilation_h_factor = reader.int32_(position, 16, 1);
  1212. return $;
  1213. }
  1214. static decodeText(reader, json) {
  1215. const $ = new tflite.DepthwiseConv2DOptions();
  1216. $.padding = tflite.Padding[json.padding];
  1217. $.stride_w = reader.value(json.stride_w, 0);
  1218. $.stride_h = reader.value(json.stride_h, 0);
  1219. $.depth_multiplier = reader.value(json.depth_multiplier, 0);
  1220. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1221. $.dilation_w_factor = reader.value(json.dilation_w_factor, 1);
  1222. $.dilation_h_factor = reader.value(json.dilation_h_factor, 1);
  1223. return $;
  1224. }
  1225. };
  1226. tflite.ConcatEmbeddingsOptions = class ConcatEmbeddingsOptions {
  1227. static decode(reader, position) {
  1228. const $ = new tflite.ConcatEmbeddingsOptions();
  1229. $.num_channels = reader.int32_(position, 4, 0);
  1230. $.num_columns_per_channel = reader.array(position, 6, Int32Array);
  1231. $.embedding_dim_per_channel = reader.array(position, 8, Int32Array);
  1232. return $;
  1233. }
  1234. static decodeText(reader, json) {
  1235. const $ = new tflite.ConcatEmbeddingsOptions();
  1236. $.num_channels = reader.value(json.num_channels, 0);
  1237. $.num_columns_per_channel = reader.array(json.num_columns_per_channel, Int32Array);
  1238. $.embedding_dim_per_channel = reader.array(json.embedding_dim_per_channel, Int32Array);
  1239. return $;
  1240. }
  1241. };
  1242. tflite.LSHProjectionType = {
  1243. UNKNOWN: 0,
  1244. SPARSE: 1,
  1245. DENSE: 2
  1246. };
  1247. tflite.LSHProjectionOptions = class LSHProjectionOptions {
  1248. static decode(reader, position) {
  1249. const $ = new tflite.LSHProjectionOptions();
  1250. $.type = reader.int8_(position, 4, 0);
  1251. return $;
  1252. }
  1253. static decodeText(reader, json) {
  1254. const $ = new tflite.LSHProjectionOptions();
  1255. $.type = tflite.LSHProjectionType[json.type];
  1256. return $;
  1257. }
  1258. };
  1259. tflite.SVDFOptions = class SVDFOptions {
  1260. static decode(reader, position) {
  1261. const $ = new tflite.SVDFOptions();
  1262. $.rank = reader.int32_(position, 4, 0);
  1263. $.fused_activation_function = reader.int8_(position, 6, 0);
  1264. $.asymmetric_quantize_inputs = reader.bool_(position, 8, false);
  1265. return $;
  1266. }
  1267. static decodeText(reader, json) {
  1268. const $ = new tflite.SVDFOptions();
  1269. $.rank = reader.value(json.rank, 0);
  1270. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1271. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1272. return $;
  1273. }
  1274. };
  1275. tflite.RNNOptions = class RNNOptions {
  1276. static decode(reader, position) {
  1277. const $ = new tflite.RNNOptions();
  1278. $.fused_activation_function = reader.int8_(position, 4, 0);
  1279. $.asymmetric_quantize_inputs = reader.bool_(position, 6, false);
  1280. return $;
  1281. }
  1282. static decodeText(reader, json) {
  1283. const $ = new tflite.RNNOptions();
  1284. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1285. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1286. return $;
  1287. }
  1288. };
  1289. tflite.SequenceRNNOptions = class SequenceRNNOptions {
  1290. static decode(reader, position) {
  1291. const $ = new tflite.SequenceRNNOptions();
  1292. $.time_major = reader.bool_(position, 4, false);
  1293. $.fused_activation_function = reader.int8_(position, 6, 0);
  1294. $.asymmetric_quantize_inputs = reader.bool_(position, 8, false);
  1295. return $;
  1296. }
  1297. static decodeText(reader, json) {
  1298. const $ = new tflite.SequenceRNNOptions();
  1299. $.time_major = reader.value(json.time_major, false);
  1300. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1301. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1302. return $;
  1303. }
  1304. };
  1305. tflite.BidirectionalSequenceRNNOptions = class BidirectionalSequenceRNNOptions {
  1306. static decode(reader, position) {
  1307. const $ = new tflite.BidirectionalSequenceRNNOptions();
  1308. $.time_major = reader.bool_(position, 4, false);
  1309. $.fused_activation_function = reader.int8_(position, 6, 0);
  1310. $.merge_outputs = reader.bool_(position, 8, false);
  1311. $.asymmetric_quantize_inputs = reader.bool_(position, 10, false);
  1312. return $;
  1313. }
  1314. static decodeText(reader, json) {
  1315. const $ = new tflite.BidirectionalSequenceRNNOptions();
  1316. $.time_major = reader.value(json.time_major, false);
  1317. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1318. $.merge_outputs = reader.value(json.merge_outputs, false);
  1319. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1320. return $;
  1321. }
  1322. };
  1323. tflite.FullyConnectedOptionsWeightsFormat = {
  1324. DEFAULT: 0,
  1325. SHUFFLED4x16INT8: 1
  1326. };
  1327. tflite.FullyConnectedOptions = class FullyConnectedOptions {
  1328. static decode(reader, position) {
  1329. const $ = new tflite.FullyConnectedOptions();
  1330. $.fused_activation_function = reader.int8_(position, 4, 0);
  1331. $.weights_format = reader.int8_(position, 6, 0);
  1332. $.keep_num_dims = reader.bool_(position, 8, false);
  1333. $.asymmetric_quantize_inputs = reader.bool_(position, 10, false);
  1334. $.quantized_bias_type = reader.int8_(position, 12, 0);
  1335. return $;
  1336. }
  1337. static decodeText(reader, json) {
  1338. const $ = new tflite.FullyConnectedOptions();
  1339. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1340. $.weights_format = tflite.FullyConnectedOptionsWeightsFormat[json.weights_format];
  1341. $.keep_num_dims = reader.value(json.keep_num_dims, false);
  1342. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1343. $.quantized_bias_type = tflite.TensorType[json.quantized_bias_type];
  1344. return $;
  1345. }
  1346. };
  1347. tflite.SoftmaxOptions = class SoftmaxOptions {
  1348. static decode(reader, position) {
  1349. const $ = new tflite.SoftmaxOptions();
  1350. $.beta = reader.float32_(position, 4, 0);
  1351. return $;
  1352. }
  1353. static decodeText(reader, json) {
  1354. const $ = new tflite.SoftmaxOptions();
  1355. $.beta = reader.value(json.beta, 0);
  1356. return $;
  1357. }
  1358. };
  1359. tflite.ConcatenationOptions = class ConcatenationOptions {
  1360. static decode(reader, position) {
  1361. const $ = new tflite.ConcatenationOptions();
  1362. $.axis = reader.int32_(position, 4, 0);
  1363. $.fused_activation_function = reader.int8_(position, 6, 0);
  1364. return $;
  1365. }
  1366. static decodeText(reader, json) {
  1367. const $ = new tflite.ConcatenationOptions();
  1368. $.axis = reader.value(json.axis, 0);
  1369. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1370. return $;
  1371. }
  1372. };
  1373. tflite.AddOptions = class AddOptions {
  1374. static decode(reader, position) {
  1375. const $ = new tflite.AddOptions();
  1376. $.fused_activation_function = reader.int8_(position, 4, 0);
  1377. $.pot_scale_int16 = reader.bool_(position, 6, true);
  1378. return $;
  1379. }
  1380. static decodeText(reader, json) {
  1381. const $ = new tflite.AddOptions();
  1382. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1383. $.pot_scale_int16 = reader.value(json.pot_scale_int16, true);
  1384. return $;
  1385. }
  1386. };
  1387. tflite.MulOptions = class MulOptions {
  1388. static decode(reader, position) {
  1389. const $ = new tflite.MulOptions();
  1390. $.fused_activation_function = reader.int8_(position, 4, 0);
  1391. return $;
  1392. }
  1393. static decodeText(reader, json) {
  1394. const $ = new tflite.MulOptions();
  1395. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1396. return $;
  1397. }
  1398. };
  1399. tflite.L2NormOptions = class L2NormOptions {
  1400. static decode(reader, position) {
  1401. const $ = new tflite.L2NormOptions();
  1402. $.fused_activation_function = reader.int8_(position, 4, 0);
  1403. return $;
  1404. }
  1405. static decodeText(reader, json) {
  1406. const $ = new tflite.L2NormOptions();
  1407. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1408. return $;
  1409. }
  1410. };
  1411. tflite.LocalResponseNormalizationOptions = class LocalResponseNormalizationOptions {
  1412. static decode(reader, position) {
  1413. const $ = new tflite.LocalResponseNormalizationOptions();
  1414. $.radius = reader.int32_(position, 4, 0);
  1415. $.bias = reader.float32_(position, 6, 0);
  1416. $.alpha = reader.float32_(position, 8, 0);
  1417. $.beta = reader.float32_(position, 10, 0);
  1418. return $;
  1419. }
  1420. static decodeText(reader, json) {
  1421. const $ = new tflite.LocalResponseNormalizationOptions();
  1422. $.radius = reader.value(json.radius, 0);
  1423. $.bias = reader.value(json.bias, 0);
  1424. $.alpha = reader.value(json.alpha, 0);
  1425. $.beta = reader.value(json.beta, 0);
  1426. return $;
  1427. }
  1428. };
  1429. tflite.LSTMKernelType = {
  1430. FULL: 0,
  1431. BASIC: 1
  1432. };
  1433. tflite.LSTMOptions = class LSTMOptions {
  1434. static decode(reader, position) {
  1435. const $ = new tflite.LSTMOptions();
  1436. $.fused_activation_function = reader.int8_(position, 4, 0);
  1437. $.cell_clip = reader.float32_(position, 6, 0);
  1438. $.proj_clip = reader.float32_(position, 8, 0);
  1439. $.kernel_type = reader.int8_(position, 10, 0);
  1440. $.asymmetric_quantize_inputs = reader.bool_(position, 12, false);
  1441. return $;
  1442. }
  1443. static decodeText(reader, json) {
  1444. const $ = new tflite.LSTMOptions();
  1445. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1446. $.cell_clip = reader.value(json.cell_clip, 0);
  1447. $.proj_clip = reader.value(json.proj_clip, 0);
  1448. $.kernel_type = tflite.LSTMKernelType[json.kernel_type];
  1449. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1450. return $;
  1451. }
  1452. };
  1453. tflite.UnidirectionalSequenceLSTMOptions = class UnidirectionalSequenceLSTMOptions {
  1454. static decode(reader, position) {
  1455. const $ = new tflite.UnidirectionalSequenceLSTMOptions();
  1456. $.fused_activation_function = reader.int8_(position, 4, 0);
  1457. $.cell_clip = reader.float32_(position, 6, 0);
  1458. $.proj_clip = reader.float32_(position, 8, 0);
  1459. $.time_major = reader.bool_(position, 10, false);
  1460. $.asymmetric_quantize_inputs = reader.bool_(position, 12, false);
  1461. $.diagonal_recurrent_tensors = reader.bool_(position, 14, false);
  1462. return $;
  1463. }
  1464. static decodeText(reader, json) {
  1465. const $ = new tflite.UnidirectionalSequenceLSTMOptions();
  1466. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1467. $.cell_clip = reader.value(json.cell_clip, 0);
  1468. $.proj_clip = reader.value(json.proj_clip, 0);
  1469. $.time_major = reader.value(json.time_major, false);
  1470. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1471. $.diagonal_recurrent_tensors = reader.value(json.diagonal_recurrent_tensors, false);
  1472. return $;
  1473. }
  1474. };
  1475. tflite.BidirectionalSequenceLSTMOptions = class BidirectionalSequenceLSTMOptions {
  1476. static decode(reader, position) {
  1477. const $ = new tflite.BidirectionalSequenceLSTMOptions();
  1478. $.fused_activation_function = reader.int8_(position, 4, 0);
  1479. $.cell_clip = reader.float32_(position, 6, 0);
  1480. $.proj_clip = reader.float32_(position, 8, 0);
  1481. $.merge_outputs = reader.bool_(position, 10, false);
  1482. $.time_major = reader.bool_(position, 12, true);
  1483. $.asymmetric_quantize_inputs = reader.bool_(position, 14, false);
  1484. return $;
  1485. }
  1486. static decodeText(reader, json) {
  1487. const $ = new tflite.BidirectionalSequenceLSTMOptions();
  1488. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1489. $.cell_clip = reader.value(json.cell_clip, 0);
  1490. $.proj_clip = reader.value(json.proj_clip, 0);
  1491. $.merge_outputs = reader.value(json.merge_outputs, false);
  1492. $.time_major = reader.value(json.time_major, true);
  1493. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  1494. return $;
  1495. }
  1496. };
  1497. tflite.ResizeBilinearOptions = class ResizeBilinearOptions {
  1498. static decode(reader, position) {
  1499. const $ = new tflite.ResizeBilinearOptions();
  1500. $.new_height = reader.int32_(position, 4, 0);
  1501. $.new_width = reader.int32_(position, 6, 0);
  1502. $.align_corners = reader.bool_(position, 8, false);
  1503. $.half_pixel_centers = reader.bool_(position, 10, false);
  1504. return $;
  1505. }
  1506. static decodeText(reader, json) {
  1507. const $ = new tflite.ResizeBilinearOptions();
  1508. $.new_height = reader.value(json.new_height, 0);
  1509. $.new_width = reader.value(json.new_width, 0);
  1510. $.align_corners = reader.value(json.align_corners, false);
  1511. $.half_pixel_centers = reader.value(json.half_pixel_centers, false);
  1512. return $;
  1513. }
  1514. };
  1515. tflite.ResizeNearestNeighborOptions = class ResizeNearestNeighborOptions {
  1516. static decode(reader, position) {
  1517. const $ = new tflite.ResizeNearestNeighborOptions();
  1518. $.align_corners = reader.bool_(position, 4, false);
  1519. $.half_pixel_centers = reader.bool_(position, 6, false);
  1520. return $;
  1521. }
  1522. static decodeText(reader, json) {
  1523. const $ = new tflite.ResizeNearestNeighborOptions();
  1524. $.align_corners = reader.value(json.align_corners, false);
  1525. $.half_pixel_centers = reader.value(json.half_pixel_centers, false);
  1526. return $;
  1527. }
  1528. };
  1529. tflite.CallOptions = class CallOptions {
  1530. static decode(reader, position) {
  1531. const $ = new tflite.CallOptions();
  1532. $.subgraph = reader.uint32_(position, 4, 0);
  1533. return $;
  1534. }
  1535. static decodeText(reader, json) {
  1536. const $ = new tflite.CallOptions();
  1537. $.subgraph = reader.value(json.subgraph, 0);
  1538. return $;
  1539. }
  1540. };
  1541. tflite.PadOptions = class PadOptions {
  1542. static decode(/* reader, position */) {
  1543. const $ = new tflite.PadOptions();
  1544. return $;
  1545. }
  1546. static decodeText(/* reader, json */) {
  1547. const $ = new tflite.PadOptions();
  1548. return $;
  1549. }
  1550. };
  1551. tflite.PadV2Options = class PadV2Options {
  1552. static decode(/* reader, position */) {
  1553. const $ = new tflite.PadV2Options();
  1554. return $;
  1555. }
  1556. static decodeText(/* reader, json */) {
  1557. const $ = new tflite.PadV2Options();
  1558. return $;
  1559. }
  1560. };
  1561. tflite.ReshapeOptions = class ReshapeOptions {
  1562. static decode(reader, position) {
  1563. const $ = new tflite.ReshapeOptions();
  1564. $.new_shape = reader.array(position, 4, Int32Array);
  1565. return $;
  1566. }
  1567. static decodeText(reader, json) {
  1568. const $ = new tflite.ReshapeOptions();
  1569. $.new_shape = reader.array(json.new_shape, Int32Array);
  1570. return $;
  1571. }
  1572. };
  1573. tflite.SpaceToBatchNDOptions = class SpaceToBatchNDOptions {
  1574. static decode(/* reader, position */) {
  1575. const $ = new tflite.SpaceToBatchNDOptions();
  1576. return $;
  1577. }
  1578. static decodeText(/* reader, json */) {
  1579. const $ = new tflite.SpaceToBatchNDOptions();
  1580. return $;
  1581. }
  1582. };
  1583. tflite.BatchToSpaceNDOptions = class BatchToSpaceNDOptions {
  1584. static decode(/* reader, position */) {
  1585. const $ = new tflite.BatchToSpaceNDOptions();
  1586. return $;
  1587. }
  1588. static decodeText(/* reader, json */) {
  1589. const $ = new tflite.BatchToSpaceNDOptions();
  1590. return $;
  1591. }
  1592. };
  1593. tflite.SkipGramOptions = class SkipGramOptions {
  1594. static decode(reader, position) {
  1595. const $ = new tflite.SkipGramOptions();
  1596. $.ngram_size = reader.int32_(position, 4, 0);
  1597. $.max_skip_size = reader.int32_(position, 6, 0);
  1598. $.include_all_ngrams = reader.bool_(position, 8, false);
  1599. return $;
  1600. }
  1601. static decodeText(reader, json) {
  1602. const $ = new tflite.SkipGramOptions();
  1603. $.ngram_size = reader.value(json.ngram_size, 0);
  1604. $.max_skip_size = reader.value(json.max_skip_size, 0);
  1605. $.include_all_ngrams = reader.value(json.include_all_ngrams, false);
  1606. return $;
  1607. }
  1608. };
  1609. tflite.SpaceToDepthOptions = class SpaceToDepthOptions {
  1610. static decode(reader, position) {
  1611. const $ = new tflite.SpaceToDepthOptions();
  1612. $.block_size = reader.int32_(position, 4, 0);
  1613. return $;
  1614. }
  1615. static decodeText(reader, json) {
  1616. const $ = new tflite.SpaceToDepthOptions();
  1617. $.block_size = reader.value(json.block_size, 0);
  1618. return $;
  1619. }
  1620. };
  1621. tflite.DepthToSpaceOptions = class DepthToSpaceOptions {
  1622. static decode(reader, position) {
  1623. const $ = new tflite.DepthToSpaceOptions();
  1624. $.block_size = reader.int32_(position, 4, 0);
  1625. return $;
  1626. }
  1627. static decodeText(reader, json) {
  1628. const $ = new tflite.DepthToSpaceOptions();
  1629. $.block_size = reader.value(json.block_size, 0);
  1630. return $;
  1631. }
  1632. };
  1633. tflite.SubOptions = class SubOptions {
  1634. static decode(reader, position) {
  1635. const $ = new tflite.SubOptions();
  1636. $.fused_activation_function = reader.int8_(position, 4, 0);
  1637. $.pot_scale_int16 = reader.bool_(position, 6, true);
  1638. return $;
  1639. }
  1640. static decodeText(reader, json) {
  1641. const $ = new tflite.SubOptions();
  1642. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1643. $.pot_scale_int16 = reader.value(json.pot_scale_int16, true);
  1644. return $;
  1645. }
  1646. };
  1647. tflite.DivOptions = class DivOptions {
  1648. static decode(reader, position) {
  1649. const $ = new tflite.DivOptions();
  1650. $.fused_activation_function = reader.int8_(position, 4, 0);
  1651. return $;
  1652. }
  1653. static decodeText(reader, json) {
  1654. const $ = new tflite.DivOptions();
  1655. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1656. return $;
  1657. }
  1658. };
  1659. tflite.TopKV2Options = class TopKV2Options {
  1660. static decode(/* reader, position */) {
  1661. const $ = new tflite.TopKV2Options();
  1662. return $;
  1663. }
  1664. static decodeText(/* reader, json */) {
  1665. const $ = new tflite.TopKV2Options();
  1666. return $;
  1667. }
  1668. };
  1669. tflite.CombinerType = {
  1670. SUM: 0,
  1671. MEAN: 1,
  1672. SQRTN: 2
  1673. };
  1674. tflite.EmbeddingLookupSparseOptions = class EmbeddingLookupSparseOptions {
  1675. static decode(reader, position) {
  1676. const $ = new tflite.EmbeddingLookupSparseOptions();
  1677. $.combiner = reader.int8_(position, 4, 0);
  1678. return $;
  1679. }
  1680. static decodeText(reader, json) {
  1681. const $ = new tflite.EmbeddingLookupSparseOptions();
  1682. $.combiner = tflite.CombinerType[json.combiner];
  1683. return $;
  1684. }
  1685. };
  1686. tflite.GatherOptions = class GatherOptions {
  1687. static decode(reader, position) {
  1688. const $ = new tflite.GatherOptions();
  1689. $.axis = reader.int32_(position, 4, 0);
  1690. $.batch_dims = reader.int32_(position, 6, 0);
  1691. return $;
  1692. }
  1693. static decodeText(reader, json) {
  1694. const $ = new tflite.GatherOptions();
  1695. $.axis = reader.value(json.axis, 0);
  1696. $.batch_dims = reader.value(json.batch_dims, 0);
  1697. return $;
  1698. }
  1699. };
  1700. tflite.TransposeOptions = class TransposeOptions {
  1701. static decode(/* reader, position */) {
  1702. const $ = new tflite.TransposeOptions();
  1703. return $;
  1704. }
  1705. static decodeText(/* reader, json */) {
  1706. const $ = new tflite.TransposeOptions();
  1707. return $;
  1708. }
  1709. };
  1710. tflite.ExpOptions = class ExpOptions {
  1711. static decode(/* reader, position */) {
  1712. const $ = new tflite.ExpOptions();
  1713. return $;
  1714. }
  1715. static decodeText(/* reader, json */) {
  1716. const $ = new tflite.ExpOptions();
  1717. return $;
  1718. }
  1719. };
  1720. tflite.CosOptions = class CosOptions {
  1721. static decode(/* reader, position */) {
  1722. const $ = new tflite.CosOptions();
  1723. return $;
  1724. }
  1725. static decodeText(/* reader, json */) {
  1726. const $ = new tflite.CosOptions();
  1727. return $;
  1728. }
  1729. };
  1730. tflite.ReducerOptions = class ReducerOptions {
  1731. static decode(reader, position) {
  1732. const $ = new tflite.ReducerOptions();
  1733. $.keep_dims = reader.bool_(position, 4, false);
  1734. return $;
  1735. }
  1736. static decodeText(reader, json) {
  1737. const $ = new tflite.ReducerOptions();
  1738. $.keep_dims = reader.value(json.keep_dims, false);
  1739. return $;
  1740. }
  1741. };
  1742. tflite.SqueezeOptions = class SqueezeOptions {
  1743. static decode(reader, position) {
  1744. const $ = new tflite.SqueezeOptions();
  1745. $.squeeze_dims = reader.array(position, 4, Int32Array);
  1746. return $;
  1747. }
  1748. static decodeText(reader, json) {
  1749. const $ = new tflite.SqueezeOptions();
  1750. $.squeeze_dims = reader.array(json.squeeze_dims, Int32Array);
  1751. return $;
  1752. }
  1753. };
  1754. tflite.SplitOptions = class SplitOptions {
  1755. static decode(reader, position) {
  1756. const $ = new tflite.SplitOptions();
  1757. $.num_splits = reader.int32_(position, 4, 0);
  1758. return $;
  1759. }
  1760. static decodeText(reader, json) {
  1761. const $ = new tflite.SplitOptions();
  1762. $.num_splits = reader.value(json.num_splits, 0);
  1763. return $;
  1764. }
  1765. };
  1766. tflite.SplitVOptions = class SplitVOptions {
  1767. static decode(reader, position) {
  1768. const $ = new tflite.SplitVOptions();
  1769. $.num_splits = reader.int32_(position, 4, 0);
  1770. return $;
  1771. }
  1772. static decodeText(reader, json) {
  1773. const $ = new tflite.SplitVOptions();
  1774. $.num_splits = reader.value(json.num_splits, 0);
  1775. return $;
  1776. }
  1777. };
  1778. tflite.StridedSliceOptions = class StridedSliceOptions {
  1779. static decode(reader, position) {
  1780. const $ = new tflite.StridedSliceOptions();
  1781. $.begin_mask = reader.int32_(position, 4, 0);
  1782. $.end_mask = reader.int32_(position, 6, 0);
  1783. $.ellipsis_mask = reader.int32_(position, 8, 0);
  1784. $.new_axis_mask = reader.int32_(position, 10, 0);
  1785. $.shrink_axis_mask = reader.int32_(position, 12, 0);
  1786. $.offset = reader.bool_(position, 14, false);
  1787. return $;
  1788. }
  1789. static decodeText(reader, json) {
  1790. const $ = new tflite.StridedSliceOptions();
  1791. $.begin_mask = reader.value(json.begin_mask, 0);
  1792. $.end_mask = reader.value(json.end_mask, 0);
  1793. $.ellipsis_mask = reader.value(json.ellipsis_mask, 0);
  1794. $.new_axis_mask = reader.value(json.new_axis_mask, 0);
  1795. $.shrink_axis_mask = reader.value(json.shrink_axis_mask, 0);
  1796. $.offset = reader.value(json.offset, false);
  1797. return $;
  1798. }
  1799. };
  1800. tflite.LogSoftmaxOptions = class LogSoftmaxOptions {
  1801. static decode(/* reader, position */) {
  1802. const $ = new tflite.LogSoftmaxOptions();
  1803. return $;
  1804. }
  1805. static decodeText(/* reader, json */) {
  1806. const $ = new tflite.LogSoftmaxOptions();
  1807. return $;
  1808. }
  1809. };
  1810. tflite.CastOptions = class CastOptions {
  1811. static decode(reader, position) {
  1812. const $ = new tflite.CastOptions();
  1813. $.in_data_type = reader.int8_(position, 4, 0);
  1814. $.out_data_type = reader.int8_(position, 6, 0);
  1815. return $;
  1816. }
  1817. static decodeText(reader, json) {
  1818. const $ = new tflite.CastOptions();
  1819. $.in_data_type = tflite.TensorType[json.in_data_type];
  1820. $.out_data_type = tflite.TensorType[json.out_data_type];
  1821. return $;
  1822. }
  1823. };
  1824. tflite.DequantizeOptions = class DequantizeOptions {
  1825. static decode(/* reader, position */) {
  1826. const $ = new tflite.DequantizeOptions();
  1827. return $;
  1828. }
  1829. static decodeText(/* reader, json */) {
  1830. const $ = new tflite.DequantizeOptions();
  1831. return $;
  1832. }
  1833. };
  1834. tflite.MaximumMinimumOptions = class MaximumMinimumOptions {
  1835. static decode(/* reader, position */) {
  1836. const $ = new tflite.MaximumMinimumOptions();
  1837. return $;
  1838. }
  1839. static decodeText(/* reader, json */) {
  1840. const $ = new tflite.MaximumMinimumOptions();
  1841. return $;
  1842. }
  1843. };
  1844. tflite.TileOptions = class TileOptions {
  1845. static decode(/* reader, position */) {
  1846. const $ = new tflite.TileOptions();
  1847. return $;
  1848. }
  1849. static decodeText(/* reader, json */) {
  1850. const $ = new tflite.TileOptions();
  1851. return $;
  1852. }
  1853. };
  1854. tflite.ArgMaxOptions = class ArgMaxOptions {
  1855. static decode(reader, position) {
  1856. const $ = new tflite.ArgMaxOptions();
  1857. $.output_type = reader.int8_(position, 4, 0);
  1858. return $;
  1859. }
  1860. static decodeText(reader, json) {
  1861. const $ = new tflite.ArgMaxOptions();
  1862. $.output_type = tflite.TensorType[json.output_type];
  1863. return $;
  1864. }
  1865. };
  1866. tflite.ArgMinOptions = class ArgMinOptions {
  1867. static decode(reader, position) {
  1868. const $ = new tflite.ArgMinOptions();
  1869. $.output_type = reader.int8_(position, 4, 0);
  1870. return $;
  1871. }
  1872. static decodeText(reader, json) {
  1873. const $ = new tflite.ArgMinOptions();
  1874. $.output_type = tflite.TensorType[json.output_type];
  1875. return $;
  1876. }
  1877. };
  1878. tflite.GreaterOptions = class GreaterOptions {
  1879. static decode(/* reader, position */) {
  1880. const $ = new tflite.GreaterOptions();
  1881. return $;
  1882. }
  1883. static decodeText(/* reader, json */) {
  1884. const $ = new tflite.GreaterOptions();
  1885. return $;
  1886. }
  1887. };
  1888. tflite.GreaterEqualOptions = class GreaterEqualOptions {
  1889. static decode(/* reader, position */) {
  1890. const $ = new tflite.GreaterEqualOptions();
  1891. return $;
  1892. }
  1893. static decodeText(/* reader, json */) {
  1894. const $ = new tflite.GreaterEqualOptions();
  1895. return $;
  1896. }
  1897. };
  1898. tflite.LessOptions = class LessOptions {
  1899. static decode(/* reader, position */) {
  1900. const $ = new tflite.LessOptions();
  1901. return $;
  1902. }
  1903. static decodeText(/* reader, json */) {
  1904. const $ = new tflite.LessOptions();
  1905. return $;
  1906. }
  1907. };
  1908. tflite.LessEqualOptions = class LessEqualOptions {
  1909. static decode(/* reader, position */) {
  1910. const $ = new tflite.LessEqualOptions();
  1911. return $;
  1912. }
  1913. static decodeText(/* reader, json */) {
  1914. const $ = new tflite.LessEqualOptions();
  1915. return $;
  1916. }
  1917. };
  1918. tflite.NegOptions = class NegOptions {
  1919. static decode(/* reader, position */) {
  1920. const $ = new tflite.NegOptions();
  1921. return $;
  1922. }
  1923. static decodeText(/* reader, json */) {
  1924. const $ = new tflite.NegOptions();
  1925. return $;
  1926. }
  1927. };
  1928. tflite.SelectOptions = class SelectOptions {
  1929. static decode(/* reader, position */) {
  1930. const $ = new tflite.SelectOptions();
  1931. return $;
  1932. }
  1933. static decodeText(/* reader, json */) {
  1934. const $ = new tflite.SelectOptions();
  1935. return $;
  1936. }
  1937. };
  1938. tflite.SliceOptions = class SliceOptions {
  1939. static decode(/* reader, position */) {
  1940. const $ = new tflite.SliceOptions();
  1941. return $;
  1942. }
  1943. static decodeText(/* reader, json */) {
  1944. const $ = new tflite.SliceOptions();
  1945. return $;
  1946. }
  1947. };
  1948. tflite.TransposeConvOptions = class TransposeConvOptions {
  1949. static decode(reader, position) {
  1950. const $ = new tflite.TransposeConvOptions();
  1951. $.padding = reader.int8_(position, 4, 0);
  1952. $.stride_w = reader.int32_(position, 6, 0);
  1953. $.stride_h = reader.int32_(position, 8, 0);
  1954. $.fused_activation_function = reader.int8_(position, 10, 0);
  1955. $.quantized_bias_type = reader.int8_(position, 12, 0);
  1956. return $;
  1957. }
  1958. static decodeText(reader, json) {
  1959. const $ = new tflite.TransposeConvOptions();
  1960. $.padding = tflite.Padding[json.padding];
  1961. $.stride_w = reader.value(json.stride_w, 0);
  1962. $.stride_h = reader.value(json.stride_h, 0);
  1963. $.fused_activation_function = tflite.ActivationFunctionType[json.fused_activation_function];
  1964. $.quantized_bias_type = tflite.TensorType[json.quantized_bias_type];
  1965. return $;
  1966. }
  1967. };
  1968. tflite.ExpandDimsOptions = class ExpandDimsOptions {
  1969. static decode(/* reader, position */) {
  1970. const $ = new tflite.ExpandDimsOptions();
  1971. return $;
  1972. }
  1973. static decodeText(/* reader, json */) {
  1974. const $ = new tflite.ExpandDimsOptions();
  1975. return $;
  1976. }
  1977. };
  1978. tflite.SparseToDenseOptions = class SparseToDenseOptions {
  1979. static decode(reader, position) {
  1980. const $ = new tflite.SparseToDenseOptions();
  1981. $.validate_indices = reader.bool_(position, 4, false);
  1982. return $;
  1983. }
  1984. static decodeText(reader, json) {
  1985. const $ = new tflite.SparseToDenseOptions();
  1986. $.validate_indices = reader.value(json.validate_indices, false);
  1987. return $;
  1988. }
  1989. };
  1990. tflite.EqualOptions = class EqualOptions {
  1991. static decode(/* reader, position */) {
  1992. const $ = new tflite.EqualOptions();
  1993. return $;
  1994. }
  1995. static decodeText(/* reader, json */) {
  1996. const $ = new tflite.EqualOptions();
  1997. return $;
  1998. }
  1999. };
  2000. tflite.NotEqualOptions = class NotEqualOptions {
  2001. static decode(/* reader, position */) {
  2002. const $ = new tflite.NotEqualOptions();
  2003. return $;
  2004. }
  2005. static decodeText(/* reader, json */) {
  2006. const $ = new tflite.NotEqualOptions();
  2007. return $;
  2008. }
  2009. };
  2010. tflite.ShapeOptions = class ShapeOptions {
  2011. static decode(reader, position) {
  2012. const $ = new tflite.ShapeOptions();
  2013. $.out_type = reader.int8_(position, 4, 0);
  2014. return $;
  2015. }
  2016. static decodeText(reader, json) {
  2017. const $ = new tflite.ShapeOptions();
  2018. $.out_type = tflite.TensorType[json.out_type];
  2019. return $;
  2020. }
  2021. };
  2022. tflite.RankOptions = class RankOptions {
  2023. static decode(/* reader, position */) {
  2024. const $ = new tflite.RankOptions();
  2025. return $;
  2026. }
  2027. static decodeText(/* reader, json */) {
  2028. const $ = new tflite.RankOptions();
  2029. return $;
  2030. }
  2031. };
  2032. tflite.PowOptions = class PowOptions {
  2033. static decode(/* reader, position */) {
  2034. const $ = new tflite.PowOptions();
  2035. return $;
  2036. }
  2037. static decodeText(/* reader, json */) {
  2038. const $ = new tflite.PowOptions();
  2039. return $;
  2040. }
  2041. };
  2042. tflite.FakeQuantOptions = class FakeQuantOptions {
  2043. static decode(reader, position) {
  2044. const $ = new tflite.FakeQuantOptions();
  2045. $.min = reader.float32_(position, 4, 0);
  2046. $.max = reader.float32_(position, 6, 0);
  2047. $.num_bits = reader.int32_(position, 8, 0);
  2048. $.narrow_range = reader.bool_(position, 10, false);
  2049. return $;
  2050. }
  2051. static decodeText(reader, json) {
  2052. const $ = new tflite.FakeQuantOptions();
  2053. $.min = reader.value(json.min, 0);
  2054. $.max = reader.value(json.max, 0);
  2055. $.num_bits = reader.value(json.num_bits, 0);
  2056. $.narrow_range = reader.value(json.narrow_range, false);
  2057. return $;
  2058. }
  2059. };
  2060. tflite.PackOptions = class PackOptions {
  2061. static decode(reader, position) {
  2062. const $ = new tflite.PackOptions();
  2063. $.values_count = reader.int32_(position, 4, 0);
  2064. $.axis = reader.int32_(position, 6, 0);
  2065. return $;
  2066. }
  2067. static decodeText(reader, json) {
  2068. const $ = new tflite.PackOptions();
  2069. $.values_count = reader.value(json.values_count, 0);
  2070. $.axis = reader.value(json.axis, 0);
  2071. return $;
  2072. }
  2073. };
  2074. tflite.LogicalOrOptions = class LogicalOrOptions {
  2075. static decode(/* reader, position */) {
  2076. const $ = new tflite.LogicalOrOptions();
  2077. return $;
  2078. }
  2079. static decodeText(/* reader, json */) {
  2080. const $ = new tflite.LogicalOrOptions();
  2081. return $;
  2082. }
  2083. };
  2084. tflite.OneHotOptions = class OneHotOptions {
  2085. static decode(reader, position) {
  2086. const $ = new tflite.OneHotOptions();
  2087. $.axis = reader.int32_(position, 4, 0);
  2088. return $;
  2089. }
  2090. static decodeText(reader, json) {
  2091. const $ = new tflite.OneHotOptions();
  2092. $.axis = reader.value(json.axis, 0);
  2093. return $;
  2094. }
  2095. };
  2096. tflite.AbsOptions = class AbsOptions {
  2097. static decode(/* reader, position */) {
  2098. const $ = new tflite.AbsOptions();
  2099. return $;
  2100. }
  2101. static decodeText(/* reader, json */) {
  2102. const $ = new tflite.AbsOptions();
  2103. return $;
  2104. }
  2105. };
  2106. tflite.HardSwishOptions = class HardSwishOptions {
  2107. static decode(/* reader, position */) {
  2108. const $ = new tflite.HardSwishOptions();
  2109. return $;
  2110. }
  2111. static decodeText(/* reader, json */) {
  2112. const $ = new tflite.HardSwishOptions();
  2113. return $;
  2114. }
  2115. };
  2116. tflite.LogicalAndOptions = class LogicalAndOptions {
  2117. static decode(/* reader, position */) {
  2118. const $ = new tflite.LogicalAndOptions();
  2119. return $;
  2120. }
  2121. static decodeText(/* reader, json */) {
  2122. const $ = new tflite.LogicalAndOptions();
  2123. return $;
  2124. }
  2125. };
  2126. tflite.LogicalNotOptions = class LogicalNotOptions {
  2127. static decode(/* reader, position */) {
  2128. const $ = new tflite.LogicalNotOptions();
  2129. return $;
  2130. }
  2131. static decodeText(/* reader, json */) {
  2132. const $ = new tflite.LogicalNotOptions();
  2133. return $;
  2134. }
  2135. };
  2136. tflite.UnpackOptions = class UnpackOptions {
  2137. static decode(reader, position) {
  2138. const $ = new tflite.UnpackOptions();
  2139. $.num = reader.int32_(position, 4, 0);
  2140. $.axis = reader.int32_(position, 6, 0);
  2141. return $;
  2142. }
  2143. static decodeText(reader, json) {
  2144. const $ = new tflite.UnpackOptions();
  2145. $.num = reader.value(json.num, 0);
  2146. $.axis = reader.value(json.axis, 0);
  2147. return $;
  2148. }
  2149. };
  2150. tflite.FloorDivOptions = class FloorDivOptions {
  2151. static decode(/* reader, position */) {
  2152. const $ = new tflite.FloorDivOptions();
  2153. return $;
  2154. }
  2155. static decodeText(/* reader, json */) {
  2156. const $ = new tflite.FloorDivOptions();
  2157. return $;
  2158. }
  2159. };
  2160. tflite.SquareOptions = class SquareOptions {
  2161. static decode(/* reader, position */) {
  2162. const $ = new tflite.SquareOptions();
  2163. return $;
  2164. }
  2165. static decodeText(/* reader, json */) {
  2166. const $ = new tflite.SquareOptions();
  2167. return $;
  2168. }
  2169. };
  2170. tflite.ZerosLikeOptions = class ZerosLikeOptions {
  2171. static decode(/* reader, position */) {
  2172. const $ = new tflite.ZerosLikeOptions();
  2173. return $;
  2174. }
  2175. static decodeText(/* reader, json */) {
  2176. const $ = new tflite.ZerosLikeOptions();
  2177. return $;
  2178. }
  2179. };
  2180. tflite.FillOptions = class FillOptions {
  2181. static decode(/* reader, position */) {
  2182. const $ = new tflite.FillOptions();
  2183. return $;
  2184. }
  2185. static decodeText(/* reader, json */) {
  2186. const $ = new tflite.FillOptions();
  2187. return $;
  2188. }
  2189. };
  2190. tflite.FloorModOptions = class FloorModOptions {
  2191. static decode(/* reader, position */) {
  2192. const $ = new tflite.FloorModOptions();
  2193. return $;
  2194. }
  2195. static decodeText(/* reader, json */) {
  2196. const $ = new tflite.FloorModOptions();
  2197. return $;
  2198. }
  2199. };
  2200. tflite.RangeOptions = class RangeOptions {
  2201. static decode(/* reader, position */) {
  2202. const $ = new tflite.RangeOptions();
  2203. return $;
  2204. }
  2205. static decodeText(/* reader, json */) {
  2206. const $ = new tflite.RangeOptions();
  2207. return $;
  2208. }
  2209. };
  2210. tflite.LeakyReluOptions = class LeakyReluOptions {
  2211. static decode(reader, position) {
  2212. const $ = new tflite.LeakyReluOptions();
  2213. $.alpha = reader.float32_(position, 4, 0);
  2214. return $;
  2215. }
  2216. static decodeText(reader, json) {
  2217. const $ = new tflite.LeakyReluOptions();
  2218. $.alpha = reader.value(json.alpha, 0);
  2219. return $;
  2220. }
  2221. };
  2222. tflite.SquaredDifferenceOptions = class SquaredDifferenceOptions {
  2223. static decode(/* reader, position */) {
  2224. const $ = new tflite.SquaredDifferenceOptions();
  2225. return $;
  2226. }
  2227. static decodeText(/* reader, json */) {
  2228. const $ = new tflite.SquaredDifferenceOptions();
  2229. return $;
  2230. }
  2231. };
  2232. tflite.MirrorPadMode = {
  2233. REFLECT: 0,
  2234. SYMMETRIC: 1
  2235. };
  2236. tflite.MirrorPadOptions = class MirrorPadOptions {
  2237. static decode(reader, position) {
  2238. const $ = new tflite.MirrorPadOptions();
  2239. $.mode = reader.int8_(position, 4, 0);
  2240. return $;
  2241. }
  2242. static decodeText(reader, json) {
  2243. const $ = new tflite.MirrorPadOptions();
  2244. $.mode = tflite.MirrorPadMode[json.mode];
  2245. return $;
  2246. }
  2247. };
  2248. tflite.UniqueOptions = class UniqueOptions {
  2249. static decode(reader, position) {
  2250. const $ = new tflite.UniqueOptions();
  2251. $.idx_out_type = reader.int8_(position, 4, 2);
  2252. return $;
  2253. }
  2254. static decodeText(reader, json) {
  2255. const $ = new tflite.UniqueOptions();
  2256. $.idx_out_type = tflite.TensorType[json.idx_out_type];
  2257. return $;
  2258. }
  2259. };
  2260. tflite.ReverseV2Options = class ReverseV2Options {
  2261. static decode(/* reader, position */) {
  2262. const $ = new tflite.ReverseV2Options();
  2263. return $;
  2264. }
  2265. static decodeText(/* reader, json */) {
  2266. const $ = new tflite.ReverseV2Options();
  2267. return $;
  2268. }
  2269. };
  2270. tflite.AddNOptions = class AddNOptions {
  2271. static decode(/* reader, position */) {
  2272. const $ = new tflite.AddNOptions();
  2273. return $;
  2274. }
  2275. static decodeText(/* reader, json */) {
  2276. const $ = new tflite.AddNOptions();
  2277. return $;
  2278. }
  2279. };
  2280. tflite.GatherNdOptions = class GatherNdOptions {
  2281. static decode(/* reader, position */) {
  2282. const $ = new tflite.GatherNdOptions();
  2283. return $;
  2284. }
  2285. static decodeText(/* reader, json */) {
  2286. const $ = new tflite.GatherNdOptions();
  2287. return $;
  2288. }
  2289. };
  2290. tflite.WhereOptions = class WhereOptions {
  2291. static decode(/* reader, position */) {
  2292. const $ = new tflite.WhereOptions();
  2293. return $;
  2294. }
  2295. static decodeText(/* reader, json */) {
  2296. const $ = new tflite.WhereOptions();
  2297. return $;
  2298. }
  2299. };
  2300. tflite.ReverseSequenceOptions = class ReverseSequenceOptions {
  2301. static decode(reader, position) {
  2302. const $ = new tflite.ReverseSequenceOptions();
  2303. $.seq_dim = reader.int32_(position, 4, 0);
  2304. $.batch_dim = reader.int32_(position, 6, 0);
  2305. return $;
  2306. }
  2307. static decodeText(reader, json) {
  2308. const $ = new tflite.ReverseSequenceOptions();
  2309. $.seq_dim = reader.value(json.seq_dim, 0);
  2310. $.batch_dim = reader.value(json.batch_dim, 0);
  2311. return $;
  2312. }
  2313. };
  2314. tflite.MatrixDiagOptions = class MatrixDiagOptions {
  2315. static decode(/* reader, position */) {
  2316. const $ = new tflite.MatrixDiagOptions();
  2317. return $;
  2318. }
  2319. static decodeText(/* reader, json */) {
  2320. const $ = new tflite.MatrixDiagOptions();
  2321. return $;
  2322. }
  2323. };
  2324. tflite.QuantizeOptions = class QuantizeOptions {
  2325. static decode(/* reader, position */) {
  2326. const $ = new tflite.QuantizeOptions();
  2327. return $;
  2328. }
  2329. static decodeText(/* reader, json */) {
  2330. const $ = new tflite.QuantizeOptions();
  2331. return $;
  2332. }
  2333. };
  2334. tflite.MatrixSetDiagOptions = class MatrixSetDiagOptions {
  2335. static decode(/* reader, position */) {
  2336. const $ = new tflite.MatrixSetDiagOptions();
  2337. return $;
  2338. }
  2339. static decodeText(/* reader, json */) {
  2340. const $ = new tflite.MatrixSetDiagOptions();
  2341. return $;
  2342. }
  2343. };
  2344. tflite.IfOptions = class IfOptions {
  2345. static decode(reader, position) {
  2346. const $ = new tflite.IfOptions();
  2347. $.then_subgraph_index = reader.int32_(position, 4, 0);
  2348. $.else_subgraph_index = reader.int32_(position, 6, 0);
  2349. return $;
  2350. }
  2351. static decodeText(reader, json) {
  2352. const $ = new tflite.IfOptions();
  2353. $.then_subgraph_index = reader.value(json.then_subgraph_index, 0);
  2354. $.else_subgraph_index = reader.value(json.else_subgraph_index, 0);
  2355. return $;
  2356. }
  2357. };
  2358. tflite.CallOnceOptions = class CallOnceOptions {
  2359. static decode(reader, position) {
  2360. const $ = new tflite.CallOnceOptions();
  2361. $.init_subgraph_index = reader.int32_(position, 4, 0);
  2362. return $;
  2363. }
  2364. static decodeText(reader, json) {
  2365. const $ = new tflite.CallOnceOptions();
  2366. $.init_subgraph_index = reader.value(json.init_subgraph_index, 0);
  2367. return $;
  2368. }
  2369. };
  2370. tflite.WhileOptions = class WhileOptions {
  2371. static decode(reader, position) {
  2372. const $ = new tflite.WhileOptions();
  2373. $.cond_subgraph_index = reader.int32_(position, 4, 0);
  2374. $.body_subgraph_index = reader.int32_(position, 6, 0);
  2375. return $;
  2376. }
  2377. static decodeText(reader, json) {
  2378. const $ = new tflite.WhileOptions();
  2379. $.cond_subgraph_index = reader.value(json.cond_subgraph_index, 0);
  2380. $.body_subgraph_index = reader.value(json.body_subgraph_index, 0);
  2381. return $;
  2382. }
  2383. };
  2384. tflite.NonMaxSuppressionV4Options = class NonMaxSuppressionV4Options {
  2385. static decode(/* reader, position */) {
  2386. const $ = new tflite.NonMaxSuppressionV4Options();
  2387. return $;
  2388. }
  2389. static decodeText(/* reader, json */) {
  2390. const $ = new tflite.NonMaxSuppressionV4Options();
  2391. return $;
  2392. }
  2393. };
  2394. tflite.NonMaxSuppressionV5Options = class NonMaxSuppressionV5Options {
  2395. static decode(/* reader, position */) {
  2396. const $ = new tflite.NonMaxSuppressionV5Options();
  2397. return $;
  2398. }
  2399. static decodeText(/* reader, json */) {
  2400. const $ = new tflite.NonMaxSuppressionV5Options();
  2401. return $;
  2402. }
  2403. };
  2404. tflite.ScatterNdOptions = class ScatterNdOptions {
  2405. static decode(/* reader, position */) {
  2406. const $ = new tflite.ScatterNdOptions();
  2407. return $;
  2408. }
  2409. static decodeText(/* reader, json */) {
  2410. const $ = new tflite.ScatterNdOptions();
  2411. return $;
  2412. }
  2413. };
  2414. tflite.SelectV2Options = class SelectV2Options {
  2415. static decode(/* reader, position */) {
  2416. const $ = new tflite.SelectV2Options();
  2417. return $;
  2418. }
  2419. static decodeText(/* reader, json */) {
  2420. const $ = new tflite.SelectV2Options();
  2421. return $;
  2422. }
  2423. };
  2424. tflite.DensifyOptions = class DensifyOptions {
  2425. static decode(/* reader, position */) {
  2426. const $ = new tflite.DensifyOptions();
  2427. return $;
  2428. }
  2429. static decodeText(/* reader, json */) {
  2430. const $ = new tflite.DensifyOptions();
  2431. return $;
  2432. }
  2433. };
  2434. tflite.SegmentSumOptions = class SegmentSumOptions {
  2435. static decode(/* reader, position */) {
  2436. const $ = new tflite.SegmentSumOptions();
  2437. return $;
  2438. }
  2439. static decodeText(/* reader, json */) {
  2440. const $ = new tflite.SegmentSumOptions();
  2441. return $;
  2442. }
  2443. };
  2444. tflite.BatchMatMulOptions = class BatchMatMulOptions {
  2445. static decode(reader, position) {
  2446. const $ = new tflite.BatchMatMulOptions();
  2447. $.adj_x = reader.bool_(position, 4, false);
  2448. $.adj_y = reader.bool_(position, 6, false);
  2449. $.asymmetric_quantize_inputs = reader.bool_(position, 8, false);
  2450. return $;
  2451. }
  2452. static decodeText(reader, json) {
  2453. const $ = new tflite.BatchMatMulOptions();
  2454. $.adj_x = reader.value(json.adj_x, false);
  2455. $.adj_y = reader.value(json.adj_y, false);
  2456. $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false);
  2457. return $;
  2458. }
  2459. };
  2460. tflite.CumsumOptions = class CumsumOptions {
  2461. static decode(reader, position) {
  2462. const $ = new tflite.CumsumOptions();
  2463. $.exclusive = reader.bool_(position, 4, false);
  2464. $.reverse = reader.bool_(position, 6, false);
  2465. return $;
  2466. }
  2467. static decodeText(reader, json) {
  2468. const $ = new tflite.CumsumOptions();
  2469. $.exclusive = reader.value(json.exclusive, false);
  2470. $.reverse = reader.value(json.reverse, false);
  2471. return $;
  2472. }
  2473. };
  2474. tflite.BroadcastToOptions = class BroadcastToOptions {
  2475. static decode(/* reader, position */) {
  2476. const $ = new tflite.BroadcastToOptions();
  2477. return $;
  2478. }
  2479. static decodeText(/* reader, json */) {
  2480. const $ = new tflite.BroadcastToOptions();
  2481. return $;
  2482. }
  2483. };
  2484. tflite.Rfft2dOptions = class Rfft2dOptions {
  2485. static decode(/* reader, position */) {
  2486. const $ = new tflite.Rfft2dOptions();
  2487. return $;
  2488. }
  2489. static decodeText(/* reader, json */) {
  2490. const $ = new tflite.Rfft2dOptions();
  2491. return $;
  2492. }
  2493. };
  2494. tflite.HashtableOptions = class HashtableOptions {
  2495. static decode(reader, position) {
  2496. const $ = new tflite.HashtableOptions();
  2497. $.table_id = reader.int32_(position, 4, 0);
  2498. $.key_dtype = reader.int8_(position, 6, 0);
  2499. $.value_dtype = reader.int8_(position, 8, 0);
  2500. return $;
  2501. }
  2502. static decodeText(reader, json) {
  2503. const $ = new tflite.HashtableOptions();
  2504. $.table_id = reader.value(json.table_id, 0);
  2505. $.key_dtype = tflite.TensorType[json.key_dtype];
  2506. $.value_dtype = tflite.TensorType[json.value_dtype];
  2507. return $;
  2508. }
  2509. };
  2510. tflite.HashtableFindOptions = class HashtableFindOptions {
  2511. static decode(/* reader, position */) {
  2512. const $ = new tflite.HashtableFindOptions();
  2513. return $;
  2514. }
  2515. static decodeText(/* reader, json */) {
  2516. const $ = new tflite.HashtableFindOptions();
  2517. return $;
  2518. }
  2519. };
  2520. tflite.HashtableImportOptions = class HashtableImportOptions {
  2521. static decode(/* reader, position */) {
  2522. const $ = new tflite.HashtableImportOptions();
  2523. return $;
  2524. }
  2525. static decodeText(/* reader, json */) {
  2526. const $ = new tflite.HashtableImportOptions();
  2527. return $;
  2528. }
  2529. };
  2530. tflite.HashtableSizeOptions = class HashtableSizeOptions {
  2531. static decode(/* reader, position */) {
  2532. const $ = new tflite.HashtableSizeOptions();
  2533. return $;
  2534. }
  2535. static decodeText(/* reader, json */) {
  2536. const $ = new tflite.HashtableSizeOptions();
  2537. return $;
  2538. }
  2539. };
  2540. tflite.VarHandleOptions = class VarHandleOptions {
  2541. static decode(reader, position) {
  2542. const $ = new tflite.VarHandleOptions();
  2543. $.container = reader.string_(position, 4, null);
  2544. $.shared_name = reader.string_(position, 6, null);
  2545. return $;
  2546. }
  2547. static decodeText(reader, json) {
  2548. const $ = new tflite.VarHandleOptions();
  2549. $.container = reader.value(json.container, null);
  2550. $.shared_name = reader.value(json.shared_name, null);
  2551. return $;
  2552. }
  2553. };
  2554. tflite.ReadVariableOptions = class ReadVariableOptions {
  2555. static decode(/* reader, position */) {
  2556. const $ = new tflite.ReadVariableOptions();
  2557. return $;
  2558. }
  2559. static decodeText(/* reader, json */) {
  2560. const $ = new tflite.ReadVariableOptions();
  2561. return $;
  2562. }
  2563. };
  2564. tflite.AssignVariableOptions = class AssignVariableOptions {
  2565. static decode(/* reader, position */) {
  2566. const $ = new tflite.AssignVariableOptions();
  2567. return $;
  2568. }
  2569. static decodeText(/* reader, json */) {
  2570. const $ = new tflite.AssignVariableOptions();
  2571. return $;
  2572. }
  2573. };
  2574. tflite.RandomOptions = class RandomOptions {
  2575. static decode(reader, position) {
  2576. const $ = new tflite.RandomOptions();
  2577. $.seed = reader.int64_(position, 4, 0n);
  2578. $.seed2 = reader.int64_(position, 6, 0n);
  2579. return $;
  2580. }
  2581. static decodeText(reader, json) {
  2582. const $ = new tflite.RandomOptions();
  2583. $.seed = reader.int64(json.seed, 0n);
  2584. $.seed2 = reader.int64(json.seed2, 0n);
  2585. return $;
  2586. }
  2587. };
  2588. tflite.BucketizeOptions = class BucketizeOptions {
  2589. static decode(reader, position) {
  2590. const $ = new tflite.BucketizeOptions();
  2591. $.boundaries = reader.array(position, 4, Float32Array);
  2592. return $;
  2593. }
  2594. static decodeText(reader, json) {
  2595. const $ = new tflite.BucketizeOptions();
  2596. $.boundaries = reader.array(json.boundaries, Float32Array);
  2597. return $;
  2598. }
  2599. };
  2600. tflite.GeluOptions = class GeluOptions {
  2601. static decode(reader, position) {
  2602. const $ = new tflite.GeluOptions();
  2603. $.approximate = reader.bool_(position, 4, false);
  2604. return $;
  2605. }
  2606. static decodeText(reader, json) {
  2607. const $ = new tflite.GeluOptions();
  2608. $.approximate = reader.value(json.approximate, false);
  2609. return $;
  2610. }
  2611. };
  2612. tflite.DynamicUpdateSliceOptions = class DynamicUpdateSliceOptions {
  2613. static decode(/* reader, position */) {
  2614. const $ = new tflite.DynamicUpdateSliceOptions();
  2615. return $;
  2616. }
  2617. static decodeText(/* reader, json */) {
  2618. const $ = new tflite.DynamicUpdateSliceOptions();
  2619. return $;
  2620. }
  2621. };
  2622. tflite.UnsortedSegmentProdOptions = class UnsortedSegmentProdOptions {
  2623. static decode(/* reader, position */) {
  2624. const $ = new tflite.UnsortedSegmentProdOptions();
  2625. return $;
  2626. }
  2627. static decodeText(/* reader, json */) {
  2628. const $ = new tflite.UnsortedSegmentProdOptions();
  2629. return $;
  2630. }
  2631. };
  2632. tflite.UnsortedSegmentMaxOptions = class UnsortedSegmentMaxOptions {
  2633. static decode(/* reader, position */) {
  2634. const $ = new tflite.UnsortedSegmentMaxOptions();
  2635. return $;
  2636. }
  2637. static decodeText(/* reader, json */) {
  2638. const $ = new tflite.UnsortedSegmentMaxOptions();
  2639. return $;
  2640. }
  2641. };
  2642. tflite.UnsortedSegmentSumOptions = class UnsortedSegmentSumOptions {
  2643. static decode(/* reader, position */) {
  2644. const $ = new tflite.UnsortedSegmentSumOptions();
  2645. return $;
  2646. }
  2647. static decodeText(/* reader, json */) {
  2648. const $ = new tflite.UnsortedSegmentSumOptions();
  2649. return $;
  2650. }
  2651. };
  2652. tflite.ATan2Options = class ATan2Options {
  2653. static decode(/* reader, position */) {
  2654. const $ = new tflite.ATan2Options();
  2655. return $;
  2656. }
  2657. static decodeText(/* reader, json */) {
  2658. const $ = new tflite.ATan2Options();
  2659. return $;
  2660. }
  2661. };
  2662. tflite.UnsortedSegmentMinOptions = class UnsortedSegmentMinOptions {
  2663. static decode(/* reader, position */) {
  2664. const $ = new tflite.UnsortedSegmentMinOptions();
  2665. return $;
  2666. }
  2667. static decodeText(/* reader, json */) {
  2668. const $ = new tflite.UnsortedSegmentMinOptions();
  2669. return $;
  2670. }
  2671. };
  2672. tflite.SignOptions = class SignOptions {
  2673. static decode(/* reader, position */) {
  2674. const $ = new tflite.SignOptions();
  2675. return $;
  2676. }
  2677. static decodeText(/* reader, json */) {
  2678. const $ = new tflite.SignOptions();
  2679. return $;
  2680. }
  2681. };
  2682. tflite.BitcastOptions = class BitcastOptions {
  2683. static decode(/* reader, position */) {
  2684. const $ = new tflite.BitcastOptions();
  2685. return $;
  2686. }
  2687. static decodeText(/* reader, json */) {
  2688. const $ = new tflite.BitcastOptions();
  2689. return $;
  2690. }
  2691. };
  2692. tflite.BitwiseXorOptions = class BitwiseXorOptions {
  2693. static decode(/* reader, position */) {
  2694. const $ = new tflite.BitwiseXorOptions();
  2695. return $;
  2696. }
  2697. static decodeText(/* reader, json */) {
  2698. const $ = new tflite.BitwiseXorOptions();
  2699. return $;
  2700. }
  2701. };
  2702. tflite.RightShiftOptions = class RightShiftOptions {
  2703. static decode(/* reader, position */) {
  2704. const $ = new tflite.RightShiftOptions();
  2705. return $;
  2706. }
  2707. static decodeText(/* reader, json */) {
  2708. const $ = new tflite.RightShiftOptions();
  2709. return $;
  2710. }
  2711. };
  2712. tflite.DilateOptions = class DilateOptions {
  2713. static decode(/* reader, position */) {
  2714. const $ = new tflite.DilateOptions();
  2715. return $;
  2716. }
  2717. static decodeText(/* reader, json */) {
  2718. const $ = new tflite.DilateOptions();
  2719. return $;
  2720. }
  2721. };
  2722. tflite.ReduceWindowFunction = {
  2723. UNSUPPORTED: 0,
  2724. ADD: 1,
  2725. MUL: 2,
  2726. MINIMUM: 3,
  2727. MAXIMUM: 4,
  2728. ALL: 5,
  2729. ANY: 6
  2730. };
  2731. tflite.ReduceWindowOptions = class ReduceWindowOptions {
  2732. static decode(reader, position) {
  2733. const $ = new tflite.ReduceWindowOptions();
  2734. $.reduce_function = reader.int32_(position, 4, 0);
  2735. return $;
  2736. }
  2737. static decodeText(reader, json) {
  2738. const $ = new tflite.ReduceWindowOptions();
  2739. $.reduce_function = tflite.ReduceWindowFunction[json.reduce_function];
  2740. return $;
  2741. }
  2742. };
  2743. tflite.OperatorCode = class OperatorCode {
  2744. static decode(reader, position) {
  2745. const $ = new tflite.OperatorCode();
  2746. $.deprecated_builtin_code = reader.int8_(position, 4, 0);
  2747. $.custom_code = reader.string_(position, 6, null);
  2748. $.version = reader.int32_(position, 8, 1);
  2749. $.builtin_code = reader.int32_(position, 10, 0);
  2750. return $;
  2751. }
  2752. static decodeText(reader, json) {
  2753. const $ = new tflite.OperatorCode();
  2754. $.deprecated_builtin_code = reader.value(json.deprecated_builtin_code, 0);
  2755. $.custom_code = reader.value(json.custom_code, null);
  2756. $.version = reader.value(json.version, 1);
  2757. $.builtin_code = tflite.BuiltinOperator[json.builtin_code];
  2758. return $;
  2759. }
  2760. };
  2761. tflite.CustomOptionsFormat = {
  2762. FLEXBUFFERS: 0
  2763. };
  2764. tflite.StableHLOCompositeOptions = class StableHLOCompositeOptions {
  2765. static decode(reader, position) {
  2766. const $ = new tflite.StableHLOCompositeOptions();
  2767. $.name = reader.string_(position, 4, null);
  2768. $.decomposition_subgraph_index = reader.int32_(position, 6, 0);
  2769. $.composite_attributes = reader.array(position, 8, Uint8Array);
  2770. $.composite_attributes_format = reader.int8_(position, 10, 0);
  2771. $.version = reader.int32_(position, 12, 0);
  2772. return $;
  2773. }
  2774. static decodeText(reader, json) {
  2775. const $ = new tflite.StableHLOCompositeOptions();
  2776. $.name = reader.value(json.name, null);
  2777. $.decomposition_subgraph_index = reader.value(json.decomposition_subgraph_index, 0);
  2778. $.composite_attributes = reader.array(json.composite_attributes, Uint8Array);
  2779. $.composite_attributes_format = tflite.CustomOptionsFormat[json.composite_attributes_format];
  2780. $.version = reader.value(json.version, 0);
  2781. return $;
  2782. }
  2783. };
  2784. tflite.StablehloShiftLeftOptions = class StablehloShiftLeftOptions {
  2785. static decode(/* reader, position */) {
  2786. const $ = new tflite.StablehloShiftLeftOptions();
  2787. return $;
  2788. }
  2789. static decodeText(/* reader, json */) {
  2790. const $ = new tflite.StablehloShiftLeftOptions();
  2791. return $;
  2792. }
  2793. };
  2794. tflite.Operator = class Operator {
  2795. static decode(reader, position) {
  2796. const $ = new tflite.Operator();
  2797. $.opcode_index = reader.uint32_(position, 4, 0);
  2798. $.inputs = reader.array(position, 6, Int32Array);
  2799. $.outputs = reader.array(position, 8, Int32Array);
  2800. $.builtin_options = reader.union(position, 10, tflite.BuiltinOptions);
  2801. $.custom_options = reader.array(position, 14, Uint8Array);
  2802. $.custom_options_format = reader.int8_(position, 16, 0);
  2803. $.mutating_variable_inputs = reader.bools_(position, 18);
  2804. $.intermediates = reader.array(position, 20, Int32Array);
  2805. $.large_custom_options_offset = reader.uint64_(position, 22, 0n);
  2806. $.large_custom_options_size = reader.uint64_(position, 24, 0n);
  2807. $.builtin_options_2 = reader.union(position, 26, tflite.BuiltinOptions2);
  2808. $.debug_metadata_index = reader.int32_(position, 30, -1);
  2809. return $;
  2810. }
  2811. static decodeText(reader, json) {
  2812. const $ = new tflite.Operator();
  2813. $.opcode_index = reader.value(json.opcode_index, 0);
  2814. $.inputs = reader.array(json.inputs, Int32Array);
  2815. $.outputs = reader.array(json.outputs, Int32Array);
  2816. $.builtin_options = tflite.BuiltinOptions.decodeText(reader, json.builtin_options, json.builtin_options_type);
  2817. $.custom_options = reader.array(json.custom_options, Uint8Array);
  2818. $.custom_options_format = tflite.CustomOptionsFormat[json.custom_options_format];
  2819. $.mutating_variable_inputs = reader.array(json.mutating_variable_inputs);
  2820. $.intermediates = reader.array(json.intermediates, Int32Array);
  2821. $.large_custom_options_offset = reader.uint64(json.large_custom_options_offset, 0n);
  2822. $.large_custom_options_size = reader.uint64(json.large_custom_options_size, 0n);
  2823. $.builtin_options_2 = tflite.BuiltinOptions2.decodeText(reader, json.builtin_options_2, json.builtin_options_2_type);
  2824. $.debug_metadata_index = reader.value(json.debug_metadata_index, -1);
  2825. return $;
  2826. }
  2827. };
  2828. tflite.SubGraph = class SubGraph {
  2829. static decode(reader, position) {
  2830. const $ = new tflite.SubGraph();
  2831. $.tensors = reader.tables(position, 4, tflite.Tensor);
  2832. $.inputs = reader.array(position, 6, Int32Array);
  2833. $.outputs = reader.array(position, 8, Int32Array);
  2834. $.operators = reader.tables(position, 10, tflite.Operator);
  2835. $.name = reader.string_(position, 12, null);
  2836. $.debug_metadata_index = reader.int32_(position, 14, -1);
  2837. return $;
  2838. }
  2839. static decodeText(reader, json) {
  2840. const $ = new tflite.SubGraph();
  2841. $.tensors = reader.objects(json.tensors, tflite.Tensor);
  2842. $.inputs = reader.array(json.inputs, Int32Array);
  2843. $.outputs = reader.array(json.outputs, Int32Array);
  2844. $.operators = reader.objects(json.operators, tflite.Operator);
  2845. $.name = reader.value(json.name, null);
  2846. $.debug_metadata_index = reader.value(json.debug_metadata_index, -1);
  2847. return $;
  2848. }
  2849. };
  2850. tflite.Buffer = class Buffer {
  2851. static decode(reader, position) {
  2852. const $ = new tflite.Buffer();
  2853. $.data = reader.array(position, 4, Uint8Array);
  2854. $.offset = reader.uint64_(position, 6, 0n);
  2855. $.size = reader.uint64_(position, 8, 0n);
  2856. return $;
  2857. }
  2858. static decodeText(reader, json) {
  2859. const $ = new tflite.Buffer();
  2860. $.data = reader.array(json.data, Uint8Array);
  2861. $.offset = reader.uint64(json.offset, 0n);
  2862. $.size = reader.uint64(json.size, 0n);
  2863. return $;
  2864. }
  2865. };
  2866. tflite.ExternalBufferGroup = class ExternalBufferGroup {
  2867. static decode(reader, position) {
  2868. const $ = new tflite.ExternalBufferGroup();
  2869. $.name = reader.string_(position, 4, null);
  2870. return $;
  2871. }
  2872. static decodeText(reader, json) {
  2873. const $ = new tflite.ExternalBufferGroup();
  2874. $.name = reader.value(json.name, null);
  2875. return $;
  2876. }
  2877. };
  2878. tflite.ExternalBuffer = class ExternalBuffer {
  2879. static decode(reader, position) {
  2880. const $ = new tflite.ExternalBuffer();
  2881. $.id = reader.uint32_(position, 4, 0);
  2882. $.group = reader.uint32_(position, 6, 0);
  2883. $.offset = reader.uint64_(position, 8, 0n);
  2884. $.length = reader.uint64_(position, 10, 0n);
  2885. $.packing = reader.string_(position, 12, null);
  2886. return $;
  2887. }
  2888. static decodeText(reader, json) {
  2889. const $ = new tflite.ExternalBuffer();
  2890. $.id = reader.value(json.id, 0);
  2891. $.group = reader.value(json.group, 0);
  2892. $.offset = reader.uint64(json.offset, 0n);
  2893. $.length = reader.uint64(json.length, 0n);
  2894. $.packing = reader.value(json.packing, null);
  2895. return $;
  2896. }
  2897. };
  2898. tflite.Metadata = class Metadata {
  2899. static decode(reader, position) {
  2900. const $ = new tflite.Metadata();
  2901. $.name = reader.string_(position, 4, null);
  2902. $.buffer = reader.uint32_(position, 6, 0);
  2903. return $;
  2904. }
  2905. static decodeText(reader, json) {
  2906. const $ = new tflite.Metadata();
  2907. $.name = reader.value(json.name, null);
  2908. $.buffer = reader.value(json.buffer, 0);
  2909. return $;
  2910. }
  2911. };
  2912. tflite.TensorMap = class TensorMap {
  2913. static decode(reader, position) {
  2914. const $ = new tflite.TensorMap();
  2915. $.name = reader.string_(position, 4, null);
  2916. $.tensor_index = reader.uint32_(position, 6, 0);
  2917. return $;
  2918. }
  2919. static decodeText(reader, json) {
  2920. const $ = new tflite.TensorMap();
  2921. $.name = reader.value(json.name, null);
  2922. $.tensor_index = reader.value(json.tensor_index, 0);
  2923. return $;
  2924. }
  2925. };
  2926. tflite.SignatureDef = class SignatureDef {
  2927. static decode(reader, position) {
  2928. const $ = new tflite.SignatureDef();
  2929. $.inputs = reader.tables(position, 4, tflite.TensorMap);
  2930. $.outputs = reader.tables(position, 6, tflite.TensorMap);
  2931. $.signature_key = reader.string_(position, 8, null);
  2932. $.deprecated_tag = reader.string_(position, 10, null);
  2933. $.subgraph_index = reader.uint32_(position, 12, 0);
  2934. return $;
  2935. }
  2936. static decodeText(reader, json) {
  2937. const $ = new tflite.SignatureDef();
  2938. $.inputs = reader.objects(json.inputs, tflite.TensorMap);
  2939. $.outputs = reader.objects(json.outputs, tflite.TensorMap);
  2940. $.signature_key = reader.value(json.signature_key, null);
  2941. $.deprecated_tag = reader.value(json.deprecated_tag, null);
  2942. $.subgraph_index = reader.value(json.subgraph_index, 0);
  2943. return $;
  2944. }
  2945. };
  2946. tflite.Model = class Model {
  2947. static identifier(reader) {
  2948. return reader.identifier === 'TFL3';
  2949. }
  2950. static create(reader) {
  2951. return tflite.Model.decode(reader, reader.root);
  2952. }
  2953. static createText(reader) {
  2954. return tflite.Model.decodeText(reader, reader.root);
  2955. }
  2956. static decode(reader, position) {
  2957. const $ = new tflite.Model();
  2958. $.version = reader.uint32_(position, 4, 0);
  2959. $.operator_codes = reader.tables(position, 6, tflite.OperatorCode);
  2960. $.subgraphs = reader.tables(position, 8, tflite.SubGraph);
  2961. $.description = reader.string_(position, 10, null);
  2962. $.buffers = reader.tables(position, 12, tflite.Buffer);
  2963. $.metadata_buffer = reader.array(position, 14, Int32Array);
  2964. $.metadata = reader.tables(position, 16, tflite.Metadata);
  2965. $.signature_defs = reader.tables(position, 18, tflite.SignatureDef);
  2966. $.external_buffer_groups = reader.tables(position, 20, tflite.ExternalBufferGroup);
  2967. $.external_buffers = reader.tables(position, 22, tflite.ExternalBuffer);
  2968. return $;
  2969. }
  2970. static decodeText(reader, json) {
  2971. const $ = new tflite.Model();
  2972. $.version = reader.value(json.version, 0);
  2973. $.operator_codes = reader.objects(json.operator_codes, tflite.OperatorCode);
  2974. $.subgraphs = reader.objects(json.subgraphs, tflite.SubGraph);
  2975. $.description = reader.value(json.description, null);
  2976. $.buffers = reader.objects(json.buffers, tflite.Buffer);
  2977. $.metadata_buffer = reader.array(json.metadata_buffer, Int32Array);
  2978. $.metadata = reader.objects(json.metadata, tflite.Metadata);
  2979. $.signature_defs = reader.objects(json.signature_defs, tflite.SignatureDef);
  2980. $.external_buffer_groups = reader.objects(json.external_buffer_groups, tflite.ExternalBufferGroup);
  2981. $.external_buffers = reader.objects(json.external_buffers, tflite.ExternalBuffer);
  2982. return $;
  2983. }
  2984. };
  2985. tflite.AssociatedFileType = {
  2986. UNKNOWN: 0,
  2987. DESCRIPTIONS: 1,
  2988. TENSOR_AXIS_LABELS: 2,
  2989. TENSOR_VALUE_LABELS: 3,
  2990. TENSOR_AXIS_SCORE_CALIBRATION: 4,
  2991. VOCABULARY: 5,
  2992. SCANN_INDEX_FILE: 6
  2993. };
  2994. tflite.AssociatedFile = class AssociatedFile {
  2995. static decode(reader, position) {
  2996. const $ = new tflite.AssociatedFile();
  2997. $.name = reader.string_(position, 4, null);
  2998. $.description = reader.string_(position, 6, null);
  2999. $.type = reader.int8_(position, 8, 0);
  3000. $.locale = reader.string_(position, 10, null);
  3001. $.version = reader.string_(position, 12, null);
  3002. return $;
  3003. }
  3004. static decodeText(reader, json) {
  3005. const $ = new tflite.AssociatedFile();
  3006. $.name = reader.value(json.name, null);
  3007. $.description = reader.value(json.description, null);
  3008. $.type = tflite.AssociatedFileType[json.type];
  3009. $.locale = reader.value(json.locale, null);
  3010. $.version = reader.value(json.version, null);
  3011. return $;
  3012. }
  3013. };
  3014. tflite.FeatureProperties = class FeatureProperties {
  3015. static decode(/* reader, position */) {
  3016. const $ = new tflite.FeatureProperties();
  3017. return $;
  3018. }
  3019. static decodeText(/* reader, json */) {
  3020. const $ = new tflite.FeatureProperties();
  3021. return $;
  3022. }
  3023. };
  3024. tflite.ColorSpaceType = {
  3025. UNKNOWN: 0,
  3026. RGB: 1,
  3027. GRAYSCALE: 2
  3028. };
  3029. tflite.ImageSize = class ImageSize {
  3030. static decode(reader, position) {
  3031. const $ = new tflite.ImageSize();
  3032. $.width = reader.uint32_(position, 4, 0);
  3033. $.height = reader.uint32_(position, 6, 0);
  3034. return $;
  3035. }
  3036. static decodeText(reader, json) {
  3037. const $ = new tflite.ImageSize();
  3038. $.width = reader.value(json.width, 0);
  3039. $.height = reader.value(json.height, 0);
  3040. return $;
  3041. }
  3042. };
  3043. tflite.ImageProperties = class ImageProperties {
  3044. static decode(reader, position) {
  3045. const $ = new tflite.ImageProperties();
  3046. $.color_space = reader.int8_(position, 4, 0);
  3047. $.default_size = reader.table(position, 6, tflite.ImageSize);
  3048. return $;
  3049. }
  3050. static decodeText(reader, json) {
  3051. const $ = new tflite.ImageProperties();
  3052. $.color_space = tflite.ColorSpaceType[json.color_space];
  3053. $.default_size = reader.object(json.default_size, tflite.ImageSize);
  3054. return $;
  3055. }
  3056. };
  3057. tflite.BoundingBoxType = {
  3058. UNKNOWN: 0,
  3059. BOUNDARIES: 1,
  3060. UPPER_LEFT: 2,
  3061. CENTER: 3
  3062. };
  3063. tflite.AudioProperties = class AudioProperties {
  3064. static decode(reader, position) {
  3065. const $ = new tflite.AudioProperties();
  3066. $.sample_rate = reader.uint32_(position, 4, 0);
  3067. $.channels = reader.uint32_(position, 6, 0);
  3068. return $;
  3069. }
  3070. static decodeText(reader, json) {
  3071. const $ = new tflite.AudioProperties();
  3072. $.sample_rate = reader.value(json.sample_rate, 0);
  3073. $.channels = reader.value(json.channels, 0);
  3074. return $;
  3075. }
  3076. };
  3077. tflite.CoordinateType = {
  3078. RATIO: 0,
  3079. PIXEL: 1
  3080. };
  3081. tflite.BoundingBoxProperties = class BoundingBoxProperties {
  3082. static decode(reader, position) {
  3083. const $ = new tflite.BoundingBoxProperties();
  3084. $.index = reader.array(position, 4, Uint32Array);
  3085. $.type = reader.int8_(position, 6, 0);
  3086. $.coordinate_type = reader.int8_(position, 8, 0);
  3087. return $;
  3088. }
  3089. static decodeText(reader, json) {
  3090. const $ = new tflite.BoundingBoxProperties();
  3091. $.index = reader.array(json.index, Uint32Array);
  3092. $.type = tflite.BoundingBoxType[json.type];
  3093. $.coordinate_type = tflite.CoordinateType[json.coordinate_type];
  3094. return $;
  3095. }
  3096. };
  3097. tflite.ContentProperties = class {
  3098. static decode(reader, position, type) {
  3099. switch (type) {
  3100. case 1: return tflite.FeatureProperties.decode(reader, position);
  3101. case 2: return tflite.ImageProperties.decode(reader, position);
  3102. case 3: return tflite.BoundingBoxProperties.decode(reader, position);
  3103. case 4: return tflite.AudioProperties.decode(reader, position);
  3104. default: return undefined;
  3105. }
  3106. }
  3107. static decodeText(reader, json, type) {
  3108. switch (type) {
  3109. case 'FeatureProperties': return tflite.FeatureProperties.decodeText(reader, json);
  3110. case 'ImageProperties': return tflite.ImageProperties.decodeText(reader, json);
  3111. case 'BoundingBoxProperties': return tflite.BoundingBoxProperties.decodeText(reader, json);
  3112. case 'AudioProperties': return tflite.AudioProperties.decodeText(reader, json);
  3113. default: return undefined;
  3114. }
  3115. }
  3116. };
  3117. tflite.ValueRange = class ValueRange {
  3118. static decode(reader, position) {
  3119. const $ = new tflite.ValueRange();
  3120. $.min = reader.int32_(position, 4, 0);
  3121. $.max = reader.int32_(position, 6, 0);
  3122. return $;
  3123. }
  3124. static decodeText(reader, json) {
  3125. const $ = new tflite.ValueRange();
  3126. $.min = reader.value(json.min, 0);
  3127. $.max = reader.value(json.max, 0);
  3128. return $;
  3129. }
  3130. };
  3131. tflite.Content = class Content {
  3132. static decode(reader, position) {
  3133. const $ = new tflite.Content();
  3134. $.content_properties = reader.union(position, 4, tflite.ContentProperties);
  3135. $.range = reader.table(position, 8, tflite.ValueRange);
  3136. return $;
  3137. }
  3138. static decodeText(reader, json) {
  3139. const $ = new tflite.Content();
  3140. $.content_properties = tflite.ContentProperties.decodeText(reader, json.content_properties, json.content_properties_type);
  3141. $.range = reader.object(json.range, tflite.ValueRange);
  3142. return $;
  3143. }
  3144. };
  3145. tflite.NormalizationOptions = class NormalizationOptions {
  3146. static decode(reader, position) {
  3147. const $ = new tflite.NormalizationOptions();
  3148. $.mean = reader.array(position, 4, Float32Array);
  3149. $.std = reader.array(position, 6, Float32Array);
  3150. return $;
  3151. }
  3152. static decodeText(reader, json) {
  3153. const $ = new tflite.NormalizationOptions();
  3154. $.mean = reader.array(json.mean, Float32Array);
  3155. $.std = reader.array(json.std, Float32Array);
  3156. return $;
  3157. }
  3158. };
  3159. tflite.ScoreTransformationType = {
  3160. IDENTITY: 0,
  3161. LOG: 1,
  3162. INVERSE_LOGISTIC: 2
  3163. };
  3164. tflite.ScoreCalibrationOptions = class ScoreCalibrationOptions {
  3165. static decode(reader, position) {
  3166. const $ = new tflite.ScoreCalibrationOptions();
  3167. $.score_transformation = reader.int8_(position, 4, 0);
  3168. $.default_score = reader.float32_(position, 6, 0);
  3169. return $;
  3170. }
  3171. static decodeText(reader, json) {
  3172. const $ = new tflite.ScoreCalibrationOptions();
  3173. $.score_transformation = tflite.ScoreTransformationType[json.score_transformation];
  3174. $.default_score = reader.value(json.default_score, 0);
  3175. return $;
  3176. }
  3177. };
  3178. tflite.ScoreThresholdingOptions = class ScoreThresholdingOptions {
  3179. static decode(reader, position) {
  3180. const $ = new tflite.ScoreThresholdingOptions();
  3181. $.global_score_threshold = reader.float32_(position, 4, 0);
  3182. return $;
  3183. }
  3184. static decodeText(reader, json) {
  3185. const $ = new tflite.ScoreThresholdingOptions();
  3186. $.global_score_threshold = reader.value(json.global_score_threshold, 0);
  3187. return $;
  3188. }
  3189. };
  3190. tflite.BertTokenizerOptions = class BertTokenizerOptions {
  3191. static decode(reader, position) {
  3192. const $ = new tflite.BertTokenizerOptions();
  3193. $.vocab_file = reader.tables(position, 4, tflite.AssociatedFile);
  3194. return $;
  3195. }
  3196. static decodeText(reader, json) {
  3197. const $ = new tflite.BertTokenizerOptions();
  3198. $.vocab_file = reader.objects(json.vocab_file, tflite.AssociatedFile);
  3199. return $;
  3200. }
  3201. };
  3202. tflite.SentencePieceTokenizerOptions = class SentencePieceTokenizerOptions {
  3203. static decode(reader, position) {
  3204. const $ = new tflite.SentencePieceTokenizerOptions();
  3205. $.sentencePiece_model = reader.tables(position, 4, tflite.AssociatedFile);
  3206. $.vocab_file = reader.tables(position, 6, tflite.AssociatedFile);
  3207. return $;
  3208. }
  3209. static decodeText(reader, json) {
  3210. const $ = new tflite.SentencePieceTokenizerOptions();
  3211. $.sentencePiece_model = reader.objects(json.sentencePiece_model, tflite.AssociatedFile);
  3212. $.vocab_file = reader.objects(json.vocab_file, tflite.AssociatedFile);
  3213. return $;
  3214. }
  3215. };
  3216. tflite.RegexTokenizerOptions = class RegexTokenizerOptions {
  3217. static decode(reader, position) {
  3218. const $ = new tflite.RegexTokenizerOptions();
  3219. $.delim_regex_pattern = reader.string_(position, 4, null);
  3220. $.vocab_file = reader.tables(position, 6, tflite.AssociatedFile);
  3221. return $;
  3222. }
  3223. static decodeText(reader, json) {
  3224. const $ = new tflite.RegexTokenizerOptions();
  3225. $.delim_regex_pattern = reader.value(json.delim_regex_pattern, null);
  3226. $.vocab_file = reader.objects(json.vocab_file, tflite.AssociatedFile);
  3227. return $;
  3228. }
  3229. };
  3230. tflite.ProcessUnitOptions = class {
  3231. static decode(reader, position, type) {
  3232. switch (type) {
  3233. case 1: return tflite.NormalizationOptions.decode(reader, position);
  3234. case 2: return tflite.ScoreCalibrationOptions.decode(reader, position);
  3235. case 3: return tflite.ScoreThresholdingOptions.decode(reader, position);
  3236. case 4: return tflite.BertTokenizerOptions.decode(reader, position);
  3237. case 5: return tflite.SentencePieceTokenizerOptions.decode(reader, position);
  3238. case 6: return tflite.RegexTokenizerOptions.decode(reader, position);
  3239. default: return undefined;
  3240. }
  3241. }
  3242. static decodeText(reader, json, type) {
  3243. switch (type) {
  3244. case 'NormalizationOptions': return tflite.NormalizationOptions.decodeText(reader, json);
  3245. case 'ScoreCalibrationOptions': return tflite.ScoreCalibrationOptions.decodeText(reader, json);
  3246. case 'ScoreThresholdingOptions': return tflite.ScoreThresholdingOptions.decodeText(reader, json);
  3247. case 'BertTokenizerOptions': return tflite.BertTokenizerOptions.decodeText(reader, json);
  3248. case 'SentencePieceTokenizerOptions': return tflite.SentencePieceTokenizerOptions.decodeText(reader, json);
  3249. case 'RegexTokenizerOptions': return tflite.RegexTokenizerOptions.decodeText(reader, json);
  3250. default: return undefined;
  3251. }
  3252. }
  3253. };
  3254. tflite.ProcessUnit = class ProcessUnit {
  3255. static decode(reader, position) {
  3256. const $ = new tflite.ProcessUnit();
  3257. $.options = reader.union(position, 4, tflite.ProcessUnitOptions);
  3258. return $;
  3259. }
  3260. static decodeText(reader, json) {
  3261. const $ = new tflite.ProcessUnit();
  3262. $.options = tflite.ProcessUnitOptions.decodeText(reader, json.options, json.options_type);
  3263. return $;
  3264. }
  3265. };
  3266. tflite.Stats = class Stats {
  3267. static decode(reader, position) {
  3268. const $ = new tflite.Stats();
  3269. $.max = reader.array(position, 4, Float32Array);
  3270. $.min = reader.array(position, 6, Float32Array);
  3271. return $;
  3272. }
  3273. static decodeText(reader, json) {
  3274. const $ = new tflite.Stats();
  3275. $.max = reader.array(json.max, Float32Array);
  3276. $.min = reader.array(json.min, Float32Array);
  3277. return $;
  3278. }
  3279. };
  3280. tflite.TensorGroup = class TensorGroup {
  3281. static decode(reader, position) {
  3282. const $ = new tflite.TensorGroup();
  3283. $.name = reader.string_(position, 4, null);
  3284. $.tensor_names = reader.strings_(position, 6);
  3285. return $;
  3286. }
  3287. static decodeText(reader, json) {
  3288. const $ = new tflite.TensorGroup();
  3289. $.name = reader.value(json.name, null);
  3290. $.tensor_names = reader.array(json.tensor_names);
  3291. return $;
  3292. }
  3293. };
  3294. tflite.TensorMetadata = class TensorMetadata {
  3295. static decode(reader, position) {
  3296. const $ = new tflite.TensorMetadata();
  3297. $.name = reader.string_(position, 4, null);
  3298. $.description = reader.string_(position, 6, null);
  3299. $.dimension_names = reader.strings_(position, 8);
  3300. $.content = reader.table(position, 10, tflite.Content);
  3301. $.process_units = reader.tables(position, 12, tflite.ProcessUnit);
  3302. $.stats = reader.table(position, 14, tflite.Stats);
  3303. $.associated_files = reader.tables(position, 16, tflite.AssociatedFile);
  3304. return $;
  3305. }
  3306. static decodeText(reader, json) {
  3307. const $ = new tflite.TensorMetadata();
  3308. $.name = reader.value(json.name, null);
  3309. $.description = reader.value(json.description, null);
  3310. $.dimension_names = reader.array(json.dimension_names);
  3311. $.content = reader.object(json.content, tflite.Content);
  3312. $.process_units = reader.objects(json.process_units, tflite.ProcessUnit);
  3313. $.stats = reader.object(json.stats, tflite.Stats);
  3314. $.associated_files = reader.objects(json.associated_files, tflite.AssociatedFile);
  3315. return $;
  3316. }
  3317. };
  3318. tflite.CustomMetadata = class CustomMetadata {
  3319. static decode(reader, position) {
  3320. const $ = new tflite.CustomMetadata();
  3321. $.name = reader.string_(position, 4, null);
  3322. $.data = reader.array(position, 6, Uint8Array);
  3323. return $;
  3324. }
  3325. static decodeText(reader, json) {
  3326. const $ = new tflite.CustomMetadata();
  3327. $.name = reader.value(json.name, null);
  3328. $.data = reader.array(json.data, Uint8Array);
  3329. return $;
  3330. }
  3331. };
  3332. tflite.SubGraphMetadata = class SubGraphMetadata {
  3333. static decode(reader, position) {
  3334. const $ = new tflite.SubGraphMetadata();
  3335. $.name = reader.string_(position, 4, null);
  3336. $.description = reader.string_(position, 6, null);
  3337. $.input_tensor_metadata = reader.tables(position, 8, tflite.TensorMetadata);
  3338. $.output_tensor_metadata = reader.tables(position, 10, tflite.TensorMetadata);
  3339. $.associated_files = reader.tables(position, 12, tflite.AssociatedFile);
  3340. $.input_process_units = reader.tables(position, 14, tflite.ProcessUnit);
  3341. $.output_process_units = reader.tables(position, 16, tflite.ProcessUnit);
  3342. $.input_tensor_groups = reader.tables(position, 18, tflite.TensorGroup);
  3343. $.output_tensor_groups = reader.tables(position, 20, tflite.TensorGroup);
  3344. $.custom_metadata = reader.tables(position, 22, tflite.CustomMetadata);
  3345. return $;
  3346. }
  3347. static decodeText(reader, json) {
  3348. const $ = new tflite.SubGraphMetadata();
  3349. $.name = reader.value(json.name, null);
  3350. $.description = reader.value(json.description, null);
  3351. $.input_tensor_metadata = reader.objects(json.input_tensor_metadata, tflite.TensorMetadata);
  3352. $.output_tensor_metadata = reader.objects(json.output_tensor_metadata, tflite.TensorMetadata);
  3353. $.associated_files = reader.objects(json.associated_files, tflite.AssociatedFile);
  3354. $.input_process_units = reader.objects(json.input_process_units, tflite.ProcessUnit);
  3355. $.output_process_units = reader.objects(json.output_process_units, tflite.ProcessUnit);
  3356. $.input_tensor_groups = reader.objects(json.input_tensor_groups, tflite.TensorGroup);
  3357. $.output_tensor_groups = reader.objects(json.output_tensor_groups, tflite.TensorGroup);
  3358. $.custom_metadata = reader.objects(json.custom_metadata, tflite.CustomMetadata);
  3359. return $;
  3360. }
  3361. };
  3362. tflite.ModelMetadata = class ModelMetadata {
  3363. static identifier(reader) {
  3364. return reader.identifier === 'M001';
  3365. }
  3366. static create(reader) {
  3367. return tflite.ModelMetadata.decode(reader, reader.root);
  3368. }
  3369. static createText(reader) {
  3370. return tflite.ModelMetadata.decodeText(reader, reader.root);
  3371. }
  3372. static decode(reader, position) {
  3373. const $ = new tflite.ModelMetadata();
  3374. $.name = reader.string_(position, 4, null);
  3375. $.description = reader.string_(position, 6, null);
  3376. $.version = reader.string_(position, 8, null);
  3377. $.subgraph_metadata = reader.tables(position, 10, tflite.SubGraphMetadata);
  3378. $.author = reader.string_(position, 12, null);
  3379. $.license = reader.string_(position, 14, null);
  3380. $.associated_files = reader.tables(position, 16, tflite.AssociatedFile);
  3381. $.min_parser_version = reader.string_(position, 18, null);
  3382. return $;
  3383. }
  3384. static decodeText(reader, json) {
  3385. const $ = new tflite.ModelMetadata();
  3386. $.name = reader.value(json.name, null);
  3387. $.description = reader.value(json.description, null);
  3388. $.version = reader.value(json.version, null);
  3389. $.subgraph_metadata = reader.objects(json.subgraph_metadata, tflite.SubGraphMetadata);
  3390. $.author = reader.value(json.author, null);
  3391. $.license = reader.value(json.license, null);
  3392. $.associated_files = reader.objects(json.associated_files, tflite.AssociatedFile);
  3393. $.min_parser_version = reader.value(json.min_parser_version, null);
  3394. return $;
  3395. }
  3396. };