tf-proto.js 205 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044
  1. var $root = protobuf.get('tf');
  2. $root.tensorflow = {};
  3. $root.tensorflow.SavedModel = class SavedModel {
  4. constructor() {
  5. this.meta_graphs = [];
  6. }
  7. static decode(reader, length) {
  8. const message = new $root.tensorflow.SavedModel();
  9. const end = length !== undefined ? reader.position + length : reader.length;
  10. while (reader.position < end) {
  11. const tag = reader.uint32();
  12. switch (tag >>> 3) {
  13. case 1:
  14. message.saved_model_schema_version = reader.int64();
  15. break;
  16. case 2:
  17. message.meta_graphs.push($root.tensorflow.MetaGraphDef.decode(reader, reader.uint32()));
  18. break;
  19. default:
  20. reader.skipType(tag & 7);
  21. break;
  22. }
  23. }
  24. return message;
  25. }
  26. static decodeText(reader) {
  27. const message = new $root.tensorflow.SavedModel();
  28. reader.start();
  29. while (!reader.end()) {
  30. const tag = reader.tag();
  31. switch (tag) {
  32. case "saved_model_schema_version":
  33. message.saved_model_schema_version = reader.int64();
  34. break;
  35. case "meta_graphs":
  36. message.meta_graphs.push($root.tensorflow.MetaGraphDef.decodeText(reader));
  37. break;
  38. default:
  39. reader.field(tag, message);
  40. break;
  41. }
  42. }
  43. return message;
  44. }
  45. };
  46. $root.tensorflow.SavedModel.prototype.saved_model_schema_version = protobuf.Int64.create(0);
  47. $root.tensorflow.MetaGraphDef = class MetaGraphDef {
  48. constructor() {
  49. this.collection_def = {};
  50. this.signature_def = {};
  51. this.asset_file_def = [];
  52. }
  53. static decode(reader, length) {
  54. const message = new $root.tensorflow.MetaGraphDef();
  55. const end = length !== undefined ? reader.position + length : reader.length;
  56. while (reader.position < end) {
  57. const tag = reader.uint32();
  58. switch (tag >>> 3) {
  59. case 1:
  60. message.meta_info_def = $root.tensorflow.MetaGraphDef.MetaInfoDef.decode(reader, reader.uint32());
  61. break;
  62. case 2:
  63. message.graph_def = $root.tensorflow.GraphDef.decode(reader, reader.uint32());
  64. break;
  65. case 3:
  66. message.saver_def = $root.tensorflow.SaverDef.decode(reader, reader.uint32());
  67. break;
  68. case 4:
  69. reader.entry(message.collection_def, () => reader.string(), () => $root.tensorflow.CollectionDef.decode(reader, reader.uint32()));
  70. break;
  71. case 5:
  72. reader.entry(message.signature_def, () => reader.string(), () => $root.tensorflow.SignatureDef.decode(reader, reader.uint32()));
  73. break;
  74. case 6:
  75. message.asset_file_def.push($root.tensorflow.AssetFileDef.decode(reader, reader.uint32()));
  76. break;
  77. case 7:
  78. message.object_graph_def = $root.tensorflow.SavedObjectGraph.decode(reader, reader.uint32());
  79. break;
  80. default:
  81. reader.skipType(tag & 7);
  82. break;
  83. }
  84. }
  85. return message;
  86. }
  87. static decodeText(reader) {
  88. const message = new $root.tensorflow.MetaGraphDef();
  89. reader.start();
  90. while (!reader.end()) {
  91. const tag = reader.tag();
  92. switch (tag) {
  93. case "meta_info_def":
  94. message.meta_info_def = $root.tensorflow.MetaGraphDef.MetaInfoDef.decodeText(reader);
  95. break;
  96. case "graph_def":
  97. message.graph_def = $root.tensorflow.GraphDef.decodeText(reader);
  98. break;
  99. case "saver_def":
  100. message.saver_def = $root.tensorflow.SaverDef.decodeText(reader);
  101. break;
  102. case "collection_def":
  103. reader.entry(message.collection_def, () => reader.string(), () => $root.tensorflow.CollectionDef.decodeText(reader));
  104. break;
  105. case "signature_def":
  106. reader.entry(message.signature_def, () => reader.string(), () => $root.tensorflow.SignatureDef.decodeText(reader));
  107. break;
  108. case "asset_file_def":
  109. message.asset_file_def.push($root.tensorflow.AssetFileDef.decodeText(reader));
  110. break;
  111. case "object_graph_def":
  112. message.object_graph_def = $root.tensorflow.SavedObjectGraph.decodeText(reader);
  113. break;
  114. default:
  115. reader.field(tag, message);
  116. break;
  117. }
  118. }
  119. return message;
  120. }
  121. };
  122. $root.tensorflow.MetaGraphDef.prototype.meta_info_def = null;
  123. $root.tensorflow.MetaGraphDef.prototype.graph_def = null;
  124. $root.tensorflow.MetaGraphDef.prototype.saver_def = null;
  125. $root.tensorflow.MetaGraphDef.prototype.object_graph_def = null;
  126. $root.tensorflow.MetaGraphDef.MetaInfoDef = class MetaInfoDef {
  127. constructor() {
  128. this.tags = [];
  129. this.function_aliases = {};
  130. }
  131. static decode(reader, length) {
  132. const message = new $root.tensorflow.MetaGraphDef.MetaInfoDef();
  133. const end = length !== undefined ? reader.position + length : reader.length;
  134. while (reader.position < end) {
  135. const tag = reader.uint32();
  136. switch (tag >>> 3) {
  137. case 1:
  138. message.meta_graph_version = reader.string();
  139. break;
  140. case 2:
  141. message.stripped_op_list = $root.tensorflow.OpList.decode(reader, reader.uint32());
  142. break;
  143. case 3:
  144. message.any_info = $root.google.protobuf.Any.decode(reader, reader.uint32());
  145. break;
  146. case 4:
  147. message.tags.push(reader.string());
  148. break;
  149. case 5:
  150. message.tensorflow_version = reader.string();
  151. break;
  152. case 6:
  153. message.tensorflow_git_version = reader.string();
  154. break;
  155. case 7:
  156. message.stripped_default_attrs = reader.bool();
  157. break;
  158. case 8:
  159. reader.entry(message.function_aliases, () => reader.string(), () => reader.string());
  160. break;
  161. default:
  162. reader.skipType(tag & 7);
  163. break;
  164. }
  165. }
  166. return message;
  167. }
  168. static decodeText(reader) {
  169. const message = new $root.tensorflow.MetaGraphDef.MetaInfoDef();
  170. reader.start();
  171. while (!reader.end()) {
  172. const tag = reader.tag();
  173. switch (tag) {
  174. case "meta_graph_version":
  175. message.meta_graph_version = reader.string();
  176. break;
  177. case "stripped_op_list":
  178. message.stripped_op_list = $root.tensorflow.OpList.decodeText(reader);
  179. break;
  180. case "any_info":
  181. message.any_info = $root.google.protobuf.Any.decodeText(reader);
  182. break;
  183. case "tags":
  184. reader.array(message.tags, () => reader.string());
  185. break;
  186. case "tensorflow_version":
  187. message.tensorflow_version = reader.string();
  188. break;
  189. case "tensorflow_git_version":
  190. message.tensorflow_git_version = reader.string();
  191. break;
  192. case "stripped_default_attrs":
  193. message.stripped_default_attrs = reader.bool();
  194. break;
  195. case "function_aliases":
  196. reader.entry(message.function_aliases, () => reader.string(), () => reader.string());
  197. break;
  198. default:
  199. reader.field(tag, message);
  200. break;
  201. }
  202. }
  203. return message;
  204. }
  205. };
  206. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.meta_graph_version = "";
  207. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.stripped_op_list = null;
  208. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.any_info = null;
  209. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.tensorflow_version = "";
  210. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.tensorflow_git_version = "";
  211. $root.tensorflow.MetaGraphDef.MetaInfoDef.prototype.stripped_default_attrs = false;
  212. $root.tensorflow.CollectionDef = class CollectionDef {
  213. constructor() {
  214. }
  215. get kind() {
  216. $root.tensorflow.CollectionDef.kindSet = $root.tensorflow.CollectionDef.kindSet || new Set([ "node_list", "bytes_list", "int64_list", "float_list", "any_list"]);
  217. return Object.keys(this).find((key) => $root.tensorflow.CollectionDef.kindSet.has(key) && this[key] != null);
  218. }
  219. static decode(reader, length) {
  220. const message = new $root.tensorflow.CollectionDef();
  221. const end = length !== undefined ? reader.position + length : reader.length;
  222. while (reader.position < end) {
  223. const tag = reader.uint32();
  224. switch (tag >>> 3) {
  225. case 1:
  226. message.node_list = $root.tensorflow.CollectionDef.NodeList.decode(reader, reader.uint32());
  227. break;
  228. case 2:
  229. message.bytes_list = $root.tensorflow.CollectionDef.BytesList.decode(reader, reader.uint32());
  230. break;
  231. case 3:
  232. message.int64_list = $root.tensorflow.CollectionDef.Int64List.decode(reader, reader.uint32());
  233. break;
  234. case 4:
  235. message.float_list = $root.tensorflow.CollectionDef.FloatList.decode(reader, reader.uint32());
  236. break;
  237. case 5:
  238. message.any_list = $root.tensorflow.CollectionDef.AnyList.decode(reader, reader.uint32());
  239. break;
  240. default:
  241. reader.skipType(tag & 7);
  242. break;
  243. }
  244. }
  245. return message;
  246. }
  247. static decodeText(reader) {
  248. const message = new $root.tensorflow.CollectionDef();
  249. reader.start();
  250. while (!reader.end()) {
  251. const tag = reader.tag();
  252. switch (tag) {
  253. case "node_list":
  254. message.node_list = $root.tensorflow.CollectionDef.NodeList.decodeText(reader);
  255. break;
  256. case "bytes_list":
  257. message.bytes_list = $root.tensorflow.CollectionDef.BytesList.decodeText(reader);
  258. break;
  259. case "int64_list":
  260. message.int64_list = $root.tensorflow.CollectionDef.Int64List.decodeText(reader);
  261. break;
  262. case "float_list":
  263. message.float_list = $root.tensorflow.CollectionDef.FloatList.decodeText(reader);
  264. break;
  265. case "any_list":
  266. message.any_list = $root.tensorflow.CollectionDef.AnyList.decodeText(reader);
  267. break;
  268. default:
  269. reader.field(tag, message);
  270. break;
  271. }
  272. }
  273. return message;
  274. }
  275. };
  276. $root.tensorflow.CollectionDef.NodeList = class NodeList {
  277. constructor() {
  278. this.value = [];
  279. }
  280. static decode(reader, length) {
  281. const message = new $root.tensorflow.CollectionDef.NodeList();
  282. const end = length !== undefined ? reader.position + length : reader.length;
  283. while (reader.position < end) {
  284. const tag = reader.uint32();
  285. switch (tag >>> 3) {
  286. case 1:
  287. message.value.push(reader.string());
  288. break;
  289. default:
  290. reader.skipType(tag & 7);
  291. break;
  292. }
  293. }
  294. return message;
  295. }
  296. static decodeText(reader) {
  297. const message = new $root.tensorflow.CollectionDef.NodeList();
  298. reader.start();
  299. while (!reader.end()) {
  300. const tag = reader.tag();
  301. switch (tag) {
  302. case "value":
  303. reader.array(message.value, () => reader.string());
  304. break;
  305. default:
  306. reader.field(tag, message);
  307. break;
  308. }
  309. }
  310. return message;
  311. }
  312. };
  313. $root.tensorflow.CollectionDef.BytesList = class BytesList {
  314. constructor() {
  315. this.value = [];
  316. }
  317. static decode(reader, length) {
  318. const message = new $root.tensorflow.CollectionDef.BytesList();
  319. const end = length !== undefined ? reader.position + length : reader.length;
  320. while (reader.position < end) {
  321. const tag = reader.uint32();
  322. switch (tag >>> 3) {
  323. case 1:
  324. message.value.push(reader.bytes());
  325. break;
  326. default:
  327. reader.skipType(tag & 7);
  328. break;
  329. }
  330. }
  331. return message;
  332. }
  333. static decodeText(reader) {
  334. const message = new $root.tensorflow.CollectionDef.BytesList();
  335. reader.start();
  336. while (!reader.end()) {
  337. const tag = reader.tag();
  338. switch (tag) {
  339. case "value":
  340. reader.array(message.value, () => reader.bytes());
  341. break;
  342. default:
  343. reader.field(tag, message);
  344. break;
  345. }
  346. }
  347. return message;
  348. }
  349. };
  350. $root.tensorflow.CollectionDef.Int64List = class Int64List {
  351. constructor() {
  352. this.value = [];
  353. }
  354. static decode(reader, length) {
  355. const message = new $root.tensorflow.CollectionDef.Int64List();
  356. const end = length !== undefined ? reader.position + length : reader.length;
  357. while (reader.position < end) {
  358. const tag = reader.uint32();
  359. switch (tag >>> 3) {
  360. case 1:
  361. message.value = reader.array(message.value, () => reader.int64(), tag);
  362. break;
  363. default:
  364. reader.skipType(tag & 7);
  365. break;
  366. }
  367. }
  368. return message;
  369. }
  370. static decodeText(reader) {
  371. const message = new $root.tensorflow.CollectionDef.Int64List();
  372. reader.start();
  373. while (!reader.end()) {
  374. const tag = reader.tag();
  375. switch (tag) {
  376. case "value":
  377. reader.array(message.value, () => reader.int64());
  378. break;
  379. default:
  380. reader.field(tag, message);
  381. break;
  382. }
  383. }
  384. return message;
  385. }
  386. };
  387. $root.tensorflow.CollectionDef.FloatList = class FloatList {
  388. constructor() {
  389. this.value = [];
  390. }
  391. static decode(reader, length) {
  392. const message = new $root.tensorflow.CollectionDef.FloatList();
  393. const end = length !== undefined ? reader.position + length : reader.length;
  394. while (reader.position < end) {
  395. const tag = reader.uint32();
  396. switch (tag >>> 3) {
  397. case 1:
  398. message.value = reader.floats(message.value, tag);
  399. break;
  400. default:
  401. reader.skipType(tag & 7);
  402. break;
  403. }
  404. }
  405. return message;
  406. }
  407. static decodeText(reader) {
  408. const message = new $root.tensorflow.CollectionDef.FloatList();
  409. reader.start();
  410. while (!reader.end()) {
  411. const tag = reader.tag();
  412. switch (tag) {
  413. case "value":
  414. reader.array(message.value, () => reader.float());
  415. break;
  416. default:
  417. reader.field(tag, message);
  418. break;
  419. }
  420. }
  421. return message;
  422. }
  423. };
  424. $root.tensorflow.CollectionDef.AnyList = class AnyList {
  425. constructor() {
  426. this.value = [];
  427. }
  428. static decode(reader, length) {
  429. const message = new $root.tensorflow.CollectionDef.AnyList();
  430. const end = length !== undefined ? reader.position + length : reader.length;
  431. while (reader.position < end) {
  432. const tag = reader.uint32();
  433. switch (tag >>> 3) {
  434. case 1:
  435. message.value.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
  436. break;
  437. default:
  438. reader.skipType(tag & 7);
  439. break;
  440. }
  441. }
  442. return message;
  443. }
  444. static decodeText(reader) {
  445. const message = new $root.tensorflow.CollectionDef.AnyList();
  446. reader.start();
  447. while (!reader.end()) {
  448. const tag = reader.tag();
  449. switch (tag) {
  450. case "value":
  451. reader.anyarray(message.value, () => new $root.google.protobuf.Any());
  452. break;
  453. default:
  454. reader.field(tag, message);
  455. break;
  456. }
  457. }
  458. return message;
  459. }
  460. };
  461. $root.tensorflow.TensorInfo = class TensorInfo {
  462. constructor() {
  463. }
  464. get encoding() {
  465. $root.tensorflow.TensorInfo.encodingSet = $root.tensorflow.TensorInfo.encodingSet || new Set([ "name", "coo_sparse", "composite_tensor"]);
  466. return Object.keys(this).find((key) => $root.tensorflow.TensorInfo.encodingSet.has(key) && this[key] != null);
  467. }
  468. static decode(reader, length) {
  469. const message = new $root.tensorflow.TensorInfo();
  470. const end = length !== undefined ? reader.position + length : reader.length;
  471. while (reader.position < end) {
  472. const tag = reader.uint32();
  473. switch (tag >>> 3) {
  474. case 1:
  475. message.name = reader.string();
  476. break;
  477. case 4:
  478. message.coo_sparse = $root.tensorflow.TensorInfo.CooSparse.decode(reader, reader.uint32());
  479. break;
  480. case 5:
  481. message.composite_tensor = $root.tensorflow.TensorInfo.CompositeTensor.decode(reader, reader.uint32());
  482. break;
  483. case 2:
  484. message.dtype = reader.int32();
  485. break;
  486. case 3:
  487. message.tensor_shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  488. break;
  489. default:
  490. reader.skipType(tag & 7);
  491. break;
  492. }
  493. }
  494. return message;
  495. }
  496. static decodeText(reader) {
  497. const message = new $root.tensorflow.TensorInfo();
  498. reader.start();
  499. while (!reader.end()) {
  500. const tag = reader.tag();
  501. switch (tag) {
  502. case "name":
  503. message.name = reader.string();
  504. break;
  505. case "coo_sparse":
  506. message.coo_sparse = $root.tensorflow.TensorInfo.CooSparse.decodeText(reader);
  507. break;
  508. case "composite_tensor":
  509. message.composite_tensor = $root.tensorflow.TensorInfo.CompositeTensor.decodeText(reader);
  510. break;
  511. case "dtype":
  512. message.dtype = reader.enum($root.tensorflow.DataType);
  513. break;
  514. case "tensor_shape":
  515. message.tensor_shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  516. break;
  517. default:
  518. reader.field(tag, message);
  519. break;
  520. }
  521. }
  522. return message;
  523. }
  524. };
  525. $root.tensorflow.TensorInfo.prototype.dtype = 0;
  526. $root.tensorflow.TensorInfo.prototype.tensor_shape = null;
  527. $root.tensorflow.TensorInfo.CooSparse = class CooSparse {
  528. constructor() {
  529. }
  530. static decode(reader, length) {
  531. const message = new $root.tensorflow.TensorInfo.CooSparse();
  532. const end = length !== undefined ? reader.position + length : reader.length;
  533. while (reader.position < end) {
  534. const tag = reader.uint32();
  535. switch (tag >>> 3) {
  536. case 1:
  537. message.values_tensor_name = reader.string();
  538. break;
  539. case 2:
  540. message.indices_tensor_name = reader.string();
  541. break;
  542. case 3:
  543. message.dense_shape_tensor_name = reader.string();
  544. break;
  545. default:
  546. reader.skipType(tag & 7);
  547. break;
  548. }
  549. }
  550. return message;
  551. }
  552. static decodeText(reader) {
  553. const message = new $root.tensorflow.TensorInfo.CooSparse();
  554. reader.start();
  555. while (!reader.end()) {
  556. const tag = reader.tag();
  557. switch (tag) {
  558. case "values_tensor_name":
  559. message.values_tensor_name = reader.string();
  560. break;
  561. case "indices_tensor_name":
  562. message.indices_tensor_name = reader.string();
  563. break;
  564. case "dense_shape_tensor_name":
  565. message.dense_shape_tensor_name = reader.string();
  566. break;
  567. default:
  568. reader.field(tag, message);
  569. break;
  570. }
  571. }
  572. return message;
  573. }
  574. };
  575. $root.tensorflow.TensorInfo.CooSparse.prototype.values_tensor_name = "";
  576. $root.tensorflow.TensorInfo.CooSparse.prototype.indices_tensor_name = "";
  577. $root.tensorflow.TensorInfo.CooSparse.prototype.dense_shape_tensor_name = "";
  578. $root.tensorflow.TensorInfo.CompositeTensor = class CompositeTensor {
  579. constructor() {
  580. this.components = [];
  581. }
  582. static decode(reader, length) {
  583. const message = new $root.tensorflow.TensorInfo.CompositeTensor();
  584. const end = length !== undefined ? reader.position + length : reader.length;
  585. while (reader.position < end) {
  586. const tag = reader.uint32();
  587. switch (tag >>> 3) {
  588. case 1:
  589. message.type_spec = $root.tensorflow.TypeSpecProto.decode(reader, reader.uint32());
  590. break;
  591. case 2:
  592. message.components.push($root.tensorflow.TensorInfo.decode(reader, reader.uint32()));
  593. break;
  594. default:
  595. reader.skipType(tag & 7);
  596. break;
  597. }
  598. }
  599. return message;
  600. }
  601. static decodeText(reader) {
  602. const message = new $root.tensorflow.TensorInfo.CompositeTensor();
  603. reader.start();
  604. while (!reader.end()) {
  605. const tag = reader.tag();
  606. switch (tag) {
  607. case "type_spec":
  608. message.type_spec = $root.tensorflow.TypeSpecProto.decodeText(reader);
  609. break;
  610. case "components":
  611. message.components.push($root.tensorflow.TensorInfo.decodeText(reader));
  612. break;
  613. default:
  614. reader.field(tag, message);
  615. break;
  616. }
  617. }
  618. return message;
  619. }
  620. };
  621. $root.tensorflow.TensorInfo.CompositeTensor.prototype.type_spec = null;
  622. $root.tensorflow.SignatureDef = class SignatureDef {
  623. constructor() {
  624. this.inputs = {};
  625. this.outputs = {};
  626. }
  627. static decode(reader, length) {
  628. const message = new $root.tensorflow.SignatureDef();
  629. const end = length !== undefined ? reader.position + length : reader.length;
  630. while (reader.position < end) {
  631. const tag = reader.uint32();
  632. switch (tag >>> 3) {
  633. case 1:
  634. reader.entry(message.inputs, () => reader.string(), () => $root.tensorflow.TensorInfo.decode(reader, reader.uint32()));
  635. break;
  636. case 2:
  637. reader.entry(message.outputs, () => reader.string(), () => $root.tensorflow.TensorInfo.decode(reader, reader.uint32()));
  638. break;
  639. case 3:
  640. message.method_name = reader.string();
  641. break;
  642. default:
  643. reader.skipType(tag & 7);
  644. break;
  645. }
  646. }
  647. return message;
  648. }
  649. static decodeText(reader) {
  650. const message = new $root.tensorflow.SignatureDef();
  651. reader.start();
  652. while (!reader.end()) {
  653. const tag = reader.tag();
  654. switch (tag) {
  655. case "inputs":
  656. reader.entry(message.inputs, () => reader.string(), () => $root.tensorflow.TensorInfo.decodeText(reader));
  657. break;
  658. case "outputs":
  659. reader.entry(message.outputs, () => reader.string(), () => $root.tensorflow.TensorInfo.decodeText(reader));
  660. break;
  661. case "method_name":
  662. message.method_name = reader.string();
  663. break;
  664. default:
  665. reader.field(tag, message);
  666. break;
  667. }
  668. }
  669. return message;
  670. }
  671. };
  672. $root.tensorflow.SignatureDef.prototype.method_name = "";
  673. $root.tensorflow.AssetFileDef = class AssetFileDef {
  674. constructor() {
  675. }
  676. static decode(reader, length) {
  677. const message = new $root.tensorflow.AssetFileDef();
  678. const end = length !== undefined ? reader.position + length : reader.length;
  679. while (reader.position < end) {
  680. const tag = reader.uint32();
  681. switch (tag >>> 3) {
  682. case 1:
  683. message.tensor_info = $root.tensorflow.TensorInfo.decode(reader, reader.uint32());
  684. break;
  685. case 2:
  686. message.filename = reader.string();
  687. break;
  688. default:
  689. reader.skipType(tag & 7);
  690. break;
  691. }
  692. }
  693. return message;
  694. }
  695. static decodeText(reader) {
  696. const message = new $root.tensorflow.AssetFileDef();
  697. reader.start();
  698. while (!reader.end()) {
  699. const tag = reader.tag();
  700. switch (tag) {
  701. case "tensor_info":
  702. message.tensor_info = $root.tensorflow.TensorInfo.decodeText(reader);
  703. break;
  704. case "filename":
  705. message.filename = reader.string();
  706. break;
  707. default:
  708. reader.field(tag, message);
  709. break;
  710. }
  711. }
  712. return message;
  713. }
  714. };
  715. $root.tensorflow.AssetFileDef.prototype.tensor_info = null;
  716. $root.tensorflow.AssetFileDef.prototype.filename = "";
  717. $root.tensorflow.GraphDef = class GraphDef {
  718. constructor() {
  719. this.node = [];
  720. }
  721. static decode(reader, length) {
  722. const message = new $root.tensorflow.GraphDef();
  723. const end = length !== undefined ? reader.position + length : reader.length;
  724. while (reader.position < end) {
  725. const tag = reader.uint32();
  726. switch (tag >>> 3) {
  727. case 1:
  728. message.node.push($root.tensorflow.NodeDef.decode(reader, reader.uint32()));
  729. break;
  730. case 4:
  731. message.versions = $root.tensorflow.VersionDef.decode(reader, reader.uint32());
  732. break;
  733. case 3:
  734. message.version = reader.int32();
  735. break;
  736. case 2:
  737. message.library = $root.tensorflow.FunctionDefLibrary.decode(reader, reader.uint32());
  738. break;
  739. default:
  740. reader.skipType(tag & 7);
  741. break;
  742. }
  743. }
  744. return message;
  745. }
  746. static decodeText(reader) {
  747. const message = new $root.tensorflow.GraphDef();
  748. reader.start();
  749. while (!reader.end()) {
  750. const tag = reader.tag();
  751. switch (tag) {
  752. case "node":
  753. message.node.push($root.tensorflow.NodeDef.decodeText(reader));
  754. break;
  755. case "versions":
  756. message.versions = $root.tensorflow.VersionDef.decodeText(reader);
  757. break;
  758. case "version":
  759. message.version = reader.int32();
  760. break;
  761. case "library":
  762. message.library = $root.tensorflow.FunctionDefLibrary.decodeText(reader);
  763. break;
  764. default:
  765. reader.field(tag, message);
  766. break;
  767. }
  768. }
  769. return message;
  770. }
  771. };
  772. $root.tensorflow.GraphDef.prototype.versions = null;
  773. $root.tensorflow.GraphDef.prototype.version = 0;
  774. $root.tensorflow.GraphDef.prototype.library = null;
  775. $root.tensorflow.FunctionDefLibrary = class FunctionDefLibrary {
  776. constructor() {
  777. this["function"] = [];
  778. this.gradient = [];
  779. this.registered_gradients = [];
  780. }
  781. static decode(reader, length) {
  782. const message = new $root.tensorflow.FunctionDefLibrary();
  783. const end = length !== undefined ? reader.position + length : reader.length;
  784. while (reader.position < end) {
  785. const tag = reader.uint32();
  786. switch (tag >>> 3) {
  787. case 1:
  788. message["function"].push($root.tensorflow.FunctionDef.decode(reader, reader.uint32()));
  789. break;
  790. case 2:
  791. message.gradient.push($root.tensorflow.GradientDef.decode(reader, reader.uint32()));
  792. break;
  793. case 3:
  794. message.registered_gradients.push($root.tensorflow.RegisteredGradient.decode(reader, reader.uint32()));
  795. break;
  796. default:
  797. reader.skipType(tag & 7);
  798. break;
  799. }
  800. }
  801. return message;
  802. }
  803. static decodeText(reader) {
  804. const message = new $root.tensorflow.FunctionDefLibrary();
  805. reader.start();
  806. while (!reader.end()) {
  807. const tag = reader.tag();
  808. switch (tag) {
  809. case "function":
  810. message["function"].push($root.tensorflow.FunctionDef.decodeText(reader));
  811. break;
  812. case "gradient":
  813. message.gradient.push($root.tensorflow.GradientDef.decodeText(reader));
  814. break;
  815. case "registered_gradients":
  816. message.registered_gradients.push($root.tensorflow.RegisteredGradient.decodeText(reader));
  817. break;
  818. default:
  819. reader.field(tag, message);
  820. break;
  821. }
  822. }
  823. return message;
  824. }
  825. };
  826. $root.tensorflow.FunctionDef = class FunctionDef {
  827. constructor() {
  828. this.attr = {};
  829. this.arg_attr = {};
  830. this.resource_arg_unique_id = {};
  831. this.node_def = [];
  832. this.ret = {};
  833. this.control_ret = {};
  834. }
  835. static decode(reader, length) {
  836. const message = new $root.tensorflow.FunctionDef();
  837. const end = length !== undefined ? reader.position + length : reader.length;
  838. while (reader.position < end) {
  839. const tag = reader.uint32();
  840. switch (tag >>> 3) {
  841. case 1:
  842. message.signature = $root.tensorflow.OpDef.decode(reader, reader.uint32());
  843. break;
  844. case 5:
  845. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decode(reader, reader.uint32()));
  846. break;
  847. case 7:
  848. reader.entry(message.arg_attr, () => reader.uint32(), () => $root.tensorflow.FunctionDef.ArgAttrs.decode(reader, reader.uint32()));
  849. break;
  850. case 8:
  851. reader.entry(message.resource_arg_unique_id, () => reader.uint32(), () => reader.uint32());
  852. break;
  853. case 3:
  854. message.node_def.push($root.tensorflow.NodeDef.decode(reader, reader.uint32()));
  855. break;
  856. case 4:
  857. reader.entry(message.ret, () => reader.string(), () => reader.string());
  858. break;
  859. case 6:
  860. reader.entry(message.control_ret, () => reader.string(), () => reader.string());
  861. break;
  862. default:
  863. reader.skipType(tag & 7);
  864. break;
  865. }
  866. }
  867. return message;
  868. }
  869. static decodeText(reader) {
  870. const message = new $root.tensorflow.FunctionDef();
  871. reader.start();
  872. while (!reader.end()) {
  873. const tag = reader.tag();
  874. switch (tag) {
  875. case "signature":
  876. message.signature = $root.tensorflow.OpDef.decodeText(reader);
  877. break;
  878. case "attr":
  879. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decodeText(reader));
  880. break;
  881. case "arg_attr":
  882. reader.entry(message.arg_attr, () => reader.uint32(), () => $root.tensorflow.FunctionDef.ArgAttrs.decodeText(reader));
  883. break;
  884. case "resource_arg_unique_id":
  885. reader.entry(message.resource_arg_unique_id, () => reader.uint32(), () => reader.uint32());
  886. break;
  887. case "node_def":
  888. message.node_def.push($root.tensorflow.NodeDef.decodeText(reader));
  889. break;
  890. case "ret":
  891. reader.entry(message.ret, () => reader.string(), () => reader.string());
  892. break;
  893. case "control_ret":
  894. reader.entry(message.control_ret, () => reader.string(), () => reader.string());
  895. break;
  896. default:
  897. reader.field(tag, message);
  898. break;
  899. }
  900. }
  901. return message;
  902. }
  903. };
  904. $root.tensorflow.FunctionDef.prototype.signature = null;
  905. $root.tensorflow.FunctionDef.ArgAttrs = class ArgAttrs {
  906. constructor() {
  907. this.attr = {};
  908. }
  909. static decode(reader, length) {
  910. const message = new $root.tensorflow.FunctionDef.ArgAttrs();
  911. const end = length !== undefined ? reader.position + length : reader.length;
  912. while (reader.position < end) {
  913. const tag = reader.uint32();
  914. switch (tag >>> 3) {
  915. case 1:
  916. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decode(reader, reader.uint32()));
  917. break;
  918. default:
  919. reader.skipType(tag & 7);
  920. break;
  921. }
  922. }
  923. return message;
  924. }
  925. static decodeText(reader) {
  926. const message = new $root.tensorflow.FunctionDef.ArgAttrs();
  927. reader.start();
  928. while (!reader.end()) {
  929. const tag = reader.tag();
  930. switch (tag) {
  931. case "attr":
  932. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decodeText(reader));
  933. break;
  934. default:
  935. reader.field(tag, message);
  936. break;
  937. }
  938. }
  939. return message;
  940. }
  941. };
  942. $root.tensorflow.GradientDef = class GradientDef {
  943. constructor() {
  944. }
  945. static decode(reader, length) {
  946. const message = new $root.tensorflow.GradientDef();
  947. const end = length !== undefined ? reader.position + length : reader.length;
  948. while (reader.position < end) {
  949. const tag = reader.uint32();
  950. switch (tag >>> 3) {
  951. case 1:
  952. message.function_name = reader.string();
  953. break;
  954. case 2:
  955. message.gradient_func = reader.string();
  956. break;
  957. default:
  958. reader.skipType(tag & 7);
  959. break;
  960. }
  961. }
  962. return message;
  963. }
  964. static decodeText(reader) {
  965. const message = new $root.tensorflow.GradientDef();
  966. reader.start();
  967. while (!reader.end()) {
  968. const tag = reader.tag();
  969. switch (tag) {
  970. case "function_name":
  971. message.function_name = reader.string();
  972. break;
  973. case "gradient_func":
  974. message.gradient_func = reader.string();
  975. break;
  976. default:
  977. reader.field(tag, message);
  978. break;
  979. }
  980. }
  981. return message;
  982. }
  983. };
  984. $root.tensorflow.GradientDef.prototype.function_name = "";
  985. $root.tensorflow.GradientDef.prototype.gradient_func = "";
  986. $root.tensorflow.RegisteredGradient = class RegisteredGradient {
  987. constructor() {
  988. }
  989. static decode(reader, length) {
  990. const message = new $root.tensorflow.RegisteredGradient();
  991. const end = length !== undefined ? reader.position + length : reader.length;
  992. while (reader.position < end) {
  993. const tag = reader.uint32();
  994. switch (tag >>> 3) {
  995. case 1:
  996. message.gradient_func = reader.string();
  997. break;
  998. case 2:
  999. message.registered_op_type = reader.string();
  1000. break;
  1001. default:
  1002. reader.skipType(tag & 7);
  1003. break;
  1004. }
  1005. }
  1006. return message;
  1007. }
  1008. static decodeText(reader) {
  1009. const message = new $root.tensorflow.RegisteredGradient();
  1010. reader.start();
  1011. while (!reader.end()) {
  1012. const tag = reader.tag();
  1013. switch (tag) {
  1014. case "gradient_func":
  1015. message.gradient_func = reader.string();
  1016. break;
  1017. case "registered_op_type":
  1018. message.registered_op_type = reader.string();
  1019. break;
  1020. default:
  1021. reader.field(tag, message);
  1022. break;
  1023. }
  1024. }
  1025. return message;
  1026. }
  1027. };
  1028. $root.tensorflow.RegisteredGradient.prototype.gradient_func = "";
  1029. $root.tensorflow.RegisteredGradient.prototype.registered_op_type = "";
  1030. $root.tensorflow.AttrValue = class AttrValue {
  1031. constructor() {
  1032. }
  1033. get value() {
  1034. $root.tensorflow.AttrValue.valueSet = $root.tensorflow.AttrValue.valueSet || new Set([ "s", "i", "f", "b", "type", "shape", "tensor", "list", "func", "placeholder"]);
  1035. return Object.keys(this).find((key) => $root.tensorflow.AttrValue.valueSet.has(key) && this[key] != null);
  1036. }
  1037. static decode(reader, length) {
  1038. const message = new $root.tensorflow.AttrValue();
  1039. const end = length !== undefined ? reader.position + length : reader.length;
  1040. while (reader.position < end) {
  1041. const tag = reader.uint32();
  1042. switch (tag >>> 3) {
  1043. case 2:
  1044. message.s = reader.bytes();
  1045. break;
  1046. case 3:
  1047. message.i = reader.int64();
  1048. break;
  1049. case 4:
  1050. message.f = reader.float();
  1051. break;
  1052. case 5:
  1053. message.b = reader.bool();
  1054. break;
  1055. case 6:
  1056. message.type = reader.int32();
  1057. break;
  1058. case 7:
  1059. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  1060. break;
  1061. case 8:
  1062. message.tensor = $root.tensorflow.TensorProto.decode(reader, reader.uint32());
  1063. break;
  1064. case 1:
  1065. message.list = $root.tensorflow.AttrValue.ListValue.decode(reader, reader.uint32());
  1066. break;
  1067. case 10:
  1068. message.func = $root.tensorflow.NameAttrList.decode(reader, reader.uint32());
  1069. break;
  1070. case 9:
  1071. message.placeholder = reader.string();
  1072. break;
  1073. default:
  1074. reader.skipType(tag & 7);
  1075. break;
  1076. }
  1077. }
  1078. return message;
  1079. }
  1080. static decodeText(reader) {
  1081. const message = new $root.tensorflow.AttrValue();
  1082. reader.start();
  1083. while (!reader.end()) {
  1084. const tag = reader.tag();
  1085. switch (tag) {
  1086. case "s":
  1087. message.s = reader.bytes();
  1088. break;
  1089. case "i":
  1090. message.i = reader.int64();
  1091. break;
  1092. case "f":
  1093. message.f = reader.float();
  1094. break;
  1095. case "b":
  1096. message.b = reader.bool();
  1097. break;
  1098. case "type":
  1099. message.type = reader.enum($root.tensorflow.DataType);
  1100. break;
  1101. case "shape":
  1102. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  1103. break;
  1104. case "tensor":
  1105. message.tensor = $root.tensorflow.TensorProto.decodeText(reader);
  1106. break;
  1107. case "list":
  1108. message.list = $root.tensorflow.AttrValue.ListValue.decodeText(reader);
  1109. break;
  1110. case "func":
  1111. message.func = $root.tensorflow.NameAttrList.decodeText(reader);
  1112. break;
  1113. case "placeholder":
  1114. message.placeholder = reader.string();
  1115. break;
  1116. default:
  1117. reader.field(tag, message);
  1118. break;
  1119. }
  1120. }
  1121. return message;
  1122. }
  1123. };
  1124. $root.tensorflow.AttrValue.ListValue = class ListValue {
  1125. constructor() {
  1126. this.s = [];
  1127. this.i = [];
  1128. this.f = [];
  1129. this.b = [];
  1130. this.type = [];
  1131. this.shape = [];
  1132. this.tensor = [];
  1133. this.func = [];
  1134. }
  1135. static decode(reader, length) {
  1136. const message = new $root.tensorflow.AttrValue.ListValue();
  1137. const end = length !== undefined ? reader.position + length : reader.length;
  1138. while (reader.position < end) {
  1139. const tag = reader.uint32();
  1140. switch (tag >>> 3) {
  1141. case 2:
  1142. message.s.push(reader.bytes());
  1143. break;
  1144. case 3:
  1145. message.i = reader.array(message.i, () => reader.int64(), tag);
  1146. break;
  1147. case 4:
  1148. message.f = reader.floats(message.f, tag);
  1149. break;
  1150. case 5:
  1151. message.b = reader.array(message.b, () => reader.bool(), tag);
  1152. break;
  1153. case 6:
  1154. message.type = reader.array(message.type, () => reader.int32(), tag);
  1155. break;
  1156. case 7:
  1157. message.shape.push($root.tensorflow.TensorShapeProto.decode(reader, reader.uint32()));
  1158. break;
  1159. case 8:
  1160. message.tensor.push($root.tensorflow.TensorProto.decode(reader, reader.uint32()));
  1161. break;
  1162. case 9:
  1163. message.func.push($root.tensorflow.NameAttrList.decode(reader, reader.uint32()));
  1164. break;
  1165. default:
  1166. reader.skipType(tag & 7);
  1167. break;
  1168. }
  1169. }
  1170. return message;
  1171. }
  1172. static decodeText(reader) {
  1173. const message = new $root.tensorflow.AttrValue.ListValue();
  1174. reader.start();
  1175. while (!reader.end()) {
  1176. const tag = reader.tag();
  1177. switch (tag) {
  1178. case "s":
  1179. reader.array(message.s, () => reader.bytes());
  1180. break;
  1181. case "i":
  1182. reader.array(message.i, () => reader.int64());
  1183. break;
  1184. case "f":
  1185. reader.array(message.f, () => reader.float());
  1186. break;
  1187. case "b":
  1188. reader.array(message.b, () => reader.bool());
  1189. break;
  1190. case "type":
  1191. reader.array(message.type, () => reader.enum($root.tensorflow.DataType));
  1192. break;
  1193. case "shape":
  1194. message.shape.push($root.tensorflow.TensorShapeProto.decodeText(reader));
  1195. break;
  1196. case "tensor":
  1197. message.tensor.push($root.tensorflow.TensorProto.decodeText(reader));
  1198. break;
  1199. case "func":
  1200. message.func.push($root.tensorflow.NameAttrList.decodeText(reader));
  1201. break;
  1202. default:
  1203. reader.field(tag, message);
  1204. break;
  1205. }
  1206. }
  1207. return message;
  1208. }
  1209. };
  1210. $root.tensorflow.NameAttrList = class NameAttrList {
  1211. constructor() {
  1212. this.attr = {};
  1213. }
  1214. static decode(reader, length) {
  1215. const message = new $root.tensorflow.NameAttrList();
  1216. const end = length !== undefined ? reader.position + length : reader.length;
  1217. while (reader.position < end) {
  1218. const tag = reader.uint32();
  1219. switch (tag >>> 3) {
  1220. case 1:
  1221. message.name = reader.string();
  1222. break;
  1223. case 2:
  1224. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decode(reader, reader.uint32()));
  1225. break;
  1226. default:
  1227. reader.skipType(tag & 7);
  1228. break;
  1229. }
  1230. }
  1231. return message;
  1232. }
  1233. static decodeText(reader) {
  1234. const message = new $root.tensorflow.NameAttrList();
  1235. reader.start();
  1236. while (!reader.end()) {
  1237. const tag = reader.tag();
  1238. switch (tag) {
  1239. case "name":
  1240. message.name = reader.string();
  1241. break;
  1242. case "attr":
  1243. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decodeText(reader));
  1244. break;
  1245. default:
  1246. reader.field(tag, message);
  1247. break;
  1248. }
  1249. }
  1250. return message;
  1251. }
  1252. };
  1253. $root.tensorflow.NameAttrList.prototype.name = "";
  1254. $root.tensorflow.TensorProto = class TensorProto {
  1255. constructor() {
  1256. this.half_val = [];
  1257. this.float_val = [];
  1258. this.double_val = [];
  1259. this.int_val = [];
  1260. this.string_val = [];
  1261. this.scomplex_val = [];
  1262. this.int64_val = [];
  1263. this.bool_val = [];
  1264. this.dcomplex_val = [];
  1265. this.resource_handle_val = [];
  1266. this.variant_val = [];
  1267. this.uint32_val = [];
  1268. this.uint64_val = [];
  1269. }
  1270. static decode(reader, length) {
  1271. const message = new $root.tensorflow.TensorProto();
  1272. const end = length !== undefined ? reader.position + length : reader.length;
  1273. while (reader.position < end) {
  1274. const tag = reader.uint32();
  1275. switch (tag >>> 3) {
  1276. case 1:
  1277. message.dtype = reader.int32();
  1278. break;
  1279. case 2:
  1280. message.tensor_shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  1281. break;
  1282. case 3:
  1283. message.version_number = reader.int32();
  1284. break;
  1285. case 4:
  1286. message.tensor_content = reader.bytes();
  1287. break;
  1288. case 13:
  1289. message.half_val = reader.array(message.half_val, () => reader.int32(), tag);
  1290. break;
  1291. case 5:
  1292. message.float_val = reader.floats(message.float_val, tag);
  1293. break;
  1294. case 6:
  1295. message.double_val = reader.doubles(message.double_val, tag);
  1296. break;
  1297. case 7:
  1298. message.int_val = reader.array(message.int_val, () => reader.int32(), tag);
  1299. break;
  1300. case 8:
  1301. message.string_val.push(reader.bytes());
  1302. break;
  1303. case 9:
  1304. message.scomplex_val = reader.floats(message.scomplex_val, tag);
  1305. break;
  1306. case 10:
  1307. message.int64_val = reader.array(message.int64_val, () => reader.int64(), tag);
  1308. break;
  1309. case 11:
  1310. message.bool_val = reader.array(message.bool_val, () => reader.bool(), tag);
  1311. break;
  1312. case 12:
  1313. message.dcomplex_val = reader.doubles(message.dcomplex_val, tag);
  1314. break;
  1315. case 14:
  1316. message.resource_handle_val.push($root.tensorflow.ResourceHandleProto.decode(reader, reader.uint32()));
  1317. break;
  1318. case 15:
  1319. message.variant_val.push($root.tensorflow.VariantTensorDataProto.decode(reader, reader.uint32()));
  1320. break;
  1321. case 16:
  1322. message.uint32_val = reader.array(message.uint32_val, () => reader.uint32(), tag);
  1323. break;
  1324. case 17:
  1325. message.uint64_val = reader.array(message.uint64_val, () => reader.uint64(), tag);
  1326. break;
  1327. default:
  1328. reader.skipType(tag & 7);
  1329. break;
  1330. }
  1331. }
  1332. return message;
  1333. }
  1334. static decodeText(reader) {
  1335. const message = new $root.tensorflow.TensorProto();
  1336. reader.start();
  1337. while (!reader.end()) {
  1338. const tag = reader.tag();
  1339. switch (tag) {
  1340. case "dtype":
  1341. message.dtype = reader.enum($root.tensorflow.DataType);
  1342. break;
  1343. case "tensor_shape":
  1344. message.tensor_shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  1345. break;
  1346. case "version_number":
  1347. message.version_number = reader.int32();
  1348. break;
  1349. case "tensor_content":
  1350. message.tensor_content = reader.bytes();
  1351. break;
  1352. case "half_val":
  1353. reader.array(message.half_val, () => reader.int32());
  1354. break;
  1355. case "float_val":
  1356. reader.array(message.float_val, () => reader.float());
  1357. break;
  1358. case "double_val":
  1359. reader.array(message.double_val, () => reader.double());
  1360. break;
  1361. case "int_val":
  1362. reader.array(message.int_val, () => reader.int32());
  1363. break;
  1364. case "string_val":
  1365. reader.array(message.string_val, () => reader.bytes());
  1366. break;
  1367. case "scomplex_val":
  1368. reader.array(message.scomplex_val, () => reader.float());
  1369. break;
  1370. case "int64_val":
  1371. reader.array(message.int64_val, () => reader.int64());
  1372. break;
  1373. case "bool_val":
  1374. reader.array(message.bool_val, () => reader.bool());
  1375. break;
  1376. case "dcomplex_val":
  1377. reader.array(message.dcomplex_val, () => reader.double());
  1378. break;
  1379. case "resource_handle_val":
  1380. message.resource_handle_val.push($root.tensorflow.ResourceHandleProto.decodeText(reader));
  1381. break;
  1382. case "variant_val":
  1383. message.variant_val.push($root.tensorflow.VariantTensorDataProto.decodeText(reader));
  1384. break;
  1385. case "uint32_val":
  1386. reader.array(message.uint32_val, () => reader.uint32());
  1387. break;
  1388. case "uint64_val":
  1389. reader.array(message.uint64_val, () => reader.uint64());
  1390. break;
  1391. default:
  1392. reader.field(tag, message);
  1393. break;
  1394. }
  1395. }
  1396. return message;
  1397. }
  1398. };
  1399. $root.tensorflow.TensorProto.prototype.dtype = 0;
  1400. $root.tensorflow.TensorProto.prototype.tensor_shape = null;
  1401. $root.tensorflow.TensorProto.prototype.version_number = 0;
  1402. $root.tensorflow.TensorProto.prototype.tensor_content = new Uint8Array([]);
  1403. $root.tensorflow.VariantTensorDataProto = class VariantTensorDataProto {
  1404. constructor() {
  1405. this.tensors = [];
  1406. }
  1407. static decode(reader, length) {
  1408. const message = new $root.tensorflow.VariantTensorDataProto();
  1409. const end = length !== undefined ? reader.position + length : reader.length;
  1410. while (reader.position < end) {
  1411. const tag = reader.uint32();
  1412. switch (tag >>> 3) {
  1413. case 1:
  1414. message.type_name = reader.string();
  1415. break;
  1416. case 2:
  1417. message.metadata = reader.bytes();
  1418. break;
  1419. case 3:
  1420. message.tensors.push($root.tensorflow.TensorProto.decode(reader, reader.uint32()));
  1421. break;
  1422. default:
  1423. reader.skipType(tag & 7);
  1424. break;
  1425. }
  1426. }
  1427. return message;
  1428. }
  1429. static decodeText(reader) {
  1430. const message = new $root.tensorflow.VariantTensorDataProto();
  1431. reader.start();
  1432. while (!reader.end()) {
  1433. const tag = reader.tag();
  1434. switch (tag) {
  1435. case "type_name":
  1436. message.type_name = reader.string();
  1437. break;
  1438. case "metadata":
  1439. message.metadata = reader.bytes();
  1440. break;
  1441. case "tensors":
  1442. message.tensors.push($root.tensorflow.TensorProto.decodeText(reader));
  1443. break;
  1444. default:
  1445. reader.field(tag, message);
  1446. break;
  1447. }
  1448. }
  1449. return message;
  1450. }
  1451. };
  1452. $root.tensorflow.VariantTensorDataProto.prototype.type_name = "";
  1453. $root.tensorflow.VariantTensorDataProto.prototype.metadata = new Uint8Array([]);
  1454. $root.tensorflow.ResourceHandleProto = class ResourceHandleProto {
  1455. constructor() {
  1456. this.dtypes_and_shapes = [];
  1457. }
  1458. static decode(reader, length) {
  1459. const message = new $root.tensorflow.ResourceHandleProto();
  1460. const end = length !== undefined ? reader.position + length : reader.length;
  1461. while (reader.position < end) {
  1462. const tag = reader.uint32();
  1463. switch (tag >>> 3) {
  1464. case 1:
  1465. message.device = reader.string();
  1466. break;
  1467. case 2:
  1468. message.container = reader.string();
  1469. break;
  1470. case 3:
  1471. message.name = reader.string();
  1472. break;
  1473. case 4:
  1474. message.hash_code = reader.uint64();
  1475. break;
  1476. case 5:
  1477. message.maybe_type_name = reader.string();
  1478. break;
  1479. case 6:
  1480. message.dtypes_and_shapes.push($root.tensorflow.ResourceHandleProto.DtypeAndShape.decode(reader, reader.uint32()));
  1481. break;
  1482. default:
  1483. reader.skipType(tag & 7);
  1484. break;
  1485. }
  1486. }
  1487. return message;
  1488. }
  1489. static decodeText(reader) {
  1490. const message = new $root.tensorflow.ResourceHandleProto();
  1491. reader.start();
  1492. while (!reader.end()) {
  1493. const tag = reader.tag();
  1494. switch (tag) {
  1495. case "device":
  1496. message.device = reader.string();
  1497. break;
  1498. case "container":
  1499. message.container = reader.string();
  1500. break;
  1501. case "name":
  1502. message.name = reader.string();
  1503. break;
  1504. case "hash_code":
  1505. message.hash_code = reader.uint64();
  1506. break;
  1507. case "maybe_type_name":
  1508. message.maybe_type_name = reader.string();
  1509. break;
  1510. case "dtypes_and_shapes":
  1511. message.dtypes_and_shapes.push($root.tensorflow.ResourceHandleProto.DtypeAndShape.decodeText(reader));
  1512. break;
  1513. default:
  1514. reader.field(tag, message);
  1515. break;
  1516. }
  1517. }
  1518. return message;
  1519. }
  1520. };
  1521. $root.tensorflow.ResourceHandleProto.prototype.device = "";
  1522. $root.tensorflow.ResourceHandleProto.prototype.container = "";
  1523. $root.tensorflow.ResourceHandleProto.prototype.name = "";
  1524. $root.tensorflow.ResourceHandleProto.prototype.hash_code = protobuf.Uint64.create(0);
  1525. $root.tensorflow.ResourceHandleProto.prototype.maybe_type_name = "";
  1526. $root.tensorflow.ResourceHandleProto.DtypeAndShape = class DtypeAndShape {
  1527. constructor() {
  1528. }
  1529. static decode(reader, length) {
  1530. const message = new $root.tensorflow.ResourceHandleProto.DtypeAndShape();
  1531. const end = length !== undefined ? reader.position + length : reader.length;
  1532. while (reader.position < end) {
  1533. const tag = reader.uint32();
  1534. switch (tag >>> 3) {
  1535. case 1:
  1536. message.dtype = reader.int32();
  1537. break;
  1538. case 2:
  1539. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  1540. break;
  1541. default:
  1542. reader.skipType(tag & 7);
  1543. break;
  1544. }
  1545. }
  1546. return message;
  1547. }
  1548. static decodeText(reader) {
  1549. const message = new $root.tensorflow.ResourceHandleProto.DtypeAndShape();
  1550. reader.start();
  1551. while (!reader.end()) {
  1552. const tag = reader.tag();
  1553. switch (tag) {
  1554. case "dtype":
  1555. message.dtype = reader.enum($root.tensorflow.DataType);
  1556. break;
  1557. case "shape":
  1558. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  1559. break;
  1560. default:
  1561. reader.field(tag, message);
  1562. break;
  1563. }
  1564. }
  1565. return message;
  1566. }
  1567. };
  1568. $root.tensorflow.ResourceHandleProto.DtypeAndShape.prototype.dtype = 0;
  1569. $root.tensorflow.ResourceHandleProto.DtypeAndShape.prototype.shape = null;
  1570. $root.tensorflow.TensorShapeProto = class TensorShapeProto {
  1571. constructor() {
  1572. this.dim = [];
  1573. }
  1574. static decode(reader, length) {
  1575. const message = new $root.tensorflow.TensorShapeProto();
  1576. const end = length !== undefined ? reader.position + length : reader.length;
  1577. while (reader.position < end) {
  1578. const tag = reader.uint32();
  1579. switch (tag >>> 3) {
  1580. case 2:
  1581. message.dim.push($root.tensorflow.TensorShapeProto.Dim.decode(reader, reader.uint32()));
  1582. break;
  1583. case 3:
  1584. message.unknown_rank = reader.bool();
  1585. break;
  1586. default:
  1587. reader.skipType(tag & 7);
  1588. break;
  1589. }
  1590. }
  1591. return message;
  1592. }
  1593. static decodeText(reader) {
  1594. const message = new $root.tensorflow.TensorShapeProto();
  1595. reader.start();
  1596. while (!reader.end()) {
  1597. const tag = reader.tag();
  1598. switch (tag) {
  1599. case "dim":
  1600. message.dim.push($root.tensorflow.TensorShapeProto.Dim.decodeText(reader));
  1601. break;
  1602. case "unknown_rank":
  1603. message.unknown_rank = reader.bool();
  1604. break;
  1605. default:
  1606. reader.field(tag, message);
  1607. break;
  1608. }
  1609. }
  1610. return message;
  1611. }
  1612. };
  1613. $root.tensorflow.TensorShapeProto.prototype.unknown_rank = false;
  1614. $root.tensorflow.TensorShapeProto.Dim = class Dim {
  1615. constructor() {
  1616. }
  1617. static decode(reader, length) {
  1618. const message = new $root.tensorflow.TensorShapeProto.Dim();
  1619. const end = length !== undefined ? reader.position + length : reader.length;
  1620. while (reader.position < end) {
  1621. const tag = reader.uint32();
  1622. switch (tag >>> 3) {
  1623. case 1:
  1624. message.size = reader.int64();
  1625. break;
  1626. case 2:
  1627. message.name = reader.string();
  1628. break;
  1629. default:
  1630. reader.skipType(tag & 7);
  1631. break;
  1632. }
  1633. }
  1634. return message;
  1635. }
  1636. static decodeText(reader) {
  1637. const message = new $root.tensorflow.TensorShapeProto.Dim();
  1638. reader.start();
  1639. while (!reader.end()) {
  1640. const tag = reader.tag();
  1641. switch (tag) {
  1642. case "size":
  1643. message.size = reader.int64();
  1644. break;
  1645. case "name":
  1646. message.name = reader.string();
  1647. break;
  1648. default:
  1649. reader.field(tag, message);
  1650. break;
  1651. }
  1652. }
  1653. return message;
  1654. }
  1655. };
  1656. $root.tensorflow.TensorShapeProto.Dim.prototype.size = protobuf.Int64.create(0);
  1657. $root.tensorflow.TensorShapeProto.Dim.prototype.name = "";
  1658. $root.tensorflow.DataType = {
  1659. "DT_INVALID": 0,
  1660. "DT_FLOAT": 1,
  1661. "DT_DOUBLE": 2,
  1662. "DT_INT32": 3,
  1663. "DT_UINT8": 4,
  1664. "DT_INT16": 5,
  1665. "DT_INT8": 6,
  1666. "DT_STRING": 7,
  1667. "DT_COMPLEX64": 8,
  1668. "DT_INT64": 9,
  1669. "DT_BOOL": 10,
  1670. "DT_QINT8": 11,
  1671. "DT_QUINT8": 12,
  1672. "DT_QINT32": 13,
  1673. "DT_BFLOAT16": 14,
  1674. "DT_QINT16": 15,
  1675. "DT_QUINT16": 16,
  1676. "DT_UINT16": 17,
  1677. "DT_COMPLEX128": 18,
  1678. "DT_HALF": 19,
  1679. "DT_RESOURCE": 20,
  1680. "DT_VARIANT": 21,
  1681. "DT_UINT32": 22,
  1682. "DT_UINT64": 23,
  1683. "DT_FLOAT_REF": 101,
  1684. "DT_DOUBLE_REF": 102,
  1685. "DT_INT32_REF": 103,
  1686. "DT_UINT8_REF": 104,
  1687. "DT_INT16_REF": 105,
  1688. "DT_INT8_REF": 106,
  1689. "DT_STRING_REF": 107,
  1690. "DT_COMPLEX64_REF": 108,
  1691. "DT_INT64_REF": 109,
  1692. "DT_BOOL_REF": 110,
  1693. "DT_QINT8_REF": 111,
  1694. "DT_QUINT8_REF": 112,
  1695. "DT_QINT32_REF": 113,
  1696. "DT_BFLOAT16_REF": 114,
  1697. "DT_QINT16_REF": 115,
  1698. "DT_QUINT16_REF": 116,
  1699. "DT_UINT16_REF": 117,
  1700. "DT_COMPLEX128_REF": 118,
  1701. "DT_HALF_REF": 119,
  1702. "DT_RESOURCE_REF": 120,
  1703. "DT_VARIANT_REF": 121,
  1704. "DT_UINT32_REF": 122,
  1705. "DT_UINT64_REF": 123
  1706. };
  1707. $root.tensorflow.NodeDef = class NodeDef {
  1708. constructor() {
  1709. this.input = [];
  1710. this.attr = {};
  1711. }
  1712. static decode(reader, length) {
  1713. const message = new $root.tensorflow.NodeDef();
  1714. const end = length !== undefined ? reader.position + length : reader.length;
  1715. while (reader.position < end) {
  1716. const tag = reader.uint32();
  1717. switch (tag >>> 3) {
  1718. case 1:
  1719. message.name = reader.string();
  1720. break;
  1721. case 2:
  1722. message.op = reader.string();
  1723. break;
  1724. case 3:
  1725. message.input.push(reader.string());
  1726. break;
  1727. case 4:
  1728. message.device = reader.string();
  1729. break;
  1730. case 5:
  1731. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decode(reader, reader.uint32()));
  1732. break;
  1733. case 6:
  1734. message.experimental_debug_info = $root.tensorflow.NodeDef.ExperimentalDebugInfo.decode(reader, reader.uint32());
  1735. break;
  1736. default:
  1737. reader.skipType(tag & 7);
  1738. break;
  1739. }
  1740. }
  1741. return message;
  1742. }
  1743. static decodeText(reader) {
  1744. const message = new $root.tensorflow.NodeDef();
  1745. reader.start();
  1746. while (!reader.end()) {
  1747. const tag = reader.tag();
  1748. switch (tag) {
  1749. case "name":
  1750. message.name = reader.string();
  1751. break;
  1752. case "op":
  1753. message.op = reader.string();
  1754. break;
  1755. case "input":
  1756. reader.array(message.input, () => reader.string());
  1757. break;
  1758. case "device":
  1759. message.device = reader.string();
  1760. break;
  1761. case "attr":
  1762. reader.entry(message.attr, () => reader.string(), () => $root.tensorflow.AttrValue.decodeText(reader));
  1763. break;
  1764. case "experimental_debug_info":
  1765. message.experimental_debug_info = $root.tensorflow.NodeDef.ExperimentalDebugInfo.decodeText(reader);
  1766. break;
  1767. default:
  1768. reader.field(tag, message);
  1769. break;
  1770. }
  1771. }
  1772. return message;
  1773. }
  1774. };
  1775. $root.tensorflow.NodeDef.prototype.name = "";
  1776. $root.tensorflow.NodeDef.prototype.op = "";
  1777. $root.tensorflow.NodeDef.prototype.device = "";
  1778. $root.tensorflow.NodeDef.prototype.experimental_debug_info = null;
  1779. $root.tensorflow.NodeDef.ExperimentalDebugInfo = class ExperimentalDebugInfo {
  1780. constructor() {
  1781. this.original_node_names = [];
  1782. this.original_func_names = [];
  1783. }
  1784. static decode(reader, length) {
  1785. const message = new $root.tensorflow.NodeDef.ExperimentalDebugInfo();
  1786. const end = length !== undefined ? reader.position + length : reader.length;
  1787. while (reader.position < end) {
  1788. const tag = reader.uint32();
  1789. switch (tag >>> 3) {
  1790. case 1:
  1791. message.original_node_names.push(reader.string());
  1792. break;
  1793. case 2:
  1794. message.original_func_names.push(reader.string());
  1795. break;
  1796. default:
  1797. reader.skipType(tag & 7);
  1798. break;
  1799. }
  1800. }
  1801. return message;
  1802. }
  1803. static decodeText(reader) {
  1804. const message = new $root.tensorflow.NodeDef.ExperimentalDebugInfo();
  1805. reader.start();
  1806. while (!reader.end()) {
  1807. const tag = reader.tag();
  1808. switch (tag) {
  1809. case "original_node_names":
  1810. reader.array(message.original_node_names, () => reader.string());
  1811. break;
  1812. case "original_func_names":
  1813. reader.array(message.original_func_names, () => reader.string());
  1814. break;
  1815. default:
  1816. reader.field(tag, message);
  1817. break;
  1818. }
  1819. }
  1820. return message;
  1821. }
  1822. };
  1823. $root.tensorflow.OpDef = class OpDef {
  1824. constructor() {
  1825. this.input_arg = [];
  1826. this.output_arg = [];
  1827. this.control_output = [];
  1828. this.attr = [];
  1829. }
  1830. static decode(reader, length) {
  1831. const message = new $root.tensorflow.OpDef();
  1832. const end = length !== undefined ? reader.position + length : reader.length;
  1833. while (reader.position < end) {
  1834. const tag = reader.uint32();
  1835. switch (tag >>> 3) {
  1836. case 1:
  1837. message.name = reader.string();
  1838. break;
  1839. case 2:
  1840. message.input_arg.push($root.tensorflow.OpDef.ArgDef.decode(reader, reader.uint32()));
  1841. break;
  1842. case 3:
  1843. message.output_arg.push($root.tensorflow.OpDef.ArgDef.decode(reader, reader.uint32()));
  1844. break;
  1845. case 20:
  1846. message.control_output.push(reader.string());
  1847. break;
  1848. case 4:
  1849. message.attr.push($root.tensorflow.OpDef.AttrDef.decode(reader, reader.uint32()));
  1850. break;
  1851. case 8:
  1852. message.deprecation = $root.tensorflow.OpDeprecation.decode(reader, reader.uint32());
  1853. break;
  1854. case 5:
  1855. message.summary = reader.string();
  1856. break;
  1857. case 6:
  1858. message.description = reader.string();
  1859. break;
  1860. case 18:
  1861. message.is_commutative = reader.bool();
  1862. break;
  1863. case 16:
  1864. message.is_aggregate = reader.bool();
  1865. break;
  1866. case 17:
  1867. message.is_stateful = reader.bool();
  1868. break;
  1869. case 19:
  1870. message.allows_uninitialized_input = reader.bool();
  1871. break;
  1872. case 21:
  1873. message.is_distributed_communication = reader.bool();
  1874. break;
  1875. default:
  1876. reader.skipType(tag & 7);
  1877. break;
  1878. }
  1879. }
  1880. return message;
  1881. }
  1882. static decodeText(reader) {
  1883. const message = new $root.tensorflow.OpDef();
  1884. reader.start();
  1885. while (!reader.end()) {
  1886. const tag = reader.tag();
  1887. switch (tag) {
  1888. case "name":
  1889. message.name = reader.string();
  1890. break;
  1891. case "input_arg":
  1892. message.input_arg.push($root.tensorflow.OpDef.ArgDef.decodeText(reader));
  1893. break;
  1894. case "output_arg":
  1895. message.output_arg.push($root.tensorflow.OpDef.ArgDef.decodeText(reader));
  1896. break;
  1897. case "control_output":
  1898. reader.array(message.control_output, () => reader.string());
  1899. break;
  1900. case "attr":
  1901. message.attr.push($root.tensorflow.OpDef.AttrDef.decodeText(reader));
  1902. break;
  1903. case "deprecation":
  1904. message.deprecation = $root.tensorflow.OpDeprecation.decodeText(reader);
  1905. break;
  1906. case "summary":
  1907. message.summary = reader.string();
  1908. break;
  1909. case "description":
  1910. message.description = reader.string();
  1911. break;
  1912. case "is_commutative":
  1913. message.is_commutative = reader.bool();
  1914. break;
  1915. case "is_aggregate":
  1916. message.is_aggregate = reader.bool();
  1917. break;
  1918. case "is_stateful":
  1919. message.is_stateful = reader.bool();
  1920. break;
  1921. case "allows_uninitialized_input":
  1922. message.allows_uninitialized_input = reader.bool();
  1923. break;
  1924. case "is_distributed_communication":
  1925. message.is_distributed_communication = reader.bool();
  1926. break;
  1927. default:
  1928. reader.field(tag, message);
  1929. break;
  1930. }
  1931. }
  1932. return message;
  1933. }
  1934. };
  1935. $root.tensorflow.OpDef.prototype.name = "";
  1936. $root.tensorflow.OpDef.prototype.deprecation = null;
  1937. $root.tensorflow.OpDef.prototype.summary = "";
  1938. $root.tensorflow.OpDef.prototype.description = "";
  1939. $root.tensorflow.OpDef.prototype.is_commutative = false;
  1940. $root.tensorflow.OpDef.prototype.is_aggregate = false;
  1941. $root.tensorflow.OpDef.prototype.is_stateful = false;
  1942. $root.tensorflow.OpDef.prototype.allows_uninitialized_input = false;
  1943. $root.tensorflow.OpDef.prototype.is_distributed_communication = false;
  1944. $root.tensorflow.OpDef.ArgDef = class ArgDef {
  1945. constructor() {
  1946. this.handle_data = [];
  1947. }
  1948. static decode(reader, length) {
  1949. const message = new $root.tensorflow.OpDef.ArgDef();
  1950. const end = length !== undefined ? reader.position + length : reader.length;
  1951. while (reader.position < end) {
  1952. const tag = reader.uint32();
  1953. switch (tag >>> 3) {
  1954. case 1:
  1955. message.name = reader.string();
  1956. break;
  1957. case 2:
  1958. message.description = reader.string();
  1959. break;
  1960. case 3:
  1961. message.type = reader.int32();
  1962. break;
  1963. case 4:
  1964. message.type_attr = reader.string();
  1965. break;
  1966. case 5:
  1967. message.number_attr = reader.string();
  1968. break;
  1969. case 6:
  1970. message.type_list_attr = reader.string();
  1971. break;
  1972. case 7:
  1973. message.handle_data.push($root.tensorflow.ResourceHandleProto.DtypeAndShape.decode(reader, reader.uint32()));
  1974. break;
  1975. case 16:
  1976. message.is_ref = reader.bool();
  1977. break;
  1978. case 17:
  1979. message.experimental_full_type = $root.tensorflow.FullTypeDef.decode(reader, reader.uint32());
  1980. break;
  1981. default:
  1982. reader.skipType(tag & 7);
  1983. break;
  1984. }
  1985. }
  1986. return message;
  1987. }
  1988. static decodeText(reader) {
  1989. const message = new $root.tensorflow.OpDef.ArgDef();
  1990. reader.start();
  1991. while (!reader.end()) {
  1992. const tag = reader.tag();
  1993. switch (tag) {
  1994. case "name":
  1995. message.name = reader.string();
  1996. break;
  1997. case "description":
  1998. message.description = reader.string();
  1999. break;
  2000. case "type":
  2001. message.type = reader.enum($root.tensorflow.DataType);
  2002. break;
  2003. case "type_attr":
  2004. message.type_attr = reader.string();
  2005. break;
  2006. case "number_attr":
  2007. message.number_attr = reader.string();
  2008. break;
  2009. case "type_list_attr":
  2010. message.type_list_attr = reader.string();
  2011. break;
  2012. case "handle_data":
  2013. message.handle_data.push($root.tensorflow.ResourceHandleProto.DtypeAndShape.decodeText(reader));
  2014. break;
  2015. case "is_ref":
  2016. message.is_ref = reader.bool();
  2017. break;
  2018. case "experimental_full_type":
  2019. message.experimental_full_type = $root.tensorflow.FullTypeDef.decodeText(reader);
  2020. break;
  2021. default:
  2022. reader.field(tag, message);
  2023. break;
  2024. }
  2025. }
  2026. return message;
  2027. }
  2028. };
  2029. $root.tensorflow.OpDef.ArgDef.prototype.name = "";
  2030. $root.tensorflow.OpDef.ArgDef.prototype.description = "";
  2031. $root.tensorflow.OpDef.ArgDef.prototype.type = 0;
  2032. $root.tensorflow.OpDef.ArgDef.prototype.type_attr = "";
  2033. $root.tensorflow.OpDef.ArgDef.prototype.number_attr = "";
  2034. $root.tensorflow.OpDef.ArgDef.prototype.type_list_attr = "";
  2035. $root.tensorflow.OpDef.ArgDef.prototype.is_ref = false;
  2036. $root.tensorflow.OpDef.ArgDef.prototype.experimental_full_type = null;
  2037. $root.tensorflow.OpDef.AttrDef = class AttrDef {
  2038. constructor() {
  2039. }
  2040. static decode(reader, length) {
  2041. const message = new $root.tensorflow.OpDef.AttrDef();
  2042. const end = length !== undefined ? reader.position + length : reader.length;
  2043. while (reader.position < end) {
  2044. const tag = reader.uint32();
  2045. switch (tag >>> 3) {
  2046. case 1:
  2047. message.name = reader.string();
  2048. break;
  2049. case 2:
  2050. message.type = reader.string();
  2051. break;
  2052. case 3:
  2053. message.default_value = $root.tensorflow.AttrValue.decode(reader, reader.uint32());
  2054. break;
  2055. case 4:
  2056. message.description = reader.string();
  2057. break;
  2058. case 5:
  2059. message.has_minimum = reader.bool();
  2060. break;
  2061. case 6:
  2062. message.minimum = reader.int64();
  2063. break;
  2064. case 7:
  2065. message.allowed_values = $root.tensorflow.AttrValue.decode(reader, reader.uint32());
  2066. break;
  2067. default:
  2068. reader.skipType(tag & 7);
  2069. break;
  2070. }
  2071. }
  2072. return message;
  2073. }
  2074. static decodeText(reader) {
  2075. const message = new $root.tensorflow.OpDef.AttrDef();
  2076. reader.start();
  2077. while (!reader.end()) {
  2078. const tag = reader.tag();
  2079. switch (tag) {
  2080. case "name":
  2081. message.name = reader.string();
  2082. break;
  2083. case "type":
  2084. message.type = reader.string();
  2085. break;
  2086. case "default_value":
  2087. message.default_value = $root.tensorflow.AttrValue.decodeText(reader);
  2088. break;
  2089. case "description":
  2090. message.description = reader.string();
  2091. break;
  2092. case "has_minimum":
  2093. message.has_minimum = reader.bool();
  2094. break;
  2095. case "minimum":
  2096. message.minimum = reader.int64();
  2097. break;
  2098. case "allowed_values":
  2099. message.allowed_values = $root.tensorflow.AttrValue.decodeText(reader);
  2100. break;
  2101. default:
  2102. reader.field(tag, message);
  2103. break;
  2104. }
  2105. }
  2106. return message;
  2107. }
  2108. };
  2109. $root.tensorflow.OpDef.AttrDef.prototype.name = "";
  2110. $root.tensorflow.OpDef.AttrDef.prototype.type = "";
  2111. $root.tensorflow.OpDef.AttrDef.prototype.default_value = null;
  2112. $root.tensorflow.OpDef.AttrDef.prototype.description = "";
  2113. $root.tensorflow.OpDef.AttrDef.prototype.has_minimum = false;
  2114. $root.tensorflow.OpDef.AttrDef.prototype.minimum = protobuf.Int64.create(0);
  2115. $root.tensorflow.OpDef.AttrDef.prototype.allowed_values = null;
  2116. $root.tensorflow.OpDeprecation = class OpDeprecation {
  2117. constructor() {
  2118. }
  2119. static decode(reader, length) {
  2120. const message = new $root.tensorflow.OpDeprecation();
  2121. const end = length !== undefined ? reader.position + length : reader.length;
  2122. while (reader.position < end) {
  2123. const tag = reader.uint32();
  2124. switch (tag >>> 3) {
  2125. case 1:
  2126. message.version = reader.int32();
  2127. break;
  2128. case 2:
  2129. message.explanation = reader.string();
  2130. break;
  2131. default:
  2132. reader.skipType(tag & 7);
  2133. break;
  2134. }
  2135. }
  2136. return message;
  2137. }
  2138. static decodeText(reader) {
  2139. const message = new $root.tensorflow.OpDeprecation();
  2140. reader.start();
  2141. while (!reader.end()) {
  2142. const tag = reader.tag();
  2143. switch (tag) {
  2144. case "version":
  2145. message.version = reader.int32();
  2146. break;
  2147. case "explanation":
  2148. message.explanation = reader.string();
  2149. break;
  2150. default:
  2151. reader.field(tag, message);
  2152. break;
  2153. }
  2154. }
  2155. return message;
  2156. }
  2157. };
  2158. $root.tensorflow.OpDeprecation.prototype.version = 0;
  2159. $root.tensorflow.OpDeprecation.prototype.explanation = "";
  2160. $root.tensorflow.OpList = class OpList {
  2161. constructor() {
  2162. this.op = [];
  2163. }
  2164. static decode(reader, length) {
  2165. const message = new $root.tensorflow.OpList();
  2166. const end = length !== undefined ? reader.position + length : reader.length;
  2167. while (reader.position < end) {
  2168. const tag = reader.uint32();
  2169. switch (tag >>> 3) {
  2170. case 1:
  2171. message.op.push($root.tensorflow.OpDef.decode(reader, reader.uint32()));
  2172. break;
  2173. default:
  2174. reader.skipType(tag & 7);
  2175. break;
  2176. }
  2177. }
  2178. return message;
  2179. }
  2180. static decodeText(reader) {
  2181. const message = new $root.tensorflow.OpList();
  2182. reader.start();
  2183. while (!reader.end()) {
  2184. const tag = reader.tag();
  2185. switch (tag) {
  2186. case "op":
  2187. message.op.push($root.tensorflow.OpDef.decodeText(reader));
  2188. break;
  2189. default:
  2190. reader.field(tag, message);
  2191. break;
  2192. }
  2193. }
  2194. return message;
  2195. }
  2196. };
  2197. $root.tensorflow.FullTypeId = {
  2198. "TFT_UNSET": 0,
  2199. "TFT_VAR": 1,
  2200. "TFT_ANY": 2,
  2201. "TFT_PRODUCT": 3,
  2202. "TFT_CALLABLE": 100,
  2203. "TFT_TENSOR": 1000,
  2204. "TFT_ARRAY": 1001,
  2205. "TFT_OPTIONAL": 1002,
  2206. "TFT_DATASET": 10102,
  2207. "TFT_BOOL": 200,
  2208. "TFT_UINT8": 201,
  2209. "TFT_UINT16": 202,
  2210. "TFT_UINT32": 203,
  2211. "TFT_UINT64": 204,
  2212. "TFT_INT8": 205,
  2213. "TFT_INT16": 206,
  2214. "TFT_INT32": 207,
  2215. "TFT_INT64": 208,
  2216. "TFT_HALF": 209,
  2217. "TFT_FLOAT": 210,
  2218. "TFT_DOUBLE": 211,
  2219. "TFT_BFLOAT16": 215,
  2220. "TFT_COMPLEX64": 212,
  2221. "TFT_COMPLEX128": 213,
  2222. "TFT_STRING": 214
  2223. };
  2224. $root.tensorflow.FullTypeDef = class FullTypeDef {
  2225. constructor() {
  2226. this.args = [];
  2227. }
  2228. get attr() {
  2229. $root.tensorflow.FullTypeDef.attrSet = $root.tensorflow.FullTypeDef.attrSet || new Set([ "s"]);
  2230. return Object.keys(this).find((key) => $root.tensorflow.FullTypeDef.attrSet.has(key) && this[key] != null);
  2231. }
  2232. static decode(reader, length) {
  2233. const message = new $root.tensorflow.FullTypeDef();
  2234. const end = length !== undefined ? reader.position + length : reader.length;
  2235. while (reader.position < end) {
  2236. const tag = reader.uint32();
  2237. switch (tag >>> 3) {
  2238. case 1:
  2239. message.type_id = reader.int32();
  2240. break;
  2241. case 2:
  2242. message.args.push($root.tensorflow.FullTypeDef.decode(reader, reader.uint32()));
  2243. break;
  2244. case 3:
  2245. message.s = reader.string();
  2246. break;
  2247. default:
  2248. reader.skipType(tag & 7);
  2249. break;
  2250. }
  2251. }
  2252. return message;
  2253. }
  2254. static decodeText(reader) {
  2255. const message = new $root.tensorflow.FullTypeDef();
  2256. reader.start();
  2257. while (!reader.end()) {
  2258. const tag = reader.tag();
  2259. switch (tag) {
  2260. case "type_id":
  2261. message.type_id = reader.enum($root.tensorflow.FullTypeId);
  2262. break;
  2263. case "args":
  2264. message.args.push($root.tensorflow.FullTypeDef.decodeText(reader));
  2265. break;
  2266. case "s":
  2267. message.s = reader.string();
  2268. break;
  2269. default:
  2270. reader.field(tag, message);
  2271. break;
  2272. }
  2273. }
  2274. return message;
  2275. }
  2276. };
  2277. $root.tensorflow.FullTypeDef.prototype.type_id = 0;
  2278. $root.tensorflow.VersionDef = class VersionDef {
  2279. constructor() {
  2280. this.bad_consumers = [];
  2281. }
  2282. static decode(reader, length) {
  2283. const message = new $root.tensorflow.VersionDef();
  2284. const end = length !== undefined ? reader.position + length : reader.length;
  2285. while (reader.position < end) {
  2286. const tag = reader.uint32();
  2287. switch (tag >>> 3) {
  2288. case 1:
  2289. message.producer = reader.int32();
  2290. break;
  2291. case 2:
  2292. message.min_consumer = reader.int32();
  2293. break;
  2294. case 3:
  2295. message.bad_consumers = reader.array(message.bad_consumers, () => reader.int32(), tag);
  2296. break;
  2297. default:
  2298. reader.skipType(tag & 7);
  2299. break;
  2300. }
  2301. }
  2302. return message;
  2303. }
  2304. static decodeText(reader) {
  2305. const message = new $root.tensorflow.VersionDef();
  2306. reader.start();
  2307. while (!reader.end()) {
  2308. const tag = reader.tag();
  2309. switch (tag) {
  2310. case "producer":
  2311. message.producer = reader.int32();
  2312. break;
  2313. case "min_consumer":
  2314. message.min_consumer = reader.int32();
  2315. break;
  2316. case "bad_consumers":
  2317. reader.array(message.bad_consumers, () => reader.int32());
  2318. break;
  2319. default:
  2320. reader.field(tag, message);
  2321. break;
  2322. }
  2323. }
  2324. return message;
  2325. }
  2326. };
  2327. $root.tensorflow.VersionDef.prototype.producer = 0;
  2328. $root.tensorflow.VersionDef.prototype.min_consumer = 0;
  2329. $root.tensorflow.SavedObjectGraph = class SavedObjectGraph {
  2330. constructor() {
  2331. this.nodes = [];
  2332. this.concrete_functions = {};
  2333. }
  2334. static decode(reader, length) {
  2335. const message = new $root.tensorflow.SavedObjectGraph();
  2336. const end = length !== undefined ? reader.position + length : reader.length;
  2337. while (reader.position < end) {
  2338. const tag = reader.uint32();
  2339. switch (tag >>> 3) {
  2340. case 1:
  2341. message.nodes.push($root.tensorflow.SavedObject.decode(reader, reader.uint32()));
  2342. break;
  2343. case 2:
  2344. reader.entry(message.concrete_functions, () => reader.string(), () => $root.tensorflow.SavedConcreteFunction.decode(reader, reader.uint32()));
  2345. break;
  2346. default:
  2347. reader.skipType(tag & 7);
  2348. break;
  2349. }
  2350. }
  2351. return message;
  2352. }
  2353. static decodeText(reader) {
  2354. const message = new $root.tensorflow.SavedObjectGraph();
  2355. reader.start();
  2356. while (!reader.end()) {
  2357. const tag = reader.tag();
  2358. switch (tag) {
  2359. case "nodes":
  2360. message.nodes.push($root.tensorflow.SavedObject.decodeText(reader));
  2361. break;
  2362. case "concrete_functions":
  2363. reader.entry(message.concrete_functions, () => reader.string(), () => $root.tensorflow.SavedConcreteFunction.decodeText(reader));
  2364. break;
  2365. default:
  2366. reader.field(tag, message);
  2367. break;
  2368. }
  2369. }
  2370. return message;
  2371. }
  2372. };
  2373. $root.tensorflow.SavedObject = class SavedObject {
  2374. constructor() {
  2375. this.children = [];
  2376. this.slot_variables = [];
  2377. this.saveable_objects = {};
  2378. }
  2379. get kind() {
  2380. $root.tensorflow.SavedObject.kindSet = $root.tensorflow.SavedObject.kindSet || new Set([ "user_object", "asset", "function", "variable", "bare_concrete_function", "constant", "resource", "captured_tensor"]);
  2381. return Object.keys(this).find((key) => $root.tensorflow.SavedObject.kindSet.has(key) && this[key] != null);
  2382. }
  2383. static decode(reader, length) {
  2384. const message = new $root.tensorflow.SavedObject();
  2385. const end = length !== undefined ? reader.position + length : reader.length;
  2386. while (reader.position < end) {
  2387. const tag = reader.uint32();
  2388. switch (tag >>> 3) {
  2389. case 1:
  2390. message.children.push($root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.decode(reader, reader.uint32()));
  2391. break;
  2392. case 3:
  2393. message.slot_variables.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.decode(reader, reader.uint32()));
  2394. break;
  2395. case 4:
  2396. message.user_object = $root.tensorflow.SavedUserObject.decode(reader, reader.uint32());
  2397. break;
  2398. case 5:
  2399. message.asset = $root.tensorflow.SavedAsset.decode(reader, reader.uint32());
  2400. break;
  2401. case 6:
  2402. message["function"] = $root.tensorflow.SavedFunction.decode(reader, reader.uint32());
  2403. break;
  2404. case 7:
  2405. message.variable = $root.tensorflow.SavedVariable.decode(reader, reader.uint32());
  2406. break;
  2407. case 8:
  2408. message.bare_concrete_function = $root.tensorflow.SavedBareConcreteFunction.decode(reader, reader.uint32());
  2409. break;
  2410. case 9:
  2411. message.constant = $root.tensorflow.SavedConstant.decode(reader, reader.uint32());
  2412. break;
  2413. case 10:
  2414. message.resource = $root.tensorflow.SavedResource.decode(reader, reader.uint32());
  2415. break;
  2416. case 12:
  2417. message.captured_tensor = $root.tensorflow.CapturedTensor.decode(reader, reader.uint32());
  2418. break;
  2419. case 11:
  2420. reader.entry(message.saveable_objects, () => reader.string(), () => $root.tensorflow.SaveableObject.decode(reader, reader.uint32()));
  2421. break;
  2422. default:
  2423. reader.skipType(tag & 7);
  2424. break;
  2425. }
  2426. }
  2427. return message;
  2428. }
  2429. static decodeText(reader) {
  2430. const message = new $root.tensorflow.SavedObject();
  2431. reader.start();
  2432. while (!reader.end()) {
  2433. const tag = reader.tag();
  2434. switch (tag) {
  2435. case "children":
  2436. message.children.push($root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.decodeText(reader));
  2437. break;
  2438. case "slot_variables":
  2439. message.slot_variables.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.decodeText(reader));
  2440. break;
  2441. case "user_object":
  2442. message.user_object = $root.tensorflow.SavedUserObject.decodeText(reader);
  2443. break;
  2444. case "asset":
  2445. message.asset = $root.tensorflow.SavedAsset.decodeText(reader);
  2446. break;
  2447. case "function":
  2448. message["function"] = $root.tensorflow.SavedFunction.decodeText(reader);
  2449. break;
  2450. case "variable":
  2451. message.variable = $root.tensorflow.SavedVariable.decodeText(reader);
  2452. break;
  2453. case "bare_concrete_function":
  2454. message.bare_concrete_function = $root.tensorflow.SavedBareConcreteFunction.decodeText(reader);
  2455. break;
  2456. case "constant":
  2457. message.constant = $root.tensorflow.SavedConstant.decodeText(reader);
  2458. break;
  2459. case "resource":
  2460. message.resource = $root.tensorflow.SavedResource.decodeText(reader);
  2461. break;
  2462. case "captured_tensor":
  2463. message.captured_tensor = $root.tensorflow.CapturedTensor.decodeText(reader);
  2464. break;
  2465. case "saveable_objects":
  2466. reader.entry(message.saveable_objects, () => reader.string(), () => $root.tensorflow.SaveableObject.decodeText(reader));
  2467. break;
  2468. default:
  2469. reader.field(tag, message);
  2470. break;
  2471. }
  2472. }
  2473. return message;
  2474. }
  2475. };
  2476. $root.tensorflow.SavedUserObject = class SavedUserObject {
  2477. constructor() {
  2478. }
  2479. static decode(reader, length) {
  2480. const message = new $root.tensorflow.SavedUserObject();
  2481. const end = length !== undefined ? reader.position + length : reader.length;
  2482. while (reader.position < end) {
  2483. const tag = reader.uint32();
  2484. switch (tag >>> 3) {
  2485. case 1:
  2486. message.identifier = reader.string();
  2487. break;
  2488. case 2:
  2489. message.version = $root.tensorflow.VersionDef.decode(reader, reader.uint32());
  2490. break;
  2491. case 3:
  2492. message.metadata = reader.string();
  2493. break;
  2494. default:
  2495. reader.skipType(tag & 7);
  2496. break;
  2497. }
  2498. }
  2499. return message;
  2500. }
  2501. static decodeText(reader) {
  2502. const message = new $root.tensorflow.SavedUserObject();
  2503. reader.start();
  2504. while (!reader.end()) {
  2505. const tag = reader.tag();
  2506. switch (tag) {
  2507. case "identifier":
  2508. message.identifier = reader.string();
  2509. break;
  2510. case "version":
  2511. message.version = $root.tensorflow.VersionDef.decodeText(reader);
  2512. break;
  2513. case "metadata":
  2514. message.metadata = reader.string();
  2515. break;
  2516. default:
  2517. reader.field(tag, message);
  2518. break;
  2519. }
  2520. }
  2521. return message;
  2522. }
  2523. };
  2524. $root.tensorflow.SavedUserObject.prototype.identifier = "";
  2525. $root.tensorflow.SavedUserObject.prototype.version = null;
  2526. $root.tensorflow.SavedUserObject.prototype.metadata = "";
  2527. $root.tensorflow.SavedAsset = class SavedAsset {
  2528. constructor() {
  2529. }
  2530. static decode(reader, length) {
  2531. const message = new $root.tensorflow.SavedAsset();
  2532. const end = length !== undefined ? reader.position + length : reader.length;
  2533. while (reader.position < end) {
  2534. const tag = reader.uint32();
  2535. switch (tag >>> 3) {
  2536. case 1:
  2537. message.asset_file_def_index = reader.int32();
  2538. break;
  2539. default:
  2540. reader.skipType(tag & 7);
  2541. break;
  2542. }
  2543. }
  2544. return message;
  2545. }
  2546. static decodeText(reader) {
  2547. const message = new $root.tensorflow.SavedAsset();
  2548. reader.start();
  2549. while (!reader.end()) {
  2550. const tag = reader.tag();
  2551. switch (tag) {
  2552. case "asset_file_def_index":
  2553. message.asset_file_def_index = reader.int32();
  2554. break;
  2555. default:
  2556. reader.field(tag, message);
  2557. break;
  2558. }
  2559. }
  2560. return message;
  2561. }
  2562. };
  2563. $root.tensorflow.SavedAsset.prototype.asset_file_def_index = 0;
  2564. $root.tensorflow.SavedFunction = class SavedFunction {
  2565. constructor() {
  2566. this.concrete_functions = [];
  2567. }
  2568. static decode(reader, length) {
  2569. const message = new $root.tensorflow.SavedFunction();
  2570. const end = length !== undefined ? reader.position + length : reader.length;
  2571. while (reader.position < end) {
  2572. const tag = reader.uint32();
  2573. switch (tag >>> 3) {
  2574. case 1:
  2575. message.concrete_functions.push(reader.string());
  2576. break;
  2577. case 2:
  2578. message.function_spec = $root.tensorflow.FunctionSpec.decode(reader, reader.uint32());
  2579. break;
  2580. default:
  2581. reader.skipType(tag & 7);
  2582. break;
  2583. }
  2584. }
  2585. return message;
  2586. }
  2587. static decodeText(reader) {
  2588. const message = new $root.tensorflow.SavedFunction();
  2589. reader.start();
  2590. while (!reader.end()) {
  2591. const tag = reader.tag();
  2592. switch (tag) {
  2593. case "concrete_functions":
  2594. reader.array(message.concrete_functions, () => reader.string());
  2595. break;
  2596. case "function_spec":
  2597. message.function_spec = $root.tensorflow.FunctionSpec.decodeText(reader);
  2598. break;
  2599. default:
  2600. reader.field(tag, message);
  2601. break;
  2602. }
  2603. }
  2604. return message;
  2605. }
  2606. };
  2607. $root.tensorflow.SavedFunction.prototype.function_spec = null;
  2608. $root.tensorflow.CapturedTensor = class CapturedTensor {
  2609. constructor() {
  2610. }
  2611. static decode(reader, length) {
  2612. const message = new $root.tensorflow.CapturedTensor();
  2613. const end = length !== undefined ? reader.position + length : reader.length;
  2614. while (reader.position < end) {
  2615. const tag = reader.uint32();
  2616. switch (tag >>> 3) {
  2617. case 1:
  2618. message.name = reader.string();
  2619. break;
  2620. case 2:
  2621. message.concrete_function = reader.string();
  2622. break;
  2623. default:
  2624. reader.skipType(tag & 7);
  2625. break;
  2626. }
  2627. }
  2628. return message;
  2629. }
  2630. static decodeText(reader) {
  2631. const message = new $root.tensorflow.CapturedTensor();
  2632. reader.start();
  2633. while (!reader.end()) {
  2634. const tag = reader.tag();
  2635. switch (tag) {
  2636. case "name":
  2637. message.name = reader.string();
  2638. break;
  2639. case "concrete_function":
  2640. message.concrete_function = reader.string();
  2641. break;
  2642. default:
  2643. reader.field(tag, message);
  2644. break;
  2645. }
  2646. }
  2647. return message;
  2648. }
  2649. };
  2650. $root.tensorflow.CapturedTensor.prototype.name = "";
  2651. $root.tensorflow.CapturedTensor.prototype.concrete_function = "";
  2652. $root.tensorflow.SavedConcreteFunction = class SavedConcreteFunction {
  2653. constructor() {
  2654. this.bound_inputs = [];
  2655. }
  2656. static decode(reader, length) {
  2657. const message = new $root.tensorflow.SavedConcreteFunction();
  2658. const end = length !== undefined ? reader.position + length : reader.length;
  2659. while (reader.position < end) {
  2660. const tag = reader.uint32();
  2661. switch (tag >>> 3) {
  2662. case 2:
  2663. message.bound_inputs = reader.array(message.bound_inputs, () => reader.int32(), tag);
  2664. break;
  2665. case 3:
  2666. message.canonicalized_input_signature = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  2667. break;
  2668. case 4:
  2669. message.output_signature = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  2670. break;
  2671. default:
  2672. reader.skipType(tag & 7);
  2673. break;
  2674. }
  2675. }
  2676. return message;
  2677. }
  2678. static decodeText(reader) {
  2679. const message = new $root.tensorflow.SavedConcreteFunction();
  2680. reader.start();
  2681. while (!reader.end()) {
  2682. const tag = reader.tag();
  2683. switch (tag) {
  2684. case "bound_inputs":
  2685. reader.array(message.bound_inputs, () => reader.int32());
  2686. break;
  2687. case "canonicalized_input_signature":
  2688. message.canonicalized_input_signature = $root.tensorflow.StructuredValue.decodeText(reader);
  2689. break;
  2690. case "output_signature":
  2691. message.output_signature = $root.tensorflow.StructuredValue.decodeText(reader);
  2692. break;
  2693. default:
  2694. reader.field(tag, message);
  2695. break;
  2696. }
  2697. }
  2698. return message;
  2699. }
  2700. };
  2701. $root.tensorflow.SavedConcreteFunction.prototype.canonicalized_input_signature = null;
  2702. $root.tensorflow.SavedConcreteFunction.prototype.output_signature = null;
  2703. $root.tensorflow.SavedBareConcreteFunction = class SavedBareConcreteFunction {
  2704. constructor() {
  2705. this.argument_keywords = [];
  2706. }
  2707. static decode(reader, length) {
  2708. const message = new $root.tensorflow.SavedBareConcreteFunction();
  2709. const end = length !== undefined ? reader.position + length : reader.length;
  2710. while (reader.position < end) {
  2711. const tag = reader.uint32();
  2712. switch (tag >>> 3) {
  2713. case 1:
  2714. message.concrete_function_name = reader.string();
  2715. break;
  2716. case 2:
  2717. message.argument_keywords.push(reader.string());
  2718. break;
  2719. case 3:
  2720. message.allowed_positional_arguments = reader.int64();
  2721. break;
  2722. case 4:
  2723. message.function_spec = $root.tensorflow.FunctionSpec.decode(reader, reader.uint32());
  2724. break;
  2725. default:
  2726. reader.skipType(tag & 7);
  2727. break;
  2728. }
  2729. }
  2730. return message;
  2731. }
  2732. static decodeText(reader) {
  2733. const message = new $root.tensorflow.SavedBareConcreteFunction();
  2734. reader.start();
  2735. while (!reader.end()) {
  2736. const tag = reader.tag();
  2737. switch (tag) {
  2738. case "concrete_function_name":
  2739. message.concrete_function_name = reader.string();
  2740. break;
  2741. case "argument_keywords":
  2742. reader.array(message.argument_keywords, () => reader.string());
  2743. break;
  2744. case "allowed_positional_arguments":
  2745. message.allowed_positional_arguments = reader.int64();
  2746. break;
  2747. case "function_spec":
  2748. message.function_spec = $root.tensorflow.FunctionSpec.decodeText(reader);
  2749. break;
  2750. default:
  2751. reader.field(tag, message);
  2752. break;
  2753. }
  2754. }
  2755. return message;
  2756. }
  2757. };
  2758. $root.tensorflow.SavedBareConcreteFunction.prototype.concrete_function_name = "";
  2759. $root.tensorflow.SavedBareConcreteFunction.prototype.allowed_positional_arguments = protobuf.Int64.create(0);
  2760. $root.tensorflow.SavedBareConcreteFunction.prototype.function_spec = null;
  2761. $root.tensorflow.SavedConstant = class SavedConstant {
  2762. constructor() {
  2763. }
  2764. static decode(reader, length) {
  2765. const message = new $root.tensorflow.SavedConstant();
  2766. const end = length !== undefined ? reader.position + length : reader.length;
  2767. while (reader.position < end) {
  2768. const tag = reader.uint32();
  2769. switch (tag >>> 3) {
  2770. case 1:
  2771. message.operation = reader.string();
  2772. break;
  2773. default:
  2774. reader.skipType(tag & 7);
  2775. break;
  2776. }
  2777. }
  2778. return message;
  2779. }
  2780. static decodeText(reader) {
  2781. const message = new $root.tensorflow.SavedConstant();
  2782. reader.start();
  2783. while (!reader.end()) {
  2784. const tag = reader.tag();
  2785. switch (tag) {
  2786. case "operation":
  2787. message.operation = reader.string();
  2788. break;
  2789. default:
  2790. reader.field(tag, message);
  2791. break;
  2792. }
  2793. }
  2794. return message;
  2795. }
  2796. };
  2797. $root.tensorflow.SavedConstant.prototype.operation = "";
  2798. $root.tensorflow.SavedVariable = class SavedVariable {
  2799. constructor() {
  2800. this.experimental_distributed_variable_components = [];
  2801. }
  2802. static decode(reader, length) {
  2803. const message = new $root.tensorflow.SavedVariable();
  2804. const end = length !== undefined ? reader.position + length : reader.length;
  2805. while (reader.position < end) {
  2806. const tag = reader.uint32();
  2807. switch (tag >>> 3) {
  2808. case 1:
  2809. message.dtype = reader.int32();
  2810. break;
  2811. case 2:
  2812. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  2813. break;
  2814. case 3:
  2815. message.trainable = reader.bool();
  2816. break;
  2817. case 4:
  2818. message.synchronization = reader.int32();
  2819. break;
  2820. case 5:
  2821. message.aggregation = reader.int32();
  2822. break;
  2823. case 6:
  2824. message.name = reader.string();
  2825. break;
  2826. case 7:
  2827. message.device = reader.string();
  2828. break;
  2829. case 8:
  2830. message.experimental_distributed_variable_components.push($root.tensorflow.SavedVariable.decode(reader, reader.uint32()));
  2831. break;
  2832. default:
  2833. reader.skipType(tag & 7);
  2834. break;
  2835. }
  2836. }
  2837. return message;
  2838. }
  2839. static decodeText(reader) {
  2840. const message = new $root.tensorflow.SavedVariable();
  2841. reader.start();
  2842. while (!reader.end()) {
  2843. const tag = reader.tag();
  2844. switch (tag) {
  2845. case "dtype":
  2846. message.dtype = reader.enum($root.tensorflow.DataType);
  2847. break;
  2848. case "shape":
  2849. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  2850. break;
  2851. case "trainable":
  2852. message.trainable = reader.bool();
  2853. break;
  2854. case "synchronization":
  2855. message.synchronization = reader.enum($root.tensorflow.VariableSynchronization);
  2856. break;
  2857. case "aggregation":
  2858. message.aggregation = reader.enum($root.tensorflow.VariableAggregation);
  2859. break;
  2860. case "name":
  2861. message.name = reader.string();
  2862. break;
  2863. case "device":
  2864. message.device = reader.string();
  2865. break;
  2866. case "experimental_distributed_variable_components":
  2867. message.experimental_distributed_variable_components.push($root.tensorflow.SavedVariable.decodeText(reader));
  2868. break;
  2869. default:
  2870. reader.field(tag, message);
  2871. break;
  2872. }
  2873. }
  2874. return message;
  2875. }
  2876. };
  2877. $root.tensorflow.SavedVariable.prototype.dtype = 0;
  2878. $root.tensorflow.SavedVariable.prototype.shape = null;
  2879. $root.tensorflow.SavedVariable.prototype.trainable = false;
  2880. $root.tensorflow.SavedVariable.prototype.synchronization = 0;
  2881. $root.tensorflow.SavedVariable.prototype.aggregation = 0;
  2882. $root.tensorflow.SavedVariable.prototype.name = "";
  2883. $root.tensorflow.SavedVariable.prototype.device = "";
  2884. $root.tensorflow.FunctionSpec = class FunctionSpec {
  2885. constructor() {
  2886. }
  2887. static decode(reader, length) {
  2888. const message = new $root.tensorflow.FunctionSpec();
  2889. const end = length !== undefined ? reader.position + length : reader.length;
  2890. while (reader.position < end) {
  2891. const tag = reader.uint32();
  2892. switch (tag >>> 3) {
  2893. case 1:
  2894. message.fullargspec = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  2895. break;
  2896. case 2:
  2897. message.is_method = reader.bool();
  2898. break;
  2899. case 5:
  2900. message.input_signature = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  2901. break;
  2902. case 6:
  2903. message.jit_compile = reader.int32();
  2904. break;
  2905. default:
  2906. reader.skipType(tag & 7);
  2907. break;
  2908. }
  2909. }
  2910. return message;
  2911. }
  2912. static decodeText(reader) {
  2913. const message = new $root.tensorflow.FunctionSpec();
  2914. reader.start();
  2915. while (!reader.end()) {
  2916. const tag = reader.tag();
  2917. switch (tag) {
  2918. case "fullargspec":
  2919. message.fullargspec = $root.tensorflow.StructuredValue.decodeText(reader);
  2920. break;
  2921. case "is_method":
  2922. message.is_method = reader.bool();
  2923. break;
  2924. case "input_signature":
  2925. message.input_signature = $root.tensorflow.StructuredValue.decodeText(reader);
  2926. break;
  2927. case "jit_compile":
  2928. message.jit_compile = reader.enum($root.tensorflow.FunctionSpec.JitCompile);
  2929. break;
  2930. default:
  2931. reader.field(tag, message);
  2932. break;
  2933. }
  2934. }
  2935. return message;
  2936. }
  2937. };
  2938. $root.tensorflow.FunctionSpec.prototype.fullargspec = null;
  2939. $root.tensorflow.FunctionSpec.prototype.is_method = false;
  2940. $root.tensorflow.FunctionSpec.prototype.input_signature = null;
  2941. $root.tensorflow.FunctionSpec.prototype.jit_compile = 0;
  2942. $root.tensorflow.FunctionSpec.JitCompile = {
  2943. "DEFAULT": 0,
  2944. "ON": 1,
  2945. "OFF": 2
  2946. };
  2947. $root.tensorflow.SavedResource = class SavedResource {
  2948. constructor() {
  2949. }
  2950. static decode(reader, length) {
  2951. const message = new $root.tensorflow.SavedResource();
  2952. const end = length !== undefined ? reader.position + length : reader.length;
  2953. while (reader.position < end) {
  2954. const tag = reader.uint32();
  2955. switch (tag >>> 3) {
  2956. case 1:
  2957. message.device = reader.string();
  2958. break;
  2959. default:
  2960. reader.skipType(tag & 7);
  2961. break;
  2962. }
  2963. }
  2964. return message;
  2965. }
  2966. static decodeText(reader) {
  2967. const message = new $root.tensorflow.SavedResource();
  2968. reader.start();
  2969. while (!reader.end()) {
  2970. const tag = reader.tag();
  2971. switch (tag) {
  2972. case "device":
  2973. message.device = reader.string();
  2974. break;
  2975. default:
  2976. reader.field(tag, message);
  2977. break;
  2978. }
  2979. }
  2980. return message;
  2981. }
  2982. };
  2983. $root.tensorflow.SavedResource.prototype.device = "";
  2984. $root.tensorflow.SaveableObject = class SaveableObject {
  2985. constructor() {
  2986. }
  2987. static decode(reader, length) {
  2988. const message = new $root.tensorflow.SaveableObject();
  2989. const end = length !== undefined ? reader.position + length : reader.length;
  2990. while (reader.position < end) {
  2991. const tag = reader.uint32();
  2992. switch (tag >>> 3) {
  2993. case 2:
  2994. message.save_function = reader.int32();
  2995. break;
  2996. case 3:
  2997. message.restore_function = reader.int32();
  2998. break;
  2999. default:
  3000. reader.skipType(tag & 7);
  3001. break;
  3002. }
  3003. }
  3004. return message;
  3005. }
  3006. static decodeText(reader) {
  3007. const message = new $root.tensorflow.SaveableObject();
  3008. reader.start();
  3009. while (!reader.end()) {
  3010. const tag = reader.tag();
  3011. switch (tag) {
  3012. case "save_function":
  3013. message.save_function = reader.int32();
  3014. break;
  3015. case "restore_function":
  3016. message.restore_function = reader.int32();
  3017. break;
  3018. default:
  3019. reader.field(tag, message);
  3020. break;
  3021. }
  3022. }
  3023. return message;
  3024. }
  3025. };
  3026. $root.tensorflow.SaveableObject.prototype.save_function = 0;
  3027. $root.tensorflow.SaveableObject.prototype.restore_function = 0;
  3028. $root.tensorflow.VariableSynchronization = {
  3029. "VARIABLE_SYNCHRONIZATION_AUTO": 0,
  3030. "VARIABLE_SYNCHRONIZATION_NONE": 1,
  3031. "VARIABLE_SYNCHRONIZATION_ON_WRITE": 2,
  3032. "VARIABLE_SYNCHRONIZATION_ON_READ": 3
  3033. };
  3034. $root.tensorflow.VariableAggregation = {
  3035. "VARIABLE_AGGREGATION_NONE": 0,
  3036. "VARIABLE_AGGREGATION_SUM": 1,
  3037. "VARIABLE_AGGREGATION_MEAN": 2,
  3038. "VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA": 3
  3039. };
  3040. $root.tensorflow.VariableDef = class VariableDef {
  3041. constructor() {
  3042. }
  3043. static decode(reader, length) {
  3044. const message = new $root.tensorflow.VariableDef();
  3045. const end = length !== undefined ? reader.position + length : reader.length;
  3046. while (reader.position < end) {
  3047. const tag = reader.uint32();
  3048. switch (tag >>> 3) {
  3049. case 1:
  3050. message.variable_name = reader.string();
  3051. break;
  3052. case 6:
  3053. message.initial_value_name = reader.string();
  3054. break;
  3055. case 2:
  3056. message.initializer_name = reader.string();
  3057. break;
  3058. case 3:
  3059. message.snapshot_name = reader.string();
  3060. break;
  3061. case 4:
  3062. message.save_slice_info_def = $root.tensorflow.SaveSliceInfoDef.decode(reader, reader.uint32());
  3063. break;
  3064. case 5:
  3065. message.is_resource = reader.bool();
  3066. break;
  3067. case 7:
  3068. message.trainable = reader.bool();
  3069. break;
  3070. case 8:
  3071. message.synchronization = reader.int32();
  3072. break;
  3073. case 9:
  3074. message.aggregation = reader.int32();
  3075. break;
  3076. default:
  3077. reader.skipType(tag & 7);
  3078. break;
  3079. }
  3080. }
  3081. return message;
  3082. }
  3083. static decodeText(reader) {
  3084. const message = new $root.tensorflow.VariableDef();
  3085. reader.start();
  3086. while (!reader.end()) {
  3087. const tag = reader.tag();
  3088. switch (tag) {
  3089. case "variable_name":
  3090. message.variable_name = reader.string();
  3091. break;
  3092. case "initial_value_name":
  3093. message.initial_value_name = reader.string();
  3094. break;
  3095. case "initializer_name":
  3096. message.initializer_name = reader.string();
  3097. break;
  3098. case "snapshot_name":
  3099. message.snapshot_name = reader.string();
  3100. break;
  3101. case "save_slice_info_def":
  3102. message.save_slice_info_def = $root.tensorflow.SaveSliceInfoDef.decodeText(reader);
  3103. break;
  3104. case "is_resource":
  3105. message.is_resource = reader.bool();
  3106. break;
  3107. case "trainable":
  3108. message.trainable = reader.bool();
  3109. break;
  3110. case "synchronization":
  3111. message.synchronization = reader.enum($root.tensorflow.VariableSynchronization);
  3112. break;
  3113. case "aggregation":
  3114. message.aggregation = reader.enum($root.tensorflow.VariableAggregation);
  3115. break;
  3116. default:
  3117. reader.field(tag, message);
  3118. break;
  3119. }
  3120. }
  3121. return message;
  3122. }
  3123. };
  3124. $root.tensorflow.VariableDef.prototype.variable_name = "";
  3125. $root.tensorflow.VariableDef.prototype.initial_value_name = "";
  3126. $root.tensorflow.VariableDef.prototype.initializer_name = "";
  3127. $root.tensorflow.VariableDef.prototype.snapshot_name = "";
  3128. $root.tensorflow.VariableDef.prototype.save_slice_info_def = null;
  3129. $root.tensorflow.VariableDef.prototype.is_resource = false;
  3130. $root.tensorflow.VariableDef.prototype.trainable = false;
  3131. $root.tensorflow.VariableDef.prototype.synchronization = 0;
  3132. $root.tensorflow.VariableDef.prototype.aggregation = 0;
  3133. $root.tensorflow.SaveSliceInfoDef = class SaveSliceInfoDef {
  3134. constructor() {
  3135. this.full_shape = [];
  3136. this.var_offset = [];
  3137. this.var_shape = [];
  3138. }
  3139. static decode(reader, length) {
  3140. const message = new $root.tensorflow.SaveSliceInfoDef();
  3141. const end = length !== undefined ? reader.position + length : reader.length;
  3142. while (reader.position < end) {
  3143. const tag = reader.uint32();
  3144. switch (tag >>> 3) {
  3145. case 1:
  3146. message.full_name = reader.string();
  3147. break;
  3148. case 2:
  3149. message.full_shape = reader.array(message.full_shape, () => reader.int64(), tag);
  3150. break;
  3151. case 3:
  3152. message.var_offset = reader.array(message.var_offset, () => reader.int64(), tag);
  3153. break;
  3154. case 4:
  3155. message.var_shape = reader.array(message.var_shape, () => reader.int64(), tag);
  3156. break;
  3157. default:
  3158. reader.skipType(tag & 7);
  3159. break;
  3160. }
  3161. }
  3162. return message;
  3163. }
  3164. static decodeText(reader) {
  3165. const message = new $root.tensorflow.SaveSliceInfoDef();
  3166. reader.start();
  3167. while (!reader.end()) {
  3168. const tag = reader.tag();
  3169. switch (tag) {
  3170. case "full_name":
  3171. message.full_name = reader.string();
  3172. break;
  3173. case "full_shape":
  3174. reader.array(message.full_shape, () => reader.int64());
  3175. break;
  3176. case "var_offset":
  3177. reader.array(message.var_offset, () => reader.int64());
  3178. break;
  3179. case "var_shape":
  3180. reader.array(message.var_shape, () => reader.int64());
  3181. break;
  3182. default:
  3183. reader.field(tag, message);
  3184. break;
  3185. }
  3186. }
  3187. return message;
  3188. }
  3189. };
  3190. $root.tensorflow.SaveSliceInfoDef.prototype.full_name = "";
  3191. $root.tensorflow.StructuredValue = class StructuredValue {
  3192. constructor() {
  3193. }
  3194. get kind() {
  3195. $root.tensorflow.StructuredValue.kindSet = $root.tensorflow.StructuredValue.kindSet || new Set([ "none_value", "float64_value", "int64_value", "string_value", "bool_value", "tensor_shape_value", "tensor_dtype_value", "tensor_spec_value", "type_spec_value", "bounded_tensor_spec_value", "list_value", "tuple_value", "dict_value", "named_tuple_value"]);
  3196. return Object.keys(this).find((key) => $root.tensorflow.StructuredValue.kindSet.has(key) && this[key] != null);
  3197. }
  3198. static decode(reader, length) {
  3199. const message = new $root.tensorflow.StructuredValue();
  3200. const end = length !== undefined ? reader.position + length : reader.length;
  3201. while (reader.position < end) {
  3202. const tag = reader.uint32();
  3203. switch (tag >>> 3) {
  3204. case 1:
  3205. message.none_value = $root.tensorflow.NoneValue.decode(reader, reader.uint32());
  3206. break;
  3207. case 11:
  3208. message.float64_value = reader.double();
  3209. break;
  3210. case 12:
  3211. message.int64_value = reader.sint64();
  3212. break;
  3213. case 13:
  3214. message.string_value = reader.string();
  3215. break;
  3216. case 14:
  3217. message.bool_value = reader.bool();
  3218. break;
  3219. case 31:
  3220. message.tensor_shape_value = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  3221. break;
  3222. case 32:
  3223. message.tensor_dtype_value = reader.int32();
  3224. break;
  3225. case 33:
  3226. message.tensor_spec_value = $root.tensorflow.TensorSpecProto.decode(reader, reader.uint32());
  3227. break;
  3228. case 34:
  3229. message.type_spec_value = $root.tensorflow.TypeSpecProto.decode(reader, reader.uint32());
  3230. break;
  3231. case 35:
  3232. message.bounded_tensor_spec_value = $root.tensorflow.BoundedTensorSpecProto.decode(reader, reader.uint32());
  3233. break;
  3234. case 51:
  3235. message.list_value = $root.tensorflow.ListValue.decode(reader, reader.uint32());
  3236. break;
  3237. case 52:
  3238. message.tuple_value = $root.tensorflow.TupleValue.decode(reader, reader.uint32());
  3239. break;
  3240. case 53:
  3241. message.dict_value = $root.tensorflow.DictValue.decode(reader, reader.uint32());
  3242. break;
  3243. case 54:
  3244. message.named_tuple_value = $root.tensorflow.NamedTupleValue.decode(reader, reader.uint32());
  3245. break;
  3246. default:
  3247. reader.skipType(tag & 7);
  3248. break;
  3249. }
  3250. }
  3251. return message;
  3252. }
  3253. static decodeText(reader) {
  3254. const message = new $root.tensorflow.StructuredValue();
  3255. reader.start();
  3256. while (!reader.end()) {
  3257. const tag = reader.tag();
  3258. switch (tag) {
  3259. case "none_value":
  3260. message.none_value = $root.tensorflow.NoneValue.decodeText(reader);
  3261. break;
  3262. case "float64_value":
  3263. message.float64_value = reader.double();
  3264. break;
  3265. case "int64_value":
  3266. message.int64_value = reader.sint64();
  3267. break;
  3268. case "string_value":
  3269. message.string_value = reader.string();
  3270. break;
  3271. case "bool_value":
  3272. message.bool_value = reader.bool();
  3273. break;
  3274. case "tensor_shape_value":
  3275. message.tensor_shape_value = $root.tensorflow.TensorShapeProto.decodeText(reader);
  3276. break;
  3277. case "tensor_dtype_value":
  3278. message.tensor_dtype_value = reader.enum($root.tensorflow.DataType);
  3279. break;
  3280. case "tensor_spec_value":
  3281. message.tensor_spec_value = $root.tensorflow.TensorSpecProto.decodeText(reader);
  3282. break;
  3283. case "type_spec_value":
  3284. message.type_spec_value = $root.tensorflow.TypeSpecProto.decodeText(reader);
  3285. break;
  3286. case "bounded_tensor_spec_value":
  3287. message.bounded_tensor_spec_value = $root.tensorflow.BoundedTensorSpecProto.decodeText(reader);
  3288. break;
  3289. case "list_value":
  3290. message.list_value = $root.tensorflow.ListValue.decodeText(reader);
  3291. break;
  3292. case "tuple_value":
  3293. message.tuple_value = $root.tensorflow.TupleValue.decodeText(reader);
  3294. break;
  3295. case "dict_value":
  3296. message.dict_value = $root.tensorflow.DictValue.decodeText(reader);
  3297. break;
  3298. case "named_tuple_value":
  3299. message.named_tuple_value = $root.tensorflow.NamedTupleValue.decodeText(reader);
  3300. break;
  3301. default:
  3302. reader.field(tag, message);
  3303. break;
  3304. }
  3305. }
  3306. return message;
  3307. }
  3308. };
  3309. $root.tensorflow.NoneValue = class NoneValue {
  3310. constructor() {
  3311. }
  3312. static decode(reader, length) {
  3313. const message = new $root.tensorflow.NoneValue();
  3314. const end = length !== undefined ? reader.position + length : reader.length;
  3315. while (reader.position < end) {
  3316. const tag = reader.uint32();
  3317. switch (tag >>> 3) {
  3318. default:
  3319. reader.skipType(tag & 7);
  3320. break;
  3321. }
  3322. }
  3323. return message;
  3324. }
  3325. static decodeText(reader) {
  3326. const message = new $root.tensorflow.NoneValue();
  3327. reader.start();
  3328. while (!reader.end()) {
  3329. const tag = reader.tag();
  3330. switch (tag) {
  3331. default:
  3332. reader.field(tag, message);
  3333. break;
  3334. }
  3335. }
  3336. return message;
  3337. }
  3338. };
  3339. $root.tensorflow.ListValue = class ListValue {
  3340. constructor() {
  3341. this.values = [];
  3342. }
  3343. static decode(reader, length) {
  3344. const message = new $root.tensorflow.ListValue();
  3345. const end = length !== undefined ? reader.position + length : reader.length;
  3346. while (reader.position < end) {
  3347. const tag = reader.uint32();
  3348. switch (tag >>> 3) {
  3349. case 1:
  3350. message.values.push($root.tensorflow.StructuredValue.decode(reader, reader.uint32()));
  3351. break;
  3352. default:
  3353. reader.skipType(tag & 7);
  3354. break;
  3355. }
  3356. }
  3357. return message;
  3358. }
  3359. static decodeText(reader) {
  3360. const message = new $root.tensorflow.ListValue();
  3361. reader.start();
  3362. while (!reader.end()) {
  3363. const tag = reader.tag();
  3364. switch (tag) {
  3365. case "values":
  3366. message.values.push($root.tensorflow.StructuredValue.decodeText(reader));
  3367. break;
  3368. default:
  3369. reader.field(tag, message);
  3370. break;
  3371. }
  3372. }
  3373. return message;
  3374. }
  3375. };
  3376. $root.tensorflow.TupleValue = class TupleValue {
  3377. constructor() {
  3378. this.values = [];
  3379. }
  3380. static decode(reader, length) {
  3381. const message = new $root.tensorflow.TupleValue();
  3382. const end = length !== undefined ? reader.position + length : reader.length;
  3383. while (reader.position < end) {
  3384. const tag = reader.uint32();
  3385. switch (tag >>> 3) {
  3386. case 1:
  3387. message.values.push($root.tensorflow.StructuredValue.decode(reader, reader.uint32()));
  3388. break;
  3389. default:
  3390. reader.skipType(tag & 7);
  3391. break;
  3392. }
  3393. }
  3394. return message;
  3395. }
  3396. static decodeText(reader) {
  3397. const message = new $root.tensorflow.TupleValue();
  3398. reader.start();
  3399. while (!reader.end()) {
  3400. const tag = reader.tag();
  3401. switch (tag) {
  3402. case "values":
  3403. message.values.push($root.tensorflow.StructuredValue.decodeText(reader));
  3404. break;
  3405. default:
  3406. reader.field(tag, message);
  3407. break;
  3408. }
  3409. }
  3410. return message;
  3411. }
  3412. };
  3413. $root.tensorflow.DictValue = class DictValue {
  3414. constructor() {
  3415. this.fields = {};
  3416. }
  3417. static decode(reader, length) {
  3418. const message = new $root.tensorflow.DictValue();
  3419. const end = length !== undefined ? reader.position + length : reader.length;
  3420. while (reader.position < end) {
  3421. const tag = reader.uint32();
  3422. switch (tag >>> 3) {
  3423. case 1:
  3424. reader.entry(message.fields, () => reader.string(), () => $root.tensorflow.StructuredValue.decode(reader, reader.uint32()));
  3425. break;
  3426. default:
  3427. reader.skipType(tag & 7);
  3428. break;
  3429. }
  3430. }
  3431. return message;
  3432. }
  3433. static decodeText(reader) {
  3434. const message = new $root.tensorflow.DictValue();
  3435. reader.start();
  3436. while (!reader.end()) {
  3437. const tag = reader.tag();
  3438. switch (tag) {
  3439. case "fields":
  3440. reader.entry(message.fields, () => reader.string(), () => $root.tensorflow.StructuredValue.decodeText(reader));
  3441. break;
  3442. default:
  3443. reader.field(tag, message);
  3444. break;
  3445. }
  3446. }
  3447. return message;
  3448. }
  3449. };
  3450. $root.tensorflow.PairValue = class PairValue {
  3451. constructor() {
  3452. }
  3453. static decode(reader, length) {
  3454. const message = new $root.tensorflow.PairValue();
  3455. const end = length !== undefined ? reader.position + length : reader.length;
  3456. while (reader.position < end) {
  3457. const tag = reader.uint32();
  3458. switch (tag >>> 3) {
  3459. case 1:
  3460. message.key = reader.string();
  3461. break;
  3462. case 2:
  3463. message.value = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  3464. break;
  3465. default:
  3466. reader.skipType(tag & 7);
  3467. break;
  3468. }
  3469. }
  3470. return message;
  3471. }
  3472. static decodeText(reader) {
  3473. const message = new $root.tensorflow.PairValue();
  3474. reader.start();
  3475. while (!reader.end()) {
  3476. const tag = reader.tag();
  3477. switch (tag) {
  3478. case "key":
  3479. message.key = reader.string();
  3480. break;
  3481. case "value":
  3482. message.value = $root.tensorflow.StructuredValue.decodeText(reader);
  3483. break;
  3484. default:
  3485. reader.field(tag, message);
  3486. break;
  3487. }
  3488. }
  3489. return message;
  3490. }
  3491. };
  3492. $root.tensorflow.PairValue.prototype.key = "";
  3493. $root.tensorflow.PairValue.prototype.value = null;
  3494. $root.tensorflow.NamedTupleValue = class NamedTupleValue {
  3495. constructor() {
  3496. this.values = [];
  3497. }
  3498. static decode(reader, length) {
  3499. const message = new $root.tensorflow.NamedTupleValue();
  3500. const end = length !== undefined ? reader.position + length : reader.length;
  3501. while (reader.position < end) {
  3502. const tag = reader.uint32();
  3503. switch (tag >>> 3) {
  3504. case 1:
  3505. message.name = reader.string();
  3506. break;
  3507. case 2:
  3508. message.values.push($root.tensorflow.PairValue.decode(reader, reader.uint32()));
  3509. break;
  3510. default:
  3511. reader.skipType(tag & 7);
  3512. break;
  3513. }
  3514. }
  3515. return message;
  3516. }
  3517. static decodeText(reader) {
  3518. const message = new $root.tensorflow.NamedTupleValue();
  3519. reader.start();
  3520. while (!reader.end()) {
  3521. const tag = reader.tag();
  3522. switch (tag) {
  3523. case "name":
  3524. message.name = reader.string();
  3525. break;
  3526. case "values":
  3527. message.values.push($root.tensorflow.PairValue.decodeText(reader));
  3528. break;
  3529. default:
  3530. reader.field(tag, message);
  3531. break;
  3532. }
  3533. }
  3534. return message;
  3535. }
  3536. };
  3537. $root.tensorflow.NamedTupleValue.prototype.name = "";
  3538. $root.tensorflow.TensorSpecProto = class TensorSpecProto {
  3539. constructor() {
  3540. }
  3541. static decode(reader, length) {
  3542. const message = new $root.tensorflow.TensorSpecProto();
  3543. const end = length !== undefined ? reader.position + length : reader.length;
  3544. while (reader.position < end) {
  3545. const tag = reader.uint32();
  3546. switch (tag >>> 3) {
  3547. case 1:
  3548. message.name = reader.string();
  3549. break;
  3550. case 2:
  3551. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  3552. break;
  3553. case 3:
  3554. message.dtype = reader.int32();
  3555. break;
  3556. default:
  3557. reader.skipType(tag & 7);
  3558. break;
  3559. }
  3560. }
  3561. return message;
  3562. }
  3563. static decodeText(reader) {
  3564. const message = new $root.tensorflow.TensorSpecProto();
  3565. reader.start();
  3566. while (!reader.end()) {
  3567. const tag = reader.tag();
  3568. switch (tag) {
  3569. case "name":
  3570. message.name = reader.string();
  3571. break;
  3572. case "shape":
  3573. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  3574. break;
  3575. case "dtype":
  3576. message.dtype = reader.enum($root.tensorflow.DataType);
  3577. break;
  3578. default:
  3579. reader.field(tag, message);
  3580. break;
  3581. }
  3582. }
  3583. return message;
  3584. }
  3585. };
  3586. $root.tensorflow.TensorSpecProto.prototype.name = "";
  3587. $root.tensorflow.TensorSpecProto.prototype.shape = null;
  3588. $root.tensorflow.TensorSpecProto.prototype.dtype = 0;
  3589. $root.tensorflow.BoundedTensorSpecProto = class BoundedTensorSpecProto {
  3590. constructor() {
  3591. }
  3592. static decode(reader, length) {
  3593. const message = new $root.tensorflow.BoundedTensorSpecProto();
  3594. const end = length !== undefined ? reader.position + length : reader.length;
  3595. while (reader.position < end) {
  3596. const tag = reader.uint32();
  3597. switch (tag >>> 3) {
  3598. case 1:
  3599. message.name = reader.string();
  3600. break;
  3601. case 2:
  3602. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  3603. break;
  3604. case 3:
  3605. message.dtype = reader.int32();
  3606. break;
  3607. case 4:
  3608. message.minimum = $root.tensorflow.TensorProto.decode(reader, reader.uint32());
  3609. break;
  3610. case 5:
  3611. message.maximum = $root.tensorflow.TensorProto.decode(reader, reader.uint32());
  3612. break;
  3613. default:
  3614. reader.skipType(tag & 7);
  3615. break;
  3616. }
  3617. }
  3618. return message;
  3619. }
  3620. static decodeText(reader) {
  3621. const message = new $root.tensorflow.BoundedTensorSpecProto();
  3622. reader.start();
  3623. while (!reader.end()) {
  3624. const tag = reader.tag();
  3625. switch (tag) {
  3626. case "name":
  3627. message.name = reader.string();
  3628. break;
  3629. case "shape":
  3630. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  3631. break;
  3632. case "dtype":
  3633. message.dtype = reader.enum($root.tensorflow.DataType);
  3634. break;
  3635. case "minimum":
  3636. message.minimum = $root.tensorflow.TensorProto.decodeText(reader);
  3637. break;
  3638. case "maximum":
  3639. message.maximum = $root.tensorflow.TensorProto.decodeText(reader);
  3640. break;
  3641. default:
  3642. reader.field(tag, message);
  3643. break;
  3644. }
  3645. }
  3646. return message;
  3647. }
  3648. };
  3649. $root.tensorflow.BoundedTensorSpecProto.prototype.name = "";
  3650. $root.tensorflow.BoundedTensorSpecProto.prototype.shape = null;
  3651. $root.tensorflow.BoundedTensorSpecProto.prototype.dtype = 0;
  3652. $root.tensorflow.BoundedTensorSpecProto.prototype.minimum = null;
  3653. $root.tensorflow.BoundedTensorSpecProto.prototype.maximum = null;
  3654. $root.tensorflow.TypeSpecProto = class TypeSpecProto {
  3655. constructor() {
  3656. }
  3657. static decode(reader, length) {
  3658. const message = new $root.tensorflow.TypeSpecProto();
  3659. const end = length !== undefined ? reader.position + length : reader.length;
  3660. while (reader.position < end) {
  3661. const tag = reader.uint32();
  3662. switch (tag >>> 3) {
  3663. case 1:
  3664. message.type_spec_class = reader.int32();
  3665. break;
  3666. case 2:
  3667. message.type_state = $root.tensorflow.StructuredValue.decode(reader, reader.uint32());
  3668. break;
  3669. case 3:
  3670. message.type_spec_class_name = reader.string();
  3671. break;
  3672. default:
  3673. reader.skipType(tag & 7);
  3674. break;
  3675. }
  3676. }
  3677. return message;
  3678. }
  3679. static decodeText(reader) {
  3680. const message = new $root.tensorflow.TypeSpecProto();
  3681. reader.start();
  3682. while (!reader.end()) {
  3683. const tag = reader.tag();
  3684. switch (tag) {
  3685. case "type_spec_class":
  3686. message.type_spec_class = reader.enum($root.tensorflow.TypeSpecProto.TypeSpecClass);
  3687. break;
  3688. case "type_state":
  3689. message.type_state = $root.tensorflow.StructuredValue.decodeText(reader);
  3690. break;
  3691. case "type_spec_class_name":
  3692. message.type_spec_class_name = reader.string();
  3693. break;
  3694. default:
  3695. reader.field(tag, message);
  3696. break;
  3697. }
  3698. }
  3699. return message;
  3700. }
  3701. };
  3702. $root.tensorflow.TypeSpecProto.prototype.type_spec_class = 0;
  3703. $root.tensorflow.TypeSpecProto.prototype.type_state = null;
  3704. $root.tensorflow.TypeSpecProto.prototype.type_spec_class_name = "";
  3705. $root.tensorflow.TypeSpecProto.TypeSpecClass = {
  3706. "UNKNOWN": 0,
  3707. "SPARSE_TENSOR_SPEC": 1,
  3708. "INDEXED_SLICES_SPEC": 2,
  3709. "RAGGED_TENSOR_SPEC": 3,
  3710. "TENSOR_ARRAY_SPEC": 4,
  3711. "DATA_DATASET_SPEC": 5,
  3712. "DATA_ITERATOR_SPEC": 6,
  3713. "OPTIONAL_SPEC": 7,
  3714. "PER_REPLICA_SPEC": 8,
  3715. "VARIABLE_SPEC": 9,
  3716. "ROW_PARTITION_SPEC": 10,
  3717. "REGISTERED_TYPE_SPEC": 12,
  3718. "EXTENSION_TYPE_SPEC": 13
  3719. };
  3720. $root.tensorflow.TrackableObjectGraph = class TrackableObjectGraph {
  3721. constructor() {
  3722. this.nodes = [];
  3723. }
  3724. static decode(reader, length) {
  3725. const message = new $root.tensorflow.TrackableObjectGraph();
  3726. const end = length !== undefined ? reader.position + length : reader.length;
  3727. while (reader.position < end) {
  3728. const tag = reader.uint32();
  3729. switch (tag >>> 3) {
  3730. case 1:
  3731. message.nodes.push($root.tensorflow.TrackableObjectGraph.TrackableObject.decode(reader, reader.uint32()));
  3732. break;
  3733. default:
  3734. reader.skipType(tag & 7);
  3735. break;
  3736. }
  3737. }
  3738. return message;
  3739. }
  3740. static decodeText(reader) {
  3741. const message = new $root.tensorflow.TrackableObjectGraph();
  3742. reader.start();
  3743. while (!reader.end()) {
  3744. const tag = reader.tag();
  3745. switch (tag) {
  3746. case "nodes":
  3747. message.nodes.push($root.tensorflow.TrackableObjectGraph.TrackableObject.decodeText(reader));
  3748. break;
  3749. default:
  3750. reader.field(tag, message);
  3751. break;
  3752. }
  3753. }
  3754. return message;
  3755. }
  3756. };
  3757. $root.tensorflow.TrackableObjectGraph.TrackableObject = class TrackableObject {
  3758. constructor() {
  3759. this.children = [];
  3760. this.attributes = [];
  3761. this.slot_variables = [];
  3762. }
  3763. static decode(reader, length) {
  3764. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject();
  3765. const end = length !== undefined ? reader.position + length : reader.length;
  3766. while (reader.position < end) {
  3767. const tag = reader.uint32();
  3768. switch (tag >>> 3) {
  3769. case 1:
  3770. message.children.push($root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.decode(reader, reader.uint32()));
  3771. break;
  3772. case 2:
  3773. message.attributes.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.decode(reader, reader.uint32()));
  3774. break;
  3775. case 3:
  3776. message.slot_variables.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.decode(reader, reader.uint32()));
  3777. break;
  3778. default:
  3779. reader.skipType(tag & 7);
  3780. break;
  3781. }
  3782. }
  3783. return message;
  3784. }
  3785. static decodeText(reader) {
  3786. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject();
  3787. reader.start();
  3788. while (!reader.end()) {
  3789. const tag = reader.tag();
  3790. switch (tag) {
  3791. case "children":
  3792. message.children.push($root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.decodeText(reader));
  3793. break;
  3794. case "attributes":
  3795. message.attributes.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.decodeText(reader));
  3796. break;
  3797. case "slot_variables":
  3798. message.slot_variables.push($root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.decodeText(reader));
  3799. break;
  3800. default:
  3801. reader.field(tag, message);
  3802. break;
  3803. }
  3804. }
  3805. return message;
  3806. }
  3807. };
  3808. $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference = class ObjectReference {
  3809. constructor() {
  3810. }
  3811. static decode(reader, length) {
  3812. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference();
  3813. const end = length !== undefined ? reader.position + length : reader.length;
  3814. while (reader.position < end) {
  3815. const tag = reader.uint32();
  3816. switch (tag >>> 3) {
  3817. case 1:
  3818. message.node_id = reader.int32();
  3819. break;
  3820. case 2:
  3821. message.local_name = reader.string();
  3822. break;
  3823. default:
  3824. reader.skipType(tag & 7);
  3825. break;
  3826. }
  3827. }
  3828. return message;
  3829. }
  3830. static decodeText(reader) {
  3831. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference();
  3832. reader.start();
  3833. while (!reader.end()) {
  3834. const tag = reader.tag();
  3835. switch (tag) {
  3836. case "node_id":
  3837. message.node_id = reader.int32();
  3838. break;
  3839. case "local_name":
  3840. message.local_name = reader.string();
  3841. break;
  3842. default:
  3843. reader.field(tag, message);
  3844. break;
  3845. }
  3846. }
  3847. return message;
  3848. }
  3849. };
  3850. $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.prototype.node_id = 0;
  3851. $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.prototype.local_name = "";
  3852. $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor = class SerializedTensor {
  3853. constructor() {
  3854. }
  3855. static decode(reader, length) {
  3856. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor();
  3857. const end = length !== undefined ? reader.position + length : reader.length;
  3858. while (reader.position < end) {
  3859. const tag = reader.uint32();
  3860. switch (tag >>> 3) {
  3861. case 1:
  3862. message.name = reader.string();
  3863. break;
  3864. case 2:
  3865. message.full_name = reader.string();
  3866. break;
  3867. case 3:
  3868. message.checkpoint_key = reader.string();
  3869. break;
  3870. case 4:
  3871. message.optional_restore = reader.bool();
  3872. break;
  3873. default:
  3874. reader.skipType(tag & 7);
  3875. break;
  3876. }
  3877. }
  3878. return message;
  3879. }
  3880. static decodeText(reader) {
  3881. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor();
  3882. reader.start();
  3883. while (!reader.end()) {
  3884. const tag = reader.tag();
  3885. switch (tag) {
  3886. case "name":
  3887. message.name = reader.string();
  3888. break;
  3889. case "full_name":
  3890. message.full_name = reader.string();
  3891. break;
  3892. case "checkpoint_key":
  3893. message.checkpoint_key = reader.string();
  3894. break;
  3895. case "optional_restore":
  3896. message.optional_restore = reader.bool();
  3897. break;
  3898. default:
  3899. reader.field(tag, message);
  3900. break;
  3901. }
  3902. }
  3903. return message;
  3904. }
  3905. };
  3906. $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.prototype.name = "";
  3907. $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.prototype.full_name = "";
  3908. $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.prototype.checkpoint_key = "";
  3909. $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.prototype.optional_restore = false;
  3910. $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference = class SlotVariableReference {
  3911. constructor() {
  3912. }
  3913. static decode(reader, length) {
  3914. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference();
  3915. const end = length !== undefined ? reader.position + length : reader.length;
  3916. while (reader.position < end) {
  3917. const tag = reader.uint32();
  3918. switch (tag >>> 3) {
  3919. case 1:
  3920. message.original_variable_node_id = reader.int32();
  3921. break;
  3922. case 2:
  3923. message.slot_name = reader.string();
  3924. break;
  3925. case 3:
  3926. message.slot_variable_node_id = reader.int32();
  3927. break;
  3928. default:
  3929. reader.skipType(tag & 7);
  3930. break;
  3931. }
  3932. }
  3933. return message;
  3934. }
  3935. static decodeText(reader) {
  3936. const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference();
  3937. reader.start();
  3938. while (!reader.end()) {
  3939. const tag = reader.tag();
  3940. switch (tag) {
  3941. case "original_variable_node_id":
  3942. message.original_variable_node_id = reader.int32();
  3943. break;
  3944. case "slot_name":
  3945. message.slot_name = reader.string();
  3946. break;
  3947. case "slot_variable_node_id":
  3948. message.slot_variable_node_id = reader.int32();
  3949. break;
  3950. default:
  3951. reader.field(tag, message);
  3952. break;
  3953. }
  3954. }
  3955. return message;
  3956. }
  3957. };
  3958. $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.prototype.original_variable_node_id = 0;
  3959. $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.prototype.slot_name = "";
  3960. $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.prototype.slot_variable_node_id = 0;
  3961. $root.tensorflow.SaverDef = class SaverDef {
  3962. constructor() {
  3963. }
  3964. static decode(reader, length) {
  3965. const message = new $root.tensorflow.SaverDef();
  3966. const end = length !== undefined ? reader.position + length : reader.length;
  3967. while (reader.position < end) {
  3968. const tag = reader.uint32();
  3969. switch (tag >>> 3) {
  3970. case 1:
  3971. message.filename_tensor_name = reader.string();
  3972. break;
  3973. case 2:
  3974. message.save_tensor_name = reader.string();
  3975. break;
  3976. case 3:
  3977. message.restore_op_name = reader.string();
  3978. break;
  3979. case 4:
  3980. message.max_to_keep = reader.int32();
  3981. break;
  3982. case 5:
  3983. message.sharded = reader.bool();
  3984. break;
  3985. case 6:
  3986. message.keep_checkpoint_every_n_hours = reader.float();
  3987. break;
  3988. case 7:
  3989. message.version = reader.int32();
  3990. break;
  3991. default:
  3992. reader.skipType(tag & 7);
  3993. break;
  3994. }
  3995. }
  3996. return message;
  3997. }
  3998. static decodeText(reader) {
  3999. const message = new $root.tensorflow.SaverDef();
  4000. reader.start();
  4001. while (!reader.end()) {
  4002. const tag = reader.tag();
  4003. switch (tag) {
  4004. case "filename_tensor_name":
  4005. message.filename_tensor_name = reader.string();
  4006. break;
  4007. case "save_tensor_name":
  4008. message.save_tensor_name = reader.string();
  4009. break;
  4010. case "restore_op_name":
  4011. message.restore_op_name = reader.string();
  4012. break;
  4013. case "max_to_keep":
  4014. message.max_to_keep = reader.int32();
  4015. break;
  4016. case "sharded":
  4017. message.sharded = reader.bool();
  4018. break;
  4019. case "keep_checkpoint_every_n_hours":
  4020. message.keep_checkpoint_every_n_hours = reader.float();
  4021. break;
  4022. case "version":
  4023. message.version = reader.enum($root.tensorflow.SaverDef.CheckpointFormatVersion);
  4024. break;
  4025. default:
  4026. reader.field(tag, message);
  4027. break;
  4028. }
  4029. }
  4030. return message;
  4031. }
  4032. };
  4033. $root.tensorflow.SaverDef.prototype.filename_tensor_name = "";
  4034. $root.tensorflow.SaverDef.prototype.save_tensor_name = "";
  4035. $root.tensorflow.SaverDef.prototype.restore_op_name = "";
  4036. $root.tensorflow.SaverDef.prototype.max_to_keep = 0;
  4037. $root.tensorflow.SaverDef.prototype.sharded = false;
  4038. $root.tensorflow.SaverDef.prototype.keep_checkpoint_every_n_hours = 0;
  4039. $root.tensorflow.SaverDef.prototype.version = 0;
  4040. $root.tensorflow.SaverDef.CheckpointFormatVersion = {
  4041. "LEGACY": 0,
  4042. "V1": 1,
  4043. "V2": 2
  4044. };
  4045. $root.tensorflow.BundleHeaderProto = class BundleHeaderProto {
  4046. constructor() {
  4047. }
  4048. static decode(reader, length) {
  4049. const message = new $root.tensorflow.BundleHeaderProto();
  4050. const end = length !== undefined ? reader.position + length : reader.length;
  4051. while (reader.position < end) {
  4052. const tag = reader.uint32();
  4053. switch (tag >>> 3) {
  4054. case 1:
  4055. message.num_shards = reader.int32();
  4056. break;
  4057. case 2:
  4058. message.endianness = reader.int32();
  4059. break;
  4060. case 3:
  4061. message.version = $root.tensorflow.VersionDef.decode(reader, reader.uint32());
  4062. break;
  4063. default:
  4064. reader.skipType(tag & 7);
  4065. break;
  4066. }
  4067. }
  4068. return message;
  4069. }
  4070. static decodeText(reader) {
  4071. const message = new $root.tensorflow.BundleHeaderProto();
  4072. reader.start();
  4073. while (!reader.end()) {
  4074. const tag = reader.tag();
  4075. switch (tag) {
  4076. case "num_shards":
  4077. message.num_shards = reader.int32();
  4078. break;
  4079. case "endianness":
  4080. message.endianness = reader.enum($root.tensorflow.BundleHeaderProto.Endianness);
  4081. break;
  4082. case "version":
  4083. message.version = $root.tensorflow.VersionDef.decodeText(reader);
  4084. break;
  4085. default:
  4086. reader.field(tag, message);
  4087. break;
  4088. }
  4089. }
  4090. return message;
  4091. }
  4092. };
  4093. $root.tensorflow.BundleHeaderProto.prototype.num_shards = 0;
  4094. $root.tensorflow.BundleHeaderProto.prototype.endianness = 0;
  4095. $root.tensorflow.BundleHeaderProto.prototype.version = null;
  4096. $root.tensorflow.BundleHeaderProto.Endianness = {
  4097. "LITTLE": 0,
  4098. "BIG": 1
  4099. };
  4100. $root.tensorflow.BundleEntryProto = class BundleEntryProto {
  4101. constructor() {
  4102. this.slices = [];
  4103. }
  4104. static decode(reader, length) {
  4105. const message = new $root.tensorflow.BundleEntryProto();
  4106. const end = length !== undefined ? reader.position + length : reader.length;
  4107. while (reader.position < end) {
  4108. const tag = reader.uint32();
  4109. switch (tag >>> 3) {
  4110. case 1:
  4111. message.dtype = reader.int32();
  4112. break;
  4113. case 2:
  4114. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  4115. break;
  4116. case 3:
  4117. message.shard_id = reader.int32();
  4118. break;
  4119. case 4:
  4120. message.offset = reader.int64();
  4121. break;
  4122. case 5:
  4123. message.size = reader.int64();
  4124. break;
  4125. case 6:
  4126. message.crc32c = reader.fixed32();
  4127. break;
  4128. case 7:
  4129. message.slices.push($root.tensorflow.TensorSliceProto.decode(reader, reader.uint32()));
  4130. break;
  4131. default:
  4132. reader.skipType(tag & 7);
  4133. break;
  4134. }
  4135. }
  4136. return message;
  4137. }
  4138. static decodeText(reader) {
  4139. const message = new $root.tensorflow.BundleEntryProto();
  4140. reader.start();
  4141. while (!reader.end()) {
  4142. const tag = reader.tag();
  4143. switch (tag) {
  4144. case "dtype":
  4145. message.dtype = reader.enum($root.tensorflow.DataType);
  4146. break;
  4147. case "shape":
  4148. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  4149. break;
  4150. case "shard_id":
  4151. message.shard_id = reader.int32();
  4152. break;
  4153. case "offset":
  4154. message.offset = reader.int64();
  4155. break;
  4156. case "size":
  4157. message.size = reader.int64();
  4158. break;
  4159. case "crc32c":
  4160. message.crc32c = reader.fixed32();
  4161. break;
  4162. case "slices":
  4163. message.slices.push($root.tensorflow.TensorSliceProto.decodeText(reader));
  4164. break;
  4165. default:
  4166. reader.field(tag, message);
  4167. break;
  4168. }
  4169. }
  4170. return message;
  4171. }
  4172. };
  4173. $root.tensorflow.BundleEntryProto.prototype.dtype = 0;
  4174. $root.tensorflow.BundleEntryProto.prototype.shape = null;
  4175. $root.tensorflow.BundleEntryProto.prototype.shard_id = 0;
  4176. $root.tensorflow.BundleEntryProto.prototype.offset = protobuf.Int64.create(0);
  4177. $root.tensorflow.BundleEntryProto.prototype.size = protobuf.Int64.create(0);
  4178. $root.tensorflow.BundleEntryProto.prototype.crc32c = 0;
  4179. $root.tensorflow.TensorSliceProto = class TensorSliceProto {
  4180. constructor() {
  4181. this.extent = [];
  4182. }
  4183. static decode(reader, length) {
  4184. const message = new $root.tensorflow.TensorSliceProto();
  4185. const end = length !== undefined ? reader.position + length : reader.length;
  4186. while (reader.position < end) {
  4187. const tag = reader.uint32();
  4188. switch (tag >>> 3) {
  4189. case 1:
  4190. message.extent.push($root.tensorflow.TensorSliceProto.Extent.decode(reader, reader.uint32()));
  4191. break;
  4192. default:
  4193. reader.skipType(tag & 7);
  4194. break;
  4195. }
  4196. }
  4197. return message;
  4198. }
  4199. static decodeText(reader) {
  4200. const message = new $root.tensorflow.TensorSliceProto();
  4201. reader.start();
  4202. while (!reader.end()) {
  4203. const tag = reader.tag();
  4204. switch (tag) {
  4205. case "extent":
  4206. message.extent.push($root.tensorflow.TensorSliceProto.Extent.decodeText(reader));
  4207. break;
  4208. default:
  4209. reader.field(tag, message);
  4210. break;
  4211. }
  4212. }
  4213. return message;
  4214. }
  4215. };
  4216. $root.tensorflow.TensorSliceProto.Extent = class Extent {
  4217. constructor() {
  4218. }
  4219. get has_length() {
  4220. $root.tensorflow.TensorSliceProto.Extent.has_lengthSet = $root.tensorflow.TensorSliceProto.Extent.has_lengthSet || new Set([ "length"]);
  4221. return Object.keys(this).find((key) => $root.tensorflow.TensorSliceProto.Extent.has_lengthSet.has(key) && this[key] != null);
  4222. }
  4223. static decode(reader, length) {
  4224. const message = new $root.tensorflow.TensorSliceProto.Extent();
  4225. const end = length !== undefined ? reader.position + length : reader.length;
  4226. while (reader.position < end) {
  4227. const tag = reader.uint32();
  4228. switch (tag >>> 3) {
  4229. case 1:
  4230. message.start = reader.int64();
  4231. break;
  4232. case 2:
  4233. message.length = reader.int64();
  4234. break;
  4235. default:
  4236. reader.skipType(tag & 7);
  4237. break;
  4238. }
  4239. }
  4240. return message;
  4241. }
  4242. static decodeText(reader) {
  4243. const message = new $root.tensorflow.TensorSliceProto.Extent();
  4244. reader.start();
  4245. while (!reader.end()) {
  4246. const tag = reader.tag();
  4247. switch (tag) {
  4248. case "start":
  4249. message.start = reader.int64();
  4250. break;
  4251. case "length":
  4252. message.length = reader.int64();
  4253. break;
  4254. default:
  4255. reader.field(tag, message);
  4256. break;
  4257. }
  4258. }
  4259. return message;
  4260. }
  4261. };
  4262. $root.tensorflow.TensorSliceProto.Extent.prototype.start = protobuf.Int64.create(0);
  4263. $root.tensorflow.SavedSliceMeta = class SavedSliceMeta {
  4264. constructor() {
  4265. this.slice = [];
  4266. }
  4267. static decode(reader, length) {
  4268. const message = new $root.tensorflow.SavedSliceMeta();
  4269. const end = length !== undefined ? reader.position + length : reader.length;
  4270. while (reader.position < end) {
  4271. const tag = reader.uint32();
  4272. switch (tag >>> 3) {
  4273. case 1:
  4274. message.name = reader.string();
  4275. break;
  4276. case 2:
  4277. message.shape = $root.tensorflow.TensorShapeProto.decode(reader, reader.uint32());
  4278. break;
  4279. case 3:
  4280. message.type = reader.int32();
  4281. break;
  4282. case 4:
  4283. message.slice.push($root.tensorflow.TensorSliceProto.decode(reader, reader.uint32()));
  4284. break;
  4285. default:
  4286. reader.skipType(tag & 7);
  4287. break;
  4288. }
  4289. }
  4290. return message;
  4291. }
  4292. static decodeText(reader) {
  4293. const message = new $root.tensorflow.SavedSliceMeta();
  4294. reader.start();
  4295. while (!reader.end()) {
  4296. const tag = reader.tag();
  4297. switch (tag) {
  4298. case "name":
  4299. message.name = reader.string();
  4300. break;
  4301. case "shape":
  4302. message.shape = $root.tensorflow.TensorShapeProto.decodeText(reader);
  4303. break;
  4304. case "type":
  4305. message.type = reader.enum($root.tensorflow.DataType);
  4306. break;
  4307. case "slice":
  4308. message.slice.push($root.tensorflow.TensorSliceProto.decodeText(reader));
  4309. break;
  4310. default:
  4311. reader.field(tag, message);
  4312. break;
  4313. }
  4314. }
  4315. return message;
  4316. }
  4317. };
  4318. $root.tensorflow.SavedSliceMeta.prototype.name = "";
  4319. $root.tensorflow.SavedSliceMeta.prototype.shape = null;
  4320. $root.tensorflow.SavedSliceMeta.prototype.type = 0;
  4321. $root.tensorflow.SavedTensorSliceMeta = class SavedTensorSliceMeta {
  4322. constructor() {
  4323. this.tensor = [];
  4324. }
  4325. static decode(reader, length) {
  4326. const message = new $root.tensorflow.SavedTensorSliceMeta();
  4327. const end = length !== undefined ? reader.position + length : reader.length;
  4328. while (reader.position < end) {
  4329. const tag = reader.uint32();
  4330. switch (tag >>> 3) {
  4331. case 1:
  4332. message.tensor.push($root.tensorflow.SavedSliceMeta.decode(reader, reader.uint32()));
  4333. break;
  4334. case 2:
  4335. message.versions = $root.tensorflow.VersionDef.decode(reader, reader.uint32());
  4336. break;
  4337. default:
  4338. reader.skipType(tag & 7);
  4339. break;
  4340. }
  4341. }
  4342. return message;
  4343. }
  4344. static decodeText(reader) {
  4345. const message = new $root.tensorflow.SavedTensorSliceMeta();
  4346. reader.start();
  4347. while (!reader.end()) {
  4348. const tag = reader.tag();
  4349. switch (tag) {
  4350. case "tensor":
  4351. message.tensor.push($root.tensorflow.SavedSliceMeta.decodeText(reader));
  4352. break;
  4353. case "versions":
  4354. message.versions = $root.tensorflow.VersionDef.decodeText(reader);
  4355. break;
  4356. default:
  4357. reader.field(tag, message);
  4358. break;
  4359. }
  4360. }
  4361. return message;
  4362. }
  4363. };
  4364. $root.tensorflow.SavedTensorSliceMeta.prototype.versions = null;
  4365. $root.tensorflow.SavedSlice = class SavedSlice {
  4366. constructor() {
  4367. }
  4368. static decode(reader, length) {
  4369. const message = new $root.tensorflow.SavedSlice();
  4370. const end = length !== undefined ? reader.position + length : reader.length;
  4371. while (reader.position < end) {
  4372. const tag = reader.uint32();
  4373. switch (tag >>> 3) {
  4374. case 1:
  4375. message.name = reader.string();
  4376. break;
  4377. case 2:
  4378. message.slice = $root.tensorflow.TensorSliceProto.decode(reader, reader.uint32());
  4379. break;
  4380. case 3:
  4381. message.data = $root.tensorflow.TensorProto.decode(reader, reader.uint32());
  4382. break;
  4383. default:
  4384. reader.skipType(tag & 7);
  4385. break;
  4386. }
  4387. }
  4388. return message;
  4389. }
  4390. static decodeText(reader) {
  4391. const message = new $root.tensorflow.SavedSlice();
  4392. reader.start();
  4393. while (!reader.end()) {
  4394. const tag = reader.tag();
  4395. switch (tag) {
  4396. case "name":
  4397. message.name = reader.string();
  4398. break;
  4399. case "slice":
  4400. message.slice = $root.tensorflow.TensorSliceProto.decodeText(reader);
  4401. break;
  4402. case "data":
  4403. message.data = $root.tensorflow.TensorProto.decodeText(reader);
  4404. break;
  4405. default:
  4406. reader.field(tag, message);
  4407. break;
  4408. }
  4409. }
  4410. return message;
  4411. }
  4412. };
  4413. $root.tensorflow.SavedSlice.prototype.name = "";
  4414. $root.tensorflow.SavedSlice.prototype.slice = null;
  4415. $root.tensorflow.SavedSlice.prototype.data = null;
  4416. $root.tensorflow.SavedTensorSlices = class SavedTensorSlices {
  4417. constructor() {
  4418. }
  4419. static decode(reader, length) {
  4420. const message = new $root.tensorflow.SavedTensorSlices();
  4421. const end = length !== undefined ? reader.position + length : reader.length;
  4422. while (reader.position < end) {
  4423. const tag = reader.uint32();
  4424. switch (tag >>> 3) {
  4425. case 1:
  4426. message.meta = $root.tensorflow.SavedTensorSliceMeta.decode(reader, reader.uint32());
  4427. break;
  4428. case 2:
  4429. message.data = $root.tensorflow.SavedSlice.decode(reader, reader.uint32());
  4430. break;
  4431. default:
  4432. reader.skipType(tag & 7);
  4433. break;
  4434. }
  4435. }
  4436. return message;
  4437. }
  4438. static decodeText(reader) {
  4439. const message = new $root.tensorflow.SavedTensorSlices();
  4440. reader.start();
  4441. while (!reader.end()) {
  4442. const tag = reader.tag();
  4443. switch (tag) {
  4444. case "meta":
  4445. message.meta = $root.tensorflow.SavedTensorSliceMeta.decodeText(reader);
  4446. break;
  4447. case "data":
  4448. message.data = $root.tensorflow.SavedSlice.decodeText(reader);
  4449. break;
  4450. default:
  4451. reader.field(tag, message);
  4452. break;
  4453. }
  4454. }
  4455. return message;
  4456. }
  4457. };
  4458. $root.tensorflow.SavedTensorSlices.prototype.meta = null;
  4459. $root.tensorflow.SavedTensorSlices.prototype.data = null;
  4460. $root.tensorflow.Event = class Event {
  4461. constructor() {
  4462. }
  4463. get what() {
  4464. $root.tensorflow.Event.whatSet = $root.tensorflow.Event.whatSet || new Set([ "file_version", "graph_def", "summary", "log_message", "session_log", "tagged_run_metadata", "meta_graph_def"]);
  4465. return Object.keys(this).find((key) => $root.tensorflow.Event.whatSet.has(key) && this[key] != null);
  4466. }
  4467. static decode(reader, length) {
  4468. const message = new $root.tensorflow.Event();
  4469. const end = length !== undefined ? reader.position + length : reader.length;
  4470. while (reader.position < end) {
  4471. const tag = reader.uint32();
  4472. switch (tag >>> 3) {
  4473. case 1:
  4474. message.wall_time = reader.double();
  4475. break;
  4476. case 2:
  4477. message.step = reader.int64();
  4478. break;
  4479. case 3:
  4480. message.file_version = reader.string();
  4481. break;
  4482. case 4:
  4483. message.graph_def = reader.bytes();
  4484. break;
  4485. case 5:
  4486. message.summary = $root.tensorflow.Summary.decode(reader, reader.uint32());
  4487. break;
  4488. case 6:
  4489. message.log_message = $root.tensorflow.LogMessage.decode(reader, reader.uint32());
  4490. break;
  4491. case 7:
  4492. message.session_log = $root.tensorflow.SessionLog.decode(reader, reader.uint32());
  4493. break;
  4494. case 8:
  4495. message.tagged_run_metadata = $root.tensorflow.TaggedRunMetadata.decode(reader, reader.uint32());
  4496. break;
  4497. case 9:
  4498. message.meta_graph_def = reader.bytes();
  4499. break;
  4500. default:
  4501. reader.skipType(tag & 7);
  4502. break;
  4503. }
  4504. }
  4505. return message;
  4506. }
  4507. static decodeText(reader) {
  4508. const message = new $root.tensorflow.Event();
  4509. reader.start();
  4510. while (!reader.end()) {
  4511. const tag = reader.tag();
  4512. switch (tag) {
  4513. case "wall_time":
  4514. message.wall_time = reader.double();
  4515. break;
  4516. case "step":
  4517. message.step = reader.int64();
  4518. break;
  4519. case "file_version":
  4520. message.file_version = reader.string();
  4521. break;
  4522. case "graph_def":
  4523. message.graph_def = reader.bytes();
  4524. break;
  4525. case "summary":
  4526. message.summary = $root.tensorflow.Summary.decodeText(reader);
  4527. break;
  4528. case "log_message":
  4529. message.log_message = $root.tensorflow.LogMessage.decodeText(reader);
  4530. break;
  4531. case "session_log":
  4532. message.session_log = $root.tensorflow.SessionLog.decodeText(reader);
  4533. break;
  4534. case "tagged_run_metadata":
  4535. message.tagged_run_metadata = $root.tensorflow.TaggedRunMetadata.decodeText(reader);
  4536. break;
  4537. case "meta_graph_def":
  4538. message.meta_graph_def = reader.bytes();
  4539. break;
  4540. default:
  4541. reader.field(tag, message);
  4542. break;
  4543. }
  4544. }
  4545. return message;
  4546. }
  4547. };
  4548. $root.tensorflow.Event.prototype.wall_time = 0;
  4549. $root.tensorflow.Event.prototype.step = protobuf.Int64.create(0);
  4550. $root.tensorflow.LogMessage = class LogMessage {
  4551. constructor() {
  4552. }
  4553. static decode(reader, length) {
  4554. const message = new $root.tensorflow.LogMessage();
  4555. const end = length !== undefined ? reader.position + length : reader.length;
  4556. while (reader.position < end) {
  4557. const tag = reader.uint32();
  4558. switch (tag >>> 3) {
  4559. case 1:
  4560. message.level = reader.int32();
  4561. break;
  4562. case 2:
  4563. message.message = reader.string();
  4564. break;
  4565. default:
  4566. reader.skipType(tag & 7);
  4567. break;
  4568. }
  4569. }
  4570. return message;
  4571. }
  4572. static decodeText(reader) {
  4573. const message = new $root.tensorflow.LogMessage();
  4574. reader.start();
  4575. while (!reader.end()) {
  4576. const tag = reader.tag();
  4577. switch (tag) {
  4578. case "level":
  4579. message.level = reader.enum($root.tensorflow.LogMessage.Level);
  4580. break;
  4581. case "message":
  4582. message.message = reader.string();
  4583. break;
  4584. default:
  4585. reader.field(tag, message);
  4586. break;
  4587. }
  4588. }
  4589. return message;
  4590. }
  4591. };
  4592. $root.tensorflow.LogMessage.prototype.level = 0;
  4593. $root.tensorflow.LogMessage.prototype.message = "";
  4594. $root.tensorflow.LogMessage.Level = {
  4595. "UNKNOWN": 0,
  4596. "DEBUGGING": 10,
  4597. "INFO": 20,
  4598. "WARN": 30,
  4599. "ERROR": 40,
  4600. "FATAL": 50
  4601. };
  4602. $root.tensorflow.SessionLog = class SessionLog {
  4603. constructor() {
  4604. }
  4605. static decode(reader, length) {
  4606. const message = new $root.tensorflow.SessionLog();
  4607. const end = length !== undefined ? reader.position + length : reader.length;
  4608. while (reader.position < end) {
  4609. const tag = reader.uint32();
  4610. switch (tag >>> 3) {
  4611. case 1:
  4612. message.status = reader.int32();
  4613. break;
  4614. case 2:
  4615. message.checkpoint_path = reader.string();
  4616. break;
  4617. case 3:
  4618. message.msg = reader.string();
  4619. break;
  4620. default:
  4621. reader.skipType(tag & 7);
  4622. break;
  4623. }
  4624. }
  4625. return message;
  4626. }
  4627. static decodeText(reader) {
  4628. const message = new $root.tensorflow.SessionLog();
  4629. reader.start();
  4630. while (!reader.end()) {
  4631. const tag = reader.tag();
  4632. switch (tag) {
  4633. case "status":
  4634. message.status = reader.enum($root.tensorflow.SessionLog.SessionStatus);
  4635. break;
  4636. case "checkpoint_path":
  4637. message.checkpoint_path = reader.string();
  4638. break;
  4639. case "msg":
  4640. message.msg = reader.string();
  4641. break;
  4642. default:
  4643. reader.field(tag, message);
  4644. break;
  4645. }
  4646. }
  4647. return message;
  4648. }
  4649. };
  4650. $root.tensorflow.SessionLog.prototype.status = 0;
  4651. $root.tensorflow.SessionLog.prototype.checkpoint_path = "";
  4652. $root.tensorflow.SessionLog.prototype.msg = "";
  4653. $root.tensorflow.SessionLog.SessionStatus = {
  4654. "STATUS_UNSPECIFIED": 0,
  4655. "START": 1,
  4656. "STOP": 2,
  4657. "CHECKPOINT": 3
  4658. };
  4659. $root.tensorflow.TaggedRunMetadata = class TaggedRunMetadata {
  4660. constructor() {
  4661. }
  4662. static decode(reader, length) {
  4663. const message = new $root.tensorflow.TaggedRunMetadata();
  4664. const end = length !== undefined ? reader.position + length : reader.length;
  4665. while (reader.position < end) {
  4666. const tag = reader.uint32();
  4667. switch (tag >>> 3) {
  4668. case 1:
  4669. message.tag = reader.string();
  4670. break;
  4671. case 2:
  4672. message.run_metadata = reader.bytes();
  4673. break;
  4674. default:
  4675. reader.skipType(tag & 7);
  4676. break;
  4677. }
  4678. }
  4679. return message;
  4680. }
  4681. static decodeText(reader) {
  4682. const message = new $root.tensorflow.TaggedRunMetadata();
  4683. reader.start();
  4684. while (!reader.end()) {
  4685. const tag = reader.tag();
  4686. switch (tag) {
  4687. case "tag":
  4688. message.tag = reader.string();
  4689. break;
  4690. case "run_metadata":
  4691. message.run_metadata = reader.bytes();
  4692. break;
  4693. default:
  4694. reader.field(tag, message);
  4695. break;
  4696. }
  4697. }
  4698. return message;
  4699. }
  4700. };
  4701. $root.tensorflow.TaggedRunMetadata.prototype.tag = "";
  4702. $root.tensorflow.TaggedRunMetadata.prototype.run_metadata = new Uint8Array([]);
  4703. $root.tensorflow.WorkerHealth = {
  4704. "OK": 0,
  4705. "RECEIVED_SHUTDOWN_SIGNAL": 1,
  4706. "INTERNAL_ERROR": 2,
  4707. "SHUTTING_DOWN": 3
  4708. };
  4709. $root.tensorflow.WorkerShutdownMode = {
  4710. "DEFAULT": 0,
  4711. "NOT_CONFIGURED": 1,
  4712. "WAIT_FOR_COORDINATOR": 2,
  4713. "SHUTDOWN_AFTER_TIMEOUT": 3
  4714. };
  4715. $root.tensorflow.WatchdogConfig = class WatchdogConfig {
  4716. constructor() {
  4717. }
  4718. static decode(reader, length) {
  4719. const message = new $root.tensorflow.WatchdogConfig();
  4720. const end = length !== undefined ? reader.position + length : reader.length;
  4721. while (reader.position < end) {
  4722. const tag = reader.uint32();
  4723. switch (tag >>> 3) {
  4724. case 1:
  4725. message.timeout_ms = reader.int64();
  4726. break;
  4727. default:
  4728. reader.skipType(tag & 7);
  4729. break;
  4730. }
  4731. }
  4732. return message;
  4733. }
  4734. static decodeText(reader) {
  4735. const message = new $root.tensorflow.WatchdogConfig();
  4736. reader.start();
  4737. while (!reader.end()) {
  4738. const tag = reader.tag();
  4739. switch (tag) {
  4740. case "timeout_ms":
  4741. message.timeout_ms = reader.int64();
  4742. break;
  4743. default:
  4744. reader.field(tag, message);
  4745. break;
  4746. }
  4747. }
  4748. return message;
  4749. }
  4750. };
  4751. $root.tensorflow.WatchdogConfig.prototype.timeout_ms = protobuf.Int64.create(0);
  4752. $root.tensorflow.RequestedExitCode = class RequestedExitCode {
  4753. constructor() {
  4754. }
  4755. static decode(reader, length) {
  4756. const message = new $root.tensorflow.RequestedExitCode();
  4757. const end = length !== undefined ? reader.position + length : reader.length;
  4758. while (reader.position < end) {
  4759. const tag = reader.uint32();
  4760. switch (tag >>> 3) {
  4761. case 1:
  4762. message.exit_code = reader.int32();
  4763. break;
  4764. default:
  4765. reader.skipType(tag & 7);
  4766. break;
  4767. }
  4768. }
  4769. return message;
  4770. }
  4771. static decodeText(reader) {
  4772. const message = new $root.tensorflow.RequestedExitCode();
  4773. reader.start();
  4774. while (!reader.end()) {
  4775. const tag = reader.tag();
  4776. switch (tag) {
  4777. case "exit_code":
  4778. message.exit_code = reader.int32();
  4779. break;
  4780. default:
  4781. reader.field(tag, message);
  4782. break;
  4783. }
  4784. }
  4785. return message;
  4786. }
  4787. };
  4788. $root.tensorflow.RequestedExitCode.prototype.exit_code = 0;
  4789. $root.tensorflow.WorkerHeartbeatRequest = class WorkerHeartbeatRequest {
  4790. constructor() {
  4791. }
  4792. static decode(reader, length) {
  4793. const message = new $root.tensorflow.WorkerHeartbeatRequest();
  4794. const end = length !== undefined ? reader.position + length : reader.length;
  4795. while (reader.position < end) {
  4796. const tag = reader.uint32();
  4797. switch (tag >>> 3) {
  4798. case 1:
  4799. message.shutdown_mode = reader.int32();
  4800. break;
  4801. case 2:
  4802. message.watchdog_config = $root.tensorflow.WatchdogConfig.decode(reader, reader.uint32());
  4803. break;
  4804. case 3:
  4805. message.exit_code = $root.tensorflow.RequestedExitCode.decode(reader, reader.uint32());
  4806. break;
  4807. default:
  4808. reader.skipType(tag & 7);
  4809. break;
  4810. }
  4811. }
  4812. return message;
  4813. }
  4814. static decodeText(reader) {
  4815. const message = new $root.tensorflow.WorkerHeartbeatRequest();
  4816. reader.start();
  4817. while (!reader.end()) {
  4818. const tag = reader.tag();
  4819. switch (tag) {
  4820. case "shutdown_mode":
  4821. message.shutdown_mode = reader.enum($root.tensorflow.WorkerShutdownMode);
  4822. break;
  4823. case "watchdog_config":
  4824. message.watchdog_config = $root.tensorflow.WatchdogConfig.decodeText(reader);
  4825. break;
  4826. case "exit_code":
  4827. message.exit_code = $root.tensorflow.RequestedExitCode.decodeText(reader);
  4828. break;
  4829. default:
  4830. reader.field(tag, message);
  4831. break;
  4832. }
  4833. }
  4834. return message;
  4835. }
  4836. };
  4837. $root.tensorflow.WorkerHeartbeatRequest.prototype.shutdown_mode = 0;
  4838. $root.tensorflow.WorkerHeartbeatRequest.prototype.watchdog_config = null;
  4839. $root.tensorflow.WorkerHeartbeatRequest.prototype.exit_code = null;
  4840. $root.tensorflow.WorkerHeartbeatResponse = class WorkerHeartbeatResponse {
  4841. constructor() {
  4842. this.worker_log = [];
  4843. }
  4844. static decode(reader, length) {
  4845. const message = new $root.tensorflow.WorkerHeartbeatResponse();
  4846. const end = length !== undefined ? reader.position + length : reader.length;
  4847. while (reader.position < end) {
  4848. const tag = reader.uint32();
  4849. switch (tag >>> 3) {
  4850. case 1:
  4851. message.health_status = reader.int32();
  4852. break;
  4853. case 2:
  4854. message.worker_log.push($root.tensorflow.Event.decode(reader, reader.uint32()));
  4855. break;
  4856. case 3:
  4857. message.hostname = reader.string();
  4858. break;
  4859. default:
  4860. reader.skipType(tag & 7);
  4861. break;
  4862. }
  4863. }
  4864. return message;
  4865. }
  4866. static decodeText(reader) {
  4867. const message = new $root.tensorflow.WorkerHeartbeatResponse();
  4868. reader.start();
  4869. while (!reader.end()) {
  4870. const tag = reader.tag();
  4871. switch (tag) {
  4872. case "health_status":
  4873. message.health_status = reader.enum($root.tensorflow.WorkerHealth);
  4874. break;
  4875. case "worker_log":
  4876. message.worker_log.push($root.tensorflow.Event.decodeText(reader));
  4877. break;
  4878. case "hostname":
  4879. message.hostname = reader.string();
  4880. break;
  4881. default:
  4882. reader.field(tag, message);
  4883. break;
  4884. }
  4885. }
  4886. return message;
  4887. }
  4888. };
  4889. $root.tensorflow.WorkerHeartbeatResponse.prototype.health_status = 0;
  4890. $root.tensorflow.WorkerHeartbeatResponse.prototype.hostname = "";
  4891. $root.tensorflow.SummaryDescription = class SummaryDescription {
  4892. constructor() {
  4893. }
  4894. static decode(reader, length) {
  4895. const message = new $root.tensorflow.SummaryDescription();
  4896. const end = length !== undefined ? reader.position + length : reader.length;
  4897. while (reader.position < end) {
  4898. const tag = reader.uint32();
  4899. switch (tag >>> 3) {
  4900. case 1:
  4901. message.type_hint = reader.string();
  4902. break;
  4903. default:
  4904. reader.skipType(tag & 7);
  4905. break;
  4906. }
  4907. }
  4908. return message;
  4909. }
  4910. static decodeText(reader) {
  4911. const message = new $root.tensorflow.SummaryDescription();
  4912. reader.start();
  4913. while (!reader.end()) {
  4914. const tag = reader.tag();
  4915. switch (tag) {
  4916. case "type_hint":
  4917. message.type_hint = reader.string();
  4918. break;
  4919. default:
  4920. reader.field(tag, message);
  4921. break;
  4922. }
  4923. }
  4924. return message;
  4925. }
  4926. };
  4927. $root.tensorflow.SummaryDescription.prototype.type_hint = "";
  4928. $root.tensorflow.HistogramProto = class HistogramProto {
  4929. constructor() {
  4930. this.bucket_limit = [];
  4931. this.bucket = [];
  4932. }
  4933. static decode(reader, length) {
  4934. const message = new $root.tensorflow.HistogramProto();
  4935. const end = length !== undefined ? reader.position + length : reader.length;
  4936. while (reader.position < end) {
  4937. const tag = reader.uint32();
  4938. switch (tag >>> 3) {
  4939. case 1:
  4940. message.min = reader.double();
  4941. break;
  4942. case 2:
  4943. message.max = reader.double();
  4944. break;
  4945. case 3:
  4946. message.num = reader.double();
  4947. break;
  4948. case 4:
  4949. message.sum = reader.double();
  4950. break;
  4951. case 5:
  4952. message.sum_squares = reader.double();
  4953. break;
  4954. case 6:
  4955. message.bucket_limit = reader.doubles(message.bucket_limit, tag);
  4956. break;
  4957. case 7:
  4958. message.bucket = reader.doubles(message.bucket, tag);
  4959. break;
  4960. default:
  4961. reader.skipType(tag & 7);
  4962. break;
  4963. }
  4964. }
  4965. return message;
  4966. }
  4967. static decodeText(reader) {
  4968. const message = new $root.tensorflow.HistogramProto();
  4969. reader.start();
  4970. while (!reader.end()) {
  4971. const tag = reader.tag();
  4972. switch (tag) {
  4973. case "min":
  4974. message.min = reader.double();
  4975. break;
  4976. case "max":
  4977. message.max = reader.double();
  4978. break;
  4979. case "num":
  4980. message.num = reader.double();
  4981. break;
  4982. case "sum":
  4983. message.sum = reader.double();
  4984. break;
  4985. case "sum_squares":
  4986. message.sum_squares = reader.double();
  4987. break;
  4988. case "bucket_limit":
  4989. reader.array(message.bucket_limit, () => reader.double());
  4990. break;
  4991. case "bucket":
  4992. reader.array(message.bucket, () => reader.double());
  4993. break;
  4994. default:
  4995. reader.field(tag, message);
  4996. break;
  4997. }
  4998. }
  4999. return message;
  5000. }
  5001. };
  5002. $root.tensorflow.HistogramProto.prototype.min = 0;
  5003. $root.tensorflow.HistogramProto.prototype.max = 0;
  5004. $root.tensorflow.HistogramProto.prototype.num = 0;
  5005. $root.tensorflow.HistogramProto.prototype.sum = 0;
  5006. $root.tensorflow.HistogramProto.prototype.sum_squares = 0;
  5007. $root.tensorflow.SummaryMetadata = class SummaryMetadata {
  5008. constructor() {
  5009. }
  5010. static decode(reader, length) {
  5011. const message = new $root.tensorflow.SummaryMetadata();
  5012. const end = length !== undefined ? reader.position + length : reader.length;
  5013. while (reader.position < end) {
  5014. const tag = reader.uint32();
  5015. switch (tag >>> 3) {
  5016. case 1:
  5017. message.plugin_data = $root.tensorflow.SummaryMetadata.PluginData.decode(reader, reader.uint32());
  5018. break;
  5019. case 2:
  5020. message.display_name = reader.string();
  5021. break;
  5022. case 3:
  5023. message.summary_description = reader.string();
  5024. break;
  5025. case 4:
  5026. message.data_class = reader.int32();
  5027. break;
  5028. default:
  5029. reader.skipType(tag & 7);
  5030. break;
  5031. }
  5032. }
  5033. return message;
  5034. }
  5035. static decodeText(reader) {
  5036. const message = new $root.tensorflow.SummaryMetadata();
  5037. reader.start();
  5038. while (!reader.end()) {
  5039. const tag = reader.tag();
  5040. switch (tag) {
  5041. case "plugin_data":
  5042. message.plugin_data = $root.tensorflow.SummaryMetadata.PluginData.decodeText(reader);
  5043. break;
  5044. case "display_name":
  5045. message.display_name = reader.string();
  5046. break;
  5047. case "summary_description":
  5048. message.summary_description = reader.string();
  5049. break;
  5050. case "data_class":
  5051. message.data_class = reader.enum($root.tensorflow.DataClass);
  5052. break;
  5053. default:
  5054. reader.field(tag, message);
  5055. break;
  5056. }
  5057. }
  5058. return message;
  5059. }
  5060. };
  5061. $root.tensorflow.SummaryMetadata.prototype.plugin_data = null;
  5062. $root.tensorflow.SummaryMetadata.prototype.display_name = "";
  5063. $root.tensorflow.SummaryMetadata.prototype.summary_description = "";
  5064. $root.tensorflow.SummaryMetadata.prototype.data_class = 0;
  5065. $root.tensorflow.SummaryMetadata.PluginData = class PluginData {
  5066. constructor() {
  5067. }
  5068. static decode(reader, length) {
  5069. const message = new $root.tensorflow.SummaryMetadata.PluginData();
  5070. const end = length !== undefined ? reader.position + length : reader.length;
  5071. while (reader.position < end) {
  5072. const tag = reader.uint32();
  5073. switch (tag >>> 3) {
  5074. case 1:
  5075. message.plugin_name = reader.string();
  5076. break;
  5077. case 2:
  5078. message.content = reader.bytes();
  5079. break;
  5080. default:
  5081. reader.skipType(tag & 7);
  5082. break;
  5083. }
  5084. }
  5085. return message;
  5086. }
  5087. static decodeText(reader) {
  5088. const message = new $root.tensorflow.SummaryMetadata.PluginData();
  5089. reader.start();
  5090. while (!reader.end()) {
  5091. const tag = reader.tag();
  5092. switch (tag) {
  5093. case "plugin_name":
  5094. message.plugin_name = reader.string();
  5095. break;
  5096. case "content":
  5097. message.content = reader.bytes();
  5098. break;
  5099. default:
  5100. reader.field(tag, message);
  5101. break;
  5102. }
  5103. }
  5104. return message;
  5105. }
  5106. };
  5107. $root.tensorflow.SummaryMetadata.PluginData.prototype.plugin_name = "";
  5108. $root.tensorflow.SummaryMetadata.PluginData.prototype.content = new Uint8Array([]);
  5109. $root.tensorflow.DataClass = {
  5110. "DATA_CLASS_UNKNOWN": 0,
  5111. "DATA_CLASS_SCALAR": 1,
  5112. "DATA_CLASS_TENSOR": 2,
  5113. "DATA_CLASS_BLOB_SEQUENCE": 3
  5114. };
  5115. $root.tensorflow.Summary = class Summary {
  5116. constructor() {
  5117. this.value = [];
  5118. }
  5119. static decode(reader, length) {
  5120. const message = new $root.tensorflow.Summary();
  5121. const end = length !== undefined ? reader.position + length : reader.length;
  5122. while (reader.position < end) {
  5123. const tag = reader.uint32();
  5124. switch (tag >>> 3) {
  5125. case 1:
  5126. message.value.push($root.tensorflow.Summary.Value.decode(reader, reader.uint32()));
  5127. break;
  5128. default:
  5129. reader.skipType(tag & 7);
  5130. break;
  5131. }
  5132. }
  5133. return message;
  5134. }
  5135. static decodeText(reader) {
  5136. const message = new $root.tensorflow.Summary();
  5137. reader.start();
  5138. while (!reader.end()) {
  5139. const tag = reader.tag();
  5140. switch (tag) {
  5141. case "value":
  5142. message.value.push($root.tensorflow.Summary.Value.decodeText(reader));
  5143. break;
  5144. default:
  5145. reader.field(tag, message);
  5146. break;
  5147. }
  5148. }
  5149. return message;
  5150. }
  5151. };
  5152. $root.tensorflow.Summary.Image = class Image {
  5153. constructor() {
  5154. }
  5155. static decode(reader, length) {
  5156. const message = new $root.tensorflow.Summary.Image();
  5157. const end = length !== undefined ? reader.position + length : reader.length;
  5158. while (reader.position < end) {
  5159. const tag = reader.uint32();
  5160. switch (tag >>> 3) {
  5161. case 1:
  5162. message.height = reader.int32();
  5163. break;
  5164. case 2:
  5165. message.width = reader.int32();
  5166. break;
  5167. case 3:
  5168. message.colorspace = reader.int32();
  5169. break;
  5170. case 4:
  5171. message.encoded_image_string = reader.bytes();
  5172. break;
  5173. default:
  5174. reader.skipType(tag & 7);
  5175. break;
  5176. }
  5177. }
  5178. return message;
  5179. }
  5180. static decodeText(reader) {
  5181. const message = new $root.tensorflow.Summary.Image();
  5182. reader.start();
  5183. while (!reader.end()) {
  5184. const tag = reader.tag();
  5185. switch (tag) {
  5186. case "height":
  5187. message.height = reader.int32();
  5188. break;
  5189. case "width":
  5190. message.width = reader.int32();
  5191. break;
  5192. case "colorspace":
  5193. message.colorspace = reader.int32();
  5194. break;
  5195. case "encoded_image_string":
  5196. message.encoded_image_string = reader.bytes();
  5197. break;
  5198. default:
  5199. reader.field(tag, message);
  5200. break;
  5201. }
  5202. }
  5203. return message;
  5204. }
  5205. };
  5206. $root.tensorflow.Summary.Image.prototype.height = 0;
  5207. $root.tensorflow.Summary.Image.prototype.width = 0;
  5208. $root.tensorflow.Summary.Image.prototype.colorspace = 0;
  5209. $root.tensorflow.Summary.Image.prototype.encoded_image_string = new Uint8Array([]);
  5210. $root.tensorflow.Summary.Audio = class Audio {
  5211. constructor() {
  5212. }
  5213. static decode(reader, length) {
  5214. const message = new $root.tensorflow.Summary.Audio();
  5215. const end = length !== undefined ? reader.position + length : reader.length;
  5216. while (reader.position < end) {
  5217. const tag = reader.uint32();
  5218. switch (tag >>> 3) {
  5219. case 1:
  5220. message.sample_rate = reader.float();
  5221. break;
  5222. case 2:
  5223. message.num_channels = reader.int64();
  5224. break;
  5225. case 3:
  5226. message.length_frames = reader.int64();
  5227. break;
  5228. case 4:
  5229. message.encoded_audio_string = reader.bytes();
  5230. break;
  5231. case 5:
  5232. message.content_type = reader.string();
  5233. break;
  5234. default:
  5235. reader.skipType(tag & 7);
  5236. break;
  5237. }
  5238. }
  5239. return message;
  5240. }
  5241. static decodeText(reader) {
  5242. const message = new $root.tensorflow.Summary.Audio();
  5243. reader.start();
  5244. while (!reader.end()) {
  5245. const tag = reader.tag();
  5246. switch (tag) {
  5247. case "sample_rate":
  5248. message.sample_rate = reader.float();
  5249. break;
  5250. case "num_channels":
  5251. message.num_channels = reader.int64();
  5252. break;
  5253. case "length_frames":
  5254. message.length_frames = reader.int64();
  5255. break;
  5256. case "encoded_audio_string":
  5257. message.encoded_audio_string = reader.bytes();
  5258. break;
  5259. case "content_type":
  5260. message.content_type = reader.string();
  5261. break;
  5262. default:
  5263. reader.field(tag, message);
  5264. break;
  5265. }
  5266. }
  5267. return message;
  5268. }
  5269. };
  5270. $root.tensorflow.Summary.Audio.prototype.sample_rate = 0;
  5271. $root.tensorflow.Summary.Audio.prototype.num_channels = protobuf.Int64.create(0);
  5272. $root.tensorflow.Summary.Audio.prototype.length_frames = protobuf.Int64.create(0);
  5273. $root.tensorflow.Summary.Audio.prototype.encoded_audio_string = new Uint8Array([]);
  5274. $root.tensorflow.Summary.Audio.prototype.content_type = "";
  5275. $root.tensorflow.Summary.Value = class Value {
  5276. constructor() {
  5277. }
  5278. get value() {
  5279. $root.tensorflow.Summary.Value.valueSet = $root.tensorflow.Summary.Value.valueSet || new Set([ "simple_value", "obsolete_old_style_histogram", "image", "histo", "audio", "tensor"]);
  5280. return Object.keys(this).find((key) => $root.tensorflow.Summary.Value.valueSet.has(key) && this[key] != null);
  5281. }
  5282. static decode(reader, length) {
  5283. const message = new $root.tensorflow.Summary.Value();
  5284. const end = length !== undefined ? reader.position + length : reader.length;
  5285. while (reader.position < end) {
  5286. const tag = reader.uint32();
  5287. switch (tag >>> 3) {
  5288. case 7:
  5289. message.node_name = reader.string();
  5290. break;
  5291. case 1:
  5292. message.tag = reader.string();
  5293. break;
  5294. case 9:
  5295. message.metadata = $root.tensorflow.SummaryMetadata.decode(reader, reader.uint32());
  5296. break;
  5297. case 2:
  5298. message.simple_value = reader.float();
  5299. break;
  5300. case 3:
  5301. message.obsolete_old_style_histogram = reader.bytes();
  5302. break;
  5303. case 4:
  5304. message.image = $root.tensorflow.Summary.Image.decode(reader, reader.uint32());
  5305. break;
  5306. case 5:
  5307. message.histo = $root.tensorflow.HistogramProto.decode(reader, reader.uint32());
  5308. break;
  5309. case 6:
  5310. message.audio = $root.tensorflow.Summary.Audio.decode(reader, reader.uint32());
  5311. break;
  5312. case 8:
  5313. message.tensor = $root.tensorflow.TensorProto.decode(reader, reader.uint32());
  5314. break;
  5315. default:
  5316. reader.skipType(tag & 7);
  5317. break;
  5318. }
  5319. }
  5320. return message;
  5321. }
  5322. static decodeText(reader) {
  5323. const message = new $root.tensorflow.Summary.Value();
  5324. reader.start();
  5325. while (!reader.end()) {
  5326. const tag = reader.tag();
  5327. switch (tag) {
  5328. case "node_name":
  5329. message.node_name = reader.string();
  5330. break;
  5331. case "tag":
  5332. message.tag = reader.string();
  5333. break;
  5334. case "metadata":
  5335. message.metadata = $root.tensorflow.SummaryMetadata.decodeText(reader);
  5336. break;
  5337. case "simple_value":
  5338. message.simple_value = reader.float();
  5339. break;
  5340. case "obsolete_old_style_histogram":
  5341. message.obsolete_old_style_histogram = reader.bytes();
  5342. break;
  5343. case "image":
  5344. message.image = $root.tensorflow.Summary.Image.decodeText(reader);
  5345. break;
  5346. case "histo":
  5347. message.histo = $root.tensorflow.HistogramProto.decodeText(reader);
  5348. break;
  5349. case "audio":
  5350. message.audio = $root.tensorflow.Summary.Audio.decodeText(reader);
  5351. break;
  5352. case "tensor":
  5353. message.tensor = $root.tensorflow.TensorProto.decodeText(reader);
  5354. break;
  5355. default:
  5356. reader.field(tag, message);
  5357. break;
  5358. }
  5359. }
  5360. return message;
  5361. }
  5362. };
  5363. $root.tensorflow.Summary.Value.prototype.node_name = "";
  5364. $root.tensorflow.Summary.Value.prototype.tag = "";
  5365. $root.tensorflow.Summary.Value.prototype.metadata = null;
  5366. $root.google = {};
  5367. $root.google.protobuf = {};
  5368. $root.google.protobuf.Any = class Any {
  5369. constructor() {
  5370. }
  5371. static decode(reader, length) {
  5372. const message = new $root.google.protobuf.Any();
  5373. const end = length !== undefined ? reader.position + length : reader.length;
  5374. while (reader.position < end) {
  5375. const tag = reader.uint32();
  5376. switch (tag >>> 3) {
  5377. case 1:
  5378. message.type_url = reader.string();
  5379. break;
  5380. case 2:
  5381. message.value = reader.bytes();
  5382. break;
  5383. default:
  5384. reader.skipType(tag & 7);
  5385. break;
  5386. }
  5387. }
  5388. return message;
  5389. }
  5390. static decodeText(reader) {
  5391. return reader.any(() => new $root.google.protobuf.Any());
  5392. }
  5393. };
  5394. $root.google.protobuf.Any.prototype.type_url = "";
  5395. $root.google.protobuf.Any.prototype.value = new Uint8Array([]);
  5396. $root.third_party = {};
  5397. $root.third_party.tensorflow = {};
  5398. $root.third_party.tensorflow.python = {};
  5399. $root.third_party.tensorflow.python.keras = {};
  5400. $root.third_party.tensorflow.python.keras.protobuf = {};
  5401. $root.third_party.tensorflow.python.keras.protobuf.SavedMetadata = class SavedMetadata {
  5402. constructor() {
  5403. this.nodes = [];
  5404. }
  5405. static decode(reader, length) {
  5406. const message = new $root.third_party.tensorflow.python.keras.protobuf.SavedMetadata();
  5407. const end = length !== undefined ? reader.position + length : reader.length;
  5408. while (reader.position < end) {
  5409. const tag = reader.uint32();
  5410. switch (tag >>> 3) {
  5411. case 1:
  5412. message.nodes.push($root.third_party.tensorflow.python.keras.protobuf.SavedObject.decode(reader, reader.uint32()));
  5413. break;
  5414. default:
  5415. reader.skipType(tag & 7);
  5416. break;
  5417. }
  5418. }
  5419. return message;
  5420. }
  5421. static decodeText(reader) {
  5422. const message = new $root.third_party.tensorflow.python.keras.protobuf.SavedMetadata();
  5423. reader.start();
  5424. while (!reader.end()) {
  5425. const tag = reader.tag();
  5426. switch (tag) {
  5427. case "nodes":
  5428. message.nodes.push($root.third_party.tensorflow.python.keras.protobuf.SavedObject.decodeText(reader));
  5429. break;
  5430. default:
  5431. reader.field(tag, message);
  5432. break;
  5433. }
  5434. }
  5435. return message;
  5436. }
  5437. };
  5438. $root.third_party.tensorflow.python.keras.protobuf.SavedObject = class SavedObject {
  5439. constructor() {
  5440. }
  5441. static decode(reader, length) {
  5442. const message = new $root.third_party.tensorflow.python.keras.protobuf.SavedObject();
  5443. const end = length !== undefined ? reader.position + length : reader.length;
  5444. while (reader.position < end) {
  5445. const tag = reader.uint32();
  5446. switch (tag >>> 3) {
  5447. case 2:
  5448. message.node_id = reader.int32();
  5449. break;
  5450. case 3:
  5451. message.node_path = reader.string();
  5452. break;
  5453. case 4:
  5454. message.identifier = reader.string();
  5455. break;
  5456. case 5:
  5457. message.metadata = reader.string();
  5458. break;
  5459. case 6:
  5460. message.version = $root.third_party.tensorflow.python.keras.protobuf.VersionDef.decode(reader, reader.uint32());
  5461. break;
  5462. default:
  5463. reader.skipType(tag & 7);
  5464. break;
  5465. }
  5466. }
  5467. return message;
  5468. }
  5469. static decodeText(reader) {
  5470. const message = new $root.third_party.tensorflow.python.keras.protobuf.SavedObject();
  5471. reader.start();
  5472. while (!reader.end()) {
  5473. const tag = reader.tag();
  5474. switch (tag) {
  5475. case "node_id":
  5476. message.node_id = reader.int32();
  5477. break;
  5478. case "node_path":
  5479. message.node_path = reader.string();
  5480. break;
  5481. case "identifier":
  5482. message.identifier = reader.string();
  5483. break;
  5484. case "metadata":
  5485. message.metadata = reader.string();
  5486. break;
  5487. case "version":
  5488. message.version = $root.third_party.tensorflow.python.keras.protobuf.VersionDef.decodeText(reader);
  5489. break;
  5490. default:
  5491. reader.field(tag, message);
  5492. break;
  5493. }
  5494. }
  5495. return message;
  5496. }
  5497. };
  5498. $root.third_party.tensorflow.python.keras.protobuf.SavedObject.prototype.node_id = 0;
  5499. $root.third_party.tensorflow.python.keras.protobuf.SavedObject.prototype.node_path = "";
  5500. $root.third_party.tensorflow.python.keras.protobuf.SavedObject.prototype.identifier = "";
  5501. $root.third_party.tensorflow.python.keras.protobuf.SavedObject.prototype.metadata = "";
  5502. $root.third_party.tensorflow.python.keras.protobuf.SavedObject.prototype.version = null;
  5503. $root.third_party.tensorflow.python.keras.protobuf.VersionDef = class VersionDef {
  5504. constructor() {
  5505. this.bad_consumers = [];
  5506. }
  5507. static decode(reader, length) {
  5508. const message = new $root.third_party.tensorflow.python.keras.protobuf.VersionDef();
  5509. const end = length !== undefined ? reader.position + length : reader.length;
  5510. while (reader.position < end) {
  5511. const tag = reader.uint32();
  5512. switch (tag >>> 3) {
  5513. case 1:
  5514. message.producer = reader.int32();
  5515. break;
  5516. case 2:
  5517. message.min_consumer = reader.int32();
  5518. break;
  5519. case 3:
  5520. message.bad_consumers = reader.array(message.bad_consumers, () => reader.int32(), tag);
  5521. break;
  5522. default:
  5523. reader.skipType(tag & 7);
  5524. break;
  5525. }
  5526. }
  5527. return message;
  5528. }
  5529. static decodeText(reader) {
  5530. const message = new $root.third_party.tensorflow.python.keras.protobuf.VersionDef();
  5531. reader.start();
  5532. while (!reader.end()) {
  5533. const tag = reader.tag();
  5534. switch (tag) {
  5535. case "producer":
  5536. message.producer = reader.int32();
  5537. break;
  5538. case "min_consumer":
  5539. message.min_consumer = reader.int32();
  5540. break;
  5541. case "bad_consumers":
  5542. reader.array(message.bad_consumers, () => reader.int32());
  5543. break;
  5544. default:
  5545. reader.field(tag, message);
  5546. break;
  5547. }
  5548. }
  5549. return message;
  5550. }
  5551. };
  5552. $root.third_party.tensorflow.python.keras.protobuf.VersionDef.prototype.producer = 0;
  5553. $root.third_party.tensorflow.python.keras.protobuf.VersionDef.prototype.min_consumer = 0;