circle-schema.js 125 KB

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