tflite-schema.js 106 KB

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