From 6f380facdb6aae8df572b695c672fb8ffccbef05 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 25 Apr 2021 16:56:10 -0400 Subject: [PATCH] convert blazeface to module --- CHANGELOG.md | 12 +- TODO.md | 3 +- demo/index.js | 8 +- dist/human.esm-nobundle.js | 20 +- dist/human.esm-nobundle.js.map | 6 +- dist/human.esm.js | 1664 +- dist/human.esm.js.map | 6 +- dist/human.js | 1664 +- dist/human.js.map | 6 +- dist/human.node-gpu.js | 30822 +++++++++++----------------- dist/human.node-wasm.js | 30822 +++++++++++----------------- dist/human.node.js | 30822 +++++++++++----------------- server/build.log | 17 + src/blazeface/blazeface.ts | 45 +- src/blazeface/box.ts | 20 + src/blazeface/facemesh.ts | 98 +- src/blazeface/facepipeline.ts | 15 +- src/blazeface/util.ts | 21 + src/faceall.ts | 3 +- src/handpose/anchors.ts | 17664 ++++++---------- src/handpose/handdetector.ts | 11 +- src/handpose/handpipeline.ts | 4 +- src/handpose/handpose.ts | 82 +- src/human.ts | 8 +- typedoc/classes/human.html | 6 +- types/blazeface/blazeface.d.ts | 1 - types/blazeface/box.d.ts | 11 + types/blazeface/facemesh.d.ts | 29 +- types/blazeface/facepipeline.d.ts | 5 - types/blazeface/util.d.ts | 1 + types/handpose/anchors.d.ts | 6 +- types/handpose/handdetector.d.ts | 2 +- types/handpose/handpipeline.d.ts | 2 +- types/handpose/handpose.d.ts | 28 +- types/human.d.ts | 4 +- 35 files changed, 45174 insertions(+), 68764 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e5f8022..2dbca5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,16 @@ Repository: **** ### **HEAD -> main** 2021/04/25 mandic00@live.com +- build nodejs deliverables in non-minified form +- stop building sourcemaps for nodejs deliverables +- remove deallocate, profile, scoped +- replaced maxfaces, maxdetections, maxhands, maxresults with maxdetected +- replaced nmsradius with built-in default +- unified minconfidence and scorethresdold as minconfidence +- add exception handlers to all demos +- remove blazeface-front and add unhandledrejection handler - major update for 1.8 release candidate - -### **origin/main** 2021/04/25 mandic00@live.com - +- enable webworker detection ### **1.7.1** 2021/04/25 mandic00@live.com diff --git a/TODO.md b/TODO.md index 5bed198e..4ed2df4a 100644 --- a/TODO.md +++ b/TODO.md @@ -6,8 +6,7 @@ N/A ## Exploring Features -- Implement built-in input handler for `http:`, `https:`, `file:` -- Canvas.js for WASM on NodeJS +N/A ## Explore Models diff --git a/demo/index.js b/demo/index.js index 71f5633b..2249cf7a 100644 --- a/demo/index.js +++ b/demo/index.js @@ -7,10 +7,9 @@ import Menu from './helpers/menu.js'; import GLBench from './helpers/gl-bench.js'; import webRTC from './helpers/webrtc.js'; -const userConfig = {}; +// const userConfig = {}; let human; -/* const userConfig = { backend: 'humangl', async: false, @@ -21,7 +20,7 @@ const userConfig = { enabled: false, flip: false, }, - face: { enabled: false, + face: { enabled: true, mesh: { enabled: true }, iris: { enabled: true }, description: { enabled: false }, @@ -29,11 +28,10 @@ const userConfig = { }, hand: { enabled: false }, gesture: { enabled: false }, - body: { enabled: true, modelPath: 'posenet.json' }, + body: { enabled: false, modelPath: 'posenet.json' }, // body: { enabled: true, modelPath: 'blazepose.json' }, // object: { enabled: true }, }; -*/ // ui options const ui = { diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index 9f894255..aa0b08c3 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -5,14 +5,14 @@ author: ' */ -var H1=Object.defineProperty;var F0=Object.prototype.hasOwnProperty,q0=Object.getOwnPropertyNames,C0=Object.getOwnPropertyDescriptor;var U=(t,e)=>{for(var r in e)H1(t,r,{get:e[r],enumerable:!0})},w=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of q0(e))!F0.call(t,A)&&A!=="default"&&H1(t,A,{get:()=>e[A],enumerable:!(r=C0(e,A))||r.enumerable});return t};var X1=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var q=(t,e,r)=>(X1(t,e,"read from private field"),r?r.call(t):e.get(t)),te=(t,e,r,A)=>(X1(t,e,"write to private field"),A?A.call(t,r):e.set(t,r),r);function O(t,e){let r=t.endsWith("/")?"":"/",_=e.startsWith(".")||e.startsWith("/")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("file:")?`${e}`:`${t}${r}${e}`;if(!_.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${_} Expecting JSON file`);return _}function p(...t){let e=new Date,r=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`;t&&console.log(r,"Human:",...t)}var j=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function X(...t){let e=r=>r&&typeof r=="object";return t.reduce((r,A)=>(Object.keys(A||{}).forEach(_=>{let c=r[_],n=A[_];Array.isArray(c)&&Array.isArray(n)?r[_]=c.concat(...n):e(c)&&e(n)?r[_]=X(c,n):r[_]=n}),r),{})}function F1(){let t,e;if(typeof navigator!="undefined"){let r=navigator.userAgent.match(/\(([^()]+)\)/g);if(r&&r[0]){let A=r[0].match(/\(([^()]+)\)/g);t=A?A[0].replace(/\(|\)/g,""):"",e=navigator.userAgent.replace(r[0],""),t[1]&&(e=e.replace(r[1],"")),e=e.replace(/ /g," ")}}else typeof process!="undefined"&&(t=`${process.platform} ${process.arch}`,e=`NodeJS ${process.version}`);return{platform:t,agent:e}}var h={};U(h,{data:()=>J0,version:()=>K0});w(h,St);w(h,Wt);w(h,Nt);w(h,It);w(h,kt);w(h,Ot);import*as q1 from"@tensorflow/tfjs/package.json";import*as C1 from"@tensorflow/tfjs-core/package.json";import*as B1 from"@tensorflow/tfjs-data/package.json";import*as U1 from"@tensorflow/tfjs-layers/package.json";import*as Y1 from"@tensorflow/tfjs-converter/package.json";import{version_cpu as B0}from"@tensorflow/tfjs-backend-cpu/dist/index.js";import{version_webgl as U0}from"@tensorflow/tfjs-backend-webgl/dist/index.js";import{version_wasm as Y0}from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as St from"@tensorflow/tfjs-core/dist/index.js";import*as Wt from"@tensorflow/tfjs-layers/dist/index.js";import*as Nt from"@tensorflow/tfjs-converter/dist/index.js";import*as J0 from"@tensorflow/tfjs-data/dist/index.js";import*as It from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as kt from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as Ot from"@tensorflow/tfjs-backend-wasm/dist/index.js";var K0={tfjs:(q1==null?void 0:q1.version)||void 0,"tfjs-core":(C1==null?void 0:C1.version)||void 0,"tfjs-data":(B1==null?void 0:B1.version)||void 0,"tfjs-layers":(U1==null?void 0:U1.version)||void 0,"tfjs-converter":(Y1==null?void 0:Y1.version)||void 0,"tfjs-backend-cpu":B0||void 0,"tfjs-backend-webgl":U0||void 0,"tfjs-backend-wasm":Y0||void 0};var H={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function J1(){if(!h.findBackend(H.name)){p("backend registration:",H.name);try{H.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(H.width,H.height):document.createElement("canvas")}catch(t){p("error: cannot create canvas:",t);return}try{H.gl=H.canvas.getContext("webgl2",H.webGLattr)}catch(t){p("error: cannot get WebGL2 context:",t);return}try{h.setWebGLContext(2,H.gl)}catch(t){p("error: cannot set WebGL2 context:",t);return}try{let t=new h.GPGPUContext(H.gl);h.registerBackend(H.name,()=>new h.MathBackendWebGL(t),H.priority)}catch(t){p("error: cannot register WebGL backend:",t);return}try{h.getKernelsForBackend("webgl").forEach(e=>{let r={...e,backendName:H.name};h.registerKernel(r)})}catch(t){p("error: cannot update WebGL backend registration:",t);return}try{h.ENV.set("WEBGL_VERSION",2)}catch(t){p("error: cannot set WebGL backend flags:",t);return}p("backend registered:",H.name)}}var Je={};U(Je,{load:()=>Ge,predict:()=>ge});var D0=["angry","disgust","fear","happy","sad","surprise","neutral"],B,Ke=[],be=Number.MAX_SAFE_INTEGER,De=[.2989,.587,.114];async function Ge(t){return B?t.debug&&p("cached model:",B.modelUrl):(B=await h.loadGraphModel(O(t.modelBasePath,t.face.emotion.modelPath)),!B||!B.modelUrl?p("load model failed:",t.face.emotion.modelPath):t.debug&&p("load model:",B.modelUrl)),B}async function ge(t,e){return B?be0?(be++,Ke):(e.videoOptimized?be=0:be=Number.MAX_SAFE_INTEGER,new Promise(async r=>{let A=h.image.resizeBilinear(t,[B.inputs[0].shape[2],B.inputs[0].shape[1]],!1),[_,c,n]=h.split(A,3,3);A.dispose();let o=h.mul(_,De[0]),s=h.mul(c,De[1]),a=h.mul(n,De[2]);_.dispose(),c.dispose(),n.dispose();let y=h.addN([o,s,a]);o.dispose(),s.dispose(),a.dispose();let i=h.tidy(()=>y.sub(.5).mul(2));y.dispose();let d=[];if(e.face.emotion.enabled){let u=await B.predict(i),P=u.dataSync();h.dispose(u);for(let x=0;xe.face.emotion.minConfidence&&d.push({score:Math.min(.99,Math.trunc(100*P[x])/100),emotion:D0[x]});d.sort((x,f)=>f.score-x.score)}i.dispose(),Ke=d,r(d)})):null}var Qe={};U(Qe,{enhance:()=>t1,load:()=>$e,match:()=>K1,predict:()=>Me,similarity:()=>e1});var F,Te={age:0},Pe=Number.MAX_SAFE_INTEGER;async function $e(t){return F?t.debug&&p("cached model:",F.modelUrl):(F=await h.loadGraphModel(O(t.modelBasePath,t.face.description.modelPath)),!F||!F.modelUrl?p("load model failed:",t.face.description.modelPath):t.debug&&p("load model:",F.modelUrl)),F}function e1(t,e,r=2){if(!t||!e||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)!==(e==null?void 0:e.length))return 0;let A=5*t.map((c,n)=>Math.abs(t[n]-e[n])**r).reduce((c,n)=>c+n,0)**(1/r);return Math.max(0,100-A)/100}function K1(t,e,r=0){let A={similarity:0,name:"",source:"",embedding:[]};if(!t||!e||!Array.isArray(t)||!Array.isArray(e))return A;for(let _ of e)if(_.embedding&&_.name){let c=e1(t,_.embedding);c>r&&c>A.similarity&&(A={..._,similarity:c})}return A}function t1(t){return h.tidy(()=>{let r=t.image||t.tensor||t;if(!(r instanceof h.Tensor))return null;let A=[[.05,.15,.85,.85]];return(r.shape.length===3?h.image.cropAndResize(h.expandDims(r,0),A,[0],[F.inputs[0].shape[2],F.inputs[0].shape[1]]):h.image.cropAndResize(r,A,[0],[F.inputs[0].shape[2],F.inputs[0].shape[1]])).mul(255)})}async function Me(t,e){return F?Pe0?(Pe++,Te):(e.videoOptimized?Pe=0:Pe=Number.MAX_SAFE_INTEGER,new Promise(async r=>{let A=t1(t),_,c={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};e.face.description.enabled&&(_=await F.predict(A)),h.dispose(A),_&&(h.tidy(()=>{let n=_.find(i=>i.shape[1]===1).dataSync(),o=Math.trunc(200*Math.abs(n[0]-.5))/100;o>e.face.description.minConfidence&&(c.gender=n[0]<=.5?"female":"male",c.genderConfidence=Math.min(.99,o));let s=_.find(i=>i.shape[1]===100).argMax(1).dataSync()[0],a=_.find(i=>i.shape[1]===100).dataSync();c.age=Math.round(a[s-1]>a[s+1]?10*s-100*a[s-1]:10*s+100*a[s+1])/10;let y=_.find(i=>i.shape[1]===1024);c.descriptor=[...y.dataSync()]}),_.forEach(n=>h.dispose(n))),Te=c,r(c)})):null}var G0=(t,e)=>{let r=f=>f*180/Math.PI,A=f=>{let m=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=m,f[1]/=m,f[2]/=m,f},_=(f,m)=>{let M=f[0]-m[0],v=f[1]-m[1],R=f[2]-m[2];return[M,v,R]},c=(f,m)=>{let M=f[1]*m[2]-f[2]*m[1],v=f[2]*m[0]-f[0]*m[2],R=f[0]*m[1]-f[1]*m[0];return[M,v,R]},n=f=>{let[m,M,v,R,b,l,g,z,E]=f,I,$,L;return R<1?R>-1?(L=Math.asin(R),$=Math.atan2(-g,m),I=Math.atan2(-l,b)):(L=-Math.PI/2,$=-Math.atan2(z,E),I=0):(L=Math.PI/2,$=Math.atan2(z,E),I=0),{pitch:2*-I,yaw:2*-$,roll:2*-L}},o=f=>{let m=(v,R,b,l)=>Math.atan2(l-R,b-v);return{pitch:m(f[10][1],f[10][2],f[152][1],f[152][2]),yaw:m(f[33][0],f[33][2],f[263][0],f[263][2]),roll:m(f[33][0],f[33][1],f[263][0],f[263][1])}},s=t.meshRaw;if(!s||s.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let a=Math.max(t.boxRaw[2]*e[0],t.boxRaw[3]*e[1])/1.5,y=[s[10],s[152],s[234],s[454]].map(f=>[f[0]*e[0]/a,f[1]*e[1]/a,f[2]]),i=A(_(y[1],y[0])),d=A(_(y[3],y[2])),u=A(c(d,i));d=c(i,u);let P=[d[0],d[1],d[2],i[0],i[1],i[2],u[0],u[1],u[2]];return{angle:n(P),matrix:P}},n1=async(t,e)=>{var y,i,d,u,P,x,f;let r,A,_,c,n,o,s=[];t.state="run:face",r=j();let a=await((y=t.models.face)==null?void 0:y.estimateFaces(e,t.config));if(t.perf.face=Math.trunc(j()-r),!a)return[];for(let m of a){if(t.analyze("Get Face"),!m.image||m.image.isDisposedInternal){p("Face object is disposed:",m.image);continue}let M=G0(m,[e.shape[2],e.shape[1]]);t.analyze("Start Emotion:"),t.config.async?c=t.config.face.emotion.enabled?ge(m.image,t.config):{}:(t.state="run:emotion",r=j(),c=t.config.face.emotion.enabled?await ge(m.image,t.config):{},t.perf.emotion=Math.trunc(j()-r)),t.analyze("End Emotion:"),t.analyze("Start Description:"),t.config.async?o=t.config.face.description.enabled?Me(m,t.config):[]:(t.state="run:description",r=j(),o=t.config.face.description.enabled?await Me(m.image,t.config):[],t.perf.embedding=Math.trunc(j()-r)),t.analyze("End Description:"),t.config.async&&([A,_,c,n,o]=await Promise.all([A,_,c,n,o])),t.analyze("Finish Face:"),!t.config.face.iris.enabled&&((i=m==null?void 0:m.annotations)==null?void 0:i.leftEyeIris)&&((d=m==null?void 0:m.annotations)==null?void 0:d.rightEyeIris)&&(delete m.annotations.leftEyeIris,delete m.annotations.rightEyeIris);let v=((u=m.annotations)==null?void 0:u.leftEyeIris)&&((P=m.annotations)==null?void 0:P.rightEyeIris)?11.7*Math.max(Math.abs(m.annotations.leftEyeIris[3][0]-m.annotations.leftEyeIris[1][0]),Math.abs(m.annotations.rightEyeIris[4][1]-m.annotations.rightEyeIris[2][1])):0;s.push({...m,age:o.age,gender:o.gender,genderConfidence:o.genderConfidence,embedding:o.descriptor,emotion:c,iris:v!==0?Math.trunc(v)/100:0,rotation:M,tensor:t.config.face.detector.return?(x=m.image)==null?void 0:x.squeeze():null}),(f=m.image)==null||f.dispose(),t.analyze("End Face")}return t.analyze("End FaceMesh:"),t.config.async&&(t.perf.face&&delete t.perf.face,t.perf.age&&delete t.perf.age,t.perf.gender&&delete t.perf.gender,t.perf.emotion&&delete t.perf.emotion),s};var o1={};U(o1,{MediaPipeFaceMesh:()=>s1,load:()=>i1,triangulation:()=>c0,uvmap:()=>_0});var D1=6;function Q0(t){let e={strides:[t/16,t/8],anchors:[2,6]},r=[];for(let A=0;A({startEndTensor:t,startPoint:h.slice(t,[0,0],[-1,2]),endPoint:h.slice(t,[0,2],[-1,2])});function et(t,e,r){let A=h.slice(t,[0,1],[-1,2]),_=h.add(A,e),c=h.slice(t,[0,3],[-1,2]),n=h.div(c,r),o=h.div(_,r),s=h.div(n,2),a=h.sub(o,s),y=h.add(o,s),i=h.mul(a,r),d=h.mul(y,r);return h.concat2d([i,d],1)}var G1=class{constructor(e,r){this.model=e,this.anchorsData=Q0(e.inputs[0].shape[1]),this.anchors=h.tensor2d(this.anchorsData),this.inputSize=e.inputs[0].shape[2],this.config=r}async getBoundingBoxes(e){if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return null;let[r,A,_]=h.tidy(()=>{let d=e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),u=this.model.predict(d),P;if(Array.isArray(u)){let M=u.sort((l,g)=>l.size-g.size),v=h.concat([M[0],M[2]],2),R=h.concat([M[1],M[3]],2);P=h.concat([R,v],1).squeeze(0)}else P=u.squeeze();let x=et(P,this.anchors,[this.inputSize,this.inputSize]),f=h.slice(P,[0,0],[-1,1]),m=h.sigmoid(f).squeeze();return[P,x,m]}),c=await h.image.nonMaxSuppressionAsync(A,_,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),n=c.arraySync();c.dispose();let s=n.map(i=>h.slice(A,[i,0],[1,-1])).map(i=>{let d=i.arraySync();return i.dispose(),d}),a=_.dataSync(),y=[];for(let i=0;ithis.config.face.detector.minConfidence){let P=$0(s[i]),x=this.anchorsData[d],f=h.tidy(()=>h.slice(r,[d,D1-1],[1,-1]).squeeze().reshape([D1,-1]));y.push({box:P,landmarks:f,anchor:x,confidence:u})}}return r.dispose(),A.dispose(),_.dispose(),{boxes:y,scaleFactor:[e.shape[2]/this.inputSize,e.shape[1]/this.inputSize]}}};async function Q1(t){let e=await h.loadGraphModel(O(t.modelBasePath,t.face.detector.modelPath),{fromTFHub:t.face.detector.modelPath.includes("tfhub.dev")}),r=new G1(e,t);return!e||!e.modelUrl?p("load model failed:",t.face.detector.modelPath):t.debug&&p("load model:",e.modelUrl),r}function $1(t,e){let r=[t.startPoint[0]*e[0],t.startPoint[1]*e[1]],A=[t.endPoint[0]*e[0],t.endPoint[1]*e[1]];return{startPoint:r,endPoint:A}}function ae(t){return[Math.abs(t.endPoint[0]-t.startPoint[0]),Math.abs(t.endPoint[1]-t.startPoint[1])]}function _e(t){return[t.startPoint[0]+(t.endPoint[0]-t.startPoint[0])/2,t.startPoint[1]+(t.endPoint[1]-t.startPoint[1])/2]}function he(t,e,r){let A=e.shape[1],_=e.shape[2],c=[[t.startPoint[1]/A,t.startPoint[0]/_,t.endPoint[1]/A,t.endPoint[0]/_]];return h.image.cropAndResize(e,c,[0],r)}function ve(t,e=1.5){let r=_e(t),A=ae(t),_=[e*A[0]/2,e*A[1]/2],c=[r[0]-_[0],r[1]-_[1]],n=[r[0]+_[0],r[1]+_[1]];return{startPoint:c,endPoint:n,landmarks:t.landmarks}}function ze(t){let e=_e(t),r=ae(t),_=Math.max(...r)/2,c=[e[0]-_,e[1]-_],n=[e[0]+_,e[1]+_];return{startPoint:c,endPoint:n,landmarks:t.landmarks}}var Ee=[[1,0,0],[0,1,0],[0,0,1]];function tt(t){return t-2*Math.PI*Math.floor((t+Math.PI)/(2*Math.PI))}function r1(t,e){let r=Math.PI/2-Math.atan2(-(e[1]-t[1]),e[0]-t[0]);return tt(r)}function e0(t,e){return[[1,0,t],[0,1,e],[0,0,1]]}function D(t,e){let r=0;for(let A=0;Axe[t]),nn=At.map(t=>xe[t]),rn=ct.map(t=>xe[t]);var c1=Y.leftEyeLower0,_1=Y.rightEyeLower0,oe={leftBounds:[c1[0],c1[c1.length-1]],rightBounds:[_1[0],_1[_1.length-1]]},je={count:468,mouth:13,symmetryLine:[13,Y.midwayBetweenEyes[0]]},A0={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},se={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function Se(t,e,r,A){for(let _=0;_[c[0]/this.meshSize*(i[0]-this.meshSize/2),c[1]/this.meshSize*(i[1]-this.meshSize/2),i[2]]),o=A!==0?Re(A,[0,0]):Ee,s=A!==0?n.map(i=>[...r0(i,o),i[2]]):n,a=A!==0?n0(_):Ee,y=[..._e({startPoint:r.startPoint,endPoint:r.endPoint}),1];return s.map(i=>[i[0]+D(y,a[0]),i[1]+D(y,a[1]),i[2]])}getLeftToRightEyeDepthDifference(e){let r=e[oe.leftBounds[0]][2],A=e[oe.rightBounds[0]][2];return r-A}getEyeBox(e,r,A,_,c=!1){let n=ze(ve(this.calculateLandmarksBoundingBox([e[A],e[_]]),this.irisEnlarge)),o=ae(n),s=h.image.cropAndResize(r,[[n.startPoint[1]/this.meshSize,n.startPoint[0]/this.meshSize,n.endPoint[1]/this.meshSize,n.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return c&&h.ENV.flags.IS_BROWSER&&(s=h.image.flipLeftRight(s)),{box:n,boxSize:o,crop:s}}getEyeCoords(e,r,A,_=!1){let c=[];for(let n=0;n{let a=n;return s===2?a=_:s===4&&(a=c),[o[0],o[1],a]})}async predict(e,r){let A=!1,_;if((this.skipped===0||this.skipped>r.face.detector.skipFrames||!r.face.mesh.enabled||!r.videoOptimized)&&(_=await this.boundingBoxDetector.getBoundingBoxes(e),this.skipped=0),r.videoOptimized&&this.skipped++,!r.videoOptimized||_&&_.boxes&&(!r.face.mesh.enabled||_.boxes.length!==this.detectedFaces&&this.detectedFaces!==r.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let n of _.boxes)this.storedBoxes.push({startPoint:n.box.startPoint.dataSync(),endPoint:n.box.endPoint.dataSync(),landmarks:n.landmarks,confidence:n.confidence});this.storedBoxes.length>0&&(A=!0)}if(r.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),A){if(!_||!_.boxes||_.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let n=0;n{n.box.startPoint.dispose(),n.box.endPoint.dispose(),n.landmarks.dispose()});let c=h.tidy(()=>this.storedBoxes.map((n,o)=>{let s=n.confidence,a,y=0,i;if(r.face.detector.rotation&&r.face.mesh.enabled&&h.ENV.flags.IS_BROWSER){let[b,l]=n.landmarks.length>=je.count?je.symmetryLine:A0.symmetryLine;y=r1(n.landmarks[b],n.landmarks[l]);let g=_e({startPoint:n.startPoint,endPoint:n.endPoint}),z=[g[0]/e.shape[2],g[1]/e.shape[1]],E=h.image.rotateWithOffset(e,y,0,z);i=Re(-y,g),r.face.mesh.enabled?a=he({startPoint:n.startPoint,endPoint:n.endPoint},E,[this.meshSize,this.meshSize]).div(255):a=he({startPoint:n.startPoint,endPoint:n.endPoint},E,[this.boxSize,this.boxSize]).div(255)}else{i=Ee;let b=e.clone();r.face.mesh.enabled?a=he({startPoint:n.startPoint,endPoint:n.endPoint},b,[this.meshSize,this.meshSize]).div(255):a=he({startPoint:n.startPoint,endPoint:n.endPoint},b,[this.boxSize,this.boxSize]).div(255)}if(!r.face.mesh.enabled)return{coords:null,box:n,faceConfidence:null,boxConfidence:s,confidence:n.confidence,image:a};let[,d,u]=this.meshDetector.predict(a),P=d.dataSync()[0];if(P=je.count?je.symmetryLine:A0.symmetryLine;y=r1(n.landmarks[b],n.landmarks[l]);let g=_e({startPoint:n.startPoint,endPoint:n.endPoint}),z=[g[0]/e.shape[2],g[1]/e.shape[1]],E=h.image.rotateWithOffset(e.toFloat(),y,0,z);i=Re(-y,g),a=he({startPoint:n.startPoint,endPoint:n.endPoint},E,[this.meshSize,this.meshSize]).div(255)}let v={coords:M,box:n,faceConfidence:P,boxConfidence:s,image:a,rawCoords:f},R=ze(n);return this.storedBoxes[o]={...R,landmarks:m,confidence:n.confidence,faceConfidence:P},v}));return c=c.filter(n=>n!==null),r.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(n=>n.faceConfidence>r.face.detector.minConfidence)),this.detectedFaces=c.length,c}calculateLandmarksBoundingBox(e){let r=e.map(n=>n[0]),A=e.map(n=>n[1]),_=[Math.min(...r),Math.min(...A)],c=[Math.max(...r),Math.max(...A)];return{startPoint:_,endPoint:c,landmarks:e}}};var s1=class{constructor(e,r,A,_){this.facePipeline=new h1(e,r,A),this.config=_}async estimateFaces(e,r){let A=await this.facePipeline.predict(e,r),_=[];for(let c of A||[]){if(c.isDisposedInternal)continue;let n=c.coords?c.coords.arraySync():[],o=n.map(i=>[i[0]/e.shape[2],i[1]/e.shape[1],i[2]/this.facePipeline.meshSize]),s={};if(n&&n.length>0)for(let i of Object.keys(Y))s[i]=Y[i].map(d=>n[d]);let a=c.box?[Math.max(0,c.box.startPoint[0]),Math.max(0,c.box.startPoint[1]),Math.min(e.shape[2],c.box.endPoint[0])-Math.max(0,c.box.startPoint[0]),Math.min(e.shape[1],c.box.endPoint[1])-Math.max(0,c.box.startPoint[1])]:0,y=c.box?[c.box.startPoint[0]/e.shape[2],c.box.startPoint[1]/e.shape[1],(c.box.endPoint[0]-c.box.startPoint[0])/e.shape[2],(c.box.endPoint[1]-c.box.startPoint[1])/e.shape[1]]:[];_.push({confidence:Math.round(100*c.faceConfidence||100*c.boxConfidence||0)/100,boxConfidence:Math.round(100*c.boxConfidence)/100,faceConfidence:Math.round(100*c.faceConfidence)/100,box:a,boxRaw:y,mesh:n,meshRaw:o,annotations:s,image:c.image?c.image.clone():null}),c.coords&&c.coords.dispose(),c.image&&c.image.dispose()}return _}},k=[null,null,null];async function i1(t){return!k[0]&&t.face.enabled||!k[1]&&t.face.mesh.enabled||!k[2]&&t.face.iris.enabled?(k=await Promise.all([!k[0]&&t.face.enabled?Q1(t):null,!k[1]&&t.face.mesh.enabled?h.loadGraphModel(O(t.modelBasePath,t.face.mesh.modelPath),{fromTFHub:t.face.mesh.modelPath.includes("tfhub.dev")}):null,!k[2]&&t.face.iris.enabled?h.loadGraphModel(O(t.modelBasePath,t.face.iris.modelPath),{fromTFHub:t.face.iris.modelPath.includes("tfhub.dev")}):null]),t.face.mesh.enabled&&(!k[1]||!k[1].modelUrl?p("load model failed:",t.face.mesh.modelPath):t.debug&&p("load model:",k[1].modelUrl)),t.face.iris.enabled&&(!k[2]||!k[1].modelUrl?p("load model failed:",t.face.iris.modelPath):t.debug&&p("load model:",k[2].modelUrl))):t.debug&&(p("cached model:",k[0].model.modelUrl),p("cached model:",k[1].modelUrl),p("cached model:",k[2].modelUrl)),new s1(k[0],k[1],k[2],t)}var c0=ne,_0=xe;var d1={};U(d1,{load:()=>m1,predict:()=>f1});var ye=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],h0=ye.length,we=ye.reduce((t,e,r)=>(t[e]=r,t),{}),_t=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],ht=_t.map(([t,e])=>[we[t],we[e]]),o0=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function s0(t){let e=t.reduce(({maxX:r,maxY:A,minX:_,minY:c},{position:{x:n,y:o}})=>({maxX:Math.max(r,n),maxY:Math.max(A,o),minX:Math.min(_,n),minY:Math.min(c,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY]}function i0(t,[e,r],[A,_]){let c=(o,s,a)=>({score:o.score,box:[Math.trunc(o.box[0]*a),Math.trunc(o.box[1]*s),Math.trunc(o.box[2]*a),Math.trunc(o.box[3]*s)],keypoints:o.keypoints.map(({score:y,part:i,position:d})=>({score:y,part:i,position:{x:Math.trunc(d.x*a),y:Math.trunc(d.y*s)}}))});return t.map(o=>c(o,e/A,r/_))}var a1=class{constructor(e,r){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=r}enqueue(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)}dequeue(){let e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(e){for(;e>0&&this.less(Math.floor(e/2),e);)this.exchange(e,Math.floor(e/2)),e=Math.floor(e/2)}sink(e){for(;2*e<=this.numberOfElements;){let r=2*e;if(rr?r:t}function a0(t,e,r,A){let _=r-t,c=A-e;return _*_+c*c}function l1(t,e){return{x:t.x+e.x,y:t.y+e.y}}var We=1,x0=16,ot=20**2;function y0(t,e,r,A,_,c,n,o=2){let s=M=>({y:n.get(M.y,M.x,t),x:n.get(M.y,M.x,n.shape[2]/2+t)}),a=(M,v,R)=>({y:w1(Math.round(M.y/c),0,v-1),x:w1(Math.round(M.x/c),0,R-1)}),[y,i]=A.shape,d=a(e.position,y,i),u=s(d),x=l1(e.position,u);for(let M=0;M[we[x],we[f]]),o=n.map(([,x])=>x),s=n.map(([x])=>x),a=e.shape[2],y=o.length,i=new Array(a),{part:d,score:u}=t,P=y1(d,A,r);i[d.id]={score:u,part:ye[d.id],position:P};for(let x=y-1;x>=0;--x){let f=o[x],m=s[x];i[f]&&!i[m]&&(i[m]=y0(x,i[f],m,e,r,A,c))}for(let x=0;xe){o=!1;break}if(!o)break}return o}function at(t,e){let[r,A,_]=e.shape,c=new a1(r*A*_,({score:n})=>n);for(let n=0;n{let c=_[A].position;return a0(r,e,c.y,c.x)<=ot})}function xt(t,e){return e.reduce((A,{position:_,score:c},n)=>(w0(t,_,n)||(A+=c),A),0)/e.length}function l0(t,e,r,A,_,c){let n=[],o=at(c,e);for(;n.length<_&&!o.empty();){let s=o.dequeue(),a=y1(s.part,x0,t);if(w0(n,a,s.part.id))continue;let i=st(s,e,t,x0,r,A).filter(P=>P.score>c),d=xt(n,i),u=s0(i);d>c&&n.push({keypoints:i,box:u,score:Math.round(100*d)/100})}return n}var C,yt=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function f1(t,e){let r=h.tidy(()=>{let o=t.resizeBilinear([C.inputs[0].shape[2],C.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),a=C.execute(o,yt).map(y=>y.squeeze([0]));return a[1]=a[1].sigmoid(),a}),A=await Promise.all(r.map(n=>n.buffer()));for(let n of r)n.dispose();let _=await l0(A[0],A[1],A[2],A[3],e.body.maxDetected,e.body.minConfidence);return i0(_,[t.shape[1],t.shape[2]],[C.inputs[0].shape[2],C.inputs[0].shape[1]])}async function m1(t){return C?t.debug&&p("cached model:",C.modelUrl):(C=await h.loadGraphModel(O(t.modelBasePath,t.body.modelPath)),!C||!C.modelUrl?p("load model failed:",t.body.modelPath):t.debug&&p("load model:",C.modelUrl)),C}var T1={};U(T1,{HandPose:()=>M1,load:()=>v1});function Ne(t){return[Math.abs(t.endPoint[0]-t.startPoint[0]),Math.abs(t.endPoint[1]-t.startPoint[1])]}function le(t){return[t.startPoint[0]+(t.endPoint[0]-t.startPoint[0])/2,t.startPoint[1]+(t.endPoint[1]-t.startPoint[1])/2]}function d0(t,e,r){let A=e.shape[1],_=e.shape[2],c=[[t.startPoint[1]/A,t.startPoint[0]/_,t.endPoint[1]/A,t.endPoint[0]/_]];return h.image.cropAndResize(e,c,[0],r)}function f0(t,e){let r=[t.startPoint[0]*e[0],t.startPoint[1]*e[1]],A=[t.endPoint[0]*e[0],t.endPoint[1]*e[1]],_=t.palmLandmarks.map(c=>[c[0]*e[0],c[1]*e[1]]);return{startPoint:r,endPoint:A,palmLandmarks:_,confidence:t.confidence}}function Ie(t,e=1.5){let r=le(t),A=Ne(t),_=[e*A[0]/2,e*A[1]/2],c=[r[0]-_[0],r[1]-_[1]],n=[r[0]+_[0],r[1]+_[1]];return{startPoint:c,endPoint:n,palmLandmarks:t.palmLandmarks}}function ke(t){let e=le(t),r=Ne(t),_=Math.max(...r)/2,c=[e[0]-_,e[1]-_],n=[e[0]+_,e[1]+_];return{startPoint:c,endPoint:n,palmLandmarks:t.palmLandmarks}}var u1=class{constructor(e,r,A){this.model=e,this.anchors=A.map(_=>[_.x_center,_.y_center]),this.anchorsTensor=h.tensor2d(this.anchors),this.inputSize=r,this.inputSizeTensor=h.tensor1d([r,r]),this.doubleInputSizeTensor=h.tensor1d([r*2,r*2])}normalizeBoxes(e){return h.tidy(()=>{let r=h.slice(e,[0,0],[-1,2]),A=h.slice(e,[0,2],[-1,2]),_=h.add(h.div(r,this.inputSizeTensor),this.anchorsTensor),c=h.div(A,this.doubleInputSizeTensor),n=h.mul(h.sub(_,c),this.inputSizeTensor),o=h.mul(h.add(_,c),this.inputSizeTensor);return h.concat2d([n,o],1)})}normalizeLandmarks(e,r){return h.tidy(()=>{let A=h.add(h.div(e.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[r]);return h.mul(A,this.inputSizeTensor)})}async getBoxes(e,r){let A=this.model.predict(e),_=A.squeeze();A.dispose();let c=h.tidy(()=>h.sigmoid(h.slice(_,[0,0],[-1,1])).squeeze()),n=c.dataSync(),o=h.slice(_,[0,1],[-1,4]),s=this.normalizeBoxes(o);o.dispose();let a=await h.image.nonMaxSuppressionAsync(s,n,r.hand.maxDetected,r.hand.iouThreshold,r.hand.minConfidence),y=a.arraySync();c.dispose(),a.dispose();let i=[];for(let d of y)if(n[d]>=r.hand.minConfidence){let u=h.slice(s,[d,0],[1,-1]),P=h.slice(_,[d,5],[1,14]),x=h.tidy(()=>this.normalizeLandmarks(P,d).reshape([-1,2]));P.dispose(),i.push({box:u,palmLandmarks:x,confidence:n[d]})}return _.dispose(),s.dispose(),i}async estimateHandBounds(e,r){let A=e.shape[1],_=e.shape[2],c=h.tidy(()=>e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),n=await this.getBoxes(c,r);c.dispose();let o=[];if(!n||n.length===0)return o;for(let s of n){let a=s.box.dataSync(),y=a.slice(0,2),i=a.slice(2,4),d=s.palmLandmarks.arraySync();s.box.dispose(),s.palmLandmarks.dispose(),o.push(f0({startPoint:y,endPoint:i,palmLandmarks:d,confidence:s.confidence},[_/this.inputSize,A/this.inputSize]))}return o}};function wt(t){return t-2*Math.PI*Math.floor((t+Math.PI)/(2*Math.PI))}function m0(t,e){let r=Math.PI/2-Math.atan2(-(e[1]-t[1]),e[0]-t[0]);return wt(r)}var u0=(t,e)=>[[1,0,t],[0,1,e],[0,0,1]];function G(t,e){let r=0;for(let A=0;Ab1([...c,1],r)),_=this.calculateLandmarksBoundingBox(A);return Ie(ke(_),dt)}getBoxForHandLandmarks(e){let r=this.calculateLandmarksBoundingBox(e),A=Ie(ke(r),g0);A.palmLandmarks=[];for(let _=0;_[n[0]*(u[0]-this.inputSize/2),n[1]*(u[1]-this.inputSize/2),n[2]*u[2]]),s=p1(A,[0,0]),a=o.map(u=>[...b1(u,s),u[2]]),y=b0(_),i=[...le(r),1],d=[G(i,y[0]),G(i,y[1])];return a.map(u=>[u[0]+d[0],u[1]+d[1],u[2]])}async estimateHands(e,r){let A=!1,_;(this.skipped===0||this.skipped>r.hand.skipFrames||!r.hand.landmarks||!r.videoOptimized)&&(_=await this.handDetector.estimateHandBounds(e,r),this.skipped=0),r.videoOptimized&&this.skipped++,_&&_.length>0&&(_.length!==this.detectedHands&&this.detectedHands!==r.hand.maxDetected||!r.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[..._],this.storedBoxes.length>0&&(A=!0));let c=[];r.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let n=0;n=r.hand.minConfidence){let v=h.reshape(m,[-1,3]),R=v.arraySync();m.dispose(),v.dispose();let b=this.transformRawCoords(R,u,s,d),l=this.getBoxForHandLandmarks(b);this.storedBoxes[n]=l;let g={landmarks:b,confidence:M,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};c.push(g)}else this.storedBoxes[n]=null;m.dispose()}else{let s=Ie(ke(o),g0),a={confidence:o.confidence,box:{topLeft:s.startPoint,bottomRight:s.endPoint}};c.push(a)}}return this.storedBoxes=this.storedBoxes.filter(n=>n!==null),this.detectedHands=c.length,c}calculateLandmarksBoundingBox(e){let r=e.map(n=>n[0]),A=e.map(n=>n[1]),_=[Math.min(...r),Math.min(...A)],c=[Math.max(...r),Math.max(...A)];return{startPoint:_,endPoint:c}}};var P0=[{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375}];var P1={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},M1=class{constructor(e){this.handPipeline=e}static getAnnotations(){return P1}async estimateHands(e,r){let A=await this.handPipeline.estimateHands(e,r);if(!A)return[];let _=[];for(let c of A){let n={};if(c.landmarks)for(let a of Object.keys(P1))n[a]=P1[a].map(y=>c.landmarks[y]);let o=c.box?[Math.max(0,c.box.topLeft[0]),Math.max(0,c.box.topLeft[1]),Math.min(e.shape[2],c.box.bottomRight[0])-Math.max(0,c.box.topLeft[0]),Math.min(e.shape[1],c.box.bottomRight[1])-Math.max(0,c.box.topLeft[1])]:[],s=[c.box.topLeft[0]/e.shape[2],c.box.topLeft[1]/e.shape[1],(c.box.bottomRight[0]-c.box.topLeft[0])/e.shape[2],(c.box.bottomRight[1]-c.box.topLeft[1])/e.shape[1]];_.push({confidence:Math.round(100*c.confidence)/100,box:o,boxRaw:s,landmarks:c.landmarks,annotations:n})}return _}},J,K;async function v1(t){!J||!K?([J,K]=await Promise.all([t.hand.enabled?h.loadGraphModel(O(t.modelBasePath,t.hand.detector.modelPath),{fromTFHub:t.hand.detector.modelPath.includes("tfhub.dev")}):null,t.hand.landmarks?h.loadGraphModel(O(t.modelBasePath,t.hand.skeleton.modelPath),{fromTFHub:t.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),t.hand.enabled&&(!J||!J.modelUrl?p("load model failed:",t.hand.detector.modelPath):t.debug&&p("load model:",J.modelUrl),!K||!K.modelUrl?p("load model failed:",t.hand.skeleton.modelPath):t.debug&&p("load model:",K.modelUrl))):(t.debug&&p("cached model:",J.modelUrl),t.debug&&p("cached model:",K.modelUrl));let e=new u1(J,J==null?void 0:J.inputs[0].shape[2],P0),r=new g1(e,K,K==null?void 0:K.inputs[0].shape[2]);return new M1(r)}var z1={};U(z1,{load:()=>E1,predict:()=>R1});var M0=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],v0=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var Z;async function E1(t){return Z?t.debug&&p("cached model:",Z.modelUrl):(Z=await h.loadGraphModel(O(t.modelBasePath,t.body.modelPath)),Z.width=parseInt(Z.signature.inputs["input_1:0"].tensorShape.dim[2].size),Z.height=parseInt(Z.signature.inputs["input_1:0"].tensorShape.dim[1].size),!Z||!Z.modelUrl?p("load model failed:",t.body.modelPath):t.debug&&p("load model:",Z.modelUrl)),Z}async function R1(t,e){if(!Z||!e.body.enabled)return null;let r={width:t.shape[2],height:t.shape[1]},A=h.image.resizeBilinear(t,[Z.width,Z.height],!1),_=h.div(A,[255]);A.dispose();let c=await Z.predict(_),n=c.find(i=>i.size===195||i.size===155).dataSync();c.forEach(i=>i.dispose()),_.dispose();let o=[],s=n.length===195?M0:v0,a=5;for(let i=0;id.score>i?d.score:i,0),keypoints:o}]}var j1={};U(j1,{load:()=>W1,predict:()=>N1});var Oe=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var V,S1=[],Le=Number.MAX_SAFE_INTEGER,Ze=2.5;async function W1(t){if(V)t.debug&&p("cached model:",V.modelUrl);else{V=await h.loadGraphModel(O(t.modelBasePath,t.object.modelPath));let e=Object.values(V.modelSignature.inputs);if(V.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!V.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${t.object.modelPath}`);!V||!V.modelUrl?p("load model failed:",t.object.modelPath):t.debug&&p("load model:",V.modelUrl)}return V}async function ut(t,e,r,A){let _=0,c=[];for(let a of[1,2,4])h.tidy(()=>{var f,m;let y=a*13,i=(f=t.find(M=>M.shape[1]===y**2&&M.shape[2]===Oe.length))==null?void 0:f.squeeze(),d=(m=t.find(M=>M.shape[1]===y**2&&M.shape[2]A.object.minConfidence&&v!==61){let b=(.5+Math.trunc(M%y))/y,l=(.5+Math.trunc(M/y))/y,g=P[M].map(ee=>ee*(y/a/e)),[z,E]=[b-Ze/a*g[0],l-Ze/a*g[1]],[I,$]=[b+Ze/a*g[2]-z,l+Ze/a*g[3]-E],L=[z,E,I,$];L=L.map(ee=>Math.max(0,Math.min(ee,1)));let Ye=[L[0]*r[0],L[1]*r[1],L[2]*r[0],L[3]*r[1]],pe={id:_++,strideSize:a,score:Math.round(100*R)/100,class:v+1,label:Oe[v].label,center:[Math.trunc(r[0]*b),Math.trunc(r[1]*l)],centerRaw:[b,l],box:Ye.map(ee=>Math.trunc(ee)),boxRaw:L};c.push(pe)}}});t.forEach(a=>h.dispose(a));let n=c.map(a=>a.boxRaw),o=c.map(a=>a.score),s=[];if(n&&n.length>0){let a=await h.image.nonMaxSuppressionAsync(n,o,A.object.maxDetected,A.object.iouThreshold,A.object.minConfidence);s=a.dataSync(),h.dispose(a)}return c=c.filter((a,y)=>s.includes(y)).sort((a,y)=>y.score-a.score),c}async function N1(t,e){return V?Le0?(Le++,S1):(e.videoOptimized?Le=0:Le=Number.MAX_SAFE_INTEGER,new Promise(async r=>{let A=[t.shape[2],t.shape[1]],_=h.image.resizeBilinear(t,[V.inputSize,V.inputSize],!1),c=_.div(255),n=c.transpose([0,3,1,2]);c.dispose(),_.dispose();let o;e.object.enabled&&(o=await V.predict(n)),n.dispose();let s=await ut(o,V.inputSize,A,e);S1=s,r(s)})):null}var z0=t=>{if(!t)return[];let e=[];for(let r=0;rs.part==="leftWrist"),_=t[r].keypoints.find(s=>s.part==="rightWrist"),c=t[r].keypoints.find(s=>s.part==="nose");c&&A&&_&&A.position.ys.part==="leftShoulder"),o=t[r].keypoints.find(s=>s.part==="rightShoulder");n&&o&&e.push({body:r,gesture:`leaning ${n.position.y>o.position.y?"left":"right"}`})}return e},E0=t=>{if(!t)return[];let e=[];for(let r=0;r0){let A=t[r].mesh[33][2]-t[r].mesh[263][2];Math.abs(A)<10?e.push({face:r,gesture:"facing center"}):e.push({face:r,gesture:`facing ${A<0?"left":"right"}`}),Math.abs(t[r].mesh[374][1]-t[r].mesh[386][1])/Math.abs(t[r].mesh[443][1]-t[r].mesh[450][1])<.2&&e.push({face:r,gesture:"blink left eye"}),Math.abs(t[r].mesh[145][1]-t[r].mesh[159][1])/Math.abs(t[r].mesh[223][1]-t[r].mesh[230][1])<.2&&e.push({face:r,gesture:"blink right eye"});let n=Math.min(100,500*Math.abs(t[r].mesh[13][1]-t[r].mesh[14][1])/Math.abs(t[r].mesh[10][1]-t[r].mesh[152][1]));n>10&&e.push({face:r,gesture:`mouth ${Math.trunc(n)}% open`});let o=t[r].mesh[152][2];Math.abs(o)>10&&e.push({face:r,gesture:`head ${o<0?"up":"down"}`})}return e},R0=t=>{if(!t)return[];let e=[];for(let r=0;r.033||i>.033)&&(a=!1),d>.033&&e.push({iris:r,gesture:"looking right"}),i>.033&&e.push({iris:r,gesture:"looking left"});let u=Math.abs(t[r].mesh[145][1]-t[r].annotations.rightEyeIris[0][1])/t[r].annotations.rightEyeIris[0][1],P=Math.abs(t[r].mesh[374][1]-t[r].annotations.leftEyeIris[0][1])/t[r].annotations.leftEyeIris[0][1];(P<.015||u<.015||P>.03||u>.03)&&(a=!1),(P<.015||u<.015)&&e.push({iris:r,gesture:"looking down"}),(P>.03||u>.03)&&e.push({iris:r,gesture:"looking up"}),a&&e.push({iris:r,gesture:"looking center"})}return e},j0=t=>{if(!t)return[];let e=[];for(let r=0;r0){let _=A.reduce((n,o)=>n.position[2]n.position[1]k1});function pt(t,e,r){let A=function(o,s,a){let y=new RegExp("\\b"+s+" \\w+ (\\w+)","ig");o.replace(y,(i,d)=>(a[d]=0,i))},_=function(o,s){let a=t.createShader(s);if(t.shaderSource(a,o),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw new Error("Filter: GL compile failed",t.getShaderInfoLog(a));return a};this.uniform={},this.attribute={};let c=_(e,t.VERTEX_SHADER),n=_(r,t.FRAGMENT_SHADER);if(this.id=t.createProgram(),t.attachShader(this.id,c),t.attachShader(this.id,n),t.linkProgram(this.id),!t.getProgramParameter(this.id,t.LINK_STATUS))throw new Error("Filter: GL link failed",t.getProgramInfoLog(this.id));t.useProgram(this.id),A(e,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=t.getAttribLocation(this.id,o);A(e,"uniform",this.uniform),A(r,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=t.getUniformLocation(this.id,o)}function S0(t){t||(t={});let e=0,r=null,A=!1,_=-1,c=[null,null],n=[],o=-1,s=-1,a=null,y=null,i={},d=t.canvas||document.createElement("canvas"),u={},P={INTERMEDIATE:1},x=d.getContext("webgl");if(!x)throw new Error("Filter: getContext() failed");this.addFilter=function(b){let l=Array.prototype.slice.call(arguments,1),g=i[b];n.push({func:g,args:l})},this.reset=function(){n=[]};let f=function(b,l){if(!(b===o&&l===s)){if(d.width=b,o=b,d.height=l,s=l,!a){let g=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);a=x.createBuffer(),x.bindBuffer(x.ARRAY_BUFFER,a),x.bufferData(x.ARRAY_BUFFER,g,x.STATIC_DRAW),x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}x.viewport(0,0,o,s),c=[null,null]}},m=function(b,l){let g=x.createFramebuffer();x.bindFramebuffer(x.FRAMEBUFFER,g);let z=x.createRenderbuffer();x.bindRenderbuffer(x.RENDERBUFFER,z);let E=x.createTexture();return x.bindTexture(x.TEXTURE_2D,E),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,b,l,0,x.RGBA,x.UNSIGNED_BYTE,null),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,E,0),x.bindTexture(x.TEXTURE_2D,null),x.bindFramebuffer(x.FRAMEBUFFER,null),{fbo:g,texture:E}},M=function(b){return c[b]=c[b]||m(o,s),c[b]},v=function(b=null){var E,I;let l=null,g=null,z=!1;e===0?l=r:l=(E=M(_))==null?void 0:E.texture,e++,A&&!(b&P.INTERMEDIATE)?(g=null,z=e%2==0):(_=(_+1)%2,g=(I=M(_))==null?void 0:I.fbo),x.bindTexture(x.TEXTURE_2D,l),x.bindFramebuffer(x.FRAMEBUFFER,g),x.uniform1f(y.uniform.flipY,z?-1:1),x.drawArrays(x.TRIANGLES,0,6)};this.apply=function(b){if(f(b.width,b.height),e=0,r||(r=x.createTexture()),x.bindTexture(x.TEXTURE_2D,r),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.NEAREST),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.NEAREST),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,b),n.length===0)return v(),d;for(let l=0;l0,c=t.naturalHeight||t.videoHeight||t.height||t.shape&&t.shape[2]>0,n=_,o=c;if(n>Ve&&(n=Ve,o=n*c/_),o>Ve&&(o=Ve,n=o*_/c),e.filter.width>0?n=e.filter.width:e.filter.height>0&&(n=_*(e.filter.height/c)),e.filter.height>0?o=e.filter.height:e.filter.width>0&&(o=c*(e.filter.width/_)),!n||!o)throw new Error("Human: Input cannot determine dimension");(!T||(T==null?void 0:T.width)!==n||(T==null?void 0:T.height)!==o)&&(T=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,o):document.createElement("canvas"),(T==null?void 0:T.width)!==n&&(T.width=n),(T==null?void 0:T.height)!==o&&(T.height=o));let s=T.getContext("2d");if(t instanceof ImageData?s.putImageData(t,0,0):e.filter.flip&&typeof s.translate!="undefined"?(s.translate(_,0),s.scale(-1,1),s.drawImage(t,0,0,_,c,0,0,T==null?void 0:T.width,T==null?void 0:T.height),s.setTransform(1,0,0,1,0,0)):s.drawImage(t,0,0,_,c,0,0,T==null?void 0:T.width,T==null?void 0:T.height),e.filter.enabled){if((!N||!W||T.width!==W.width||(T==null?void 0:T.height)!==(W==null?void 0:W.height))&&(W=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(T==null?void 0:T.width,T==null?void 0:T.height):document.createElement("canvas"),(W==null?void 0:W.width)!==(T==null?void 0:T.width)&&(W.width=T==null?void 0:T.width),(W==null?void 0:W.height)!==(T==null?void 0:T.height)&&(W.height=T==null?void 0:T.height),N=h.ENV.flags.IS_BROWSER?new S0({canvas:W}):null),!N)return{tensor:null,canvas:T};N.reset(),N.addFilter("brightness",e.filter.brightness),e.filter.contrast!==0&&N.addFilter("contrast",e.filter.contrast),e.filter.sharpness!==0&&N.addFilter("sharpen",e.filter.sharpness),e.filter.blur!==0&&N.addFilter("blur",e.filter.blur),e.filter.saturation!==0&&N.addFilter("saturation",e.filter.saturation),e.filter.hue!==0&&N.addFilter("hue",e.filter.hue),e.filter.negative&&N.addFilter("negative"),e.filter.sepia&&N.addFilter("sepia"),e.filter.vintage&&N.addFilter("brownie"),e.filter.sepia&&N.addFilter("sepia"),e.filter.kodachrome&&N.addFilter("kodachrome"),e.filter.technicolor&&N.addFilter("technicolor"),e.filter.polaroid&&N.addFilter("polaroid"),e.filter.pixelate!==0&&N.addFilter("pixelate",e.filter.pixelate),N.apply(T)}else W=T,N&&(N=null);let a;if(W.data){let i=[W.height,W.width,3];a=h.tensor3d(W.data,i,"int32")}else if(W instanceof ImageData)a=h.browser.fromPixels(W);else if(e.backend==="webgl"||e.backend==="humangl"){let i=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,o):document.createElement("canvas");i.width=n,i.height=o;let d=i.getContext("2d");d==null||d.drawImage(W,0,0),a=h.browser.fromPixels(i)}else{let i=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,o):document.createElement("canvas");i.width=n,i.height=o;let d=i.getContext("2d");d==null||d.drawImage(W,0,0);let u=d==null?void 0:d.getImageData(0,0,n,o);a=h.browser.fromPixels(u)}let y=a.toFloat();r=y.expandDims(0),a.dispose(),y.dispose()}let A=e.filter.return?W:null;return{tensor:r,canvas:A}}var O1={};U(O1,{all:()=>gt,body:()=>I0,canvas:()=>bt,face:()=>N0,gesture:()=>W0,hand:()=>k0,object:()=>O0,options:()=>re});var S={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var re={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function He(t,e,r,A=0,_){t.fillStyle=_.useDepth&&A?`rgba(${127.5+2*A}, ${127.5-2*A}, 255, 0.3)`:_.color,t.beginPath(),t.arc(e,r,_.pointSize,0,2*Math.PI),t.fill()}function Ae(t,e,r,A,_,c){if(t.beginPath(),c.useCurves){let n=(e+e+A)/2,o=(r+r+_)/2;t.ellipse(n,o,A/2,_/2,0,0,2*Math.PI)}else t.lineWidth=c.lineWidth,t.moveTo(e+c.roundRect,r),t.lineTo(e+A-c.roundRect,r),t.quadraticCurveTo(e+A,r,e+A,r+c.roundRect),t.lineTo(e+A,r+_-c.roundRect),t.quadraticCurveTo(e+A,r+_,e+A-c.roundRect,r+_),t.lineTo(e+c.roundRect,r+_),t.quadraticCurveTo(e,r+_,e,r+_-c.roundRect),t.lineTo(e,r+c.roundRect),t.quadraticCurveTo(e,r,e+c.roundRect,r),t.closePath();t.stroke()}function L1(t,e=[],r){if(!(e===void 0||e.length===0)){t.beginPath(),t.moveTo(e[0][0],e[0][1]);for(let A of e)t.strokeStyle=r.useDepth&&A[2]?`rgba(${127.5+2*A[2]}, ${127.5-2*A[2]}, 255, 0.3)`:r.color,t.fillStyle=r.useDepth&&A[2]?`rgba(${127.5+2*A[2]}, ${127.5-2*A[2]}, 255, 0.3)`:r.color,t.lineTo(A[0],parseInt(A[1]));t.stroke(),r.fillPolygons&&(t.closePath(),t.fill())}}function de(t,e=[],r){if(!(e===void 0||e.length===0)){if(!r.useCurves||e.length<=2){L1(t,e,r);return}t.moveTo(e[0][0],e[0][1]);for(let A=0;A1&&s[1].length>0){let a=o[1]>0?`#${o[1]}`:"",y=`${o[0]} ${a}: ${s[1]}`;A.shadowColor&&A.shadowColor!==""&&(_.fillStyle=A.shadowColor,_.fillText(y,8,2+c*A.lineHeight)),_.fillStyle=A.labelColor,_.fillText(y,6,0+c*A.lineHeight),c+=1}}}async function N0(t,e,r){let A=X(re,r);if(!e||!t||!(t instanceof HTMLCanvasElement))return;let _=t.getContext("2d");if(!!_)for(let c of e){_.font=A.font,_.strokeStyle=A.color,_.fillStyle=A.color,A.drawBoxes&&(A.useRawBoxes?Ae(_,t.width*c.boxRaw[0],t.height*c.boxRaw[1],t.width*c.boxRaw[2],t.height*c.boxRaw[3],A):Ae(_,c.box[0],c.box[1],c.box[2],c.box[3],A));let n=[];if(n.push(`face confidence: ${Math.trunc(100*c.confidence)}%`),c.genderConfidence&&n.push(`${c.gender||""} ${Math.trunc(100*c.genderConfidence)}% confident`),c.age&&n.push(`age: ${c.age||""}`),c.iris&&n.push(`iris distance: ${c.iris}`),c.emotion&&c.emotion.length>0){let o=c.emotion.map(s=>`${Math.trunc(100*s.score)}% ${s.emotion}`);n.push(o.join(" "))}c.rotation&&c.rotation.angle&&c.rotation.angle.roll&&n.push(`roll: ${Math.trunc(100*c.rotation.angle.roll)/100} yaw:${Math.trunc(100*c.rotation.angle.yaw)/100} pitch:${Math.trunc(100*c.rotation.angle.pitch)/100}`),n.length===0&&n.push("face"),_.fillStyle=A.color;for(let o=n.length-1;o>=0;o--){let s=Math.max(c.box[0],0),a=o*A.lineHeight+c.box[1];A.shadowColor&&A.shadowColor!==""&&(_.fillStyle=A.shadowColor,_.fillText(n[o],s+5,a+16)),_.fillStyle=A.labelColor,_.fillText(n[o],s+4,a+15)}if(_.lineWidth=1,c.mesh&&c.mesh.length>0){if(A.drawPoints)for(let o of c.mesh)He(_,o[0],o[1],o[2],A);if(A.drawPolygons){_.lineWidth=1;for(let o=0;oc.mesh[a]);L1(_,s,A)}if(c.annotations&&c.annotations.leftEyeIris){_.strokeStyle=A.useDepth?"rgba(255, 200, 255, 0.3)":A.color,_.beginPath();let o=Math.abs(c.annotations.leftEyeIris[3][0]-c.annotations.leftEyeIris[1][0])/2,s=Math.abs(c.annotations.leftEyeIris[4][1]-c.annotations.leftEyeIris[2][1])/2;_.ellipse(c.annotations.leftEyeIris[0][0],c.annotations.leftEyeIris[0][1],o,s,0,0,2*Math.PI),_.stroke(),A.fillPolygons&&(_.fillStyle=A.useDepth?"rgba(255, 255, 200, 0.3)":A.color,_.fill())}if(c.annotations&&c.annotations.rightEyeIris){_.strokeStyle=A.useDepth?"rgba(255, 200, 255, 0.3)":A.color,_.beginPath();let o=Math.abs(c.annotations.rightEyeIris[3][0]-c.annotations.rightEyeIris[1][0])/2,s=Math.abs(c.annotations.rightEyeIris[4][1]-c.annotations.rightEyeIris[2][1])/2;_.ellipse(c.annotations.rightEyeIris[0][0],c.annotations.rightEyeIris[0][1],o,s,0,0,2*Math.PI),_.stroke(),A.fillPolygons&&(_.fillStyle=A.useDepth?"rgba(255, 255, 200, 0.3)":A.color,_.fill())}}}}}var Q=[];async function I0(t,e,r){let A=X(re,r);if(!e||!t||!(t instanceof HTMLCanvasElement))return;let _=t.getContext("2d");if(!!_){_.lineJoin="round";for(let c=0;cs.part==="leftShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),de(_,o,A),o.length=0,n=e[c].keypoints.find(s=>s.part==="rightShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightHip"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftHip"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),o.length===4&&L1(_,o,A),o.length=0,n=e[c].keypoints.find(s=>s.part==="leftHip"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftKnee"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftAnkle"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftHeel"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftFoot"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),de(_,o,A),o.length=0,n=e[c].keypoints.find(s=>s.part==="rightHip"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightKnee"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightAnkle"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightHeel"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightFoot"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),de(_,o,A),o.length=0,n=e[c].keypoints.find(s=>s.part==="leftShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftElbow"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftWrist"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="leftPalm"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),de(_,o,A),o.length=0,n=e[c].keypoints.find(s=>s.part==="rightShoulder"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightElbow"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightWrist"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),n=e[c].keypoints.find(s=>s.part==="rightPalm"),n&&n.score>S.body.minConfidence&&o.push([n.position.x,n.position.y]),de(_,o,A)}}}}async function k0(t,e,r){let A=X(re,r);if(!e||!t||!(t instanceof HTMLCanvasElement))return;let _=t.getContext("2d");if(!!_){_.lineJoin="round",_.font=A.font;for(let c of e){if(A.drawBoxes){_.strokeStyle=A.color,_.fillStyle=A.color;let n;if(!A.calculateHandBox)n=A.useRawBoxes?c.boxRaw:c.box;else if(n=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],c.landmarks&&c.landmarks.length>0){for(let o of c.landmarks)o[0]n[2]&&(n[2]=o[0]),o[1]>n[3]&&(n[3]=o[1]);n[2]-=n[0],n[3]-=n[1]}A.useRawBoxes?Ae(_,t.width*n[0],t.height*n[1],t.width*n[2],t.height*n[3],A):Ae(_,n[0],n[1],n[2],n[3],A),A.drawLabels&&(A.shadowColor&&A.shadowColor!==""&&(_.fillStyle=A.shadowColor,_.fillText("hand",n[0]+3,1+n[1]+A.lineHeight,n[2])),_.fillStyle=A.labelColor,_.fillText("hand",n[0]+2,0+n[1]+A.lineHeight,n[2])),_.stroke()}if(A.drawPoints&&c.landmarks&&c.landmarks.length>0)for(let n of c.landmarks)_.fillStyle=A.useDepth?`rgba(${127.5+2*n[2]}, ${127.5-2*n[2]}, 255, 0.5)`:A.color,He(_,n[0],n[1],0,A);if(A.drawPolygons){let n=o=>{if(!!o)for(let s=0;s0?s-1:0][0],o[s>0?s-1:0][1]),_.lineTo(o[s][0],o[s][1]),_.stroke()};n(c.annotations.indexFinger),n(c.annotations.middleFinger),n(c.annotations.ringFinger),n(c.annotations.pinky),n(c.annotations.thumb)}}}}async function O0(t,e,r){let A=X(re,r);if(!e||!t||!(t instanceof HTMLCanvasElement))return;let _=t.getContext("2d");if(!!_){_.lineJoin="round",_.font=A.font;for(let c of e)if(A.drawBoxes){if(_.strokeStyle=A.color,_.fillStyle=A.color,A.useRawBoxes?Ae(_,t.width*c.boxRaw[0],t.height*c.boxRaw[1],t.width*c.boxRaw[2],t.height*c.boxRaw[3],A):Ae(_,c.box[0],c.box[1],c.box[2],c.box[3],A),A.drawLabels){let n=`${Math.round(100*c.score)}% ${c.label}`;A.shadowColor&&A.shadowColor!==""&&(_.fillStyle=A.shadowColor,_.fillText(n,c.box[0]+3,1+c.box[1]+A.lineHeight,c.box[2])),_.fillStyle=A.labelColor,_.fillText(n,c.box[0]+2,0+c.box[1]+A.lineHeight,c.box[2])}_.stroke()}}}async function bt(t,e){if(!t||!e||!(t instanceof HTMLCanvasElement)||!(e instanceof HTMLCanvasElement))return;let r=t.getContext("2d");r==null||r.drawImage(t,0,0)}async function gt(t,e,r){let A=X(re,r);!e||!t||t instanceof HTMLCanvasElement&&(N0(t,e.face,A),I0(t,e.body,A),k0(t,e.hand,A),W0(t,e.gesture,A),O0(t,e.object,A))}var Xe=` +var F5=Object.defineProperty;var JA=Object.prototype.hasOwnProperty,KA=Object.getOwnPropertyNames,DA=Object.getOwnPropertyDescriptor;var Y=(A,e)=>{for(var t in e)F5(A,t,{get:e[t],enumerable:!0})},m=(A,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of KA(e))!JA.call(A,s)&&s!=="default"&&F5(A,s,{get:()=>e[s],enumerable:!(t=DA(e,s))||t.enumerable});return A};var q5=(A,e,t)=>{if(!e.has(A))throw TypeError("Cannot "+t)};var C=(A,e,t)=>(q5(A,e,"read from private field"),t?t.call(A):e.get(A)),e0=(A,e,t,s)=>(q5(A,e,"write to private field"),s?s.call(A,t):e.set(A,t),t);function L(A,e){let t=A.endsWith("/")?"":"/",o=e.startsWith(".")||e.startsWith("/")||e.startsWith("http:")||e.startsWith("https:")||e.startsWith("file:")?`${e}`:`${A}${t}${e}`;if(!o.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${o} Expecting JSON file`);return o}function b(...A){let e=new Date,t=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`;A&&console.log(t,"Human:",...A)}var W=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function F(...A){let e=t=>t&&typeof t=="object";return A.reduce((t,s)=>(Object.keys(s||{}).forEach(o=>{let i=t[o],n=s[o];Array.isArray(i)&&Array.isArray(n)?t[o]=i.concat(...n):e(i)&&e(n)?t[o]=F(i,n):t[o]=n}),t),{})}function C5(){let A,e;if(typeof navigator!="undefined"){let t=navigator.userAgent.match(/\(([^()]+)\)/g);if(t&&t[0]){let s=t[0].match(/\(([^()]+)\)/g);A=s?s[0].replace(/\(|\)/g,""):"",e=navigator.userAgent.replace(t[0],""),A[1]&&(e=e.replace(t[1],"")),e=e.replace(/ /g," ")}}else typeof process!="undefined"&&(A=`${process.platform} ${process.arch}`,e=`NodeJS ${process.version}`);return{platform:A,agent:e}}var r={};Y(r,{data:()=>$A,version:()=>A2});m(r,k2);m(r,O2);m(r,L2);m(r,Z2);m(r,V2);m(r,H2);import*as B5 from"@tensorflow/tfjs/package.json";import*as U5 from"@tensorflow/tfjs-core/package.json";import*as Y5 from"@tensorflow/tfjs-data/package.json";import*as J5 from"@tensorflow/tfjs-layers/package.json";import*as K5 from"@tensorflow/tfjs-converter/package.json";import{version_cpu as GA}from"@tensorflow/tfjs-backend-cpu/dist/index.js";import{version_webgl as QA}from"@tensorflow/tfjs-backend-webgl/dist/index.js";import{version_wasm as _A}from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as k2 from"@tensorflow/tfjs-core/dist/index.js";import*as O2 from"@tensorflow/tfjs-layers/dist/index.js";import*as L2 from"@tensorflow/tfjs-converter/dist/index.js";import*as $A from"@tensorflow/tfjs-data/dist/index.js";import*as Z2 from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as V2 from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as H2 from"@tensorflow/tfjs-backend-wasm/dist/index.js";var A2={tfjs:(B5==null?void 0:B5.version)||void 0,"tfjs-core":(U5==null?void 0:U5.version)||void 0,"tfjs-data":(Y5==null?void 0:Y5.version)||void 0,"tfjs-layers":(J5==null?void 0:J5.version)||void 0,"tfjs-converter":(K5==null?void 0:K5.version)||void 0,"tfjs-backend-cpu":GA||void 0,"tfjs-backend-webgl":QA||void 0,"tfjs-backend-wasm":_A||void 0};var X={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function D5(){if(!r.findBackend(X.name)){b("backend registration:",X.name);try{X.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(X.width,X.height):document.createElement("canvas")}catch(A){b("error: cannot create canvas:",A);return}try{X.gl=X.canvas.getContext("webgl2",X.webGLattr)}catch(A){b("error: cannot get WebGL2 context:",A);return}try{r.setWebGLContext(2,X.gl)}catch(A){b("error: cannot set WebGL2 context:",A);return}try{let A=new r.GPGPUContext(X.gl);r.registerBackend(X.name,()=>new r.MathBackendWebGL(A),X.priority)}catch(A){b("error: cannot register WebGL backend:",A);return}try{r.getKernelsForBackend("webgl").forEach(e=>{let t={...e,backendName:X.name};r.registerKernel(t)})}catch(A){b("error: cannot update WebGL backend registration:",A);return}try{r.ENV.set("WEBGL_VERSION",2)}catch(A){b("error: cannot set WebGL backend flags:",A);return}b("backend registered:",X.name)}}var A5={};Y(A5,{load:()=>n5,predict:()=>t5,triangulation:()=>rA,uvmap:()=>aA});function G5(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],s=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]];return{startPoint:t,endPoint:s}}function l0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function i0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function r0(A,e,t){let s=e.shape[1],o=e.shape[2],i=[[A.startPoint[1]/s,A.startPoint[0]/o,A.endPoint[1]/s,A.endPoint[0]/o]];return r.image.cropAndResize(e,i,[0],t)}function T0(A,e=1.5){let t=i0(A),s=l0(A),o=[e*s[0]/2,e*s[1]/2],i=[t[0]-o[0],t[1]-o[1]],n=[t[0]+o[0],t[1]+o[1]];return{startPoint:i,endPoint:n,landmarks:A.landmarks}}function P0(A){let e=i0(A),t=l0(A),o=Math.max(...t)/2,i=[e[0]-o,e[1]-o],n=[e[0]+o,e[1]+o];return{startPoint:i,endPoint:n,landmarks:A.landmarks}}function K0(A){let e=A.map(i=>i[0]),t=A.map(i=>i[1]),s=[Math.min(...e),Math.min(...t)],o=[Math.max(...e),Math.max(...t)];return{startPoint:s,endPoint:o,landmarks:A}}var Q5=A=>({startEndTensor:A,startPoint:r.slice(A,[0,0],[-1,2]),endPoint:r.slice(A,[0,2],[-1,2])});var M0=[[1,0,0],[0,1,0],[0,0,1]];function e2(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function D0(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return e2(t)}function _5(A,e){return[[1,0,A],[0,1,e],[0,0,1]]}function K(A,e){let t=0;for(let s=0;s{let u=e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),p=this.model.predict(u),z;if(Array.isArray(p)){let v=p.sort((h,T)=>h.size-T.size),R=r.concat([v[0],v[2]],2),S=r.concat([v[1],v[3]],2);z=r.concat([S,R],1).squeeze(0)}else z=p.squeeze();let c=n2(z,this.anchors,[this.inputSize,this.inputSize]),f=r.slice(z,[0,0],[-1,1]),M=r.sigmoid(f).squeeze();return[z,c,M]}),i=await r.image.nonMaxSuppressionAsync(s,o,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),n=i.arraySync();i.dispose();let x=n.map(y=>r.slice(s,[y,0],[1,-1])).map(y=>{let u=y.arraySync();return y.dispose(),u}),l=o.dataSync(),d=[];for(let y=0;ythis.config.face.detector.minConfidence){let z=Q5(x[y]),c=this.anchorsData[u],f=r.tidy(()=>r.slice(t,[u,nA-1],[1,-1]).squeeze().reshape([nA,-1]));d.push({box:z,landmarks:f,anchor:c,confidence:p})}}return t.dispose(),s.dispose(),o.dispose(),{boxes:d,scaleFactor:[e.shape[2]/this.inputSize,e.shape[1]/this.inputSize]}}};async function sA(A){let e=await r.loadGraphModel(L(A.modelBasePath,A.face.detector.modelPath),{fromTFHub:A.face.detector.modelPath.includes("tfhub.dev")}),t=new oA(e,A);return!e||!e.modelUrl?b("load model failed:",A.face.detector.modelPath):A.debug&&b("load model:",e.modelUrl),t}var J={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},G0=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],c0=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],t0=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];var o2=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],s2=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],i2=[33,133,362,263,1,78,308],_2=o2.map(A=>c0[A]),$2=s2.map(A=>c0[A]),Ae=i2.map(A=>c0[A]);var Q0=J.leftEyeLower0,_0=J.rightEyeLower0,a0={leftBounds:[Q0[0],Q0[Q0.length-1]],rightBounds:[_0[0],_0[_0.length-1]]},v0={count:468,mouth:13,symmetryLine:[13,J.midwayBetweenEyes[0]]},iA={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},x0={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function E0(A,e,t,s){for(let o=0;o[i[0]/this.meshSize*(y[0]-this.meshSize/2),i[1]/this.meshSize*(y[1]-this.meshSize/2),y[2]]),a=s!==0?z0(s,[0,0]):M0,x=s!==0?n.map(y=>[...eA(y,a),y[2]]):n,l=s!==0?AA(o):M0,d=[...i0({startPoint:t.startPoint,endPoint:t.endPoint}),1];return x.map(y=>[y[0]+K(d,l[0]),y[1]+K(d,l[1]),y[2]])}getLeftToRightEyeDepthDifference(e){let t=e[a0.leftBounds[0]][2],s=e[a0.rightBounds[0]][2];return t-s}getEyeBox(e,t,s,o,i=!1){let n=P0(T0(K0([e[s],e[o]]),this.irisEnlarge)),a=l0(n),x=r.image.cropAndResize(t,[[n.startPoint[1]/this.meshSize,n.startPoint[0]/this.meshSize,n.endPoint[1]/this.meshSize,n.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return i&&r.ENV.flags.IS_BROWSER&&(x=r.image.flipLeftRight(x)),{box:n,boxSize:a,crop:x}}getEyeCoords(e,t,s,o=!1){let i=[];for(let n=0;n{let l=n;return x===2?l=o:x===4&&(l=i),[a[0],a[1],l]})}async predict(e,t){let s=!1,o;if((this.skipped===0||this.skipped>t.face.detector.skipFrames||!t.face.mesh.enabled||!t.videoOptimized)&&(o=await this.boundingBoxDetector.getBoundingBoxes(e),this.skipped=0),t.videoOptimized&&this.skipped++,!t.videoOptimized||o&&o.boxes&&(!t.face.mesh.enabled||o.boxes.length!==this.detectedFaces&&this.detectedFaces!==t.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let n of o.boxes)this.storedBoxes.push({startPoint:n.box.startPoint.dataSync(),endPoint:n.box.endPoint.dataSync(),landmarks:n.landmarks,confidence:n.confidence});this.storedBoxes.length>0&&(s=!0)}if(t.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),s){if(!o||!o.boxes||o.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let n=0;n{n.box.startPoint.dispose(),n.box.endPoint.dispose(),n.landmarks.dispose()});let i=r.tidy(()=>this.storedBoxes.map((n,a)=>{let x=n.confidence,l,d=0,y;if(t.face.detector.rotation&&t.face.mesh.enabled&&r.ENV.flags.IS_BROWSER){let[g,h]=n.landmarks.length>=v0.count?v0.symmetryLine:iA.symmetryLine;d=D0(n.landmarks[g],n.landmarks[h]);let T=i0({startPoint:n.startPoint,endPoint:n.endPoint}),E=[T[0]/e.shape[2],T[1]/e.shape[1]],j=r.image.rotateWithOffset(e,d,0,E);y=z0(-d,T),t.face.mesh.enabled?l=r0({startPoint:n.startPoint,endPoint:n.endPoint},j,[this.meshSize,this.meshSize]).div(255):l=r0({startPoint:n.startPoint,endPoint:n.endPoint},j,[this.boxSize,this.boxSize]).div(255)}else{y=M0;let g=e.clone();t.face.mesh.enabled?l=r0({startPoint:n.startPoint,endPoint:n.endPoint},g,[this.meshSize,this.meshSize]).div(255):l=r0({startPoint:n.startPoint,endPoint:n.endPoint},g,[this.boxSize,this.boxSize]).div(255)}if(!t.face.mesh.enabled)return{coords:null,box:n,faceConfidence:null,boxConfidence:x,confidence:n.confidence,image:l};let[,u,p]=this.meshDetector.predict(l),z=u.dataSync()[0];if(z=v0.count?v0.symmetryLine:iA.symmetryLine;d=D0(n.landmarks[g],n.landmarks[h]);let T=i0({startPoint:n.startPoint,endPoint:n.endPoint}),E=[T[0]/e.shape[2],T[1]/e.shape[1]],j=r.image.rotateWithOffset(e.toFloat(),d,0,E);y=z0(-d,T),l=r0({startPoint:n.startPoint,endPoint:n.endPoint},j,[this.meshSize,this.meshSize]).div(255)}let R={coords:v,box:n,faceConfidence:z,boxConfidence:x,image:l,rawCoords:f},S=P0(n);return this.storedBoxes[a]={...S,landmarks:M,confidence:n.confidence,faceConfidence:z},R}));return i=i.filter(n=>n!==null),t.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(n=>n.faceConfidence>t.face.detector.minConfidence)),this.detectedFaces=i.length,i}};var O=[null,null,null],e5;async function t5(A,e){let t=await e5.predict(A,e),s=[];for(let o of t||[]){if(o.isDisposedInternal)continue;let i=o.coords?o.coords.arraySync():[],n=i.map(d=>[d[0]/A.shape[2],d[1]/A.shape[1],d[2]/e5.meshSize]),a={};if(i&&i.length>0)for(let d of Object.keys(J))a[d]=J[d].map(y=>i[y]);let x=o.box?[Math.max(0,o.box.startPoint[0]),Math.max(0,o.box.startPoint[1]),Math.min(A.shape[2],o.box.endPoint[0])-Math.max(0,o.box.startPoint[0]),Math.min(A.shape[1],o.box.endPoint[1])-Math.max(0,o.box.startPoint[1])]:0,l=o.box?[o.box.startPoint[0]/A.shape[2],o.box.startPoint[1]/A.shape[1],(o.box.endPoint[0]-o.box.startPoint[0])/A.shape[2],(o.box.endPoint[1]-o.box.startPoint[1])/A.shape[1]]:[];s.push({confidence:Math.round(100*o.faceConfidence||100*o.boxConfidence||0)/100,boxConfidence:Math.round(100*o.boxConfidence)/100,faceConfidence:Math.round(100*o.faceConfidence)/100,box:x,boxRaw:l,mesh:i,meshRaw:n,annotations:a,image:o.image?o.image.clone():null}),o.coords&&o.coords.dispose(),o.image&&o.image.dispose()}return s}async function n5(A){return!O[0]&&A.face.enabled||!O[1]&&A.face.mesh.enabled||!O[2]&&A.face.iris.enabled?(O=await Promise.all([!O[0]&&A.face.enabled?sA(A):null,!O[1]&&A.face.mesh.enabled?r.loadGraphModel(L(A.modelBasePath,A.face.mesh.modelPath),{fromTFHub:A.face.mesh.modelPath.includes("tfhub.dev")}):null,!O[2]&&A.face.iris.enabled?r.loadGraphModel(L(A.modelBasePath,A.face.iris.modelPath),{fromTFHub:A.face.iris.modelPath.includes("tfhub.dev")}):null]),A.face.mesh.enabled&&(!O[1]||!O[1].modelUrl?b("load model failed:",A.face.mesh.modelPath):A.debug&&b("load model:",O[1].modelUrl)),A.face.iris.enabled&&(!O[2]||!O[1].modelUrl?b("load model failed:",A.face.iris.modelPath):A.debug&&b("load model:",O[2].modelUrl))):A.debug&&(b("cached model:",O[0].model.modelUrl),b("cached model:",O[1].modelUrl),b("cached model:",O[2].modelUrl)),e5=new $0(O[0],O[1],O[2]),O}var rA=t0,aA=c0;var o5={};Y(o5,{load:()=>r5,predict:()=>j0});var r2=["angry","disgust","fear","happy","sad","surprise","neutral"],U,s5=[],R0=Number.MAX_SAFE_INTEGER,i5=[.2989,.587,.114];async function r5(A){return U?A.debug&&b("cached model:",U.modelUrl):(U=await r.loadGraphModel(L(A.modelBasePath,A.face.emotion.modelPath)),!U||!U.modelUrl?b("load model failed:",A.face.emotion.modelPath):A.debug&&b("load model:",U.modelUrl)),U}async function j0(A,e){return U?R00?(R0++,s5):(e.videoOptimized?R0=0:R0=Number.MAX_SAFE_INTEGER,new Promise(async t=>{let s=r.image.resizeBilinear(A,[U.inputs[0].shape[2],U.inputs[0].shape[1]],!1),[o,i,n]=r.split(s,3,3);s.dispose();let a=r.mul(o,i5[0]),x=r.mul(i,i5[1]),l=r.mul(n,i5[2]);o.dispose(),i.dispose(),n.dispose();let d=r.addN([a,x,l]);a.dispose(),x.dispose(),l.dispose();let y=r.tidy(()=>d.sub(.5).mul(2));d.dispose();let u=[];if(e.face.emotion.enabled){let p=await U.predict(y),z=p.dataSync();r.dispose(p);for(let c=0;ce.face.emotion.minConfidence&&u.push({score:Math.min(.99,Math.trunc(100*z[c])/100),emotion:r2[c]});u.sort((c,f)=>f.score-c.score)}y.dispose(),s5=u,t(u)})):null}var a5={};Y(a5,{enhance:()=>l5,load:()=>x5,match:()=>xA,predict:()=>w0,similarity:()=>y5});var q,S0={age:0},W0=Number.MAX_SAFE_INTEGER;async function x5(A){return q?A.debug&&b("cached model:",q.modelUrl):(q=await r.loadGraphModel(L(A.modelBasePath,A.face.description.modelPath)),!q||!q.modelUrl?b("load model failed:",A.face.description.modelPath):A.debug&&b("load model:",q.modelUrl)),q}function y5(A,e,t=2){if(!A||!e||(A==null?void 0:A.length)===0||(e==null?void 0:e.length)===0||(A==null?void 0:A.length)!==(e==null?void 0:e.length))return 0;let s=5*A.map((i,n)=>Math.abs(A[n]-e[n])**t).reduce((i,n)=>i+n,0)**(1/t);return Math.max(0,100-s)/100}function xA(A,e,t=0){let s={similarity:0,name:"",source:"",embedding:[]};if(!A||!e||!Array.isArray(A)||!Array.isArray(e))return s;for(let o of e)if(o.embedding&&o.name){let i=y5(A,o.embedding);i>t&&i>s.similarity&&(s={...o,similarity:i})}return s}function l5(A){return r.tidy(()=>{let t=A.image||A.tensor||A;if(!(t instanceof r.Tensor))return null;let s=[[.05,.15,.85,.85]];return(t.shape.length===3?r.image.cropAndResize(r.expandDims(t,0),s,[0],[q.inputs[0].shape[2],q.inputs[0].shape[1]]):r.image.cropAndResize(t,s,[0],[q.inputs[0].shape[2],q.inputs[0].shape[1]])).mul(255)})}async function w0(A,e){return q?W00?(W0++,S0):(e.videoOptimized?W0=0:W0=Number.MAX_SAFE_INTEGER,new Promise(async t=>{let s=l5(A),o,i={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};e.face.description.enabled&&(o=await q.predict(s)),r.dispose(s),o&&(r.tidy(()=>{let n=o.find(y=>y.shape[1]===1).dataSync(),a=Math.trunc(200*Math.abs(n[0]-.5))/100;a>e.face.description.minConfidence&&(i.gender=n[0]<=.5?"female":"male",i.genderConfidence=Math.min(.99,a));let x=o.find(y=>y.shape[1]===100).argMax(1).dataSync()[0],l=o.find(y=>y.shape[1]===100).dataSync();i.age=Math.round(l[x-1]>l[x+1]?10*x-100*l[x-1]:10*x+100*l[x+1])/10;let d=o.find(y=>y.shape[1]===1024);i.descriptor=[...d.dataSync()]}),o.forEach(n=>r.dispose(n))),S0=i,t(i)})):null}var a2=(A,e)=>{let t=f=>f*180/Math.PI,s=f=>{let M=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=M,f[1]/=M,f[2]/=M,f},o=(f,M)=>{let v=f[0]-M[0],R=f[1]-M[1],S=f[2]-M[2];return[v,R,S]},i=(f,M)=>{let v=f[1]*M[2]-f[2]*M[1],R=f[2]*M[0]-f[0]*M[2],S=f[0]*M[1]-f[1]*M[0];return[v,R,S]},n=f=>{let[M,v,R,S,g,h,T,E,j]=f,k,$,Z;return S<1?S>-1?(Z=Math.asin(S),$=Math.atan2(-T,M),k=Math.atan2(-h,g)):(Z=-Math.PI/2,$=-Math.atan2(E,j),k=0):(Z=Math.PI/2,$=Math.atan2(E,j),k=0),{pitch:2*-k,yaw:2*-$,roll:2*-Z}},a=f=>{let M=(R,S,g,h)=>Math.atan2(h-S,g-R);return{pitch:M(f[10][1],f[10][2],f[152][1],f[152][2]),yaw:M(f[33][0],f[33][2],f[263][0],f[263][2]),roll:M(f[33][0],f[33][1],f[263][0],f[263][1])}},x=A.meshRaw;if(!x||x.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let l=Math.max(A.boxRaw[2]*e[0],A.boxRaw[3]*e[1])/1.5,d=[x[10],x[152],x[234],x[454]].map(f=>[f[0]*e[0]/l,f[1]*e[1]/l,f[2]]),y=s(o(d[1],d[0])),u=s(o(d[3],d[2])),p=s(i(u,y));u=i(y,p);let z=[u[0],u[1],u[2],y[0],y[1],y[2],p[0],p[1],p[2]];return{angle:n(z),matrix:z}},c5=async(A,e)=>{var d,y,u,p,z,c;let t,s,o,i,n,a,x=[];A.state="run:face",t=W();let l=await t5(e,A.config);if(A.perf.face=Math.trunc(W()-t),!l)return[];for(let f of l){if(A.analyze("Get Face"),!f.image||f.image.isDisposedInternal){b("Face object is disposed:",f.image);continue}let M=a2(f,[e.shape[2],e.shape[1]]);A.analyze("Start Emotion:"),A.config.async?i=A.config.face.emotion.enabled?j0(f.image,A.config):{}:(A.state="run:emotion",t=W(),i=A.config.face.emotion.enabled?await j0(f.image,A.config):{},A.perf.emotion=Math.trunc(W()-t)),A.analyze("End Emotion:"),A.analyze("Start Description:"),A.config.async?a=A.config.face.description.enabled?w0(f,A.config):[]:(A.state="run:description",t=W(),a=A.config.face.description.enabled?await w0(f.image,A.config):[],A.perf.embedding=Math.trunc(W()-t)),A.analyze("End Description:"),A.config.async&&([s,o,i,n,a]=await Promise.all([s,o,i,n,a])),A.analyze("Finish Face:"),!A.config.face.iris.enabled&&((d=f==null?void 0:f.annotations)==null?void 0:d.leftEyeIris)&&((y=f==null?void 0:f.annotations)==null?void 0:y.rightEyeIris)&&(delete f.annotations.leftEyeIris,delete f.annotations.rightEyeIris);let v=((u=f.annotations)==null?void 0:u.leftEyeIris)&&((p=f.annotations)==null?void 0:p.rightEyeIris)?11.7*Math.max(Math.abs(f.annotations.leftEyeIris[3][0]-f.annotations.leftEyeIris[1][0]),Math.abs(f.annotations.rightEyeIris[4][1]-f.annotations.rightEyeIris[2][1])):0;x.push({...f,age:a.age,gender:a.gender,genderConfidence:a.genderConfidence,embedding:a.descriptor,emotion:i,iris:v!==0?Math.trunc(v)/100:0,rotation:M,tensor:A.config.face.detector.return?(z=f.image)==null?void 0:z.squeeze():null}),(c=f.image)==null||c.dispose(),A.analyze("End Face")}return A.analyze("End FaceMesh:"),A.config.async&&(A.perf.face&&delete A.perf.face,A.perf.age&&delete A.perf.age,A.perf.gender&&delete A.perf.gender,A.perf.emotion&&delete A.perf.emotion),x};var p5={};Y(p5,{load:()=>g5,predict:()=>b5});var d0=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],yA=d0.length,f0=d0.reduce((A,e,t)=>(A[e]=t,A),{}),x2=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],y2=x2.map(([A,e])=>[f0[A],f0[e]]),lA=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function cA(A){let e=A.reduce(({maxX:t,maxY:s,minX:o,minY:i},{position:{x:n,y:a}})=>({maxX:Math.max(t,n),maxY:Math.max(s,a),minX:Math.min(o,n),minY:Math.min(i,a)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY]}function dA(A,[e,t],[s,o]){let i=(a,x,l)=>({score:a.score,box:[Math.trunc(a.box[0]*l),Math.trunc(a.box[1]*x),Math.trunc(a.box[2]*l),Math.trunc(a.box[3]*x)],keypoints:a.keypoints.map(({score:d,part:y,position:u})=>({score:d,part:y,position:{x:Math.trunc(u.x*l),y:Math.trunc(u.y*x)}}))});return A.map(a=>i(a,e/s,t/o))}var d5=class{constructor(e,t){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=t}enqueue(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)}dequeue(){let e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(e){for(;e>0&&this.less(Math.floor(e/2),e);)this.exchange(e,Math.floor(e/2)),e=Math.floor(e/2)}sink(e){for(;2*e<=this.numberOfElements;){let t=2*e;if(tt?t:A}function fA(A,e,t,s){let o=t-A,i=s-e;return o*o+i*i}function u5(A,e){return{x:A.x+e.x,y:A.y+e.y}}var I0=1,mA=16,l2=20**2;function hA(A,e,t,s,o,i,n,a=2){let x=v=>({y:n.get(v.y,v.x,A),x:n.get(v.y,v.x,n.shape[2]/2+A)}),l=(v,R,S)=>({y:h5(Math.round(v.y/i),0,R-1),x:h5(Math.round(v.x/i),0,S-1)}),[d,y]=s.shape,u=l(e.position,d,y),p=x(u),c=u5(e.position,p);for(let v=0;v[f0[c],f0[f]]),a=n.map(([,c])=>c),x=n.map(([c])=>c),l=e.shape[2],d=a.length,y=new Array(l),{part:u,score:p}=A,z=m5(u,s,t);y[u.id]={score:p,part:d0[u.id],position:z};for(let c=d-1;c>=0;--c){let f=a[c],M=x[c];y[f]&&!y[M]&&(y[M]=hA(c,y[f],M,e,t,s,i))}for(let c=0;ce){a=!1;break}if(!a)break}return a}function f2(A,e){let[t,s,o]=e.shape,i=new d5(t*s*o,({score:n})=>n);for(let n=0;n{let i=o[s].position;return fA(t,e,i.y,i.x)<=l2})}function m2(A,e){return e.reduce((s,{position:o,score:i},n)=>(uA(A,o,n)||(s+=i),s),0)/e.length}function pA(A,e,t,s,o,i){let n=[],a=f2(i,e);for(;n.lengthz.score>i),u=m2(n,y),p=cA(y);u>i&&n.push({keypoints:y,box:p,score:Math.round(100*u)/100})}return n}var B,h2=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function b5(A,e){let t=r.tidy(()=>{let a=A.resizeBilinear([B.inputs[0].shape[2],B.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),l=B.execute(a,h2).map(d=>d.squeeze([0]));return l[1]=l[1].sigmoid(),l}),s=await Promise.all(t.map(n=>n.buffer()));for(let n of t)n.dispose();let o=await pA(s[0],s[1],s[2],s[3],e.body.maxDetected,e.body.minConfidence);return dA(o,[A.shape[1],A.shape[2]],[B.inputs[0].shape[2],B.inputs[0].shape[1]])}async function g5(A){return B?A.debug&&b("cached model:",B.modelUrl):(B=await r.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),!B||!B.modelUrl?b("load model failed:",A.body.modelPath):A.debug&&b("load model:",B.modelUrl)),B}var v5={};Y(v5,{load:()=>R5,predict:()=>E5});function N0(A){return[Math.abs(A.endPoint[0]-A.startPoint[0]),Math.abs(A.endPoint[1]-A.startPoint[1])]}function m0(A){return[A.startPoint[0]+(A.endPoint[0]-A.startPoint[0])/2,A.startPoint[1]+(A.endPoint[1]-A.startPoint[1])/2]}function bA(A,e,t){let s=e.shape[1],o=e.shape[2],i=[[A.startPoint[1]/s,A.startPoint[0]/o,A.endPoint[1]/s,A.endPoint[0]/o]];return r.image.cropAndResize(e,i,[0],t)}function gA(A,e){let t=[A.startPoint[0]*e[0],A.startPoint[1]*e[1]],s=[A.endPoint[0]*e[0],A.endPoint[1]*e[1]],o=A.palmLandmarks.map(i=>[i[0]*e[0],i[1]*e[1]]);return{startPoint:t,endPoint:s,palmLandmarks:o,confidence:A.confidence}}function k0(A,e=1.5){let t=m0(A),s=N0(A),o=[e*s[0]/2,e*s[1]/2],i=[t[0]-o[0],t[1]-o[1]],n=[t[0]+o[0],t[1]+o[1]];return{startPoint:i,endPoint:n,palmLandmarks:A.palmLandmarks}}function O0(A){let e=m0(A),t=N0(A),o=Math.max(...t)/2,i=[e[0]-o,e[1]-o],n=[e[0]+o,e[1]+o];return{startPoint:i,endPoint:n,palmLandmarks:A.palmLandmarks}}var TA=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var T5=class{constructor(e){var t;this.model=e,this.anchors=TA.map(s=>[s.x,s.y]),this.anchorsTensor=r.tensor2d(this.anchors),this.inputSize=(t=this.model)==null?void 0:t.inputs[0].shape[2],this.inputSizeTensor=r.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=r.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(e){return r.tidy(()=>{let t=r.slice(e,[0,0],[-1,2]),s=r.slice(e,[0,2],[-1,2]),o=r.add(r.div(t,this.inputSizeTensor),this.anchorsTensor),i=r.div(s,this.doubleInputSizeTensor),n=r.mul(r.sub(o,i),this.inputSizeTensor),a=r.mul(r.add(o,i),this.inputSizeTensor);return r.concat2d([n,a],1)})}normalizeLandmarks(e,t){return r.tidy(()=>{let s=r.add(r.div(e.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[t]);return r.mul(s,this.inputSizeTensor)})}async getBoxes(e,t){let s=this.model.predict(e),o=s.squeeze();s.dispose();let i=r.tidy(()=>r.sigmoid(r.slice(o,[0,0],[-1,1])).squeeze()),n=i.dataSync(),a=r.slice(o,[0,1],[-1,4]),x=this.normalizeBoxes(a);a.dispose();let l=await r.image.nonMaxSuppressionAsync(x,n,t.hand.maxDetected,t.hand.iouThreshold,t.hand.minConfidence),d=l.arraySync();i.dispose(),l.dispose();let y=[];for(let u of d)if(n[u]>=t.hand.minConfidence){let p=r.slice(x,[u,0],[1,-1]),z=r.slice(o,[u,5],[1,14]),c=r.tidy(()=>this.normalizeLandmarks(z,u).reshape([-1,2]));z.dispose(),y.push({box:p,palmLandmarks:c,confidence:n[u]})}return o.dispose(),x.dispose(),y}async estimateHandBounds(e,t){let s=e.shape[1],o=e.shape[2],i=r.tidy(()=>e.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),n=await this.getBoxes(i,t);i.dispose();let a=[];if(!n||n.length===0)return a;for(let x of n){let l=x.box.dataSync(),d=l.slice(0,2),y=l.slice(2,4),u=x.palmLandmarks.arraySync();x.box.dispose(),x.palmLandmarks.dispose(),a.push(gA({startPoint:d,endPoint:y,palmLandmarks:u,confidence:x.confidence},[o/this.inputSize,s/this.inputSize]))}return a}};function u2(A){return A-2*Math.PI*Math.floor((A+Math.PI)/(2*Math.PI))}function PA(A,e){let t=Math.PI/2-Math.atan2(-(e[1]-A[1]),e[0]-A[0]);return u2(t)}var MA=(A,e)=>[[1,0,A],[0,1,e],[0,0,1]];function D(A,e){let t=0;for(let s=0;sM5([...i,1],t)),o=this.calculateLandmarksBoundingBox(s);return k0(O0(o),b2)}getBoxForHandLandmarks(e){let t=this.calculateLandmarksBoundingBox(e),s=k0(O0(t),EA);s.palmLandmarks=[];for(let o=0;o[n[0]*(p[0]-this.inputSize/2),n[1]*(p[1]-this.inputSize/2),n[2]*p[2]]),x=P5(s,[0,0]),l=a.map(p=>[...M5(p,x),p[2]]),d=vA(o),y=[...m0(t),1],u=[D(y,d[0]),D(y,d[1])];return l.map(p=>[p[0]+u[0],p[1]+u[1],p[2]])}async estimateHands(e,t){let s=!1,o;(this.skipped===0||this.skipped>t.hand.skipFrames||!t.hand.landmarks||!t.videoOptimized)&&(o=await this.handDetector.estimateHandBounds(e,t),this.skipped=0),t.videoOptimized&&this.skipped++,o&&o.length>0&&(o.length!==this.detectedHands&&this.detectedHands!==t.hand.maxDetected||!t.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...o],this.storedBoxes.length>0&&(s=!0));let i=[];t.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let n=0;n=t.hand.minConfidence){let R=r.reshape(M,[-1,3]),S=R.arraySync();M.dispose(),R.dispose();let g=this.transformRawCoords(S,p,x,u),h=this.getBoxForHandLandmarks(g);this.storedBoxes[n]=h;let T={landmarks:g,confidence:v,box:{topLeft:h.startPoint,bottomRight:h.endPoint}};i.push(T)}else this.storedBoxes[n]=null;M.dispose()}else{let x=k0(O0(a),EA),l={confidence:a.confidence,box:{topLeft:x.startPoint,bottomRight:x.endPoint}};i.push(l)}}return this.storedBoxes=this.storedBoxes.filter(n=>n!==null),this.detectedHands=i.length,i}calculateLandmarksBoundingBox(e){let t=e.map(n=>n[0]),s=e.map(n=>n[1]),o=[Math.min(...t),Math.min(...s)],i=[Math.max(...t),Math.max(...s)];return{startPoint:o,endPoint:i}}};var jA={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},G,Q,SA;async function E5(A,e){let t=await SA.estimateHands(A,e);if(!t)return[];let s=[];for(let o of t){let i={};if(o.landmarks)for(let x of Object.keys(jA))i[x]=jA[x].map(l=>o.landmarks[l]);let n=o.box?[Math.max(0,o.box.topLeft[0]),Math.max(0,o.box.topLeft[1]),Math.min(A.shape[2],o.box.bottomRight[0])-Math.max(0,o.box.topLeft[0]),Math.min(A.shape[1],o.box.bottomRight[1])-Math.max(0,o.box.topLeft[1])]:[],a=[o.box.topLeft[0]/A.shape[2],o.box.topLeft[1]/A.shape[1],(o.box.bottomRight[0]-o.box.topLeft[0])/A.shape[2],(o.box.bottomRight[1]-o.box.topLeft[1])/A.shape[1]];s.push({confidence:Math.round(100*o.confidence)/100,box:n,boxRaw:a,landmarks:o.landmarks,annotations:i})}return s}async function R5(A){!G||!Q?([G,Q]=await Promise.all([A.hand.enabled?r.loadGraphModel(L(A.modelBasePath,A.hand.detector.modelPath),{fromTFHub:A.hand.detector.modelPath.includes("tfhub.dev")}):null,A.hand.landmarks?r.loadGraphModel(L(A.modelBasePath,A.hand.skeleton.modelPath),{fromTFHub:A.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),A.hand.enabled&&(!G||!G.modelUrl?b("load model failed:",A.hand.detector.modelPath):A.debug&&b("load model:",G.modelUrl),!Q||!Q.modelUrl?b("load model failed:",A.hand.skeleton.modelPath):A.debug&&b("load model:",Q.modelUrl))):(A.debug&&b("cached model:",G.modelUrl),A.debug&&b("cached model:",Q.modelUrl));let e=new T5(G);return SA=new z5(e,Q),[G,Q]}var j5={};Y(j5,{load:()=>S5,predict:()=>W5});var WA=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],wA=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var V;async function S5(A){return V?A.debug&&b("cached model:",V.modelUrl):(V=await r.loadGraphModel(L(A.modelBasePath,A.body.modelPath)),V.width=parseInt(V.signature.inputs["input_1:0"].tensorShape.dim[2].size),V.height=parseInt(V.signature.inputs["input_1:0"].tensorShape.dim[1].size),!V||!V.modelUrl?b("load model failed:",A.body.modelPath):A.debug&&b("load model:",V.modelUrl)),V}async function W5(A,e){if(!V||!e.body.enabled)return null;let t={width:A.shape[2],height:A.shape[1]},s=r.image.resizeBilinear(A,[V.width,V.height],!1),o=r.div(s,[255]);s.dispose();let i=await V.predict(o),n=i.find(y=>y.size===195||y.size===155).dataSync();i.forEach(y=>y.dispose()),o.dispose();let a=[],x=n.length===195?WA:wA,l=5;for(let y=0;yu.score>y?u.score:y,0),keypoints:a}]}var w5={};Y(w5,{load:()=>N5,predict:()=>k5});var L0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var H,I5=[],Z0=Number.MAX_SAFE_INTEGER,V0=2.5;async function N5(A){if(H)A.debug&&b("cached model:",H.modelUrl);else{H=await r.loadGraphModel(L(A.modelBasePath,A.object.modelPath));let e=Object.values(H.modelSignature.inputs);if(H.inputSize=Array.isArray(e)?parseInt(e[0].tensorShape.dim[2].size):null,!H.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${A.object.modelPath}`);!H||!H.modelUrl?b("load model failed:",A.object.modelPath):A.debug&&b("load model:",H.modelUrl)}return H}async function P2(A,e,t,s){let o=0,i=[];for(let l of[1,2,4])r.tidy(()=>{var f,M;let d=l*13,y=(f=A.find(v=>v.shape[1]===d**2&&v.shape[2]===L0.length))==null?void 0:f.squeeze(),u=(M=A.find(v=>v.shape[1]===d**2&&v.shape[2]s.object.minConfidence&&R!==61){let g=(.5+Math.trunc(v%d))/d,h=(.5+Math.trunc(v/d))/d,T=z[v].map(A0=>A0*(d/l/e)),[E,j]=[g-V0/l*T[0],h-V0/l*T[1]],[k,$]=[g+V0/l*T[2]-E,h+V0/l*T[3]-j],Z=[E,j,k,$];Z=Z.map(A0=>Math.max(0,Math.min(A0,1)));let J0=[Z[0]*t[0],Z[1]*t[1],Z[2]*t[0],Z[3]*t[1]],g0={id:o++,strideSize:l,score:Math.round(100*S)/100,class:R+1,label:L0[R].label,center:[Math.trunc(t[0]*g),Math.trunc(t[1]*h)],centerRaw:[g,h],box:J0.map(A0=>Math.trunc(A0)),boxRaw:Z};i.push(g0)}}});A.forEach(l=>r.dispose(l));let n=i.map(l=>l.boxRaw),a=i.map(l=>l.score),x=[];if(n&&n.length>0){let l=await r.image.nonMaxSuppressionAsync(n,a,s.object.maxDetected,s.object.iouThreshold,s.object.minConfidence);x=l.dataSync(),r.dispose(l)}return i=i.filter((l,d)=>x.includes(d)).sort((l,d)=>d.score-l.score),i}async function k5(A,e){return H?Z00?(Z0++,I5):(e.videoOptimized?Z0=0:Z0=Number.MAX_SAFE_INTEGER,new Promise(async t=>{let s=[A.shape[2],A.shape[1]],o=r.image.resizeBilinear(A,[H.inputSize,H.inputSize],!1),i=o.div(255),n=i.transpose([0,3,1,2]);i.dispose(),o.dispose();let a;e.object.enabled&&(a=await H.predict(n)),n.dispose();let x=await P2(a,H.inputSize,s,e);I5=x,t(x)})):null}var IA=A=>{if(!A)return[];let e=[];for(let t=0;tx.part==="leftWrist"),o=A[t].keypoints.find(x=>x.part==="rightWrist"),i=A[t].keypoints.find(x=>x.part==="nose");i&&s&&o&&s.position.yx.part==="leftShoulder"),a=A[t].keypoints.find(x=>x.part==="rightShoulder");n&&a&&e.push({body:t,gesture:`leaning ${n.position.y>a.position.y?"left":"right"}`})}return e},NA=A=>{if(!A)return[];let e=[];for(let t=0;t0){let s=A[t].mesh[33][2]-A[t].mesh[263][2];Math.abs(s)<10?e.push({face:t,gesture:"facing center"}):e.push({face:t,gesture:`facing ${s<0?"left":"right"}`}),Math.abs(A[t].mesh[374][1]-A[t].mesh[386][1])/Math.abs(A[t].mesh[443][1]-A[t].mesh[450][1])<.2&&e.push({face:t,gesture:"blink left eye"}),Math.abs(A[t].mesh[145][1]-A[t].mesh[159][1])/Math.abs(A[t].mesh[223][1]-A[t].mesh[230][1])<.2&&e.push({face:t,gesture:"blink right eye"});let n=Math.min(100,500*Math.abs(A[t].mesh[13][1]-A[t].mesh[14][1])/Math.abs(A[t].mesh[10][1]-A[t].mesh[152][1]));n>10&&e.push({face:t,gesture:`mouth ${Math.trunc(n)}% open`});let a=A[t].mesh[152][2];Math.abs(a)>10&&e.push({face:t,gesture:`head ${a<0?"up":"down"}`})}return e},kA=A=>{if(!A)return[];let e=[];for(let t=0;t.033||y>.033)&&(l=!1),u>.033&&e.push({iris:t,gesture:"looking right"}),y>.033&&e.push({iris:t,gesture:"looking left"});let p=Math.abs(A[t].mesh[145][1]-A[t].annotations.rightEyeIris[0][1])/A[t].annotations.rightEyeIris[0][1],z=Math.abs(A[t].mesh[374][1]-A[t].annotations.leftEyeIris[0][1])/A[t].annotations.leftEyeIris[0][1];(z<.015||p<.015||z>.03||p>.03)&&(l=!1),(z<.015||p<.015)&&e.push({iris:t,gesture:"looking down"}),(z>.03||p>.03)&&e.push({iris:t,gesture:"looking up"}),l&&e.push({iris:t,gesture:"looking center"})}return e},OA=A=>{if(!A)return[];let e=[];for(let t=0;t0){let o=s.reduce((n,a)=>n.position[2]n.position[1]L5});function M2(A,e,t){let s=function(a,x,l){let d=new RegExp("\\b"+x+" \\w+ (\\w+)","ig");a.replace(d,(y,u)=>(l[u]=0,y))},o=function(a,x){let l=A.createShader(x);if(A.shaderSource(l,a),A.compileShader(l),!A.getShaderParameter(l,A.COMPILE_STATUS))throw new Error("Filter: GL compile failed",A.getShaderInfoLog(l));return l};this.uniform={},this.attribute={};let i=o(e,A.VERTEX_SHADER),n=o(t,A.FRAGMENT_SHADER);if(this.id=A.createProgram(),A.attachShader(this.id,i),A.attachShader(this.id,n),A.linkProgram(this.id),!A.getProgramParameter(this.id,A.LINK_STATUS))throw new Error("Filter: GL link failed",A.getProgramInfoLog(this.id));A.useProgram(this.id),s(e,"attribute",this.attribute);for(let a in this.attribute)this.attribute[a]=A.getAttribLocation(this.id,a);s(e,"uniform",this.uniform),s(t,"uniform",this.uniform);for(let a in this.uniform)this.uniform[a]=A.getUniformLocation(this.id,a)}function LA(A){A||(A={});let e=0,t=null,s=!1,o=-1,i=[null,null],n=[],a=-1,x=-1,l=null,d=null,y={},u=A.canvas||document.createElement("canvas"),p={},z={INTERMEDIATE:1},c=u.getContext("webgl");if(!c)throw new Error("Filter: getContext() failed");this.addFilter=function(g){let h=Array.prototype.slice.call(arguments,1),T=y[g];n.push({func:T,args:h})},this.reset=function(){n=[]};let f=function(g,h){if(!(g===a&&h===x)){if(u.width=g,a=g,u.height=h,x=h,!l){let T=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);l=c.createBuffer(),c.bindBuffer(c.ARRAY_BUFFER,l),c.bufferData(c.ARRAY_BUFFER,T,c.STATIC_DRAW),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}c.viewport(0,0,a,x),i=[null,null]}},M=function(g,h){let T=c.createFramebuffer();c.bindFramebuffer(c.FRAMEBUFFER,T);let E=c.createRenderbuffer();c.bindRenderbuffer(c.RENDERBUFFER,E);let j=c.createTexture();return c.bindTexture(c.TEXTURE_2D,j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,g,h,0,c.RGBA,c.UNSIGNED_BYTE,null),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,j,0),c.bindTexture(c.TEXTURE_2D,null),c.bindFramebuffer(c.FRAMEBUFFER,null),{fbo:T,texture:j}},v=function(g){return i[g]=i[g]||M(a,x),i[g]},R=function(g=null){var j,k;let h=null,T=null,E=!1;e===0?h=t:h=(j=v(o))==null?void 0:j.texture,e++,s&&!(g&z.INTERMEDIATE)?(T=null,E=e%2==0):(o=(o+1)%2,T=(k=v(o))==null?void 0:k.fbo),c.bindTexture(c.TEXTURE_2D,h),c.bindFramebuffer(c.FRAMEBUFFER,T),c.uniform1f(d.uniform.flipY,E?-1:1),c.drawArrays(c.TRIANGLES,0,6)};this.apply=function(g){if(f(g.width,g.height),e=0,t||(t=c.createTexture()),c.bindTexture(c.TEXTURE_2D,t),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,g),n.length===0)return R(),u;for(let h=0;h0,i=A.naturalHeight||A.videoHeight||A.height||A.shape&&A.shape[2]>0,n=o,a=i;if(n>H0&&(n=H0,a=n*i/o),a>H0&&(a=H0,n=a*o/i),e.filter.width>0?n=e.filter.width:e.filter.height>0&&(n=o*(e.filter.height/i)),e.filter.height>0?a=e.filter.height:e.filter.width>0&&(a=i*(e.filter.width/o)),!n||!a)throw new Error("Human: Input cannot determine dimension");(!P||(P==null?void 0:P.width)!==n||(P==null?void 0:P.height)!==a)&&(P=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,a):document.createElement("canvas"),(P==null?void 0:P.width)!==n&&(P.width=n),(P==null?void 0:P.height)!==a&&(P.height=a));let x=P.getContext("2d");if(A instanceof ImageData?x.putImageData(A,0,0):e.filter.flip&&typeof x.translate!="undefined"?(x.translate(o,0),x.scale(-1,1),x.drawImage(A,0,0,o,i,0,0,P==null?void 0:P.width,P==null?void 0:P.height),x.setTransform(1,0,0,1,0,0)):x.drawImage(A,0,0,o,i,0,0,P==null?void 0:P.width,P==null?void 0:P.height),e.filter.enabled){if((!N||!I||P.width!==I.width||(P==null?void 0:P.height)!==(I==null?void 0:I.height))&&(I=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(P==null?void 0:P.width,P==null?void 0:P.height):document.createElement("canvas"),(I==null?void 0:I.width)!==(P==null?void 0:P.width)&&(I.width=P==null?void 0:P.width),(I==null?void 0:I.height)!==(P==null?void 0:P.height)&&(I.height=P==null?void 0:P.height),N=r.ENV.flags.IS_BROWSER?new LA({canvas:I}):null),!N)return{tensor:null,canvas:P};N.reset(),N.addFilter("brightness",e.filter.brightness),e.filter.contrast!==0&&N.addFilter("contrast",e.filter.contrast),e.filter.sharpness!==0&&N.addFilter("sharpen",e.filter.sharpness),e.filter.blur!==0&&N.addFilter("blur",e.filter.blur),e.filter.saturation!==0&&N.addFilter("saturation",e.filter.saturation),e.filter.hue!==0&&N.addFilter("hue",e.filter.hue),e.filter.negative&&N.addFilter("negative"),e.filter.sepia&&N.addFilter("sepia"),e.filter.vintage&&N.addFilter("brownie"),e.filter.sepia&&N.addFilter("sepia"),e.filter.kodachrome&&N.addFilter("kodachrome"),e.filter.technicolor&&N.addFilter("technicolor"),e.filter.polaroid&&N.addFilter("polaroid"),e.filter.pixelate!==0&&N.addFilter("pixelate",e.filter.pixelate),N.apply(P)}else I=P,N&&(N=null);let l;if(I.data){let y=[I.height,I.width,3];l=r.tensor3d(I.data,y,"int32")}else if(I instanceof ImageData)l=r.browser.fromPixels(I);else if(e.backend==="webgl"||e.backend==="humangl"){let y=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,a):document.createElement("canvas");y.width=n,y.height=a;let u=y.getContext("2d");u==null||u.drawImage(I,0,0),l=r.browser.fromPixels(y)}else{let y=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(n,a):document.createElement("canvas");y.width=n,y.height=a;let u=y.getContext("2d");u==null||u.drawImage(I,0,0);let p=u==null?void 0:u.getImageData(0,0,n,a);l=r.browser.fromPixels(p)}let d=l.toFloat();t=d.expandDims(0),l.dispose(),d.dispose()}let s=e.filter.return?I:null;return{tensor:t,canvas:s}}var Z5={};Y(Z5,{all:()=>v2,body:()=>HA,canvas:()=>z2,face:()=>VA,gesture:()=>ZA,hand:()=>XA,object:()=>FA,options:()=>n0});var w={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var n0={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function X0(A,e,t,s=0,o){A.fillStyle=o.useDepth&&s?`rgba(${127.5+2*s}, ${127.5-2*s}, 255, 0.3)`:o.color,A.beginPath(),A.arc(e,t,o.pointSize,0,2*Math.PI),A.fill()}function o0(A,e,t,s,o,i){if(A.beginPath(),i.useCurves){let n=(e+e+s)/2,a=(t+t+o)/2;A.ellipse(n,a,s/2,o/2,0,0,2*Math.PI)}else A.lineWidth=i.lineWidth,A.moveTo(e+i.roundRect,t),A.lineTo(e+s-i.roundRect,t),A.quadraticCurveTo(e+s,t,e+s,t+i.roundRect),A.lineTo(e+s,t+o-i.roundRect),A.quadraticCurveTo(e+s,t+o,e+s-i.roundRect,t+o),A.lineTo(e+i.roundRect,t+o),A.quadraticCurveTo(e,t+o,e,t+o-i.roundRect),A.lineTo(e,t+i.roundRect),A.quadraticCurveTo(e,t,e+i.roundRect,t),A.closePath();A.stroke()}function V5(A,e=[],t){if(!(e===void 0||e.length===0)){A.beginPath(),A.moveTo(e[0][0],e[0][1]);for(let s of e)A.strokeStyle=t.useDepth&&s[2]?`rgba(${127.5+2*s[2]}, ${127.5-2*s[2]}, 255, 0.3)`:t.color,A.fillStyle=t.useDepth&&s[2]?`rgba(${127.5+2*s[2]}, ${127.5-2*s[2]}, 255, 0.3)`:t.color,A.lineTo(s[0],parseInt(s[1]));A.stroke(),t.fillPolygons&&(A.closePath(),A.fill())}}function h0(A,e=[],t){if(!(e===void 0||e.length===0)){if(!t.useCurves||e.length<=2){V5(A,e,t);return}A.moveTo(e[0][0],e[0][1]);for(let s=0;s1&&x[1].length>0){let l=a[1]>0?`#${a[1]}`:"",d=`${a[0]} ${l}: ${x[1]}`;s.shadowColor&&s.shadowColor!==""&&(o.fillStyle=s.shadowColor,o.fillText(d,8,2+i*s.lineHeight)),o.fillStyle=s.labelColor,o.fillText(d,6,0+i*s.lineHeight),i+=1}}}async function VA(A,e,t){let s=F(n0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let o=A.getContext("2d");if(!!o)for(let i of e){o.font=s.font,o.strokeStyle=s.color,o.fillStyle=s.color,s.drawBoxes&&(s.useRawBoxes?o0(o,A.width*i.boxRaw[0],A.height*i.boxRaw[1],A.width*i.boxRaw[2],A.height*i.boxRaw[3],s):o0(o,i.box[0],i.box[1],i.box[2],i.box[3],s));let n=[];if(n.push(`face confidence: ${Math.trunc(100*i.confidence)}%`),i.genderConfidence&&n.push(`${i.gender||""} ${Math.trunc(100*i.genderConfidence)}% confident`),i.age&&n.push(`age: ${i.age||""}`),i.iris&&n.push(`iris distance: ${i.iris}`),i.emotion&&i.emotion.length>0){let a=i.emotion.map(x=>`${Math.trunc(100*x.score)}% ${x.emotion}`);n.push(a.join(" "))}i.rotation&&i.rotation.angle&&i.rotation.angle.roll&&n.push(`roll: ${Math.trunc(100*i.rotation.angle.roll)/100} yaw:${Math.trunc(100*i.rotation.angle.yaw)/100} pitch:${Math.trunc(100*i.rotation.angle.pitch)/100}`),n.length===0&&n.push("face"),o.fillStyle=s.color;for(let a=n.length-1;a>=0;a--){let x=Math.max(i.box[0],0),l=a*s.lineHeight+i.box[1];s.shadowColor&&s.shadowColor!==""&&(o.fillStyle=s.shadowColor,o.fillText(n[a],x+5,l+16)),o.fillStyle=s.labelColor,o.fillText(n[a],x+4,l+15)}if(o.lineWidth=1,i.mesh&&i.mesh.length>0){if(s.drawPoints)for(let a of i.mesh)X0(o,a[0],a[1],a[2],s);if(s.drawPolygons){o.lineWidth=1;for(let a=0;ai.mesh[l]);V5(o,x,s)}if(i.annotations&&i.annotations.leftEyeIris){o.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,o.beginPath();let a=Math.abs(i.annotations.leftEyeIris[3][0]-i.annotations.leftEyeIris[1][0])/2,x=Math.abs(i.annotations.leftEyeIris[4][1]-i.annotations.leftEyeIris[2][1])/2;o.ellipse(i.annotations.leftEyeIris[0][0],i.annotations.leftEyeIris[0][1],a,x,0,0,2*Math.PI),o.stroke(),s.fillPolygons&&(o.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,o.fill())}if(i.annotations&&i.annotations.rightEyeIris){o.strokeStyle=s.useDepth?"rgba(255, 200, 255, 0.3)":s.color,o.beginPath();let a=Math.abs(i.annotations.rightEyeIris[3][0]-i.annotations.rightEyeIris[1][0])/2,x=Math.abs(i.annotations.rightEyeIris[4][1]-i.annotations.rightEyeIris[2][1])/2;o.ellipse(i.annotations.rightEyeIris[0][0],i.annotations.rightEyeIris[0][1],a,x,0,0,2*Math.PI),o.stroke(),s.fillPolygons&&(o.fillStyle=s.useDepth?"rgba(255, 255, 200, 0.3)":s.color,o.fill())}}}}}var _=[];async function HA(A,e,t){let s=F(n0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let o=A.getContext("2d");if(!!o){o.lineJoin="round";for(let i=0;ix.part==="leftShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),h0(o,a,s),a.length=0,n=e[i].keypoints.find(x=>x.part==="rightShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightHip"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftHip"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),a.length===4&&V5(o,a,s),a.length=0,n=e[i].keypoints.find(x=>x.part==="leftHip"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftKnee"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftAnkle"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftHeel"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftFoot"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),h0(o,a,s),a.length=0,n=e[i].keypoints.find(x=>x.part==="rightHip"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightKnee"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightAnkle"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightHeel"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightFoot"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),h0(o,a,s),a.length=0,n=e[i].keypoints.find(x=>x.part==="leftShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftElbow"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftWrist"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="leftPalm"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),h0(o,a,s),a.length=0,n=e[i].keypoints.find(x=>x.part==="rightShoulder"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightElbow"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightWrist"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),n=e[i].keypoints.find(x=>x.part==="rightPalm"),n&&n.score>w.body.minConfidence&&a.push([n.position.x,n.position.y]),h0(o,a,s)}}}}async function XA(A,e,t){let s=F(n0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let o=A.getContext("2d");if(!!o){o.lineJoin="round",o.font=s.font;for(let i of e){if(s.drawBoxes){o.strokeStyle=s.color,o.fillStyle=s.color;let n;if(!s.calculateHandBox)n=s.useRawBoxes?i.boxRaw:i.box;else if(n=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],i.landmarks&&i.landmarks.length>0){for(let a of i.landmarks)a[0]n[2]&&(n[2]=a[0]),a[1]>n[3]&&(n[3]=a[1]);n[2]-=n[0],n[3]-=n[1]}s.useRawBoxes?o0(o,A.width*n[0],A.height*n[1],A.width*n[2],A.height*n[3],s):o0(o,n[0],n[1],n[2],n[3],s),s.drawLabels&&(s.shadowColor&&s.shadowColor!==""&&(o.fillStyle=s.shadowColor,o.fillText("hand",n[0]+3,1+n[1]+s.lineHeight,n[2])),o.fillStyle=s.labelColor,o.fillText("hand",n[0]+2,0+n[1]+s.lineHeight,n[2])),o.stroke()}if(s.drawPoints&&i.landmarks&&i.landmarks.length>0)for(let n of i.landmarks)o.fillStyle=s.useDepth?`rgba(${127.5+2*n[2]}, ${127.5-2*n[2]}, 255, 0.5)`:s.color,X0(o,n[0],n[1],0,s);if(s.drawPolygons){let n=a=>{if(!!a)for(let x=0;x0?x-1:0][0],a[x>0?x-1:0][1]),o.lineTo(a[x][0],a[x][1]),o.stroke()};n(i.annotations.indexFinger),n(i.annotations.middleFinger),n(i.annotations.ringFinger),n(i.annotations.pinky),n(i.annotations.thumb)}}}}async function FA(A,e,t){let s=F(n0,t);if(!e||!A||!(A instanceof HTMLCanvasElement))return;let o=A.getContext("2d");if(!!o){o.lineJoin="round",o.font=s.font;for(let i of e)if(s.drawBoxes){if(o.strokeStyle=s.color,o.fillStyle=s.color,s.useRawBoxes?o0(o,A.width*i.boxRaw[0],A.height*i.boxRaw[1],A.width*i.boxRaw[2],A.height*i.boxRaw[3],s):o0(o,i.box[0],i.box[1],i.box[2],i.box[3],s),s.drawLabels){let n=`${Math.round(100*i.score)}% ${i.label}`;s.shadowColor&&s.shadowColor!==""&&(o.fillStyle=s.shadowColor,o.fillText(n,i.box[0]+3,1+i.box[1]+s.lineHeight,i.box[2])),o.fillStyle=s.labelColor,o.fillText(n,i.box[0]+2,0+i.box[1]+s.lineHeight,i.box[2])}o.stroke()}}}async function z2(A,e){if(!A||!e||!(A instanceof HTMLCanvasElement)||!(e instanceof HTMLCanvasElement))return;let t=A.getContext("2d");t==null||t.drawImage(A,0,0)}async function v2(A,e,t){let s=F(n0,t);!e||!A||A instanceof HTMLCanvasElement&&(VA(A,e.face,s),HA(A,e.body,s),XA(A,e.hand,s),ZA(A,e.gesture,s),FA(A,e.object,s))}var F0=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -163,7 +163,7 @@ PQ4GJ+ashuK0MhWaoWcA0AaOmASMK7jRNPWYBmHyiuepO2x10qfcv6vYxCzYqoGK4HVYVTJrmb5l c6oaM5TUJ8EgGsG4kLNUHT0M64OaqMMikSRsuKbnFMRLG3zVehOaGNE445NNlnVFpDMu6uie9Vo1 8z5mOAOST2pDK91cNN+5tsrH3PrW54a06KxT7fdrlh/q1Pc+tJ6IUdZGvHPLezMcnBOWbsPap5r3 ylFtbdT1xUWNWzU0/Zbwlgfmx8zGsHWtRHmMqE59aAMyNifvHPc1f0gtPdqkY5JosJHeNci2tktY -euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,Fe=` +euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,q0=` /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAsICAoIBwsKCQoNDAsNERwSEQ8PESIZGhQcKSQrKigk JyctMkA3LTA9MCcnOEw5PUNFSElIKzZPVU5GVEBHSEX/2wBDAQwNDREPESESEiFFLicuRUVFRUVF RUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUX/wAARCASwBLADASIA @@ -731,5 +731,5 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var L0="1.8.0";var ie,fe,me,ce,qe,ue,Ce,Be,Ue,Pt=class{constructor(e={}){ie.set(this,void 0);fe.set(this,void 0);me.set(this,void 0);ce.set(this,void 0);this.analyze=(...e)=>{if(!q(this,fe))return;let r=this.tf.engine().state.numTensors,A=q(this,ie);te(this,ie,r);let _=r-A;_!==0&&p(...e,_)};qe.set(this,e=>{if(!q(this,me))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof h.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(r){return"backend not loaded"}return null});ue.set(this,async(e=!1)=>{var r;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let A=j();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&p("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&p("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&p("wasm path:",this.config.wasmPath),typeof((r=this.tf)==null?void 0:r.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let _=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),c=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&p(`wasm execution: ${_?"SIMD":"no SIMD"} ${c?"multithreaded":"singlethreaded"}`),this.config.debug&&!_&&p("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&J1();try{await this.tf.setBackend(this.config.backend)}catch(_){p("error: cannot set backend:",this.config.backend,_)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(p("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let _=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&p(`gl version:${_.getParameter(_.VERSION)} renderer:${_.getParameter(_.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(j()-A)}});Ce.set(this,async()=>{let e=(_,c="application/octet-stream")=>fetch(`data:${c};base64,${_}`).then(n=>n.blob()),r,A;switch(this.config.warmup){case"face":r=await e(Xe);break;case"full":r=await e(Fe);break;default:r=null}if(r){let _=await createImageBitmap(r);A=await this.detect(_,this.config),_.close()}return A});Be.set(this,async()=>new Promise(e=>{let r,A=0;switch(this.config.warmup){case"face":A=256,r="data:image/jpeg;base64,"+Xe;break;case"full":case"body":A=1200,r="data:image/jpeg;base64,"+Fe;break;default:r=null}let _=new Image;_.onload=async()=>{let c=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(A,A):document.createElement("canvas");c.width=_.naturalWidth,c.height=_.naturalHeight;let n=c.getContext("2d");n==null||n.drawImage(_,0,0);let o=await this.detect(c,this.config);e(o)},r?_.src=r:e(null)}));Ue.set(this,async()=>{let e=_=>Buffer.from(_,"base64"),r;if(this.config.warmup==="face"&&(r=e(Xe)),(this.config.warmup==="body"||this.config.warmup==="full")&&(r=e(Fe)),!r)return null;let A;if(typeof h.node!="undefined"){let _=h.node.decodeJpeg(r),c=_.expandDims(0);this.tf.dispose(_),A=await this.detect(c,this.config),this.tf.dispose(c)}else this.config.debug&&p("Warmup tfjs-node not loaded");return A});this.tf=h,this.draw=O1,this.version=L0,this.config=X(S,e),this.state="idle",te(this,ie,0),te(this,fe,!1),te(this,me,!1),te(this,ce,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=r=>k1(r,this.config),this.classes={facemesh:o1,emotion:Je,faceres:Qe,body:this.config.body.modelPath.includes("posenet")?d1:z1,hand:T1,nanodet:j1},this.faceTriangulation=c0,this.faceUVMap=_0,this.sysinfo=F1()}similarity(e,r){return e1(e,r)}enhance(e){return t1(e)}match(e,r,A=0){return K1(e,r,A)}async load(e={}){this.state="load";let r=j();e&&(this.config=X(this.config,e)),q(this,ce)&&(this.config.debug&&p(`version: ${this.version}`),this.config.debug&&p(`tfjs version: ${this.tf.version_core}`),this.config.debug&&p("platform:",this.sysinfo.platform),this.config.debug&&p("agent:",this.sysinfo.agent),await q(this,ue).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&p("configuration:",this.config),this.config.debug&&p("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?i1(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?Ge(this.config):null),this.models.handpose||(this.config.hand.enabled?v1(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?m1(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?E1(this.config):null),this.models.nanodet||(this.config.object.enabled?W1(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?$e(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await i1(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await Ge(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await v1(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await m1(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await E1(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await W1(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await $e(this.config))),q(this,ce)&&(this.config.debug&&p("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),te(this,ce,!1));let A=Math.trunc(j()-r);A>(this.perf.load||0)&&(this.perf.load=A)}async detect(e,r={}){return new Promise(async A=>{var f,m;this.state="config";let _;this.config=X(this.config,r),this.state="check";let c=q(this,qe).call(this,e);c&&(p(c,e),A({error:c}));let n=j();await q(this,ue).call(this),await this.load();let o;e&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof Image!="undefined"&&e instanceof Image||typeof ImageData!="undefined"&&e instanceof ImageData||typeof ImageBitmap!="undefined"&&I1 instanceof ImageBitmap)&&(p("disabling video optimization"),o=this.config.videoOptimized,this.config.videoOptimized=!1),_=j();let s=k1(e,this.config);if(!s||!s.tensor){p("could not convert input to tensor"),A({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(j()-_),this.analyze("Get Image:");let a,y,i,d,u;this.config.async?(i=this.config.face.enabled?n1(this,s.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",_=j(),i=this.config.face.enabled?await n1(this,s.tensor):[],u=Math.trunc(j()-_),u>0&&(this.perf.face=u)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?a=this.config.body.enabled?f1(s.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(a=this.config.body.enabled?R1(s.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",_=j(),this.config.body.modelPath.includes("posenet")?a=this.config.body.enabled?await f1(s.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(a=this.config.body.enabled?await R1(s.tensor,this.config):[]),u=Math.trunc(j()-_),u>0&&(this.perf.body=u)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(y=this.config.hand.enabled?(f=this.models.handpose)==null?void 0:f.estimateHands(s.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",_=j(),y=this.config.hand.enabled?await((m=this.models.handpose)==null?void 0:m.estimateHands(s.tensor,this.config)):[],u=Math.trunc(j()-_),u>0&&(this.perf.hand=u)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(d=this.config.object.enabled?N1(s.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",_=j(),d=this.config.object.enabled?await N1(s.tensor,this.config):[],u=Math.trunc(j()-_),u>0&&(this.perf.object=u)),this.analyze("End Object:"),this.config.async&&([i,a,y,d]=await Promise.all([i,a,y,d])),h.dispose(s.tensor);let P=[];this.config.gesture.enabled&&(_=j(),P=[...E0(i),...z0(a),...j0(y),...R0(i)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(j()-_)),o&&(this.config.videoOptimized=o),this.perf.total=Math.trunc(j()-n),this.state="idle";let x={face:i,body:a,hand:y,gesture:P,object:d,performance:this.perf,canvas:s.canvas};A(x)})}async warmup(e={}){let r=j();if(e&&(this.config=X(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let A=this.config.videoOptimized;this.config.videoOptimized=!1;let _;typeof createImageBitmap=="function"?_=await q(this,Ce).call(this):typeof Image!="undefined"?_=await q(this,Be).call(this):_=await q(this,Ue).call(this),this.config.videoOptimized=A;let c=j();return this.config.debug&&p("Warmup",this.config.warmup,Math.round(c-r),"ms",_),_}};ie=new WeakMap,fe=new WeakMap,me=new WeakMap,ce=new WeakMap,qe=new WeakMap,ue=new WeakMap,Ce=new WeakMap,Be=new WeakMap,Ue=new WeakMap;export{Pt as Human,Pt as default}; +2Q==`;var qA="1.8.0";var y0,u0,p0,s0,C0,b0,B0,U0,Y0,R2=class{constructor(e={}){y0.set(this,void 0);u0.set(this,void 0);p0.set(this,void 0);s0.set(this,void 0);this.analyze=(...e)=>{if(!C(this,u0))return;let t=this.tf.engine().state.numTensors,s=C(this,y0);e0(this,y0,t);let o=t-s;o!==0&&b(...e,o)};C0.set(this,e=>{if(!C(this,p0))return null;if(!e)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(e instanceof r.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(t){return"backend not loaded"}return null});b0.set(this,async(e=!1)=>{var t;if(this.config.backend&&this.config.backend.length>0&&e||this.tf.getBackend()!==this.config.backend){let s=W();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&b("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&b("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&b("wasm path:",this.config.wasmPath),typeof((t=this.tf)==null?void 0:t.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let o=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),i=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&b(`wasm execution: ${o?"SIMD":"no SIMD"} ${i?"multithreaded":"singlethreaded"}`),this.config.debug&&!o&&b("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&D5();try{await this.tf.setBackend(this.config.backend)}catch(o){b("error: cannot set backend:",this.config.backend,o)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(b("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let o=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&b(`gl version:${o.getParameter(o.VERSION)} renderer:${o.getParameter(o.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(W()-s)}});B0.set(this,async()=>{let e=(o,i="application/octet-stream")=>fetch(`data:${i};base64,${o}`).then(n=>n.blob()),t,s;switch(this.config.warmup){case"face":t=await e(F0);break;case"full":t=await e(q0);break;default:t=null}if(t){let o=await createImageBitmap(t);s=await this.detect(o,this.config),o.close()}return s});U0.set(this,async()=>new Promise(e=>{let t,s=0;switch(this.config.warmup){case"face":s=256,t="data:image/jpeg;base64,"+F0;break;case"full":case"body":s=1200,t="data:image/jpeg;base64,"+q0;break;default:t=null}let o=new Image;o.onload=async()=>{let i=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(s,s):document.createElement("canvas");i.width=o.naturalWidth,i.height=o.naturalHeight;let n=i.getContext("2d");n==null||n.drawImage(o,0,0);let a=await this.detect(i,this.config);e(a)},t?o.src=t:e(null)}));Y0.set(this,async()=>{let e=o=>Buffer.from(o,"base64"),t;if(this.config.warmup==="face"&&(t=e(F0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(t=e(q0)),!t)return null;let s;if(typeof r.node!="undefined"){let o=r.node.decodeJpeg(t),i=o.expandDims(0);this.tf.dispose(o),s=await this.detect(i,this.config),this.tf.dispose(i)}else this.config.debug&&b("Warmup tfjs-node not loaded");return s});this.tf=r,this.draw=Z5,this.version=qA,this.config=F(w,e),this.state="idle",e0(this,y0,0),e0(this,u0,!1),e0(this,p0,!1),e0(this,s0,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=t=>L5(t,this.config),this.classes={facemesh:A5,emotion:o5,faceres:a5,body:this.config.body.modelPath.includes("posenet")?p5:j5,hand:v5,nanodet:w5},this.faceTriangulation=rA,this.faceUVMap=aA,this.sysinfo=C5()}similarity(e,t){return y5(e,t)}enhance(e){return l5(e)}match(e,t,s=0){return xA(e,t,s)}async load(e={}){this.state="load";let t=W();e&&(this.config=F(this.config,e)),C(this,s0)&&(this.config.debug&&b(`version: ${this.version}`),this.config.debug&&b(`tfjs version: ${this.tf.version_core}`),this.config.debug&&b("platform:",this.sysinfo.platform),this.config.debug&&b("agent:",this.sysinfo.agent),await C(this,b0).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&b("configuration:",this.config),this.config.debug&&b("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?n5(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?r5(this.config):null),this.models.handpose||(this.config.hand.enabled?R5(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?g5(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?S5(this.config):null),this.models.nanodet||(this.config.object.enabled?N5(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?x5(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await n5(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await r5(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await R5(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await g5(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await S5(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await N5(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await x5(this.config))),C(this,s0)&&(this.config.debug&&b("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),e0(this,s0,!1));let s=Math.trunc(W()-t);s>(this.perf.load||0)&&(this.perf.load=s)}async detect(e,t={}){return new Promise(async s=>{this.state="config";let o;this.config=F(this.config,t),this.state="check";let i=C(this,C0).call(this,e);i&&(b(i,e),s({error:i}));let n=W();await C(this,b0).call(this),await this.load();let a;e&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof Image!="undefined"&&e instanceof Image||typeof ImageData!="undefined"&&e instanceof ImageData||typeof ImageBitmap!="undefined"&&O5 instanceof ImageBitmap)&&(b("disabling video optimization"),a=this.config.videoOptimized,this.config.videoOptimized=!1),o=W();let x=L5(e,this.config);if(!x||!x.tensor){b("could not convert input to tensor"),s({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(W()-o),this.analyze("Get Image:");let l,d,y,u,p;this.config.async?(y=this.config.face.enabled?c5(this,x.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",o=W(),y=this.config.face.enabled?await c5(this,x.tensor):[],p=Math.trunc(W()-o),p>0&&(this.perf.face=p)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?b5(x.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?W5(x.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",o=W(),this.config.body.modelPath.includes("posenet")?l=this.config.body.enabled?await b5(x.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(l=this.config.body.enabled?await W5(x.tensor,this.config):[]),p=Math.trunc(W()-o),p>0&&(this.perf.body=p)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(d=this.config.hand.enabled?E5(x.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",o=W(),d=this.config.hand.enabled?await E5(x.tensor,this.config):[],p=Math.trunc(W()-o),p>0&&(this.perf.hand=p)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(u=this.config.object.enabled?k5(x.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",o=W(),u=this.config.object.enabled?await k5(x.tensor,this.config):[],p=Math.trunc(W()-o),p>0&&(this.perf.object=p)),this.analyze("End Object:"),this.config.async&&([y,l,d,u]=await Promise.all([y,l,d,u])),r.dispose(x.tensor);let z=[];this.config.gesture.enabled&&(o=W(),z=[...NA(y),...IA(l),...OA(d),...kA(y)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(W()-o)),a&&(this.config.videoOptimized=a),this.perf.total=Math.trunc(W()-n),this.state="idle";let c={face:y,body:l,hand:d,gesture:z,object:u,performance:this.perf,canvas:x.canvas};s(c)})}async warmup(e={}){let t=W();if(e&&(this.config=F(this.config,e)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let s=this.config.videoOptimized;this.config.videoOptimized=!1;let o;typeof createImageBitmap=="function"?o=await C(this,B0).call(this):typeof Image!="undefined"?o=await C(this,U0).call(this):o=await C(this,Y0).call(this),this.config.videoOptimized=s;let i=W();return this.config.debug&&b("Warmup",this.config.warmup,Math.round(i-t),"ms",o),o}};y0=new WeakMap,u0=new WeakMap,p0=new WeakMap,s0=new WeakMap,C0=new WeakMap,b0=new WeakMap,B0=new WeakMap,U0=new WeakMap,Y0=new WeakMap;export{R2 as Human,R2 as default}; //# sourceMappingURL=human.esm-nobundle.js.map diff --git a/dist/human.esm-nobundle.js.map b/dist/human.esm-nobundle.js.map index 5b518ba0..f4464ad2 100644 --- a/dist/human.esm-nobundle.js.map +++ b/dist/human.esm-nobundle.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/helpers.ts", "../src/sysinfo.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/faceall.ts", "../src/blazeface/facemesh.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/posenet/posenet.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/handpose/handpose.ts", "../src/handpose/box.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/handpose/anchors.ts", "../src/blazepose/blazepose.ts", "../src/blazepose/annotations.ts", "../src/nanodet/nanodet.ts", "../src/nanodet/labels.ts", "../src/gesture/gesture.ts", "../src/image/image.ts", "../src/image/imagefx.js", "../src/draw/draw.ts", "../src/config.ts", "../src/sample.ts", "../src/human.ts"], - "sourcesContent": ["// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg) {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n", "export function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "// wrapper to load tfjs in a single place so version can be changed quickly\n\n// simplified\n// { modules: 1250, moduleBytes: 4013323, imports: 7, importBytes: 2255, outputBytes: 2991826, outputFiles: 'dist/tfjs.esm.js' }\n// export * from '@tensorflow/tfjs/dist/index.js';\n// export * from '@tensorflow/tfjs-backend-wasm';\n\n// modular\n// { modules: 1253, moduleBytes: 4029357, imports: 7, importBytes: 2285, outputBytes: 2998298, outputFiles: 'dist/tfjs.esm.js' }\n\n// get versions of all packages.\nimport * as packageBundle from '@tensorflow/tfjs/package.json';\nimport * as packageCore from '@tensorflow/tfjs-core/package.json';\nimport * as packageData from '@tensorflow/tfjs-data/package.json';\nimport * as packageLayers from '@tensorflow/tfjs-layers/package.json';\nimport * as packageConverter from '@tensorflow/tfjs-converter/package.json';\n// for backends, get version from source so it can register backend during import\nimport { version_cpu } from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nimport { version_webgl } from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nimport { version_wasm } from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - compiled\nexport * from '@tensorflow/tfjs-core/dist/index.js';\nexport * from '@tensorflow/tfjs-layers/dist/index.js';\nexport * from '@tensorflow/tfjs-converter/dist/index.js';\nexport * as data from '@tensorflow/tfjs-data/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - sources\n/*\nexport * from '@tensorflow/tfjs-core/src/index';\nexport * from '@tensorflow/tfjs-layers/src/index';\nexport * from '@tensorflow/tfjs-converter/src/index';\nexport * as data from '@tensorflow/tfjs-data/src/index';\nexport * from '@tensorflow/tfjs-backend-cpu/src/index';\nexport * from '@tensorflow/tfjs-backend-webgl/src/index';\nexport * from '@tensorflow/tfjs-backend-wasm/src/index';\n*/\n\n// export versions\nexport const version = {\n tfjs: packageBundle?.version || undefined,\n 'tfjs-core': packageCore?.version || undefined,\n 'tfjs-data': packageData?.version || undefined,\n 'tfjs-layers': packageLayers?.version || undefined,\n 'tfjs-converter': packageConverter?.version || undefined,\n 'tfjs-backend-cpu': version_cpu || undefined,\n 'tfjs-backend-webgl': version_webgl || undefined,\n 'tfjs-backend-wasm': version_wasm || undefined,\n};\n// export const version = {};\n", "import { log } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport const config = {\n name: 'humangl',\n priority: 99,\n canvas: null,\n gl: null,\n width: 1024,\n height: 1024,\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nexport function register(): void {\n if (!tf.findBackend(config.name)) {\n log('backend registration:', config.name);\n try {\n config.canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(config.width, config.height) : document.createElement('canvas');\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr);\n } catch (err) {\n log('error: cannot get WebGL2 context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL2 context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n // tf.ENV.set('WEBGL_MAX_TEXTURE_SIZE', config.gl.getParameter(config.gl.MAX_TEXTURE_SIZE));\n // tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true);\n // tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n log('backend registered:', config.name);\n }\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model;\nlet last: Array<{ score: number, emotion: string }> = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if ((skipped < config.face.emotion.skipFrames) && config.videoOptimized && (last.length > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const normalize = tf.tidy(() => grayscale.sub(0.5).mul(2));\n grayscale.dispose();\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion.enabled) {\n const emotionT = await model.predict(normalize); // result is already in range 0..1, no need for additional activation\n const data = emotionT.dataSync();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n normalize.dispose();\n last = obj;\n resolve(obj);\n });\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nlet model;\nlet last = { age: 0 };\nlet skipped = Number.MAX_SAFE_INTEGER;\n\ntype Tensor = typeof tf.Tensor;\ntype DB = Array<{ name: string, source: string, embedding: number[] }>;\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.description.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.description.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport function similarity(embedding1, embedding2, order = 2): number {\n if (!embedding1 || !embedding2) return 0;\n if (embedding1?.length === 0 || embedding2?.length === 0) return 0;\n if (embedding1?.length !== embedding2?.length) return 0;\n // general minkowski distance, euclidean distance is limited case where order is 2\n const distance = 5.0 * embedding1\n .map((val, i) => (Math.abs(embedding1[i] - embedding2[i]) ** order)) // distance squared\n .reduce((sum, now) => (sum + now), 0) // sum all distances\n ** (1 / order); // get root of\n const res = Math.max(0, 100 - distance) / 100.0;\n return res;\n}\n\nexport function match(embedding: Array, db: DB, threshold = 0) {\n let best = { similarity: 0, name: '', source: '', embedding: [] as number[] };\n if (!embedding || !db || !Array.isArray(embedding) || !Array.isArray(db)) return best;\n for (const f of db) {\n if (f.embedding && f.name) {\n const perc = similarity(embedding, f.embedding);\n if (perc > threshold && perc > best.similarity) best = { ...f, similarity: perc };\n }\n }\n return best;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n // const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // optional increase image contrast\n // or do it per-channel so mean is done on each channel\n // or do it based on histogram\n const mean = merge.mean();\n const factor = 5;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = crop.mul(255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if ((skipped < config.face.description.skipFrames) && config.videoOptimized && last.age && (last.age > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderConfidence: 0,\n descriptor: [] };\n\n if (config.face.description.enabled) resT = await model.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n tf.tidy(() => {\n const gender = resT.find((t) => t.shape[1] === 1).dataSync();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > config.face.description.minConfidence) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderConfidence = Math.min(0.99, confidence);\n }\n const age = resT.find((t) => t.shape[1] === 100).argMax(1).dataSync()[0];\n const all = resT.find((t) => t.shape[1] === 100).dataSync();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]);\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it\n\n obj.descriptor = [...desc.dataSync()];\n });\n resT.forEach((t) => tf.dispose(t));\n }\n\n last = obj;\n resolve(obj);\n });\n}\n", "import { log, now } from './helpers';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as emotion from './emotion/emotion';\nimport * as faceres from './faceres/faceres';\n\ntype Tensor = typeof tf.Tensor;\n\nconst calculateFaceAngle = (face, image_size): { angle: { pitch: number, yaw: number, roll: number }, matrix: [number, number, number, number, number, number, number, number, number] } => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const degrees = (theta) => (theta * 180) / Math.PI;\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX; let thetaY; let thetaZ;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees\n // value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1] };\n\n const size = Math.max(face.boxRaw[2] * image_size[0], face.boxRaw[3] * image_size[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * image_size[0] / size,\n pt[1] * image_size[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n return { angle, matrix };\n};\n\nexport const detectFace = async (parent, input): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array<{\n confidence: number,\n boxConfidence: number,\n faceConfidence: number,\n box: [number, number, number, number],\n mesh: Array<[number, number, number]>\n meshRaw: Array<[number, number, number]>\n boxRaw: [number, number, number, number],\n annotations: Array<{ part: string, points: Array<[number, number, number]>[] }>,\n age: number,\n gender: string,\n genderConfidence: number,\n emotion: string,\n embedding: number[],\n iris: number,\n rotation: {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number]\n },\n tensor: Tensor,\n }> = [];\n parent.state = 'run:face';\n timeStamp = now();\n const faces = await parent.models.face?.estimateFaces(input, parent.config);\n parent.perf.face = Math.trunc(now() - timeStamp);\n if (!faces) return [];\n for (const face of faces) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n log('Face object is disposed:', face.image);\n continue;\n }\n\n const rotation = calculateFaceAngle(face, [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(face.image, parent.config) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(face.image, parent.config) : {};\n parent.perf.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(face, parent.config) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(face.image, parent.config) : [];\n parent.perf.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && face?.annotations?.leftEyeIris && face?.annotations?.rightEyeIris) {\n delete face.annotations.leftEyeIris;\n delete face.annotations.rightEyeIris;\n }\n const irisSize = (face.annotations?.leftEyeIris && face.annotations?.rightEyeIris)\n /* average human iris size is 11.7mm */\n ? 11.7 * Math.max(Math.abs(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0]), Math.abs(face.annotations.rightEyeIris[4][1] - face.annotations.rightEyeIris[2][1]))\n : 0;\n\n // combine results\n faceRes.push({\n ...face,\n age: descRes.age,\n gender: descRes.gender,\n genderConfidence: descRes.genderConfidence,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: (irisSize !== 0) ? Math.trunc(irisSize) / 100 : 0,\n rotation,\n tensor: parent.config.face.detector.return ? face.image?.squeeze() : null,\n });\n // dispose original face tensor\n face.image?.dispose();\n\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.perf.face) delete parent.perf.face;\n if (parent.perf.age) delete parent.perf.age;\n if (parent.perf.gender) delete parent.perf.gender;\n if (parent.perf.emotion) delete parent.perf.emotion;\n }\n return faceRes;\n};\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as facepipeline from './facepipeline';\nimport * as coords from './coords';\n\nexport class MediaPipeFaceMesh {\n facePipeline: any;\n config: any;\n\n constructor(blazeFace, blazeMeshModel, irisModel, config) {\n this.facePipeline = new facepipeline.Pipeline(blazeFace, blazeMeshModel, irisModel);\n this.config = config;\n }\n\n async estimateFaces(input, config): Promise<{ confidence, boxConfidence, faceConfidence, box, mesh, boxRaw, meshRaw, annotations, image }[]> {\n const predictions = await this.facePipeline.predict(input, config);\n const results: Array<{ confidence, boxConfidence, faceConfidence, box, mesh, boxRaw, meshRaw, annotations, image }> = [];\n for (const prediction of (predictions || [])) {\n if (prediction.isDisposedInternal) continue; // guard against disposed tensors on long running operations such as pause in middle of processing\n const mesh = prediction.coords ? prediction.coords.arraySync() : [];\n const meshRaw = mesh.map((pt) => [\n pt[0] / input.shape[2],\n pt[1] / input.shape[1],\n pt[2] / this.facePipeline.meshSize,\n ]);\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key of Object.keys(coords.MESH_ANNOTATIONS)) annotations[key] = coords.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n const box = prediction.box ? [\n Math.max(0, prediction.box.startPoint[0]),\n Math.max(0, prediction.box.startPoint[1]),\n Math.min(input.shape[2], prediction.box.endPoint[0]) - Math.max(0, prediction.box.startPoint[0]),\n Math.min(input.shape[1], prediction.box.endPoint[1]) - Math.max(0, prediction.box.startPoint[1]),\n ] : 0;\n const boxRaw = prediction.box ? [\n prediction.box.startPoint[0] / input.shape[2],\n prediction.box.startPoint[1] / input.shape[1],\n (prediction.box.endPoint[0] - prediction.box.startPoint[0]) / input.shape[2],\n (prediction.box.endPoint[1] - prediction.box.startPoint[1]) / input.shape[1],\n ] : [];\n results.push({\n confidence: Math.round(100 * prediction.faceConfidence || 100 * prediction.boxConfidence || 0) / 100,\n boxConfidence: Math.round(100 * prediction.boxConfidence) / 100,\n faceConfidence: Math.round(100 * prediction.faceConfidence) / 100,\n box,\n boxRaw,\n mesh,\n meshRaw,\n annotations,\n image: prediction.image ? prediction.image.clone() : null,\n });\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n }\n}\n\nlet faceModels:[any, any, any] = [null, null, null];\nexport async function load(config): Promise {\n if ((!faceModels[0] && config.face.enabled) || (!faceModels[1] && config.face.mesh.enabled) || (!faceModels[2] && config.face.iris.enabled)) {\n faceModels = await Promise.all([\n (!faceModels[0] && config.face.enabled) ? blazeface.load(config) : null,\n (!faceModels[1] && config.face.mesh.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.mesh.modelPath), { fromTFHub: config.face.mesh.modelPath.includes('tfhub.dev') }) : null,\n (!faceModels[2] && config.face.iris.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.iris.modelPath), { fromTFHub: config.face.iris.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.face.mesh.enabled) {\n if (!faceModels[1] || !faceModels[1].modelUrl) log('load model failed:', config.face.mesh.modelPath);\n else if (config.debug) log('load model:', faceModels[1].modelUrl);\n }\n if (config.face.iris.enabled) {\n if (!faceModels[2] || !faceModels[1].modelUrl) log('load model failed:', config.face.iris.modelPath);\n else if (config.debug) log('load model:', faceModels[2].modelUrl);\n }\n } else if (config.debug) {\n log('cached model:', faceModels[0].model.modelUrl);\n log('cached model:', faceModels[1].modelUrl);\n log('cached model:', faceModels[2].modelUrl);\n }\n const faceMesh = new MediaPipeFaceMesh(faceModels[0], faceModels[1], faceModels[2], config);\n return faceMesh;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nconst NUM_LANDMARKS = 6;\n\nfunction generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n\nexport const disposeBox = (box) => {\n box.startEndTensor.dispose();\n box.startPoint.dispose();\n box.endPoint.dispose();\n};\n\nconst createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport class BlazeFaceModel {\n model: any;\n anchorsData: any;\n anchors: any;\n inputSize: number;\n config: any;\n\n constructor(model, config) {\n this.model = model;\n this.anchorsData = generateAnchors(model.inputs[0].shape[1]);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = model.inputs[0].shape[2];\n this.config = config;\n }\n\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.inputSize, this.inputSize]);\n // const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const normalizedImage = resizedImage.div(127.5).sub(0.5);\n const batchedPrediction = this.model.predict(normalizedImage);\n let batchOut;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = concat.squeeze(0);\n } else {\n batchOut = batchedPrediction.squeeze(); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut, this.anchors, [this.inputSize, this.inputSize]);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [batchOut, boxesOut, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);\n const boxIndices = boxIndicesTensor.arraySync();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = boundingBoxesMap.map((boundingBox) => {\n const vals = boundingBox.arraySync();\n boundingBox.dispose();\n return vals;\n });\n\n const scoresVal = scores.dataSync();\n const annotatedBoxes: Array<{ box: any, landmarks: any, anchor: any, confidence: number }> = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boxIndex = boxIndices[i];\n const confidence = scoresVal[boxIndex];\n if (confidence > this.config.face.detector.minConfidence) {\n const box = createBox(boundingBoxes[i]);\n const anchor = this.anchorsData[boxIndex];\n const landmarks = tf.tidy(() => tf.slice(batch, [boxIndex, NUM_LANDMARKS - 1], [1, -1]).squeeze().reshape([NUM_LANDMARKS, -1]));\n annotatedBoxes.push({ box, landmarks, anchor, confidence });\n }\n }\n batch.dispose();\n boxes.dispose();\n scores.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.inputSize, inputImage.shape[1] / this.inputSize],\n };\n }\n}\n\nexport async function load(config) {\n const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });\n const blazeFace = new BlazeFaceModel(model, config);\n if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n return blazeFace;\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n", "export const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nexport function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport function radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\n\nexport function buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n\nexport function xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\n", "export const MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121, 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92, 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4, 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244, 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26, 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53, 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153, 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202, 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149, 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102, 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195, 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108, 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7, 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2, 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209, 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86, 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239, 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226, 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238, 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220, 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357, 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304, 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364, 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17, 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261, 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363, 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293, 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287, 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271, 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351, 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15, 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311, 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454, 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370, 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379, 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446, 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414, 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291, 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433, 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341, 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290, 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420, 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398, 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39, 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74, 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129, 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148, 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126, 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91, 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51, 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210, 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210, 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16, 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218, 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66, 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65, 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2, 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209, 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194, 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4, 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230, 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213, 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215, 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297, 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410, 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4, 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269, 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438, 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349, 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281, 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257, 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304, 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404, 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351, 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276, 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265, 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251, 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374, 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459, 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306, 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358, 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256, 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305, 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360, 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "/* eslint-disable class-methods-use-this */\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as bounding from './box';\nimport * as util from './util';\nimport * as coords from './coords';\n\nconst leftOutline = coords.MESH_ANNOTATIONS['leftEyeLower0'];\nconst rightOutline = coords.MESH_ANNOTATIONS['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, coords.MESH_ANNOTATIONS['midwayBetweenEyes'][0]],\n};\n\nconst blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.MESH_ANNOTATIONS[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nexport class Pipeline {\n storedBoxes: any;\n boundingBoxDetector: any;\n meshDetector: any;\n irisModel: any;\n boxSize: number;\n meshSize: number;\n irisSize: number;\n irisEnlarge: number;\n skipped: number;\n detectedFaces: number;\n\n constructor(boundingBoxDetector, meshDetector, irisModel) {\n // An array of facial bounding boxes.\n this.storedBoxes = [];\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.boxSize = boundingBoxDetector?.model?.inputs[0].shape[2] || 0;\n this.meshSize = meshDetector?.inputs[0].shape[2] || boundingBoxDetector?.model?.inputs[0].shape[2];\n this.irisSize = irisModel?.inputs[0].shape[1] || 0;\n this.irisEnlarge = 2.3;\n this.skipped = 0;\n this.detectedFaces = 0;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / this.meshSize * (coord[0] - this.meshSize / 2),\n boxSize[1] / this.meshSize * (coord[1] - this.meshSize / 2),\n coord[2],\n ]));\n const coordsRotationMatrix = (angle !== 0) ? util.buildRotationMatrix(angle, [0, 0]) : util.IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? util.invertTransformMatrix(rotationMatrix) : util.IDENTITY_MATRIX;\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n coord[0] + util.dot(boxCenter, inverseRotationMatrix[0]),\n coord[1] + util.dot(boxCenter, inverseRotationMatrix[1]),\n coord[2],\n ]));\n }\n\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(this.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshSize,\n box.startPoint[0] / this.meshSize, box.endPoint[1] / this.meshSize,\n box.endPoint[0] / this.meshSize,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip && tf.ENV.flags.IS_BROWSER) {\n crop = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords: Array = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / this.irisSize)) : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n let useFreshBox = false;\n // run new detector every skipFrames unless we only want box to start with\n let detector;\n if ((this.skipped === 0) || (this.skipped > config.face.detector.skipFrames) || !config.face.mesh.enabled || !config.videoOptimized) {\n detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n this.skipped = 0;\n }\n if (config.videoOptimized) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (!config.videoOptimized || (detector && detector.boxes && (!config.face.mesh.enabled || (detector.boxes.length !== this.detectedFaces) && (this.detectedFaces !== config.face.detector.maxDetected)))) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n for (const possible of detector.boxes) {\n this.storedBoxes.push({ startPoint: possible.box.startPoint.dataSync(), endPoint: possible.box.endPoint.dataSync(), landmarks: possible.landmarks, confidence: possible.confidence });\n }\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n\n if (config.face.detector.skipInitial && this.detectedFaces === 0) this.skipped = 0;\n\n if (useFreshBox) {\n if (!detector || !detector.boxes || (detector.boxes.length === 0)) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n return null;\n }\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const scaledBox = bounding.scaleBoxCoordinates({ startPoint: this.storedBoxes[i].startPoint, endPoint: this.storedBoxes[i].endPoint }, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const squarifiedBox = bounding.squarifyBox(enlargedBox);\n const landmarks = this.storedBoxes[i].landmarks.arraySync();\n const confidence = this.storedBoxes[i].confidence;\n this.storedBoxes[i] = { ...squarifiedBox, confidence, landmarks };\n }\n }\n if (detector && detector.boxes) {\n detector.boxes.forEach((prediction) => {\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n });\n }\n\n let results = tf.tidy(() => this.storedBoxes.map((box, i) => {\n const boxConfidence = box.confidence;\n\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n let face;\n let angle = 0;\n let rotationMatrix;\n\n if (config.face.detector.rotation && config.face.mesh.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.boxSize, this.boxSize]).div(255);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const clonedImage = input.clone();\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.boxSize, this.boxSize]).div(255);\n }\n\n // if we're not going to produce mesh, don't spend time with further processing\n if (!config.face.mesh.enabled) {\n const prediction = {\n coords: null,\n box,\n faceConfidence: null,\n boxConfidence,\n confidence: box.confidence,\n image: face,\n };\n return prediction;\n }\n\n const [, confidence, contourCoords] = this.meshDetector.predict(face); // The first returned tensor represents facial contours which are already included in the coordinates.\n const faceConfidence = confidence.dataSync()[0];\n if (faceConfidence < config.face.detector.minConfidence) return null; // if below confidence just exit\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n\n if (config.face.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1]);\n const eyePredictions = this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop]));\n const eyePredictionsData = eyePredictions.dataSync();\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n\n // override box from detection with one calculated from mesh\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n box = bounding.enlargeBox(this.calculateLandmarksBoundingBox(transformedCoordsData), 1.5); // redefine box with mesh calculated one\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n\n // do rotation one more time with mesh keypoints if we want to return perfect image\n if (config.face.detector.rotation && config.face.mesh.enabled && config.face.description.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input.toFloat(), angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n }\n\n const prediction = {\n coords: transformedCoords,\n box,\n faceConfidence,\n boxConfidence,\n image: face,\n rawCoords,\n };\n\n // updated stored cache values\n const squarifiedLandmarksBox = bounding.squarifyBox(box);\n this.storedBoxes[i] = { ...squarifiedLandmarksBox, landmarks: transformedCoordsData, confidence: box.confidence, faceConfidence };\n\n return prediction;\n }));\n\n results = results.filter((a) => a !== null);\n // remove cache entries for detected boxes on low confidence\n if (config.face.mesh.enabled) this.storedBoxes = this.storedBoxes.filter((a) => a.faceConfidence > config.face.detector.minConfidence);\n this.detectedFaces = results.length;\n\n return results;\n }\n\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n }\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as poses from './poses';\nimport * as util from './utils';\n\nlet model;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nexport async function predict(input, config) {\n const res = tf.tidy(() => {\n const resized = input.resizeBilinear([model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = resized.toFloat().div(127.5).sub(1.0);\n const results = model.execute(normalized, poseNetOutputs);\n const results3d = results.map((y) => y.squeeze([0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor) => tensor.buffer()));\n for (const t of res) t.dispose();\n\n const decoded = await poses.decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n return scaled;\n}\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n", "export const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n", "import * as kpt from './keypoints';\n\nexport function eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints) {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scalePose = (pose, scaleY, scaleX) => ({\n score: pose.score,\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: Math.trunc(position.x * scaleX), y: Math.trunc(position.y * scaleY) },\n })),\n });\n\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: any;\n numberOfElements: number;\n getElementValue: any;\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "import * as utils from './utils';\nimport * as kpt from './keypoints';\n\nconst localMaximumRadius = 1;\nconst defaultOutputStride = 16;\nconst squaredNmsRadius = 20 ** 2;\n\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = utils.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: kpt.partNames[targetKeypointId], score };\n}\n\nexport function decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const parentChildrenTuples = kpt.poseChain.map(([parentJoinName, childJoinName]) => ([kpt.partIds[parentJoinName], kpt.partIds[childJoinName]]));\n const parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\n const childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = utils.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: kpt.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n\nexport function decode(offsetsBuffer, scoresBuffer, displacementsFwdBuffer, displacementsBwdBuffer, maxDetected, minConfidence) {\n const poses: Array<{ keypoints: any, box: any, score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scoresBuffer);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n const rootImageCoords = utils.getImageCoords(root.part, defaultOutputStride, offsetsBuffer);\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n const allKeypoints = decodePose(root, scoresBuffer, offsetsBuffer, defaultOutputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const keypoints = allKeypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\nimport * as anchors from './anchors';\n\nconst MESH_ANNOTATIONS = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n\nexport class HandPose {\n handPipeline: any;\n\n constructor(handPipeline) {\n this.handPipeline = handPipeline;\n }\n\n static getAnnotations() {\n return MESH_ANNOTATIONS;\n }\n\n async estimateHands(input, config) {\n const predictions = await this.handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array<{ confidence: number, box: any, boxRaw: any, landmarks: any, annotations: any }> = [];\n for (const prediction of predictions) {\n const annotations = {};\n if (prediction.landmarks) {\n for (const key of Object.keys(MESH_ANNOTATIONS)) {\n annotations[key] = MESH_ANNOTATIONS[key].map((index) => prediction.landmarks[index]);\n }\n }\n const box = prediction.box ? [\n Math.max(0, prediction.box.topLeft[0]),\n Math.max(0, prediction.box.topLeft[1]),\n Math.min(input.shape[2], prediction.box.bottomRight[0]) - Math.max(0, prediction.box.topLeft[0]),\n Math.min(input.shape[1], prediction.box.bottomRight[1]) - Math.max(0, prediction.box.topLeft[1]),\n ] : [];\n const boxRaw = [\n (prediction.box.topLeft[0]) / input.shape[2],\n (prediction.box.topLeft[1]) / input.shape[1],\n (prediction.box.bottomRight[0] - prediction.box.topLeft[0]) / input.shape[2],\n (prediction.box.bottomRight[1] - prediction.box.topLeft[1]) / input.shape[1],\n ];\n hands.push({ confidence: Math.round(100 * prediction.confidence) / 100, box, boxRaw, landmarks: prediction.landmarks, annotations });\n }\n return hands;\n }\n}\n\nlet handDetectorModel;\nlet handPoseModel;\nexport async function load(config): Promise {\n if (!handDetectorModel || !handPoseModel) {\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel.modelUrl) log('load model failed:', config.hand.detector.modelPath);\n else if (config.debug) log('load model:', handDetectorModel.modelUrl);\n if (!handPoseModel || !handPoseModel.modelUrl) log('load model failed:', config.hand.skeleton.modelPath);\n else if (config.debug) log('load model:', handPoseModel.modelUrl);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel.modelUrl);\n if (config.debug) log('cached model:', handPoseModel.modelUrl);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel, handDetectorModel?.inputs[0].shape[2], anchors.anchors);\n const handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel, handPoseModel?.inputs[0].shape[2]);\n const handPose = new HandPose(handPipeline);\n return handPose;\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\n\nexport class HandDetector {\n model: any;\n anchors: any;\n anchorsTensor: any;\n inputSize: number;\n inputSizeTensor: any;\n doubleInputSizeTensor: any;\n\n constructor(model, inputSize, anchorsAnnotated) {\n this.model = model;\n this.anchors = anchorsAnnotated.map((anchor) => [anchor.x_center, anchor.y_center]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSize = inputSize;\n this.inputSizeTensor = tf.tensor1d([inputSize, inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([inputSize * 2, inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const batched = this.model.predict(input);\n const predictions = batched.squeeze();\n batched.dispose();\n const scoresT = tf.tidy(() => tf.sigmoid(tf.slice(predictions, [0, 0], [-1, 1])).squeeze());\n const scores = scoresT.dataSync();\n const rawBoxes = tf.slice(predictions, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n rawBoxes.dispose();\n const filteredT = await tf.image.nonMaxSuppressionAsync(boxes, scores, config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const filtered = filteredT.arraySync();\n\n scoresT.dispose();\n filteredT.dispose();\n const hands: Array<{ box: any, palmLandmarks: any, confidence: number }> = [];\n for (const index of filtered) {\n if (scores[index] >= config.hand.minConfidence) {\n const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(predictions, [index, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, index).reshape([-1, 2]));\n rawPalmLandmarks.dispose();\n hands.push({ box: matchingBox, palmLandmarks, confidence: scores[index] });\n }\n }\n predictions.dispose();\n boxes.dispose();\n return hands;\n }\n\n async estimateHandBounds(input, config) {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => input.resizeBilinear([this.inputSize, this.inputSize]).div(127.5).sub(1));\n const predictions = await this.getBoxes(image, config);\n image.dispose();\n const hands: Array<{}> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = prediction.box.dataSync();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = prediction.palmLandmarks.arraySync();\n prediction.box.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\n\n// const PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst PALM_BOX_ENLARGE_FACTOR = 5; // default 3\n// const HAND_BOX_SHIFT_VECTOR = [0, -0.1]; // move detected hand box by x,y to ease landmark detection\nconst HAND_BOX_ENLARGE_FACTOR = 1.65; // default 1.65\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\nexport class HandPipeline {\n handDetector: any;\n landmarkDetector: any;\n inputSize: number;\n storedBoxes: any;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, landmarkDetector, inputSize) {\n this.handDetector = handDetector;\n this.landmarkDetector = landmarkDetector;\n this.inputSize = inputSize;\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // return box.enlargeBox(box.squarifyBox(box.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), PALM_BOX_ENLARGE_FACTOR);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), PALM_BOX_ENLARGE_FACTOR);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n // const boxAroundHand = box.enlargeBox(box.squarifyBox(box.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), HAND_BOX_ENLARGE_FACTOR);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.videoOptimized) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.videoOptimized) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{}> = [];\n\n if (config.hand.skipInitial && this.detectedHands === 0) this.skipped = 0;\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const [confidenceT, keypoints] = await this.landmarkDetector.predict(handImage);\n handImage.dispose();\n const confidence = confidenceT.dataSync()[0];\n confidenceT.dispose();\n if (confidence >= config.hand.minConfidence) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = keypointsReshaped.arraySync();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = nextBoundingBox;\n const result = {\n landmarks: coords,\n confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n keypoints.dispose();\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), HAND_BOX_ENLARGE_FACTOR);\n const result = {\n confidence: currentBox.confidence,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n}\n", "export const anchors = [\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.015625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.046875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.078125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.109375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.140625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.171875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.203125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.234375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.265625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.296875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.328125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.359375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.390625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.421875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.453125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.484375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.515625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.546875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.578125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.609375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.640625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.671875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.703125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.734375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.765625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.796875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.828125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.859375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.890625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.921875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.953125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.015625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.046875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.078125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.109375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.140625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.171875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.203125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.234375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.265625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.296875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.328125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.359375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.390625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.421875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.453125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.484375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.515625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.546875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.578125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.609375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.640625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.671875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.703125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.734375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.765625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.796875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.828125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.859375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.890625,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.921875,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.953125,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.984375,\n y_center: 0.984375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.03125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.09375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.15625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.21875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.28125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.34375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.40625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.46875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.53125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.59375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.65625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.71875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.78125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.84375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.90625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.03125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.09375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.15625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.21875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.28125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.34375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.40625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.46875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.53125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.59375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.65625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.71875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.78125,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.84375,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.90625,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.96875,\n y_center: 0.96875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.0625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.1875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.3125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.4375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.5625,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.6875,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.8125,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.0625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.1875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.3125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.4375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.5625,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.6875,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.8125,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n {\n w: 1,\n h: 1,\n x_center: 0.9375,\n y_center: 0.9375,\n },\n];\n", "// paper: https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as annotations from './annotations';\n\nlet model;\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n model.width = parseInt(model.signature.inputs['input_1:0'].tensorShape.dim[2].size);\n model.height = parseInt(model.signature.inputs['input_1:0'].tensorShape.dim[1].size);\n if (!model || !model.modelUrl) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if (!config.body.enabled) return null;\n const imgSize = { width: image.shape[2], height: image.shape[1] };\n const resize = tf.image.resizeBilinear(image, [model.width, model.height], false);\n const normalize = tf.div(resize, [255.0]);\n resize.dispose();\n const resT = await model.predict(normalize);\n const points = resT.find((t) => (t.size === 195 || t.size === 155)).dataSync(); // order of output tensors may change between models, full has 195 and upper has 155 items\n resT.forEach((t) => t.dispose());\n normalize.dispose();\n const keypoints: Array<{ id, part, position: { x, y, z }, score, presence }> = [];\n const labels = points.length === 195 ? annotations.full : annotations.upper; // full model has 39 keypoints, upper has 31 keypoints\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n keypoints.push({\n id: i,\n part: labels[i],\n position: {\n x: Math.trunc(imgSize.width * points[depth * i + 0] / 255), // return normalized x value istead of 0..255\n y: Math.trunc(imgSize.height * points[depth * i + 1] / 255), // return normalized y value istead of 0..255\n z: Math.trunc(points[depth * i + 2]) + 0, // fix negative zero\n },\n score: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100, // reverse sigmoid value\n presence: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100, // reverse sigmoid value\n });\n }\n const score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n return [{ score, keypoints }];\n}\n", "export const full = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftPalm',\n 'rightPalm',\n 'leftIndex',\n 'rightIndex',\n 'leftPinky',\n 'rightPinky',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n 'leftHeel',\n 'rightHeel',\n 'leftFoot',\n 'rightFoot',\n 'midHip',\n 'forehead',\n 'leftThumb',\n 'leftHand',\n 'rightThumb',\n 'rightHand',\n];\n\nexport const upper = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'left:15',\n 'right:16',\n 'left:17',\n 'right:18',\n 'left:19',\n 'right:20',\n 'left:21',\n 'right:22',\n 'leftChest',\n 'rightChest',\n 'neck',\n 'forehead',\n 'left:27',\n 'right:28',\n 'left:29',\n 'right:30',\n];\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\n\nlet model;\nlet last: Array<{}> = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array<{ score: number, strideSize: number, class: number, label: string, center: number[], centerRaw: number[], box: number[], boxRaw: number[] }> = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(() => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = boxesMax.argMax(2).arraySync(); // what we need is indexes of features with highest scores, not values itself\n const scores = scoresT.arraySync(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))); // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)),\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => a.boxRaw);\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: any[] = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = nms.dataSync();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((a, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n // console.log(skipped, config.object.skipFrames, config.videoOptimized, ((skipped < config.object.skipFrames) && config.videoOptimized && (last.length > 0)));\n if ((skipped < config.object.skipFrames) && config.videoOptimized && (last.length > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = resize.div(255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n norm.dispose();\n resize.dispose();\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n transpose.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "export const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "export const body = (res) => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res) => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 0) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res) => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.rightEyeIris) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].annotations.rightEyeIris[0][0];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].annotations.leftEyeIris[0][0];\n if (leftIrisCenterX > 0.033 || rightIrisCenterX > 0.033) center = false;\n if (leftIrisCenterX > 0.033) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.033) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].annotations.rightEyeIris[0][1];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].annotations.leftEyeIris[0][1];\n if (leftIrisCenterY < 0.015 || rightIrisCenterY < 0.015 || leftIrisCenterY > 0.030 || rightIrisCenterY > 0.030) center = false;\n if (leftIrisCenterY < 0.015 || rightIrisCenterY < 0.015) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.030 || rightIrisCenterY > 0.030) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res) => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos)) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });\n }\n }\n return gestures;\n};\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// instance of fximage\nlet fx;\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input, config): { tensor: typeof tf.Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement } {\n let tensor;\n if (!input) throw new Error('Human: Input is missing');\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('Human: Input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if (input.shape && input.shape.length === 4 && input.shape[0] === 1 && input.shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`Human: Input tensor shape must be [1, height, width, 3] and instead was ${input.shape}`);\n } else {\n // check if resizing will be needed\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = targetWidth * originalHeight / originalWidth;\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = targetHeight * originalWidth / originalHeight;\n }\n\n // create our canvas and resize it if needed\n if (config.filter.width > 0) targetWidth = config.filter.width;\n else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);\n if (config.filter.height > 0) targetHeight = config.filter.height;\n else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) {\n inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n if (inCanvas?.width !== targetWidth) inCanvas.width = targetWidth;\n if (inCanvas?.height !== targetHeight) inCanvas.height = targetHeight;\n }\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if (input instanceof ImageData) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n\n // imagefx transforms using gl\n if (config.filter.enabled) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(inCanvas?.width, inCanvas?.height) : document.createElement('canvas');\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = tf.ENV.flags.IS_BROWSER ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n\n // create tensor from image\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'int32');\n } else if (outCanvas instanceof ImageData) { // if input is imagedata, just use it\n pixels = tf.browser.fromPixels(outCanvas);\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n pixels = tf.browser.fromPixels(tempCanvas);\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n const data = tempCtx?.getImageData(0, 0, targetWidth, targetHeight);\n pixels = tf.browser.fromPixels(data);\n }\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n const canvas = config.filter.return ? outCanvas : null;\n return { tensor, canvas };\n}\n", "/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n\n*/\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "import { defaults } from '../config';\nimport { TRI468 as triangulation } from '../blazeface/coords';\nimport { mergeDeep } from '../helpers';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n * -useRawBoxes: Boolean: internal: use non-normalized coordinates when performing draw methods,\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: Boolean,\n drawLabels: Boolean,\n drawBoxes: Boolean,\n drawPolygons: Boolean,\n fillPolygons: Boolean,\n useDepth: Boolean,\n useCurves: Boolean,\n bufferedOutput: Boolean,\n useRawBoxes: Boolean,\n calculateHandBox: Boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.3)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 16px \"Segoe UI\"',\n lineHeight: 24,\n lineWidth: 6,\n pointSize: 2,\n roundRect: 28,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: false,\n drawPolygons: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: false,\n useRawBoxes: false,\n calculateHandBox: true,\n};\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: number[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n ctx.strokeStyle = localOptions.useDepth && pt[2] ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && pt[2] ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], parseInt(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: number[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where:any[] = [];\n let what:any[] = [];\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && (what[1].length > 0)) {\n const person = where[1] > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${person}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) {\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * f.boxRaw[0], inCanvas.height * f.boxRaw[1], inCanvas.width * f.boxRaw[2], inCanvas.height * f.boxRaw[3], localOptions);\n else rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n }\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face confidence: ${Math.trunc(100 * f.confidence)}%`);\n if (f.genderConfidence) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderConfidence)}% confident`);\n // if (f.genderConfidence) labels.push(f.gender);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`iris distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.angle.roll) labels.push(`roll: ${Math.trunc(100 * f.rotation.angle.roll) / 100} yaw:${Math.trunc(100 * f.rotation.angle.yaw) / 100} pitch:${Math.trunc(100 * f.rotation.angle.pitch) / 100}`);\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n // for (const pt of f.meshRaw) point(ctx, pt[0] * inCanvas.offsetWidth, pt[1] * inCanvas.offsetHeight, pt[2]);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations.leftEyeIris) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations.leftEyeIris[3][0] - f.annotations.leftEyeIris[1][0]) / 2;\n const sizeY = Math.abs(f.annotations.leftEyeIris[4][1] - f.annotations.leftEyeIris[2][1]) / 2;\n ctx.ellipse(f.annotations.leftEyeIris[0][0], f.annotations.leftEyeIris[0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations.rightEyeIris) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations.rightEyeIris[3][0] - f.annotations.rightEyeIris[1][0]) / 2;\n const sizeY = Math.abs(f.annotations.rightEyeIris[4][1] - f.annotations.rightEyeIris[2][1]) / 2;\n ctx.ellipse(f.annotations.rightEyeIris[0][0], f.annotations.rightEyeIris[0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n }\n }\n }\n}\n\nconst lastDrawnPose:any[] = [];\nexport async function body(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n // result[i].keypoints = result[i].keypoints.filter((a) => a.score > 0.5);\n if (!lastDrawnPose[i] && localOptions.bufferedOutput) lastDrawnPose[i] = { ...result[i] };\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position.z ? `rgba(${127.5 + (2 * result[i].keypoints[pt].position.z)}, ${127.5 - (2 * result[i].keypoints[pt].position.z)}, 255, 0.5)` : localOptions.color;\n if (localOptions.bufferedOutput) {\n lastDrawnPose[i].keypoints[pt][0] = (lastDrawnPose[i].keypoints[pt][0] + result[i].keypoints[pt].position.x) / 2;\n lastDrawnPose[i].keypoints[pt][1] = (lastDrawnPose[i].keypoints[pt][1] + result[i].keypoints[pt].position.y) / 2;\n point(ctx, lastDrawnPose[i].keypoints[pt][0], lastDrawnPose[i].keypoints[pt][1], 0, localOptions);\n } else {\n point(ctx, result[i].keypoints[pt].position.x, result[i].keypoints[pt].position.y, 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels) {\n ctx.font = localOptions.font;\n if (result[i].keypoints) {\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position.z ? `rgba(${127.5 + (2 * pt.position.z)}, ${127.5 - (2 * pt.position.z)}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position.x + 4, pt.position.y + 4);\n }\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints) {\n let part;\n const points: any[] = [];\n // shoulder line\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // torso main\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n if (points.length === 4) lines(ctx, points, localOptions); // only draw if we have complete torso\n // leg left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftKnee');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftAnkle');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftHeel');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftFoot');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // leg right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightKnee');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightAnkle');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightHeel');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightFoot');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // arm left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftElbow');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftWrist');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftPalm');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // arm right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightElbow');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightWrist');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightPalm');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // draw all\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n let box;\n if (!localOptions.calculateHandBox) {\n box = localOptions.useRawBoxes ? h.boxRaw : h.box;\n } else {\n box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0];\n if (h.landmarks && h.landmarks.length > 0) {\n for (const pt of h.landmarks) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n }\n }\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * box[0], inCanvas.height * box[1], inCanvas.width * box[2], inCanvas.height * box[3], localOptions);\n else rect(ctx, box[0], box[1], box[2], box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText('hand', box[0] + 3, 1 + box[1] + localOptions.lineHeight, box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText('hand', box[0] + 2, 0 + box[1] + localOptions.lineHeight, box[2]);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.landmarks && h.landmarks.length > 0) {\n for (const pt of h.landmarks) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawPolygons) {\n const addPart = (part) => {\n if (!part) return;\n for (let i = 0; i < part.length; i++) {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n addPart(h.annotations.indexFinger);\n addPart(h.annotations.middleFinger);\n addPart(h.annotations.ringFinger);\n addPart(h.annotations.pinky);\n addPart(h.annotations.thumb);\n // addPart(hand.annotations.palmBase);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * h.boxRaw[0], inCanvas.height * h.boxRaw[1], inCanvas.width * h.boxRaw[2], inCanvas.height * h.boxRaw[3], localOptions);\n else rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${Math.round(100 * h.score)}% ${h.label}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement) {\n if (!inCanvas || !outCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement) || !(outCanvas instanceof HTMLCanvasElement)) return;\n const outCtx = inCanvas.getContext('2d');\n outCtx?.drawImage(inCanvas, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement, result:any, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n face(inCanvas, result.face, localOptions);\n body(inCanvas, result.body, localOptions);\n hand(inCanvas, result.hand, localOptions);\n gesture(inCanvas, result.gesture, localOptions);\n object(inCanvas, result.object, localOptions);\n}\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n */\nexport interface Config {\n /** Backend used for TFJS operations */\n backend: null | '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow',\n\n /** Path to *.wasm files if backend is set to `wasm` */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** Perform additional optimizations when input is video,\n * - must be disabled for images\n * - automatically disabled for Image, ImageData, ImageBitmap and Tensor inputs\n * - skips boundary detection for every `skipFrames` frames specified for each model\n * - while maintaining in-box detection since objects don't change definition as fast */\n videoOptimized: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n */\n filter: {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n },\n // type definition end\n\n /** Controlls gesture detection */\n gesture: {\n enabled: boolean,\n },\n\n /** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - skipFrames: how many frames to go without re-running the face detector and just run modified face mesh analysis, only valid if videoOptimized is set to true\n * - skipInitial: if previous detection resulted in no faces detected, should skipFrames be reset immediately to force new detection cycle\n * - return: return extracted face as tensor for futher user processing\n */\n face: {\n enabled: boolean,\n detector: {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n skipInitial: boolean,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n },\n mesh: {\n enabled: boolean,\n modelPath: string,\n },\n iris: {\n enabled: boolean,\n modelPath: string,\n },\n description: {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n },\n emotion: {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n },\n },\n\n /** Controlls and configures all body detection specific options\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n */\n body: {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n },\n\n /** Controlls and configures all hand detection specific options\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n * - skipFrames: how many frames to go without re-running the hand bounding box detector and just run modified hand skeleton detector, only valid if videoOptimized is set to true\n * - skipInitial: if previous detection resulted in no hands detected, should skipFrames be reset immediately to force new detection cycle\n */\n hand: {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n skipInitial: boolean,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath: string,\n },\n skeleton: {\n modelPath: string,\n },\n },\n\n /** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n * - skipFrames: run object detection every n input frames, only valid if videoOptimized is set to true\n */\n object: {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n },\n}\n\nconst config: Config = {\n backend: 'webgl', // select tfjs backend to use, leave empty to use default backend\n // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl\n modelBasePath: '../models/', // base path for all models\n wasmPath: '../assets/', // path for wasm binariesm, only used for backend: wasm\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n videoOptimized: true, // perform additional optimizations when input is video,\n // automatically disabled for Image, ImageData, ImageBitmap\n // skips boundary detection for every n frames\n // while maintaining in-box detection since objects cannot move that fast\n warmup: 'face', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: false, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 10, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 21, // how many frames to go without re-running the face bounding box detector\n // only used for video inputs\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head probably hasn't moved much\n // in short time (10 * 1/25 = 0.25 sec)\n skipInitial: false, // if previous detection resulted in no faces detected,\n // should skipFrames be reset immediately to force new detection cycle\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 31, // how many frames to go without re-running the detector\n // only used for video inputs\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 32, // how many frames to go without re-running the detector\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'posenet.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet' or 'blazepose'\n maxDetected: 1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet as blazepose only detects single pose\n minConfidence: 0.2, // threshold for discarding a prediction\n },\n\n hand: {\n enabled: true,\n rotation: false, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n skipFrames: 12, // how many frames to go without re-running the hand bounding box detector\n // only used for video inputs\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand probably\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n skipInitial: false, // if previous detection resulted in no hands detected,\n // should skipFrames be reset immediately to force new detection cycle\n minConfidence: 0.1, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 1, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handdetect.json', // hand detector model, can be absolute path or relative to modelBasePath\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'nanodet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 41, // how many frames to go without re-running the detector\n },\n};\nexport { config as defaults };\n", "// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABA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QSI3SAlACRCQAAEoAEoASAAAAAAAAACUACR\nACQAAAAAAAAAAAAASAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAABAAAAAAAAAAAAACBKAAAAAAAQ\nJQAAAhICEbJAYTWJ7wx8KvpC0BV4ceieWGewDHlNmWwCNjZICNhIDmcZredBecdpiY69FXCOLW+i\nUiZidukulmxxlx2paN4mNng+K4+I8Hy2yaTfl37TXetoCPfRxfp1qi3F48ofKMvtvxak8s6LDv61\nrZji9rPaLUf5PC+bfttS0q8q3p9W/wBrRMdpUZuKdN99nzvFqPbTVz7nD8OKs+do2/mW3h4D7Xaq\nZnPrtNpqz35aRaYOHY9Zk4pNt9rR+rl6zi+OnS+WN57Rv1lXp/YrNaYtruL6zNPnGO3hxP6O5w/2\nf0HDuun09Yv55Le9afznqcOvO4tBreMTHu30unnva0bWt8on+70nDuE4OHYYx4Kbesz3tPrMuhGO\nIjpDOKrK9YVpsyiGUQnYGOyUgI2SlAIEmwMWMs9kTAMJYzDOYRMArmGErZhhMArlHmzmGMwDE3Ts\nbAbs4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "import { log, now, mergeDeep } from './helpers';\nimport * as sysinfo from './sysinfo';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as backend from './tfjs/backend';\nimport * as faceall from './faceall';\nimport * as facemesh from './blazeface/facemesh';\nimport * as faceres from './faceres/faceres';\nimport * as emotion from './emotion/emotion';\nimport * as posenet from './posenet/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as blazepose from './blazepose/blazepose';\nimport * as nanodet from './nanodet/nanodet';\nimport * as gesture from './gesture/gesture';\nimport * as image from './image/image';\nimport * as draw from './draw/draw';\nimport { Config, defaults } from './config';\nimport { Result } from './result';\nimport * as sample from './sample';\nimport * as app from '../package.json';\n\n/** Generic Tensor object type */\nexport type Tensor = typeof tf.Tensor;\n\nexport type { Config } from './config';\nexport type { Result } from './result';\nexport type { DrawOptions } from './draw/draw';\n\n/** Defines all possible input types for **Human** detection */\nexport type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\n/** Error message */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS */\nexport type TensorFlow = typeof tf;\n\n/** Generic Model object type, holds instance of individual models */\ntype Model = Object;\n\n/**\n * **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n */\nexport class Human {\n /** Current version of Human library in semver format */\n version: string;\n /** Current configuration\n * - Details: {@link Config}\n */\n config: Config;\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n */\n state: string;\n /** Internal: Instance of current image being processed */\n image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n /** Internal: Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n */\n tf: TensorFlow;\n /** Draw helper classes that can draw detected objects on canvas using specified draw styles\n * - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: {\n options: draw.DrawOptions,\n gesture: typeof draw.gesture,\n face: typeof draw.face,\n body: typeof draw.body,\n hand: typeof draw.hand,\n canvas: typeof draw.canvas,\n all: typeof draw.all,\n };\n /** Internal: Currently loaded models */\n models: {\n face: facemesh.MediaPipeFaceMesh | Model | null,\n posenet: Model | null,\n blazepose: Model | null,\n efficientpose: Model | null,\n handpose: handpose.HandPose | null,\n iris: Model | null,\n age: Model | null,\n gender: Model | null,\n emotion: Model | null,\n embedding: Model | null,\n nanodet: Model | null,\n faceres: Model | null,\n };\n /** Internal: Currently loaded classes */\n classes: {\n facemesh: typeof facemesh;\n emotion: typeof emotion;\n body: typeof posenet | typeof blazepose;\n hand: typeof handpose;\n nanodet: typeof nanodet;\n faceres: typeof faceres;\n };\n /** Face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Platform and agent information detected by Human */\n sysinfo: { platform: string, agent: string };\n /** Performance object that contains values for all recently performed operations */\n perf: any;\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n #firstRun: boolean;\n\n // definition end\n\n /**\n * Creates instance of Human library that is futher used for all operations\n * - @param userConfig: {@link Config}\n */\n constructor(userConfig: Config | Object = {}) {\n this.tf = tf;\n this.draw = draw;\n this.version = app.version;\n this.config = mergeDeep(defaults, userConfig);\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.#firstRun = true;\n this.perf = {};\n // object that contains all initialized models\n this.models = {\n face: null,\n posenet: null,\n blazepose: null,\n efficientpose: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n embedding: null,\n nanodet: null,\n faceres: null,\n };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.image = (input: Input) => image.process(input, this.config);\n // export raw access to underlying models\n this.classes = {\n facemesh,\n emotion,\n faceres,\n body: this.config.body.modelPath.includes('posenet') ? posenet : blazepose,\n hand: handpose,\n nanodet,\n };\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // include platform info\n this.sysinfo = sysinfo.info();\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg) => {\n if (!this.#analyzeMemoryLeaks) return;\n const current = this.tf.engine().state.numTensors;\n const previous = this.#numTensors;\n this.#numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)\n * - Calculation is based on normalized Minkowski distance between\n */\n // eslint-disable-next-line class-methods-use-this\n similarity(embedding1: Array, embedding2: Array): number {\n return faceres.similarity(embedding1, embedding2);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n * @param input Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n return faceres.enhance(input);\n }\n\n /**\n * Math method find best match between provided face descriptor and predefined database of known descriptors\n * @param faceEmbedding: face descriptor previsouly calculated on any face\n * @param db: array of mapping of face descriptors to known values\n * @param threshold: minimum score for matching to be considered in the result\n * @returns best match\n */\n // eslint-disable-next-line class-methods-use-this\n match(faceEmbedding: Array, db: Array<{ name: string, source: string, embedding: number[] }>, threshold = 0): { name: string, source: string, similarity: number, embedding: number[] } {\n return faceres.match(faceEmbedding, db, threshold);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n */\n async load(userConfig: Config | Object = {}) {\n this.state = 'load';\n const timeStamp = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n\n if (this.#firstRun) {\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (this.config.debug) log('platform:', this.sysinfo.platform);\n if (this.config.debug) log('agent:', this.sysinfo.agent);\n\n await this.#checkBackend(true);\n if (this.tf.ENV.flags.IS_BROWSER) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n if (this.config.async) {\n [\n this.models.face,\n this.models.emotion,\n this.models.handpose,\n this.models.posenet,\n this.models.blazepose,\n this.models.nanodet,\n this.models.faceres,\n ] = await Promise.all([\n this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),\n this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),\n this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),\n this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),\n this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),\n this.models.nanodet || (this.config.object.enabled ? nanodet.load(this.config) : null),\n this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),\n ]);\n } else {\n if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);\n if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);\n if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);\n if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);\n if (this.config.object.enabled && !this.models.nanodet) this.models.nanodet = await nanodet.load(this.config);\n if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);\n }\n\n if (this.#firstRun) {\n if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');\n this.#firstRun = false;\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.perf.load || 0)) this.perf.load = current;\n }\n\n // check if backend needs initialization if it changed\n /** @hidden */\n #checkBackend = async (force = false) => {\n if (this.config.backend && (this.config.backend.length > 0) && force || (this.tf.getBackend() !== this.config.backend)) {\n const timeStamp = now();\n this.state = 'backend';\n /* force backend reload\n if (this.config.backend in tf.engine().registry) {\n const backendFactory = tf.findBackendFactory(this.config.backend);\n tf.removeBackend(this.config.backend);\n tf.registerBackend(this.config.backend, backendFactory);\n } else {\n log('Backend not registred:', this.config.backend);\n }\n */\n\n if (this.config.backend && this.config.backend.length > 0) {\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');\n\n // force browser vs node backend\n if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';\n if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';\n\n if (this.config.debug) log('setting backend:', this.config.backend);\n\n if (this.config.backend === 'wasm') {\n if (this.config.debug) log('wasm path:', this.config.wasmPath);\n if (typeof this.tf?.setWasmPaths !== 'undefined') this.tf.setWasmPaths(this.config.wasmPath);\n else throw new Error('Human: WASM backend is not loaded');\n const simd = await this.tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await this.tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (this.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (this.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n if (this.config.backend === 'humangl') backend.register();\n try {\n await this.tf.setBackend(this.config.backend);\n } catch (err) {\n log('error: cannot set backend:', this.config.backend, err);\n }\n }\n this.tf.enableProdMode();\n // this.tf.enableDebugMode();\n if (this.tf.getBackend() === 'webgl' || this.tf.getBackend() === 'humangl') {\n this.tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n this.tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n if (typeof this.config['deallocate'] !== 'undefined') {\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n this.tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n const gl = await this.tf.backend().getGPGPUContext().gl;\n if (this.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n await this.tf.ready();\n this.perf.backend = Math.trunc(now() - timeStamp);\n }\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n */\n async detect(input: Input, userConfig: Config | Object = {}): Promise {\n // detection happens inside a promise\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig);\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend\n await this.#checkBackend();\n\n // load models if enabled\n await this.load();\n\n // disable video optimization for inputs of type image, but skip if inside worker thread\n let previousVideoOptimized;\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (\n (typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n || (typeof Image !== 'undefined' && input instanceof Image)\n || (typeof ImageData !== 'undefined' && input instanceof ImageData)\n || (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap))\n ) {\n log('disabling video optimization');\n previousVideoOptimized = this.config.videoOptimized;\n this.config.videoOptimized = false;\n }\n\n timeStamp = now();\n const process = image.process(input, this.config);\n if (!process || !process.tensor) {\n log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.perf.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n // prepare where to store model results\n let bodyRes;\n let handRes;\n let faceRes;\n let objectRes;\n let current;\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n if (this.config.async) {\n faceRes = this.config.face.enabled ? faceall.detectFace(this, process.tensor) : [];\n if (this.perf.face) delete this.perf.face;\n } else {\n this.state = 'run:face';\n timeStamp = now();\n faceRes = this.config.face.enabled ? await faceall.detectFace(this, process.tensor) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.face = current;\n }\n\n // run body: can be posenet or blazepose\n this.analyze('Start Body:');\n if (this.config.async) {\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(process.tensor, this.config) : [];\n if (this.perf.body) delete this.perf.body;\n } else {\n this.state = 'run:body';\n timeStamp = now();\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.body = current;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n if (this.config.async) {\n handRes = this.config.hand.enabled ? this.models.handpose?.estimateHands(process.tensor, this.config) : [];\n if (this.perf.hand) delete this.perf.hand;\n } else {\n this.state = 'run:hand';\n timeStamp = now();\n handRes = this.config.hand.enabled ? await this.models.handpose?.estimateHands(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.hand = current;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n if (this.config.async) {\n objectRes = this.config.object.enabled ? nanodet.predict(process.tensor, this.config) : [];\n if (this.perf.object) delete this.perf.object;\n } else {\n this.state = 'run:object';\n timeStamp = now();\n objectRes = this.config.object.enabled ? await nanodet.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.object = current;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n if (this.config.async) {\n [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n }\n tf.dispose(process.tensor);\n\n // run gesture analysis last\n let gestureRes: any[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.perf.gesture = Math.trunc(now() - timeStamp);\n else if (this.perf.gesture) delete this.perf.gesture;\n }\n\n // restore video optimizations if previously disabled\n if (previousVideoOptimized) this.config.videoOptimized = previousVideoOptimized;\n\n this.perf.total = Math.trunc(now() - timeStart);\n this.state = 'idle';\n const result = {\n face: faceRes,\n body: bodyRes,\n hand: handRes,\n gesture: gestureRes,\n object: objectRes,\n performance: this.perf,\n canvas: process.canvas,\n };\n // log('Result:', result);\n resolve(result);\n });\n }\n\n /** @hidden */\n #warmupBitmap = async () => {\n const b64toBlob = (base64, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (this.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await this.detect(bitmap, this.config);\n bitmap.close();\n }\n return res;\n }\n\n /** @hidden */\n #warmupCanvas = async () => new Promise((resolve) => {\n let src;\n let size = 0;\n switch (this.config.warmup) {\n case 'face':\n size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n const img = new Image();\n img.onload = async () => {\n const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx?.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const res = await this.detect(canvas, this.config);\n resolve(res);\n };\n if (src) img.src = src;\n else resolve(null);\n });\n\n /** @hidden */\n #warmupNode = async () => {\n const atob = (str) => Buffer.from(str, 'base64');\n let img;\n if (this.config.warmup === 'face') img = atob(sample.face);\n if (this.config.warmup === 'body' || this.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n this.tf.dispose(data);\n // log('Input:', expanded);\n res = await this.detect(expanded, this.config);\n this.tf.dispose(expanded);\n } else {\n if (this.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await this.detect(input, this.config);\n */\n }\n return res;\n }\n\n /** Warmup metho pre-initializes all models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n async warmup(userConfig: Config | Object = {}): Promise {\n const t0 = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n if (!this.config.warmup || this.config.warmup === 'none') return { error: 'null' };\n const save = this.config.videoOptimized;\n this.config.videoOptimized = false;\n let res;\n if (typeof createImageBitmap === 'function') res = await this.#warmupBitmap();\n else if (typeof Image !== 'undefined') res = await this.#warmupCanvas();\n else res = await this.#warmupNode();\n this.config.videoOptimized = save;\n const t1 = now();\n if (this.config.debug) log('Warmup', this.config.warmup, Math.round(t1 - t0), 'ms', res);\n return res;\n }\n}\n\n/**\n * Class Human is also available as default export\n */\nexport { Human as default };\n"], - "mappings": ";;;;;;;ukBACO,WAAc,EAAgB,EAAsB,CACzD,GAAM,GAAY,EAAO,SAAS,KAAO,GAAK,IAExC,EAAO,AADI,EAAK,WAAW,MAAQ,EAAK,WAAW,MAAQ,EAAK,WAAW,UAAY,EAAK,WAAW,WAAa,EAAK,WAAW,SAClH,GAAG,IAAS,GAAG,IAAS,IAAY,IAC5D,GAAI,CAAC,EAAK,oBAAoB,SAAS,SAAU,KAAM,IAAI,OAAM,2BAA2B,yBAC5F,MAAO,GAIF,cAAgB,EAAK,CAC1B,GAAM,GAAK,GAAI,MACT,EAAK,GAAG,EAAG,WAAW,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,aAAa,WAAW,SAAS,EAAG,QAAQ,EAAG,kBAAkB,WAAW,SAAS,EAAG,OAErM,AAAI,GAAK,QAAQ,IAAI,EAAI,SAAU,GAAG,GAIjC,GAAM,GAAM,IACb,MAAO,cAAgB,YAAoB,YAAY,MACpD,SAAU,QAAO,QAAQ,OAAO,UAAY,IAAO,KAAM,YAI3D,cAAsB,EAAS,CACpC,GAAM,GAAW,AAAC,GAAQ,GAAO,MAAO,IAAQ,SAChD,MAAO,GAAQ,OAAO,CAAC,EAAM,IAC3B,QAAO,KAAK,GAAO,IAAI,QAAQ,AAAC,GAAQ,CACtC,GAAM,GAAO,EAAK,GACZ,EAAO,EAAI,GACjB,AAAI,MAAM,QAAQ,IAAS,MAAM,QAAQ,GAAO,EAAK,GAAO,EAAK,OAAO,GAAG,GACtE,AAAI,EAAS,IAAS,EAAS,GAAO,EAAK,GAAO,EAAU,EAAM,GAClE,EAAK,GAAO,IAEZ,GACN,ICnCE,aAAqD,CAC1D,GAAI,GACA,EACJ,GAAI,MAAO,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"sources": ["../src/helpers.ts", "../src/sysinfo.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/blazeface/facemesh.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/faceall.ts", "../src/posenet/posenet.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/handpose/handpose.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/blazepose/blazepose.ts", "../src/blazepose/annotations.ts", "../src/nanodet/nanodet.ts", "../src/nanodet/labels.ts", "../src/gesture/gesture.ts", "../src/image/image.ts", "../src/image/imagefx.js", "../src/draw/draw.ts", "../src/config.ts", "../src/sample.ts", "../src/human.ts"], + "sourcesContent": ["// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg) {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n", "export function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "// wrapper to load tfjs in a single place so version can be changed quickly\n\n// simplified\n// { modules: 1250, moduleBytes: 4013323, imports: 7, importBytes: 2255, outputBytes: 2991826, outputFiles: 'dist/tfjs.esm.js' }\n// export * from '@tensorflow/tfjs/dist/index.js';\n// export * from '@tensorflow/tfjs-backend-wasm';\n\n// modular\n// { modules: 1253, moduleBytes: 4029357, imports: 7, importBytes: 2285, outputBytes: 2998298, outputFiles: 'dist/tfjs.esm.js' }\n\n// get versions of all packages.\nimport * as packageBundle from '@tensorflow/tfjs/package.json';\nimport * as packageCore from '@tensorflow/tfjs-core/package.json';\nimport * as packageData from '@tensorflow/tfjs-data/package.json';\nimport * as packageLayers from '@tensorflow/tfjs-layers/package.json';\nimport * as packageConverter from '@tensorflow/tfjs-converter/package.json';\n// for backends, get version from source so it can register backend during import\nimport { version_cpu } from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nimport { version_webgl } from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nimport { version_wasm } from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - compiled\nexport * from '@tensorflow/tfjs-core/dist/index.js';\nexport * from '@tensorflow/tfjs-layers/dist/index.js';\nexport * from '@tensorflow/tfjs-converter/dist/index.js';\nexport * as data from '@tensorflow/tfjs-data/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-cpu/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-webgl/dist/index.js';\nexport * from '@tensorflow/tfjs-backend-wasm/dist/index.js';\n\n// export all - sources\n/*\nexport * from '@tensorflow/tfjs-core/src/index';\nexport * from '@tensorflow/tfjs-layers/src/index';\nexport * from '@tensorflow/tfjs-converter/src/index';\nexport * as data from '@tensorflow/tfjs-data/src/index';\nexport * from '@tensorflow/tfjs-backend-cpu/src/index';\nexport * from '@tensorflow/tfjs-backend-webgl/src/index';\nexport * from '@tensorflow/tfjs-backend-wasm/src/index';\n*/\n\n// export versions\nexport const version = {\n tfjs: packageBundle?.version || undefined,\n 'tfjs-core': packageCore?.version || undefined,\n 'tfjs-data': packageData?.version || undefined,\n 'tfjs-layers': packageLayers?.version || undefined,\n 'tfjs-converter': packageConverter?.version || undefined,\n 'tfjs-backend-cpu': version_cpu || undefined,\n 'tfjs-backend-webgl': version_webgl || undefined,\n 'tfjs-backend-wasm': version_wasm || undefined,\n};\n// export const version = {};\n", "import { log } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport const config = {\n name: 'humangl',\n priority: 99,\n canvas: null,\n gl: null,\n width: 1024,\n height: 1024,\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nexport function register(): void {\n if (!tf.findBackend(config.name)) {\n log('backend registration:', config.name);\n try {\n config.canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(config.width, config.height) : document.createElement('canvas');\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr);\n } catch (err) {\n log('error: cannot get WebGL2 context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL2 context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n // tf.ENV.set('WEBGL_MAX_TEXTURE_SIZE', config.gl.getParameter(config.gl.MAX_TEXTURE_SIZE));\n // tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true);\n // tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n log('backend registered:', config.name);\n }\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as facepipeline from './facepipeline';\nimport * as coords from './coords';\n\nlet faceModels:[any, any, any] = [null, null, null];\nlet facePipeline;\n\nexport async function predict(input, config): Promise<{ confidence, boxConfidence, faceConfidence, box, mesh, boxRaw, meshRaw, annotations, image }[]> {\n const predictions = await facePipeline.predict(input, config);\n const results: Array<{ confidence, boxConfidence, faceConfidence, box, mesh, boxRaw, meshRaw, annotations, image }> = [];\n for (const prediction of (predictions || [])) {\n if (prediction.isDisposedInternal) continue; // guard against disposed tensors on long running operations such as pause in middle of processing\n const mesh = prediction.coords ? prediction.coords.arraySync() : [];\n const meshRaw = mesh.map((pt) => [\n pt[0] / input.shape[2],\n pt[1] / input.shape[1],\n pt[2] / facePipeline.meshSize,\n ]);\n const annotations = {};\n if (mesh && mesh.length > 0) {\n for (const key of Object.keys(coords.MESH_ANNOTATIONS)) annotations[key] = coords.MESH_ANNOTATIONS[key].map((index) => mesh[index]);\n }\n const box = prediction.box ? [\n Math.max(0, prediction.box.startPoint[0]),\n Math.max(0, prediction.box.startPoint[1]),\n Math.min(input.shape[2], prediction.box.endPoint[0]) - Math.max(0, prediction.box.startPoint[0]),\n Math.min(input.shape[1], prediction.box.endPoint[1]) - Math.max(0, prediction.box.startPoint[1]),\n ] : 0;\n const boxRaw = prediction.box ? [\n prediction.box.startPoint[0] / input.shape[2],\n prediction.box.startPoint[1] / input.shape[1],\n (prediction.box.endPoint[0] - prediction.box.startPoint[0]) / input.shape[2],\n (prediction.box.endPoint[1] - prediction.box.startPoint[1]) / input.shape[1],\n ] : [];\n results.push({\n confidence: Math.round(100 * prediction.faceConfidence || 100 * prediction.boxConfidence || 0) / 100,\n boxConfidence: Math.round(100 * prediction.boxConfidence) / 100,\n faceConfidence: Math.round(100 * prediction.faceConfidence) / 100,\n box,\n boxRaw,\n mesh,\n meshRaw,\n annotations,\n image: prediction.image ? prediction.image.clone() : null,\n });\n if (prediction.coords) prediction.coords.dispose();\n if (prediction.image) prediction.image.dispose();\n }\n return results;\n}\n\nexport async function load(config): Promise<[Object, Object, Object]> {\n if ((!faceModels[0] && config.face.enabled) || (!faceModels[1] && config.face.mesh.enabled) || (!faceModels[2] && config.face.iris.enabled)) {\n faceModels = await Promise.all([\n (!faceModels[0] && config.face.enabled) ? blazeface.load(config) : null,\n (!faceModels[1] && config.face.mesh.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.mesh.modelPath), { fromTFHub: config.face.mesh.modelPath.includes('tfhub.dev') }) : null,\n (!faceModels[2] && config.face.iris.enabled) ? tf.loadGraphModel(join(config.modelBasePath, config.face.iris.modelPath), { fromTFHub: config.face.iris.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.face.mesh.enabled) {\n if (!faceModels[1] || !faceModels[1].modelUrl) log('load model failed:', config.face.mesh.modelPath);\n else if (config.debug) log('load model:', faceModels[1].modelUrl);\n }\n if (config.face.iris.enabled) {\n if (!faceModels[2] || !faceModels[1].modelUrl) log('load model failed:', config.face.iris.modelPath);\n else if (config.debug) log('load model:', faceModels[2].modelUrl);\n }\n } else if (config.debug) {\n log('cached model:', faceModels[0].model.modelUrl);\n log('cached model:', faceModels[1].modelUrl);\n log('cached model:', faceModels[2].modelUrl);\n }\n facePipeline = new facepipeline.Pipeline(faceModels[0], faceModels[1], faceModels[2]);\n return faceModels;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n}\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, landmarks: box.landmarks };\n}\n\nexport function calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint, landmarks };\n}\n\nexport const disposeBox = (t) => {\n t.startEndTensor.dispose();\n t.startPoint.dispose();\n t.endPoint.dispose();\n};\n\nexport const createBox = (startEndTensor) => ({\n startEndTensor,\n startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]),\n endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]),\n});\n", "export const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n/**\n * Normalizes the provided angle to the range -pi to pi.\n * @param angle The angle in radians to be normalized.\n */\nexport function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\n/**\n * Computes the angle of rotation between two anchor points.\n * @param point1 First anchor point\n * @param point2 Second anchor point\n */\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport function radToDegrees(rad) {\n return rad * 180 / Math.PI;\n}\n\nexport function buildTranslationMatrix(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n}\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n\nexport function xyDistanceBetweenPoints(a, b) {\n return Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n}\n\nexport function generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) {\n anchors.push([anchorX, anchorY]);\n }\n }\n }\n }\n return anchors;\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\n\nconst keypointsCount = 6;\n\nfunction decodeBounds(boxOutputs, anchors, inputSize) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport class BlazeFaceModel {\n model: any;\n anchorsData: any;\n anchors: any;\n inputSize: number;\n config: any;\n\n constructor(model, config) {\n this.model = model;\n this.anchorsData = util.generateAnchors(model.inputs[0].shape[1]);\n this.anchors = tf.tensor2d(this.anchorsData);\n this.inputSize = model.inputs[0].shape[2];\n this.config = config;\n }\n\n async getBoundingBoxes(inputImage) {\n // sanity check on input\n if ((!inputImage) || (inputImage.isDisposedInternal) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return null;\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = inputImage.resizeBilinear([this.inputSize, this.inputSize]);\n // const normalizedImage = tf.mul(tf.sub(resizedImage.div(255), 0.5), 2);\n const normalizedImage = resizedImage.div(127.5).sub(0.5);\n const batchedPrediction = this.model.predict(normalizedImage);\n let batchOut;\n // are we using tfhub or pinto converted model?\n if (Array.isArray(batchedPrediction)) {\n const sorted = batchedPrediction.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = concat.squeeze(0);\n } else {\n batchOut = batchedPrediction.squeeze(); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut, this.anchors, [this.inputSize, this.inputSize]);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.sigmoid(logits).squeeze();\n return [batchOut, boxesOut, scoresOut];\n });\n const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.face.detector.maxDetected, this.config.face.detector.iouThreshold, this.config.face.detector.minConfidence);\n const boxIndices = boxIndicesTensor.arraySync();\n boxIndicesTensor.dispose();\n const boundingBoxesMap = boxIndices.map((boxIndex) => tf.slice(boxes, [boxIndex, 0], [1, -1]));\n const boundingBoxes = boundingBoxesMap.map((boundingBox) => {\n const vals = boundingBox.arraySync();\n boundingBox.dispose();\n return vals;\n });\n\n const scoresVal = scores.dataSync();\n const annotatedBoxes: Array<{ box: any, landmarks: any, anchor: any, confidence: number }> = [];\n for (let i = 0; i < boundingBoxes.length; i++) {\n const boxIndex = boxIndices[i];\n const confidence = scoresVal[boxIndex];\n if (confidence > this.config.face.detector.minConfidence) {\n const localBox = box.createBox(boundingBoxes[i]);\n const anchor = this.anchorsData[boxIndex];\n const landmarks = tf.tidy(() => tf.slice(batch, [boxIndex, keypointsCount - 1], [1, -1]).squeeze().reshape([keypointsCount, -1]));\n annotatedBoxes.push({ box: localBox, landmarks, anchor, confidence });\n }\n }\n batch.dispose();\n boxes.dispose();\n scores.dispose();\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / this.inputSize, inputImage.shape[1] / this.inputSize],\n };\n }\n}\n\nexport async function load(config) {\n const model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector.modelPath), { fromTFHub: config.face.detector.modelPath.includes('tfhub.dev') });\n const blazeFace = new BlazeFaceModel(model, config);\n if (!model || !model.modelUrl) log('load model failed:', config.face.detector.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n return blazeFace;\n}\n", "export const MESH_ANNOTATIONS = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121, 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92, 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4, 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244, 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26, 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53, 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153, 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202, 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149, 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102, 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195, 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108, 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7, 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2, 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209, 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86, 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239, 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226, 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238, 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220, 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357, 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304, 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364, 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17, 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261, 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363, 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293, 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287, 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271, 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351, 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15, 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311, 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454, 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370, 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379, 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446, 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414, 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291, 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433, 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341, 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290, 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420, 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398, 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39, 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74, 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129, 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148, 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126, 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91, 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51, 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210, 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210, 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16, 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218, 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66, 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65, 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2, 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209, 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194, 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4, 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230, 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213, 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215, 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297, 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410, 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4, 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269, 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438, 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349, 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281, 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257, 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304, 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404, 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351, 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276, 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265, 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251, 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374, 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459, 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306, 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358, 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256, 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305, 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360, 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as bounding from './box';\nimport * as util from './util';\nimport * as coords from './coords';\n\nconst leftOutline = coords.MESH_ANNOTATIONS['leftEyeLower0'];\nconst rightOutline = coords.MESH_ANNOTATIONS['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, coords.MESH_ANNOTATIONS['midwayBetweenEyes'][0]],\n};\n\nconst blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.MESH_ANNOTATIONS[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n// The Pipeline coordinates between the bounding box and skeleton models.\nexport class Pipeline {\n storedBoxes: any;\n boundingBoxDetector: any;\n meshDetector: any;\n irisModel: any;\n boxSize: number;\n meshSize: number;\n irisSize: number;\n irisEnlarge: number;\n skipped: number;\n detectedFaces: number;\n\n constructor(boundingBoxDetector, meshDetector, irisModel) {\n // An array of facial bounding boxes.\n this.storedBoxes = [];\n this.boundingBoxDetector = boundingBoxDetector;\n this.meshDetector = meshDetector;\n this.irisModel = irisModel;\n this.boxSize = boundingBoxDetector?.model?.inputs[0].shape[2] || 0;\n this.meshSize = meshDetector?.inputs[0].shape[2] || boundingBoxDetector?.model?.inputs[0].shape[2];\n this.irisSize = irisModel?.inputs[0].shape[1] || 0;\n this.irisEnlarge = 2.3;\n this.skipped = 0;\n this.detectedFaces = 0;\n }\n\n transformRawCoords(rawCoords, box, angle, rotationMatrix) {\n const boxSize = bounding.getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / this.meshSize * (coord[0] - this.meshSize / 2),\n boxSize[1] / this.meshSize * (coord[1] - this.meshSize / 2),\n coord[2],\n ]));\n const coordsRotationMatrix = (angle !== 0) ? util.buildRotationMatrix(angle, [0, 0]) : util.IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...util.rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? util.invertTransformMatrix(rotationMatrix) : util.IDENTITY_MATRIX;\n const boxCenter = [...bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n coord[0] + util.dot(boxCenter, inverseRotationMatrix[0]),\n coord[1] + util.dot(boxCenter, inverseRotationMatrix[1]),\n coord[2],\n ]));\n }\n\n // eslint-disable-next-line class-methods-use-this\n getLeftToRightEyeDepthDifference(rawCoords) {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n }\n\n // Returns a box describing a cropped region around the eye fit for passing to the iris model.\n getEyeBox(rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false) {\n const box = bounding.squarifyBox(bounding.enlargeBox(bounding.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), this.irisEnlarge));\n const boxSize = bounding.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / this.meshSize,\n box.startPoint[0] / this.meshSize, box.endPoint[1] / this.meshSize,\n box.endPoint[0] / this.meshSize,\n ]], [0], [this.irisSize, this.irisSize]);\n if (flip && tf.ENV.flags.IS_BROWSER) {\n crop = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n }\n return { box, boxSize, crop };\n }\n\n // Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\n getEyeCoords(eyeData, eyeBox, eyeBoxSize, flip = false) {\n const eyeRawCoords: Array = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / this.irisSize)) : (x / this.irisSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / this.irisSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n }\n\n // The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n // eslint-disable-next-line class-methods-use-this\n getAdjustedIrisCoords(rawCoords, irisCoords, direction) {\n const upperCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.MESH_ANNOTATIONS[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n }\n\n async predict(input, config) {\n let useFreshBox = false;\n // run new detector every skipFrames unless we only want box to start with\n let detector;\n if ((this.skipped === 0) || (this.skipped > config.face.detector.skipFrames) || !config.face.mesh.enabled || !config.videoOptimized) {\n detector = await this.boundingBoxDetector.getBoundingBoxes(input);\n this.skipped = 0;\n }\n if (config.videoOptimized) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (!config.videoOptimized || (detector && detector.boxes && (!config.face.mesh.enabled || (detector.boxes.length !== this.detectedFaces) && (this.detectedFaces !== config.face.detector.maxDetected)))) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n for (const possible of detector.boxes) {\n this.storedBoxes.push({ startPoint: possible.box.startPoint.dataSync(), endPoint: possible.box.endPoint.dataSync(), landmarks: possible.landmarks, confidence: possible.confidence });\n }\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n\n if (config.face.detector.skipInitial && this.detectedFaces === 0) this.skipped = 0;\n\n if (useFreshBox) {\n if (!detector || !detector.boxes || (detector.boxes.length === 0)) {\n this.storedBoxes = [];\n this.detectedFaces = 0;\n return null;\n }\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const scaledBox = bounding.scaleBoxCoordinates({ startPoint: this.storedBoxes[i].startPoint, endPoint: this.storedBoxes[i].endPoint }, detector.scaleFactor);\n const enlargedBox = bounding.enlargeBox(scaledBox);\n const squarifiedBox = bounding.squarifyBox(enlargedBox);\n const landmarks = this.storedBoxes[i].landmarks.arraySync();\n const confidence = this.storedBoxes[i].confidence;\n this.storedBoxes[i] = { ...squarifiedBox, confidence, landmarks };\n }\n }\n if (detector && detector.boxes) {\n detector.boxes.forEach((prediction) => {\n prediction.box.startPoint.dispose();\n prediction.box.endPoint.dispose();\n prediction.landmarks.dispose();\n });\n }\n\n let results = tf.tidy(() => this.storedBoxes.map((box, i) => {\n const boxConfidence = box.confidence;\n\n // The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).\n let face;\n let angle = 0;\n let rotationMatrix;\n\n if (config.face.detector.rotation && config.face.mesh.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.boxSize, this.boxSize]).div(255);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const clonedImage = input.clone();\n if (config.face.mesh.enabled) face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.meshSize, this.meshSize]).div(255);\n else face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, clonedImage, [this.boxSize, this.boxSize]).div(255);\n }\n\n // if we're not going to produce mesh, don't spend time with further processing\n if (!config.face.mesh.enabled) {\n const prediction = {\n coords: null,\n box,\n faceConfidence: null,\n boxConfidence,\n confidence: box.confidence,\n image: face,\n };\n return prediction;\n }\n\n const [, confidence, contourCoords] = this.meshDetector.predict(face); // The first returned tensor represents facial contours which are already included in the coordinates.\n const faceConfidence = confidence.dataSync()[0];\n if (faceConfidence < config.face.detector.minConfidence) return null; // if below confidence just exit\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = coordsReshaped.arraySync();\n\n if (config.face.iris.enabled) {\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = this.getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1]);\n const eyePredictions = this.irisModel.predict(tf.concat([leftEyeCrop, rightEyeCrop]));\n const eyePredictionsData = eyePredictions.dataSync();\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = this.getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = this.getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = this.getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = this.getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = this.getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n rawCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n }\n\n // override box from detection with one calculated from mesh\n const transformedCoordsData = this.transformRawCoords(rawCoords, box, angle, rotationMatrix);\n box = bounding.enlargeBox(bounding.calculateLandmarksBoundingBox(transformedCoordsData), 1.5); // redefine box with mesh calculated one\n const transformedCoords = tf.tensor2d(transformedCoordsData);\n\n // do rotation one more time with mesh keypoints if we want to return perfect image\n if (config.face.detector.rotation && config.face.mesh.enabled && config.face.description.enabled && tf.ENV.flags.IS_BROWSER) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= meshLandmarks.count) ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine;\n angle = util.computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter = bounding.getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotatedImage = tf.image.rotateWithOffset(input.toFloat(), angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n rotationMatrix = util.buildRotationMatrix(-angle, faceCenter);\n face = bounding.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotatedImage, [this.meshSize, this.meshSize]).div(255);\n }\n\n const prediction = {\n coords: transformedCoords,\n box,\n faceConfidence,\n boxConfidence,\n image: face,\n rawCoords,\n };\n\n // updated stored cache values\n const squarifiedLandmarksBox = bounding.squarifyBox(box);\n this.storedBoxes[i] = { ...squarifiedLandmarksBox, landmarks: transformedCoordsData, confidence: box.confidence, faceConfidence };\n\n return prediction;\n }));\n\n results = results.filter((a) => a !== null);\n // remove cache entries for detected boxes on low confidence\n if (config.face.mesh.enabled) this.storedBoxes = this.storedBoxes.filter((a) => a.faceConfidence > config.face.detector.minConfidence);\n this.detectedFaces = results.length;\n\n return results;\n }\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model;\nlet last: Array<{ score: number, emotion: string }> = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.emotion.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if ((skipped < config.face.emotion.skipFrames) && config.videoOptimized && (last.length > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n resize.dispose();\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n red.dispose();\n green.dispose();\n blue.dispose();\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n redNorm.dispose();\n greenNorm.dispose();\n blueNorm.dispose();\n const normalize = tf.tidy(() => grayscale.sub(0.5).mul(2));\n grayscale.dispose();\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion.enabled) {\n const emotionT = await model.predict(normalize); // result is already in range 0..1, no need for additional activation\n const data = emotionT.dataSync();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > config.face.emotion.minConfidence) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n normalize.dispose();\n last = obj;\n resolve(obj);\n });\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nlet model;\nlet last = { age: 0 };\nlet skipped = Number.MAX_SAFE_INTEGER;\n\ntype Tensor = typeof tf.Tensor;\ntype DB = Array<{ name: string, source: string, embedding: number[] }>;\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.description.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.face.description.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport function similarity(embedding1, embedding2, order = 2): number {\n if (!embedding1 || !embedding2) return 0;\n if (embedding1?.length === 0 || embedding2?.length === 0) return 0;\n if (embedding1?.length !== embedding2?.length) return 0;\n // general minkowski distance, euclidean distance is limited case where order is 2\n const distance = 5.0 * embedding1\n .map((val, i) => (Math.abs(embedding1[i] - embedding2[i]) ** order)) // distance squared\n .reduce((sum, now) => (sum + now), 0) // sum all distances\n ** (1 / order); // get root of\n const res = Math.max(0, 100 - distance) / 100.0;\n return res;\n}\n\nexport function match(embedding: Array, db: DB, threshold = 0) {\n let best = { similarity: 0, name: '', source: '', embedding: [] as number[] };\n if (!embedding || !db || !Array.isArray(embedding) || !Array.isArray(db)) return best;\n for (const f of db) {\n if (f.embedding && f.name) {\n const perc = similarity(embedding, f.embedding);\n if (perc > threshold && perc > best.similarity) best = { ...f, similarity: perc };\n }\n }\n return best;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n // const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // optional increase image contrast\n // or do it per-channel so mean is done on each channel\n // or do it based on histogram\n const mean = merge.mean();\n const factor = 5;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = crop.mul(255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if ((skipped < config.face.description.skipFrames) && config.videoOptimized && last.age && (last.age > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderConfidence: 0,\n descriptor: [] };\n\n if (config.face.description.enabled) resT = await model.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n tf.tidy(() => {\n const gender = resT.find((t) => t.shape[1] === 1).dataSync();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > config.face.description.minConfidence) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderConfidence = Math.min(0.99, confidence);\n }\n const age = resT.find((t) => t.shape[1] === 100).argMax(1).dataSync()[0];\n const all = resT.find((t) => t.shape[1] === 100).dataSync();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]);\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it\n\n obj.descriptor = [...desc.dataSync()];\n });\n resT.forEach((t) => tf.dispose(t));\n }\n\n last = obj;\n resolve(obj);\n });\n}\n", "import { log, now } from './helpers';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as facemesh from './blazeface/facemesh';\nimport * as emotion from './emotion/emotion';\nimport * as faceres from './faceres/faceres';\n\ntype Tensor = typeof tf.Tensor;\n\nconst calculateFaceAngle = (face, image_size): { angle: { pitch: number, yaw: number, roll: number }, matrix: [number, number, number, number, number, number, number, number, number] } => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const degrees = (theta) => (theta * 180) / Math.PI;\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX; let thetaY; let thetaZ;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees\n // value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1] };\n\n const size = Math.max(face.boxRaw[2] * image_size[0], face.boxRaw[3] * image_size[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * image_size[0] / size,\n pt[1] * image_size[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n return { angle, matrix };\n};\n\nexport const detectFace = async (parent, input): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array<{\n confidence: number,\n boxConfidence: number,\n faceConfidence: number,\n box: [number, number, number, number],\n mesh: Array<[number, number, number]>\n meshRaw: Array<[number, number, number]>\n boxRaw: [number, number, number, number],\n annotations: Array<{ part: string, points: Array<[number, number, number]>[] }>,\n age: number,\n gender: string,\n genderConfidence: number,\n emotion: string,\n embedding: number[],\n iris: number,\n rotation: {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number]\n },\n tensor: Tensor,\n }> = [];\n parent.state = 'run:face';\n timeStamp = now();\n const faces = await facemesh.predict(input, parent.config);\n parent.perf.face = Math.trunc(now() - timeStamp);\n if (!faces) return [];\n for (const face of faces) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n if (!face.image || face.image.isDisposedInternal) {\n log('Face object is disposed:', face.image);\n continue;\n }\n\n const rotation = calculateFaceAngle(face, [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(face.image, parent.config) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(face.image, parent.config) : {};\n parent.perf.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(face, parent.config) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(face.image, parent.config) : [];\n parent.perf.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && face?.annotations?.leftEyeIris && face?.annotations?.rightEyeIris) {\n delete face.annotations.leftEyeIris;\n delete face.annotations.rightEyeIris;\n }\n const irisSize = (face.annotations?.leftEyeIris && face.annotations?.rightEyeIris)\n /* average human iris size is 11.7mm */\n ? 11.7 * Math.max(Math.abs(face.annotations.leftEyeIris[3][0] - face.annotations.leftEyeIris[1][0]), Math.abs(face.annotations.rightEyeIris[4][1] - face.annotations.rightEyeIris[2][1]))\n : 0;\n\n // combine results\n faceRes.push({\n ...face,\n age: descRes.age,\n gender: descRes.gender,\n genderConfidence: descRes.genderConfidence,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: (irisSize !== 0) ? Math.trunc(irisSize) / 100 : 0,\n rotation,\n tensor: parent.config.face.detector.return ? face.image?.squeeze() : null,\n });\n // dispose original face tensor\n face.image?.dispose();\n\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.perf.face) delete parent.perf.face;\n if (parent.perf.age) delete parent.perf.age;\n if (parent.perf.gender) delete parent.perf.gender;\n if (parent.perf.emotion) delete parent.perf.emotion;\n }\n return faceRes;\n};\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as poses from './poses';\nimport * as util from './utils';\n\nlet model;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nexport async function predict(input, config) {\n const res = tf.tidy(() => {\n const resized = input.resizeBilinear([model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = resized.toFloat().div(127.5).sub(1.0);\n const results = model.execute(normalized, poseNetOutputs);\n const results3d = results.map((y) => y.squeeze([0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor) => tensor.buffer()));\n for (const t of res) t.dispose();\n\n const decoded = await poses.decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n const scaled = util.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n return scaled;\n}\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n if (!model || !model.modelUrl) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n", "export const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n", "import * as kpt from './keypoints';\n\nexport function eitherPointDoesntMeetConfidence(a, b, minConfidence) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence) {\n return kpt.connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints) {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]) {\n const scalePose = (pose, scaleY, scaleX) => ({\n score: pose.score,\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: { x: Math.trunc(position.x * scaleX), y: Math.trunc(position.y * scaleY) },\n })),\n });\n\n const scaledPoses = poses.map((pose) => scalePose(pose, height / inputResolutionHeight, width / inputResolutionWidth));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: any;\n numberOfElements: number;\n getElementValue: any;\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + kpt.count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "import * as utils from './utils';\nimport * as kpt from './keypoints';\n\nconst localMaximumRadius = 1;\nconst defaultOutputStride = 16;\nconst squaredNmsRadius = 20 ** 2;\n\nfunction traverseToTargetKeypoint(edgeId, sourceKeypoint, targetKeypointId, scoresBuffer, offsets, outputStride, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scoresBuffer.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetKeypointId, offsets);\n targetKeypoint = utils.addVectors({\n x: targetKeypointIndices.x * outputStride,\n y: targetKeypointIndices.y * outputStride,\n }, { x: offsetPoint.x, y: offsetPoint.y });\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scoresBuffer.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetKeypointId);\n return { position: targetKeypoint, part: kpt.partNames[targetKeypointId], score };\n}\n\nexport function decodePose(root, scores, offsets, outputStride, displacementsFwd, displacementsBwd) {\n const parentChildrenTuples = kpt.poseChain.map(([parentJoinName, childJoinName]) => ([kpt.partIds[parentJoinName], kpt.partIds[childJoinName]]));\n const parentToChildEdges = parentChildrenTuples.map(([, childJointId]) => childJointId);\n const childToParentEdges = parentChildrenTuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2];\n const numEdges = parentToChildEdges.length;\n const instanceKeypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const { part: rootPart, score: rootScore } = root;\n const rootPoint = utils.getImageCoords(rootPart, outputStride, offsets);\n instanceKeypoints[rootPart.id] = {\n score: rootScore,\n part: kpt.partNames[rootPart.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceKeypointId = parentToChildEdges[edge];\n const targetKeypointId = childToParentEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceKeypointId = childToParentEdges[edge];\n const targetKeypointId = parentToChildEdges[edge];\n if (instanceKeypoints[sourceKeypointId] && !instanceKeypoints[targetKeypointId]) {\n instanceKeypoints[targetKeypointId] = traverseToTargetKeypoint(edge, instanceKeypoints[sourceKeypointId], targetKeypointId, scores, offsets, outputStride, displacementsFwd);\n }\n }\n return instanceKeypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId].position;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, instanceKeypoints) {\n const notOverlappedKeypointScores = instanceKeypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / instanceKeypoints.length;\n}\n\nexport function decode(offsetsBuffer, scoresBuffer, displacementsFwdBuffer, displacementsBwdBuffer, maxDetected, minConfidence) {\n const poses: Array<{ keypoints: any, box: any, score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scoresBuffer);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n const rootImageCoords = utils.getImageCoords(root.part, defaultOutputStride, offsetsBuffer);\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n const allKeypoints = decodePose(root, scoresBuffer, offsetsBuffer, defaultOutputStride, displacementsFwdBuffer, displacementsBwdBuffer);\n const keypoints = allKeypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n indexFinger: [5, 6, 7, 8],\n middleFinger: [9, 10, 11, 12],\n ringFinger: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palmBase: [0],\n};\n\nlet handDetectorModel;\nlet handPoseModel;\nlet handPipeline;\n\nexport async function predict(input, config) {\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array<{ confidence: number, box: any, boxRaw: any, landmarks: any, annotations: any }> = [];\n for (const prediction of predictions) {\n const annotations = {};\n if (prediction.landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n annotations[key] = meshAnnotations[key].map((index) => prediction.landmarks[index]);\n }\n }\n const box = prediction.box ? [\n Math.max(0, prediction.box.topLeft[0]),\n Math.max(0, prediction.box.topLeft[1]),\n Math.min(input.shape[2], prediction.box.bottomRight[0]) - Math.max(0, prediction.box.topLeft[0]),\n Math.min(input.shape[1], prediction.box.bottomRight[1]) - Math.max(0, prediction.box.topLeft[1]),\n ] : [];\n const boxRaw = [\n (prediction.box.topLeft[0]) / input.shape[2],\n (prediction.box.topLeft[1]) / input.shape[1],\n (prediction.box.bottomRight[0] - prediction.box.topLeft[0]) / input.shape[2],\n (prediction.box.bottomRight[1] - prediction.box.topLeft[1]) / input.shape[1],\n ];\n hands.push({ confidence: Math.round(100 * prediction.confidence) / 100, box, boxRaw, landmarks: prediction.landmarks, annotations });\n }\n return hands;\n}\n\nexport async function load(config): Promise<[Object, Object]> {\n if (!handDetectorModel || !handPoseModel) {\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector.modelPath), { fromTFHub: config.hand.detector.modelPath.includes('tfhub.dev') }) : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton.modelPath), { fromTFHub: config.hand.skeleton.modelPath.includes('tfhub.dev') }) : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel.modelUrl) log('load model failed:', config.hand.detector.modelPath);\n else if (config.debug) log('load model:', handDetectorModel.modelUrl);\n if (!handPoseModel || !handPoseModel.modelUrl) log('load model failed:', config.hand.skeleton.modelPath);\n else if (config.debug) log('load model:', handPoseModel.modelUrl);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel.modelUrl);\n if (config.debug) log('cached model:', handPoseModel.modelUrl);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel);\n handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n return [handDetectorModel, handPoseModel];\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "export const anchors = [\n {\n x: 0.015625,\n y: 0.015625,\n },\n {\n x: 0.015625,\n y: 0.015625,\n },\n {\n x: 0.046875,\n y: 0.015625,\n },\n {\n x: 0.046875,\n y: 0.015625,\n },\n {\n x: 0.078125,\n y: 0.015625,\n },\n {\n x: 0.078125,\n y: 0.015625,\n },\n {\n x: 0.109375,\n y: 0.015625,\n },\n {\n x: 0.109375,\n y: 0.015625,\n },\n {\n x: 0.140625,\n y: 0.015625,\n },\n {\n x: 0.140625,\n y: 0.015625,\n },\n {\n x: 0.171875,\n y: 0.015625,\n },\n {\n x: 0.171875,\n y: 0.015625,\n },\n {\n x: 0.203125,\n y: 0.015625,\n },\n {\n x: 0.203125,\n y: 0.015625,\n },\n {\n x: 0.234375,\n y: 0.015625,\n },\n {\n x: 0.234375,\n y: 0.015625,\n },\n {\n x: 0.265625,\n y: 0.015625,\n },\n {\n x: 0.265625,\n y: 0.015625,\n },\n {\n x: 0.296875,\n y: 0.015625,\n },\n {\n x: 0.296875,\n y: 0.015625,\n },\n {\n x: 0.328125,\n y: 0.015625,\n },\n {\n x: 0.328125,\n y: 0.015625,\n },\n {\n x: 0.359375,\n y: 0.015625,\n },\n {\n x: 0.359375,\n y: 0.015625,\n },\n {\n x: 0.390625,\n y: 0.015625,\n },\n {\n x: 0.390625,\n y: 0.015625,\n },\n {\n x: 0.421875,\n y: 0.015625,\n },\n {\n x: 0.421875,\n y: 0.015625,\n },\n {\n x: 0.453125,\n y: 0.015625,\n },\n {\n x: 0.453125,\n y: 0.015625,\n },\n {\n x: 0.484375,\n y: 0.015625,\n },\n {\n x: 0.484375,\n y: 0.015625,\n },\n {\n x: 0.515625,\n y: 0.015625,\n },\n {\n x: 0.515625,\n y: 0.015625,\n },\n {\n x: 0.546875,\n y: 0.015625,\n },\n {\n x: 0.546875,\n y: 0.015625,\n },\n {\n x: 0.578125,\n y: 0.015625,\n },\n {\n x: 0.578125,\n y: 0.015625,\n },\n {\n x: 0.609375,\n y: 0.015625,\n },\n {\n x: 0.609375,\n y: 0.015625,\n },\n {\n x: 0.640625,\n y: 0.015625,\n },\n {\n x: 0.640625,\n y: 0.015625,\n },\n {\n x: 0.671875,\n y: 0.015625,\n },\n {\n x: 0.671875,\n y: 0.015625,\n },\n {\n x: 0.703125,\n y: 0.015625,\n },\n {\n x: 0.703125,\n y: 0.015625,\n },\n {\n x: 0.734375,\n y: 0.015625,\n },\n {\n x: 0.734375,\n y: 0.015625,\n },\n {\n x: 0.765625,\n y: 0.015625,\n },\n {\n x: 0.765625,\n y: 0.015625,\n },\n {\n x: 0.796875,\n y: 0.015625,\n },\n {\n x: 0.796875,\n y: 0.015625,\n },\n {\n x: 0.828125,\n y: 0.015625,\n },\n {\n x: 0.828125,\n y: 0.015625,\n },\n {\n x: 0.859375,\n y: 0.015625,\n },\n {\n x: 0.859375,\n y: 0.015625,\n },\n {\n x: 0.890625,\n y: 0.015625,\n },\n {\n x: 0.890625,\n y: 0.015625,\n },\n {\n x: 0.921875,\n y: 0.015625,\n },\n {\n x: 0.921875,\n y: 0.015625,\n },\n {\n x: 0.953125,\n y: 0.015625,\n },\n {\n x: 0.953125,\n y: 0.015625,\n },\n {\n x: 0.984375,\n y: 0.015625,\n },\n {\n x: 0.984375,\n y: 0.015625,\n },\n {\n x: 0.015625,\n y: 0.046875,\n },\n {\n x: 0.015625,\n y: 0.046875,\n },\n {\n x: 0.046875,\n y: 0.046875,\n },\n {\n x: 0.046875,\n y: 0.046875,\n },\n {\n x: 0.078125,\n y: 0.046875,\n },\n {\n x: 0.078125,\n y: 0.046875,\n },\n {\n x: 0.109375,\n y: 0.046875,\n },\n {\n x: 0.109375,\n y: 0.046875,\n },\n {\n x: 0.140625,\n y: 0.046875,\n },\n {\n x: 0.140625,\n y: 0.046875,\n },\n {\n x: 0.171875,\n y: 0.046875,\n },\n {\n x: 0.171875,\n y: 0.046875,\n },\n {\n x: 0.203125,\n y: 0.046875,\n },\n {\n x: 0.203125,\n y: 0.046875,\n },\n {\n x: 0.234375,\n y: 0.046875,\n },\n {\n x: 0.234375,\n y: 0.046875,\n },\n {\n x: 0.265625,\n y: 0.046875,\n },\n {\n x: 0.265625,\n y: 0.046875,\n },\n {\n x: 0.296875,\n y: 0.046875,\n },\n {\n x: 0.296875,\n y: 0.046875,\n },\n {\n x: 0.328125,\n y: 0.046875,\n },\n {\n x: 0.328125,\n y: 0.046875,\n },\n {\n x: 0.359375,\n y: 0.046875,\n },\n {\n x: 0.359375,\n y: 0.046875,\n },\n {\n x: 0.390625,\n y: 0.046875,\n },\n {\n x: 0.390625,\n y: 0.046875,\n },\n {\n x: 0.421875,\n y: 0.046875,\n },\n {\n x: 0.421875,\n y: 0.046875,\n },\n {\n x: 0.453125,\n y: 0.046875,\n },\n {\n x: 0.453125,\n y: 0.046875,\n },\n {\n x: 0.484375,\n y: 0.046875,\n },\n {\n x: 0.484375,\n y: 0.046875,\n },\n {\n x: 0.515625,\n y: 0.046875,\n },\n {\n x: 0.515625,\n y: 0.046875,\n },\n {\n x: 0.546875,\n y: 0.046875,\n },\n {\n x: 0.546875,\n y: 0.046875,\n },\n {\n x: 0.578125,\n y: 0.046875,\n },\n {\n x: 0.578125,\n y: 0.046875,\n },\n {\n x: 0.609375,\n y: 0.046875,\n },\n {\n x: 0.609375,\n y: 0.046875,\n },\n {\n x: 0.640625,\n y: 0.046875,\n },\n {\n x: 0.640625,\n y: 0.046875,\n },\n {\n x: 0.671875,\n y: 0.046875,\n },\n {\n x: 0.671875,\n y: 0.046875,\n },\n {\n x: 0.703125,\n y: 0.046875,\n },\n {\n x: 0.703125,\n y: 0.046875,\n },\n {\n x: 0.734375,\n y: 0.046875,\n },\n {\n x: 0.734375,\n y: 0.046875,\n },\n {\n x: 0.765625,\n y: 0.046875,\n },\n {\n x: 0.765625,\n y: 0.046875,\n },\n {\n x: 0.796875,\n y: 0.046875,\n },\n {\n x: 0.796875,\n y: 0.046875,\n },\n {\n x: 0.828125,\n y: 0.046875,\n },\n {\n x: 0.828125,\n y: 0.046875,\n },\n {\n x: 0.859375,\n y: 0.046875,\n },\n {\n x: 0.859375,\n y: 0.046875,\n },\n {\n x: 0.890625,\n y: 0.046875,\n },\n {\n x: 0.890625,\n y: 0.046875,\n },\n {\n x: 0.921875,\n y: 0.046875,\n },\n {\n x: 0.921875,\n y: 0.046875,\n },\n {\n x: 0.953125,\n y: 0.046875,\n },\n {\n x: 0.953125,\n y: 0.046875,\n },\n {\n x: 0.984375,\n y: 0.046875,\n },\n {\n x: 0.984375,\n y: 0.046875,\n },\n {\n x: 0.015625,\n y: 0.078125,\n },\n {\n x: 0.015625,\n y: 0.078125,\n },\n {\n x: 0.046875,\n y: 0.078125,\n },\n {\n x: 0.046875,\n y: 0.078125,\n },\n {\n x: 0.078125,\n y: 0.078125,\n },\n {\n x: 0.078125,\n y: 0.078125,\n },\n {\n x: 0.109375,\n y: 0.078125,\n },\n {\n x: 0.109375,\n y: 0.078125,\n },\n {\n x: 0.140625,\n y: 0.078125,\n },\n {\n x: 0.140625,\n y: 0.078125,\n },\n {\n x: 0.171875,\n y: 0.078125,\n },\n {\n x: 0.171875,\n y: 0.078125,\n },\n {\n x: 0.203125,\n y: 0.078125,\n },\n {\n x: 0.203125,\n y: 0.078125,\n },\n {\n x: 0.234375,\n y: 0.078125,\n },\n {\n x: 0.234375,\n y: 0.078125,\n },\n {\n x: 0.265625,\n y: 0.078125,\n },\n {\n x: 0.265625,\n y: 0.078125,\n },\n {\n x: 0.296875,\n y: 0.078125,\n },\n {\n x: 0.296875,\n y: 0.078125,\n },\n {\n x: 0.328125,\n y: 0.078125,\n },\n {\n x: 0.328125,\n y: 0.078125,\n },\n {\n x: 0.359375,\n y: 0.078125,\n },\n {\n x: 0.359375,\n y: 0.078125,\n },\n {\n x: 0.390625,\n y: 0.078125,\n },\n {\n x: 0.390625,\n y: 0.078125,\n },\n {\n x: 0.421875,\n y: 0.078125,\n },\n {\n x: 0.421875,\n y: 0.078125,\n },\n {\n x: 0.453125,\n y: 0.078125,\n },\n {\n x: 0.453125,\n y: 0.078125,\n },\n {\n x: 0.484375,\n y: 0.078125,\n },\n {\n x: 0.484375,\n y: 0.078125,\n },\n {\n x: 0.515625,\n y: 0.078125,\n },\n {\n x: 0.515625,\n y: 0.078125,\n },\n {\n x: 0.546875,\n y: 0.078125,\n },\n {\n x: 0.546875,\n y: 0.078125,\n },\n {\n x: 0.578125,\n y: 0.078125,\n },\n {\n x: 0.578125,\n y: 0.078125,\n },\n {\n x: 0.609375,\n y: 0.078125,\n },\n {\n x: 0.609375,\n y: 0.078125,\n },\n {\n x: 0.640625,\n y: 0.078125,\n },\n {\n x: 0.640625,\n y: 0.078125,\n },\n {\n x: 0.671875,\n y: 0.078125,\n },\n {\n x: 0.671875,\n y: 0.078125,\n },\n {\n x: 0.703125,\n y: 0.078125,\n },\n {\n x: 0.703125,\n y: 0.078125,\n },\n {\n x: 0.734375,\n y: 0.078125,\n },\n {\n x: 0.734375,\n y: 0.078125,\n },\n {\n x: 0.765625,\n y: 0.078125,\n },\n {\n x: 0.765625,\n y: 0.078125,\n },\n {\n x: 0.796875,\n y: 0.078125,\n },\n {\n x: 0.796875,\n y: 0.078125,\n },\n {\n x: 0.828125,\n y: 0.078125,\n },\n {\n x: 0.828125,\n y: 0.078125,\n },\n {\n x: 0.859375,\n y: 0.078125,\n },\n {\n x: 0.859375,\n y: 0.078125,\n },\n {\n x: 0.890625,\n y: 0.078125,\n },\n {\n x: 0.890625,\n y: 0.078125,\n },\n {\n x: 0.921875,\n y: 0.078125,\n },\n {\n x: 0.921875,\n y: 0.078125,\n },\n {\n x: 0.953125,\n y: 0.078125,\n },\n {\n x: 0.953125,\n y: 0.078125,\n },\n {\n x: 0.984375,\n y: 0.078125,\n },\n {\n x: 0.984375,\n y: 0.078125,\n },\n {\n x: 0.015625,\n y: 0.109375,\n },\n {\n x: 0.015625,\n y: 0.109375,\n },\n {\n x: 0.046875,\n y: 0.109375,\n },\n {\n x: 0.046875,\n y: 0.109375,\n },\n {\n x: 0.078125,\n y: 0.109375,\n },\n {\n x: 0.078125,\n y: 0.109375,\n },\n {\n x: 0.109375,\n y: 0.109375,\n },\n {\n x: 0.109375,\n y: 0.109375,\n },\n {\n x: 0.140625,\n y: 0.109375,\n },\n {\n x: 0.140625,\n y: 0.109375,\n },\n {\n x: 0.171875,\n y: 0.109375,\n },\n {\n x: 0.171875,\n y: 0.109375,\n },\n {\n x: 0.203125,\n y: 0.109375,\n },\n {\n x: 0.203125,\n y: 0.109375,\n },\n {\n x: 0.234375,\n y: 0.109375,\n },\n {\n x: 0.234375,\n y: 0.109375,\n },\n {\n x: 0.265625,\n y: 0.109375,\n },\n {\n x: 0.265625,\n y: 0.109375,\n },\n {\n x: 0.296875,\n y: 0.109375,\n },\n {\n x: 0.296875,\n y: 0.109375,\n },\n {\n x: 0.328125,\n y: 0.109375,\n },\n {\n x: 0.328125,\n y: 0.109375,\n },\n {\n x: 0.359375,\n y: 0.109375,\n },\n {\n x: 0.359375,\n y: 0.109375,\n },\n {\n x: 0.390625,\n y: 0.109375,\n },\n {\n x: 0.390625,\n y: 0.109375,\n },\n {\n x: 0.421875,\n y: 0.109375,\n },\n {\n x: 0.421875,\n y: 0.109375,\n },\n {\n x: 0.453125,\n y: 0.109375,\n },\n {\n x: 0.453125,\n y: 0.109375,\n },\n {\n x: 0.484375,\n y: 0.109375,\n },\n {\n x: 0.484375,\n y: 0.109375,\n },\n {\n x: 0.515625,\n y: 0.109375,\n },\n {\n x: 0.515625,\n y: 0.109375,\n },\n {\n x: 0.546875,\n y: 0.109375,\n },\n {\n x: 0.546875,\n y: 0.109375,\n },\n {\n x: 0.578125,\n y: 0.109375,\n },\n {\n x: 0.578125,\n y: 0.109375,\n },\n {\n x: 0.609375,\n y: 0.109375,\n },\n {\n x: 0.609375,\n y: 0.109375,\n },\n {\n x: 0.640625,\n y: 0.109375,\n },\n {\n x: 0.640625,\n y: 0.109375,\n },\n {\n x: 0.671875,\n y: 0.109375,\n },\n {\n x: 0.671875,\n y: 0.109375,\n },\n {\n x: 0.703125,\n y: 0.109375,\n },\n {\n x: 0.703125,\n y: 0.109375,\n },\n {\n x: 0.734375,\n y: 0.109375,\n },\n {\n x: 0.734375,\n y: 0.109375,\n },\n {\n x: 0.765625,\n y: 0.109375,\n },\n {\n x: 0.765625,\n y: 0.109375,\n },\n {\n x: 0.796875,\n y: 0.109375,\n },\n {\n x: 0.796875,\n y: 0.109375,\n },\n {\n x: 0.828125,\n y: 0.109375,\n },\n {\n x: 0.828125,\n y: 0.109375,\n },\n {\n x: 0.859375,\n y: 0.109375,\n },\n {\n x: 0.859375,\n y: 0.109375,\n },\n {\n x: 0.890625,\n y: 0.109375,\n },\n {\n x: 0.890625,\n y: 0.109375,\n },\n {\n x: 0.921875,\n y: 0.109375,\n },\n {\n x: 0.921875,\n y: 0.109375,\n },\n {\n x: 0.953125,\n y: 0.109375,\n },\n {\n x: 0.953125,\n y: 0.109375,\n },\n {\n x: 0.984375,\n y: 0.109375,\n },\n {\n x: 0.984375,\n y: 0.109375,\n },\n {\n x: 0.015625,\n y: 0.140625,\n },\n {\n x: 0.015625,\n y: 0.140625,\n },\n {\n x: 0.046875,\n y: 0.140625,\n },\n {\n x: 0.046875,\n y: 0.140625,\n },\n {\n x: 0.078125,\n y: 0.140625,\n },\n {\n x: 0.078125,\n y: 0.140625,\n },\n {\n x: 0.109375,\n y: 0.140625,\n },\n {\n x: 0.109375,\n y: 0.140625,\n },\n {\n x: 0.140625,\n y: 0.140625,\n },\n {\n x: 0.140625,\n y: 0.140625,\n },\n {\n x: 0.171875,\n y: 0.140625,\n },\n {\n x: 0.171875,\n y: 0.140625,\n },\n {\n x: 0.203125,\n y: 0.140625,\n },\n {\n x: 0.203125,\n y: 0.140625,\n },\n {\n x: 0.234375,\n y: 0.140625,\n },\n {\n x: 0.234375,\n y: 0.140625,\n },\n {\n x: 0.265625,\n y: 0.140625,\n },\n {\n x: 0.265625,\n y: 0.140625,\n },\n {\n x: 0.296875,\n y: 0.140625,\n },\n {\n x: 0.296875,\n y: 0.140625,\n },\n {\n x: 0.328125,\n y: 0.140625,\n },\n {\n x: 0.328125,\n y: 0.140625,\n },\n {\n x: 0.359375,\n y: 0.140625,\n },\n {\n x: 0.359375,\n y: 0.140625,\n },\n {\n x: 0.390625,\n y: 0.140625,\n },\n {\n x: 0.390625,\n y: 0.140625,\n },\n {\n x: 0.421875,\n y: 0.140625,\n },\n {\n x: 0.421875,\n y: 0.140625,\n },\n {\n x: 0.453125,\n y: 0.140625,\n },\n {\n x: 0.453125,\n y: 0.140625,\n },\n {\n x: 0.484375,\n y: 0.140625,\n },\n {\n x: 0.484375,\n y: 0.140625,\n },\n {\n x: 0.515625,\n y: 0.140625,\n },\n {\n x: 0.515625,\n y: 0.140625,\n },\n {\n x: 0.546875,\n y: 0.140625,\n },\n {\n x: 0.546875,\n y: 0.140625,\n },\n {\n x: 0.578125,\n y: 0.140625,\n },\n {\n x: 0.578125,\n y: 0.140625,\n },\n {\n x: 0.609375,\n y: 0.140625,\n },\n {\n x: 0.609375,\n y: 0.140625,\n },\n {\n x: 0.640625,\n y: 0.140625,\n },\n {\n x: 0.640625,\n y: 0.140625,\n },\n {\n x: 0.671875,\n y: 0.140625,\n },\n {\n x: 0.671875,\n y: 0.140625,\n },\n {\n x: 0.703125,\n y: 0.140625,\n },\n {\n x: 0.703125,\n y: 0.140625,\n },\n {\n x: 0.734375,\n y: 0.140625,\n },\n {\n x: 0.734375,\n y: 0.140625,\n },\n {\n x: 0.765625,\n y: 0.140625,\n },\n {\n x: 0.765625,\n y: 0.140625,\n },\n {\n x: 0.796875,\n y: 0.140625,\n },\n {\n x: 0.796875,\n y: 0.140625,\n },\n {\n x: 0.828125,\n y: 0.140625,\n },\n {\n x: 0.828125,\n y: 0.140625,\n },\n {\n x: 0.859375,\n y: 0.140625,\n },\n {\n x: 0.859375,\n y: 0.140625,\n },\n {\n x: 0.890625,\n y: 0.140625,\n },\n {\n x: 0.890625,\n y: 0.140625,\n },\n {\n x: 0.921875,\n y: 0.140625,\n },\n {\n x: 0.921875,\n y: 0.140625,\n },\n {\n x: 0.953125,\n y: 0.140625,\n },\n {\n x: 0.953125,\n y: 0.140625,\n },\n {\n x: 0.984375,\n y: 0.140625,\n },\n {\n x: 0.984375,\n y: 0.140625,\n },\n {\n x: 0.015625,\n y: 0.171875,\n },\n {\n x: 0.015625,\n y: 0.171875,\n },\n {\n x: 0.046875,\n y: 0.171875,\n },\n {\n x: 0.046875,\n y: 0.171875,\n },\n {\n x: 0.078125,\n y: 0.171875,\n },\n {\n x: 0.078125,\n y: 0.171875,\n },\n {\n x: 0.109375,\n y: 0.171875,\n },\n {\n x: 0.109375,\n y: 0.171875,\n },\n {\n x: 0.140625,\n y: 0.171875,\n },\n {\n x: 0.140625,\n y: 0.171875,\n },\n {\n x: 0.171875,\n y: 0.171875,\n },\n {\n x: 0.171875,\n y: 0.171875,\n },\n {\n x: 0.203125,\n y: 0.171875,\n },\n {\n x: 0.203125,\n y: 0.171875,\n },\n {\n x: 0.234375,\n y: 0.171875,\n },\n {\n x: 0.234375,\n y: 0.171875,\n },\n {\n x: 0.265625,\n y: 0.171875,\n },\n {\n x: 0.265625,\n y: 0.171875,\n },\n {\n x: 0.296875,\n y: 0.171875,\n },\n {\n x: 0.296875,\n y: 0.171875,\n },\n {\n x: 0.328125,\n y: 0.171875,\n },\n {\n x: 0.328125,\n y: 0.171875,\n },\n {\n x: 0.359375,\n y: 0.171875,\n },\n {\n x: 0.359375,\n y: 0.171875,\n },\n {\n x: 0.390625,\n y: 0.171875,\n },\n {\n x: 0.390625,\n y: 0.171875,\n },\n {\n x: 0.421875,\n y: 0.171875,\n },\n {\n x: 0.421875,\n y: 0.171875,\n },\n {\n x: 0.453125,\n y: 0.171875,\n },\n {\n x: 0.453125,\n y: 0.171875,\n },\n {\n x: 0.484375,\n y: 0.171875,\n },\n {\n x: 0.484375,\n y: 0.171875,\n },\n {\n x: 0.515625,\n y: 0.171875,\n },\n {\n x: 0.515625,\n y: 0.171875,\n },\n {\n x: 0.546875,\n y: 0.171875,\n },\n {\n x: 0.546875,\n y: 0.171875,\n },\n {\n x: 0.578125,\n y: 0.171875,\n },\n {\n x: 0.578125,\n y: 0.171875,\n },\n {\n x: 0.609375,\n y: 0.171875,\n },\n {\n x: 0.609375,\n y: 0.171875,\n },\n {\n x: 0.640625,\n y: 0.171875,\n },\n {\n x: 0.640625,\n y: 0.171875,\n },\n {\n x: 0.671875,\n y: 0.171875,\n },\n {\n x: 0.671875,\n y: 0.171875,\n },\n {\n x: 0.703125,\n y: 0.171875,\n },\n {\n x: 0.703125,\n y: 0.171875,\n },\n {\n x: 0.734375,\n y: 0.171875,\n },\n {\n x: 0.734375,\n y: 0.171875,\n },\n {\n x: 0.765625,\n y: 0.171875,\n },\n {\n x: 0.765625,\n y: 0.171875,\n },\n {\n x: 0.796875,\n y: 0.171875,\n },\n {\n x: 0.796875,\n y: 0.171875,\n },\n {\n x: 0.828125,\n y: 0.171875,\n },\n {\n x: 0.828125,\n y: 0.171875,\n },\n {\n x: 0.859375,\n y: 0.171875,\n },\n {\n x: 0.859375,\n y: 0.171875,\n },\n {\n x: 0.890625,\n y: 0.171875,\n },\n {\n x: 0.890625,\n y: 0.171875,\n },\n {\n x: 0.921875,\n y: 0.171875,\n },\n {\n x: 0.921875,\n y: 0.171875,\n },\n {\n x: 0.953125,\n y: 0.171875,\n },\n {\n x: 0.953125,\n y: 0.171875,\n },\n {\n x: 0.984375,\n y: 0.171875,\n },\n {\n x: 0.984375,\n y: 0.171875,\n },\n {\n x: 0.015625,\n y: 0.203125,\n },\n {\n x: 0.015625,\n y: 0.203125,\n },\n {\n x: 0.046875,\n y: 0.203125,\n },\n {\n x: 0.046875,\n y: 0.203125,\n },\n {\n x: 0.078125,\n y: 0.203125,\n },\n {\n x: 0.078125,\n y: 0.203125,\n },\n {\n x: 0.109375,\n y: 0.203125,\n },\n {\n x: 0.109375,\n y: 0.203125,\n },\n {\n x: 0.140625,\n y: 0.203125,\n },\n {\n x: 0.140625,\n y: 0.203125,\n },\n {\n x: 0.171875,\n y: 0.203125,\n },\n {\n x: 0.171875,\n y: 0.203125,\n },\n {\n x: 0.203125,\n y: 0.203125,\n },\n {\n x: 0.203125,\n y: 0.203125,\n },\n {\n x: 0.234375,\n y: 0.203125,\n },\n {\n x: 0.234375,\n y: 0.203125,\n },\n {\n x: 0.265625,\n y: 0.203125,\n },\n {\n x: 0.265625,\n y: 0.203125,\n },\n {\n x: 0.296875,\n y: 0.203125,\n },\n {\n x: 0.296875,\n y: 0.203125,\n },\n {\n x: 0.328125,\n y: 0.203125,\n },\n {\n x: 0.328125,\n y: 0.203125,\n },\n {\n x: 0.359375,\n y: 0.203125,\n },\n {\n x: 0.359375,\n y: 0.203125,\n },\n {\n x: 0.390625,\n y: 0.203125,\n },\n {\n x: 0.390625,\n y: 0.203125,\n },\n {\n x: 0.421875,\n y: 0.203125,\n },\n {\n x: 0.421875,\n y: 0.203125,\n },\n {\n x: 0.453125,\n y: 0.203125,\n },\n {\n x: 0.453125,\n y: 0.203125,\n },\n {\n x: 0.484375,\n y: 0.203125,\n },\n {\n x: 0.484375,\n y: 0.203125,\n },\n {\n x: 0.515625,\n y: 0.203125,\n },\n {\n x: 0.515625,\n y: 0.203125,\n },\n {\n x: 0.546875,\n y: 0.203125,\n },\n {\n x: 0.546875,\n y: 0.203125,\n },\n {\n x: 0.578125,\n y: 0.203125,\n },\n {\n x: 0.578125,\n y: 0.203125,\n },\n {\n x: 0.609375,\n y: 0.203125,\n },\n {\n x: 0.609375,\n y: 0.203125,\n },\n {\n x: 0.640625,\n y: 0.203125,\n },\n {\n x: 0.640625,\n y: 0.203125,\n },\n {\n x: 0.671875,\n y: 0.203125,\n },\n {\n x: 0.671875,\n y: 0.203125,\n },\n {\n x: 0.703125,\n y: 0.203125,\n },\n {\n x: 0.703125,\n y: 0.203125,\n },\n {\n x: 0.734375,\n y: 0.203125,\n },\n {\n x: 0.734375,\n y: 0.203125,\n },\n {\n x: 0.765625,\n y: 0.203125,\n },\n {\n x: 0.765625,\n y: 0.203125,\n },\n {\n x: 0.796875,\n y: 0.203125,\n },\n {\n x: 0.796875,\n y: 0.203125,\n },\n {\n x: 0.828125,\n y: 0.203125,\n },\n {\n x: 0.828125,\n y: 0.203125,\n },\n {\n x: 0.859375,\n y: 0.203125,\n },\n {\n x: 0.859375,\n y: 0.203125,\n },\n {\n x: 0.890625,\n y: 0.203125,\n },\n {\n x: 0.890625,\n y: 0.203125,\n },\n {\n x: 0.921875,\n y: 0.203125,\n },\n {\n x: 0.921875,\n y: 0.203125,\n },\n {\n x: 0.953125,\n y: 0.203125,\n },\n {\n x: 0.953125,\n y: 0.203125,\n },\n {\n x: 0.984375,\n y: 0.203125,\n },\n {\n x: 0.984375,\n y: 0.203125,\n },\n {\n x: 0.015625,\n y: 0.234375,\n },\n {\n x: 0.015625,\n y: 0.234375,\n },\n {\n x: 0.046875,\n y: 0.234375,\n },\n {\n x: 0.046875,\n y: 0.234375,\n },\n {\n x: 0.078125,\n y: 0.234375,\n },\n {\n x: 0.078125,\n y: 0.234375,\n },\n {\n x: 0.109375,\n y: 0.234375,\n },\n {\n x: 0.109375,\n y: 0.234375,\n },\n {\n x: 0.140625,\n y: 0.234375,\n },\n {\n x: 0.140625,\n y: 0.234375,\n },\n {\n x: 0.171875,\n y: 0.234375,\n },\n {\n x: 0.171875,\n y: 0.234375,\n },\n {\n x: 0.203125,\n y: 0.234375,\n },\n {\n x: 0.203125,\n y: 0.234375,\n },\n {\n x: 0.234375,\n y: 0.234375,\n },\n {\n x: 0.234375,\n y: 0.234375,\n },\n {\n x: 0.265625,\n y: 0.234375,\n },\n {\n x: 0.265625,\n y: 0.234375,\n },\n {\n x: 0.296875,\n y: 0.234375,\n },\n {\n x: 0.296875,\n y: 0.234375,\n },\n {\n x: 0.328125,\n y: 0.234375,\n },\n {\n x: 0.328125,\n y: 0.234375,\n },\n {\n x: 0.359375,\n y: 0.234375,\n },\n {\n x: 0.359375,\n y: 0.234375,\n },\n {\n x: 0.390625,\n y: 0.234375,\n },\n {\n x: 0.390625,\n y: 0.234375,\n },\n {\n x: 0.421875,\n y: 0.234375,\n },\n {\n x: 0.421875,\n y: 0.234375,\n },\n {\n x: 0.453125,\n y: 0.234375,\n },\n {\n x: 0.453125,\n y: 0.234375,\n },\n {\n x: 0.484375,\n y: 0.234375,\n },\n {\n x: 0.484375,\n y: 0.234375,\n },\n {\n x: 0.515625,\n y: 0.234375,\n },\n {\n x: 0.515625,\n y: 0.234375,\n },\n {\n x: 0.546875,\n y: 0.234375,\n },\n {\n x: 0.546875,\n y: 0.234375,\n },\n {\n x: 0.578125,\n y: 0.234375,\n },\n {\n x: 0.578125,\n y: 0.234375,\n },\n {\n x: 0.609375,\n y: 0.234375,\n },\n {\n x: 0.609375,\n y: 0.234375,\n },\n {\n x: 0.640625,\n y: 0.234375,\n },\n {\n x: 0.640625,\n y: 0.234375,\n },\n {\n x: 0.671875,\n y: 0.234375,\n },\n {\n x: 0.671875,\n y: 0.234375,\n },\n {\n x: 0.703125,\n y: 0.234375,\n },\n {\n x: 0.703125,\n y: 0.234375,\n },\n {\n x: 0.734375,\n y: 0.234375,\n },\n {\n x: 0.734375,\n y: 0.234375,\n },\n {\n x: 0.765625,\n y: 0.234375,\n },\n {\n x: 0.765625,\n y: 0.234375,\n },\n {\n x: 0.796875,\n y: 0.234375,\n },\n {\n x: 0.796875,\n y: 0.234375,\n },\n {\n x: 0.828125,\n y: 0.234375,\n },\n {\n x: 0.828125,\n y: 0.234375,\n },\n {\n x: 0.859375,\n y: 0.234375,\n },\n {\n x: 0.859375,\n y: 0.234375,\n },\n {\n x: 0.890625,\n y: 0.234375,\n },\n {\n x: 0.890625,\n y: 0.234375,\n },\n {\n x: 0.921875,\n y: 0.234375,\n },\n {\n x: 0.921875,\n y: 0.234375,\n },\n {\n x: 0.953125,\n y: 0.234375,\n },\n {\n x: 0.953125,\n y: 0.234375,\n },\n {\n x: 0.984375,\n y: 0.234375,\n },\n {\n x: 0.984375,\n y: 0.234375,\n },\n {\n x: 0.015625,\n y: 0.265625,\n },\n {\n x: 0.015625,\n y: 0.265625,\n },\n {\n x: 0.046875,\n y: 0.265625,\n },\n {\n x: 0.046875,\n y: 0.265625,\n },\n {\n x: 0.078125,\n y: 0.265625,\n },\n {\n x: 0.078125,\n y: 0.265625,\n },\n {\n x: 0.109375,\n y: 0.265625,\n },\n {\n x: 0.109375,\n y: 0.265625,\n },\n {\n x: 0.140625,\n y: 0.265625,\n },\n {\n x: 0.140625,\n y: 0.265625,\n },\n {\n x: 0.171875,\n y: 0.265625,\n },\n {\n x: 0.171875,\n y: 0.265625,\n },\n {\n x: 0.203125,\n y: 0.265625,\n },\n {\n x: 0.203125,\n y: 0.265625,\n },\n {\n x: 0.234375,\n y: 0.265625,\n },\n {\n x: 0.234375,\n y: 0.265625,\n },\n {\n x: 0.265625,\n y: 0.265625,\n },\n {\n x: 0.265625,\n y: 0.265625,\n },\n {\n x: 0.296875,\n y: 0.265625,\n },\n {\n x: 0.296875,\n y: 0.265625,\n },\n {\n x: 0.328125,\n y: 0.265625,\n },\n {\n x: 0.328125,\n y: 0.265625,\n },\n {\n x: 0.359375,\n y: 0.265625,\n },\n {\n x: 0.359375,\n y: 0.265625,\n },\n {\n x: 0.390625,\n y: 0.265625,\n },\n {\n x: 0.390625,\n y: 0.265625,\n },\n {\n x: 0.421875,\n y: 0.265625,\n },\n {\n x: 0.421875,\n y: 0.265625,\n },\n {\n x: 0.453125,\n y: 0.265625,\n },\n {\n x: 0.453125,\n y: 0.265625,\n },\n {\n x: 0.484375,\n y: 0.265625,\n },\n {\n x: 0.484375,\n y: 0.265625,\n },\n {\n x: 0.515625,\n y: 0.265625,\n },\n {\n x: 0.515625,\n y: 0.265625,\n },\n {\n x: 0.546875,\n y: 0.265625,\n },\n {\n x: 0.546875,\n y: 0.265625,\n },\n {\n x: 0.578125,\n y: 0.265625,\n },\n {\n x: 0.578125,\n y: 0.265625,\n },\n {\n x: 0.609375,\n y: 0.265625,\n },\n {\n x: 0.609375,\n y: 0.265625,\n },\n {\n x: 0.640625,\n y: 0.265625,\n },\n {\n x: 0.640625,\n y: 0.265625,\n },\n {\n x: 0.671875,\n y: 0.265625,\n },\n {\n x: 0.671875,\n y: 0.265625,\n },\n {\n x: 0.703125,\n y: 0.265625,\n },\n {\n x: 0.703125,\n y: 0.265625,\n },\n {\n x: 0.734375,\n y: 0.265625,\n },\n {\n x: 0.734375,\n y: 0.265625,\n },\n {\n x: 0.765625,\n y: 0.265625,\n },\n {\n x: 0.765625,\n y: 0.265625,\n },\n {\n x: 0.796875,\n y: 0.265625,\n },\n {\n x: 0.796875,\n y: 0.265625,\n },\n {\n x: 0.828125,\n y: 0.265625,\n },\n {\n x: 0.828125,\n y: 0.265625,\n },\n {\n x: 0.859375,\n y: 0.265625,\n },\n {\n x: 0.859375,\n y: 0.265625,\n },\n {\n x: 0.890625,\n y: 0.265625,\n },\n {\n x: 0.890625,\n y: 0.265625,\n },\n {\n x: 0.921875,\n y: 0.265625,\n },\n {\n x: 0.921875,\n y: 0.265625,\n },\n {\n x: 0.953125,\n y: 0.265625,\n },\n {\n x: 0.953125,\n y: 0.265625,\n },\n {\n x: 0.984375,\n y: 0.265625,\n },\n {\n x: 0.984375,\n y: 0.265625,\n },\n {\n x: 0.015625,\n y: 0.296875,\n },\n {\n x: 0.015625,\n y: 0.296875,\n },\n {\n x: 0.046875,\n y: 0.296875,\n },\n {\n x: 0.046875,\n y: 0.296875,\n },\n {\n x: 0.078125,\n y: 0.296875,\n },\n {\n x: 0.078125,\n y: 0.296875,\n },\n {\n x: 0.109375,\n y: 0.296875,\n },\n {\n x: 0.109375,\n y: 0.296875,\n },\n {\n x: 0.140625,\n y: 0.296875,\n },\n {\n x: 0.140625,\n y: 0.296875,\n },\n {\n x: 0.171875,\n y: 0.296875,\n },\n {\n x: 0.171875,\n y: 0.296875,\n },\n {\n x: 0.203125,\n y: 0.296875,\n },\n {\n x: 0.203125,\n y: 0.296875,\n },\n {\n x: 0.234375,\n y: 0.296875,\n },\n {\n x: 0.234375,\n y: 0.296875,\n },\n {\n x: 0.265625,\n y: 0.296875,\n },\n {\n x: 0.265625,\n y: 0.296875,\n },\n {\n x: 0.296875,\n y: 0.296875,\n },\n {\n x: 0.296875,\n y: 0.296875,\n },\n {\n x: 0.328125,\n y: 0.296875,\n },\n {\n x: 0.328125,\n y: 0.296875,\n },\n {\n x: 0.359375,\n y: 0.296875,\n },\n {\n x: 0.359375,\n y: 0.296875,\n },\n {\n x: 0.390625,\n y: 0.296875,\n },\n {\n x: 0.390625,\n y: 0.296875,\n },\n {\n x: 0.421875,\n y: 0.296875,\n },\n {\n x: 0.421875,\n y: 0.296875,\n },\n {\n x: 0.453125,\n y: 0.296875,\n },\n {\n x: 0.453125,\n y: 0.296875,\n },\n {\n x: 0.484375,\n y: 0.296875,\n },\n {\n x: 0.484375,\n y: 0.296875,\n },\n {\n x: 0.515625,\n y: 0.296875,\n },\n {\n x: 0.515625,\n y: 0.296875,\n },\n {\n x: 0.546875,\n y: 0.296875,\n },\n {\n x: 0.546875,\n y: 0.296875,\n },\n {\n x: 0.578125,\n y: 0.296875,\n },\n {\n x: 0.578125,\n y: 0.296875,\n },\n {\n x: 0.609375,\n y: 0.296875,\n },\n {\n x: 0.609375,\n y: 0.296875,\n },\n {\n x: 0.640625,\n y: 0.296875,\n },\n {\n x: 0.640625,\n y: 0.296875,\n },\n {\n x: 0.671875,\n y: 0.296875,\n },\n {\n x: 0.671875,\n y: 0.296875,\n },\n {\n x: 0.703125,\n y: 0.296875,\n },\n {\n x: 0.703125,\n y: 0.296875,\n },\n {\n x: 0.734375,\n y: 0.296875,\n },\n {\n x: 0.734375,\n y: 0.296875,\n },\n {\n x: 0.765625,\n y: 0.296875,\n },\n {\n x: 0.765625,\n y: 0.296875,\n },\n {\n x: 0.796875,\n y: 0.296875,\n },\n {\n x: 0.796875,\n y: 0.296875,\n },\n {\n x: 0.828125,\n y: 0.296875,\n },\n {\n x: 0.828125,\n y: 0.296875,\n },\n {\n x: 0.859375,\n y: 0.296875,\n },\n {\n x: 0.859375,\n y: 0.296875,\n },\n {\n x: 0.890625,\n y: 0.296875,\n },\n {\n x: 0.890625,\n y: 0.296875,\n },\n {\n x: 0.921875,\n y: 0.296875,\n },\n {\n x: 0.921875,\n y: 0.296875,\n },\n {\n x: 0.953125,\n y: 0.296875,\n },\n {\n x: 0.953125,\n y: 0.296875,\n },\n {\n x: 0.984375,\n y: 0.296875,\n },\n {\n x: 0.984375,\n y: 0.296875,\n },\n {\n x: 0.015625,\n y: 0.328125,\n },\n {\n x: 0.015625,\n y: 0.328125,\n },\n {\n x: 0.046875,\n y: 0.328125,\n },\n {\n x: 0.046875,\n y: 0.328125,\n },\n {\n x: 0.078125,\n y: 0.328125,\n },\n {\n x: 0.078125,\n y: 0.328125,\n },\n {\n x: 0.109375,\n y: 0.328125,\n },\n {\n x: 0.109375,\n y: 0.328125,\n },\n {\n x: 0.140625,\n y: 0.328125,\n },\n {\n x: 0.140625,\n y: 0.328125,\n },\n {\n x: 0.171875,\n y: 0.328125,\n },\n {\n x: 0.171875,\n y: 0.328125,\n },\n {\n x: 0.203125,\n y: 0.328125,\n },\n {\n x: 0.203125,\n y: 0.328125,\n },\n {\n x: 0.234375,\n y: 0.328125,\n },\n {\n x: 0.234375,\n y: 0.328125,\n },\n {\n x: 0.265625,\n y: 0.328125,\n },\n {\n x: 0.265625,\n y: 0.328125,\n },\n {\n x: 0.296875,\n y: 0.328125,\n },\n {\n x: 0.296875,\n y: 0.328125,\n },\n {\n x: 0.328125,\n y: 0.328125,\n },\n {\n x: 0.328125,\n y: 0.328125,\n },\n {\n x: 0.359375,\n y: 0.328125,\n },\n {\n x: 0.359375,\n y: 0.328125,\n },\n {\n x: 0.390625,\n y: 0.328125,\n },\n {\n x: 0.390625,\n y: 0.328125,\n },\n {\n x: 0.421875,\n y: 0.328125,\n },\n {\n x: 0.421875,\n y: 0.328125,\n },\n {\n x: 0.453125,\n y: 0.328125,\n },\n {\n x: 0.453125,\n y: 0.328125,\n },\n {\n x: 0.484375,\n y: 0.328125,\n },\n {\n x: 0.484375,\n y: 0.328125,\n },\n {\n x: 0.515625,\n y: 0.328125,\n },\n {\n x: 0.515625,\n y: 0.328125,\n },\n {\n x: 0.546875,\n y: 0.328125,\n },\n {\n x: 0.546875,\n y: 0.328125,\n },\n {\n x: 0.578125,\n y: 0.328125,\n },\n {\n x: 0.578125,\n y: 0.328125,\n },\n {\n x: 0.609375,\n y: 0.328125,\n },\n {\n x: 0.609375,\n y: 0.328125,\n },\n {\n x: 0.640625,\n y: 0.328125,\n },\n {\n x: 0.640625,\n y: 0.328125,\n },\n {\n x: 0.671875,\n y: 0.328125,\n },\n {\n x: 0.671875,\n y: 0.328125,\n },\n {\n x: 0.703125,\n y: 0.328125,\n },\n {\n x: 0.703125,\n y: 0.328125,\n },\n {\n x: 0.734375,\n y: 0.328125,\n },\n {\n x: 0.734375,\n y: 0.328125,\n },\n {\n x: 0.765625,\n y: 0.328125,\n },\n {\n x: 0.765625,\n y: 0.328125,\n },\n {\n x: 0.796875,\n y: 0.328125,\n },\n {\n x: 0.796875,\n y: 0.328125,\n },\n {\n x: 0.828125,\n y: 0.328125,\n },\n {\n x: 0.828125,\n y: 0.328125,\n },\n {\n x: 0.859375,\n y: 0.328125,\n },\n {\n x: 0.859375,\n y: 0.328125,\n },\n {\n x: 0.890625,\n y: 0.328125,\n },\n {\n x: 0.890625,\n y: 0.328125,\n },\n {\n x: 0.921875,\n y: 0.328125,\n },\n {\n x: 0.921875,\n y: 0.328125,\n },\n {\n x: 0.953125,\n y: 0.328125,\n },\n {\n x: 0.953125,\n y: 0.328125,\n },\n {\n x: 0.984375,\n y: 0.328125,\n },\n {\n x: 0.984375,\n y: 0.328125,\n },\n {\n x: 0.015625,\n y: 0.359375,\n },\n {\n x: 0.015625,\n y: 0.359375,\n },\n {\n x: 0.046875,\n y: 0.359375,\n },\n {\n x: 0.046875,\n y: 0.359375,\n },\n {\n x: 0.078125,\n y: 0.359375,\n },\n {\n x: 0.078125,\n y: 0.359375,\n },\n {\n x: 0.109375,\n y: 0.359375,\n },\n {\n x: 0.109375,\n y: 0.359375,\n },\n {\n x: 0.140625,\n y: 0.359375,\n },\n {\n x: 0.140625,\n y: 0.359375,\n },\n {\n x: 0.171875,\n y: 0.359375,\n },\n {\n x: 0.171875,\n y: 0.359375,\n },\n {\n x: 0.203125,\n y: 0.359375,\n },\n {\n x: 0.203125,\n y: 0.359375,\n },\n {\n x: 0.234375,\n y: 0.359375,\n },\n {\n x: 0.234375,\n y: 0.359375,\n },\n {\n x: 0.265625,\n y: 0.359375,\n },\n {\n x: 0.265625,\n y: 0.359375,\n },\n {\n x: 0.296875,\n y: 0.359375,\n },\n {\n x: 0.296875,\n y: 0.359375,\n },\n {\n x: 0.328125,\n y: 0.359375,\n },\n {\n x: 0.328125,\n y: 0.359375,\n },\n {\n x: 0.359375,\n y: 0.359375,\n },\n {\n x: 0.359375,\n y: 0.359375,\n },\n {\n x: 0.390625,\n y: 0.359375,\n },\n {\n x: 0.390625,\n y: 0.359375,\n },\n {\n x: 0.421875,\n y: 0.359375,\n },\n {\n x: 0.421875,\n y: 0.359375,\n },\n {\n x: 0.453125,\n y: 0.359375,\n },\n {\n x: 0.453125,\n y: 0.359375,\n },\n {\n x: 0.484375,\n y: 0.359375,\n },\n {\n x: 0.484375,\n y: 0.359375,\n },\n {\n x: 0.515625,\n y: 0.359375,\n },\n {\n x: 0.515625,\n y: 0.359375,\n },\n {\n x: 0.546875,\n y: 0.359375,\n },\n {\n x: 0.546875,\n y: 0.359375,\n },\n {\n x: 0.578125,\n y: 0.359375,\n },\n {\n x: 0.578125,\n y: 0.359375,\n },\n {\n x: 0.609375,\n y: 0.359375,\n },\n {\n x: 0.609375,\n y: 0.359375,\n },\n {\n x: 0.640625,\n y: 0.359375,\n },\n {\n x: 0.640625,\n y: 0.359375,\n },\n {\n x: 0.671875,\n y: 0.359375,\n },\n {\n x: 0.671875,\n y: 0.359375,\n },\n {\n x: 0.703125,\n y: 0.359375,\n },\n {\n x: 0.703125,\n y: 0.359375,\n },\n {\n x: 0.734375,\n y: 0.359375,\n },\n {\n x: 0.734375,\n y: 0.359375,\n },\n {\n x: 0.765625,\n y: 0.359375,\n },\n {\n x: 0.765625,\n y: 0.359375,\n },\n {\n x: 0.796875,\n y: 0.359375,\n },\n {\n x: 0.796875,\n y: 0.359375,\n },\n {\n x: 0.828125,\n y: 0.359375,\n },\n {\n x: 0.828125,\n y: 0.359375,\n },\n {\n x: 0.859375,\n y: 0.359375,\n },\n {\n x: 0.859375,\n y: 0.359375,\n },\n {\n x: 0.890625,\n y: 0.359375,\n },\n {\n x: 0.890625,\n y: 0.359375,\n },\n {\n x: 0.921875,\n y: 0.359375,\n },\n {\n x: 0.921875,\n y: 0.359375,\n },\n {\n x: 0.953125,\n y: 0.359375,\n },\n {\n x: 0.953125,\n y: 0.359375,\n },\n {\n x: 0.984375,\n y: 0.359375,\n },\n {\n x: 0.984375,\n y: 0.359375,\n },\n {\n x: 0.015625,\n y: 0.390625,\n },\n {\n x: 0.015625,\n y: 0.390625,\n },\n {\n x: 0.046875,\n y: 0.390625,\n },\n {\n x: 0.046875,\n y: 0.390625,\n },\n {\n x: 0.078125,\n y: 0.390625,\n },\n {\n x: 0.078125,\n y: 0.390625,\n },\n {\n x: 0.109375,\n y: 0.390625,\n },\n {\n x: 0.109375,\n y: 0.390625,\n },\n {\n x: 0.140625,\n y: 0.390625,\n },\n {\n x: 0.140625,\n y: 0.390625,\n },\n {\n x: 0.171875,\n y: 0.390625,\n },\n {\n x: 0.171875,\n y: 0.390625,\n },\n {\n x: 0.203125,\n y: 0.390625,\n },\n {\n x: 0.203125,\n y: 0.390625,\n },\n {\n x: 0.234375,\n y: 0.390625,\n },\n {\n x: 0.234375,\n y: 0.390625,\n },\n {\n x: 0.265625,\n y: 0.390625,\n },\n {\n x: 0.265625,\n y: 0.390625,\n },\n {\n x: 0.296875,\n y: 0.390625,\n },\n {\n x: 0.296875,\n y: 0.390625,\n },\n {\n x: 0.328125,\n y: 0.390625,\n },\n {\n x: 0.328125,\n y: 0.390625,\n },\n {\n x: 0.359375,\n y: 0.390625,\n },\n {\n x: 0.359375,\n y: 0.390625,\n },\n {\n x: 0.390625,\n y: 0.390625,\n },\n {\n x: 0.390625,\n y: 0.390625,\n },\n {\n x: 0.421875,\n y: 0.390625,\n },\n {\n x: 0.421875,\n y: 0.390625,\n },\n {\n x: 0.453125,\n y: 0.390625,\n },\n {\n x: 0.453125,\n y: 0.390625,\n },\n {\n x: 0.484375,\n y: 0.390625,\n },\n {\n x: 0.484375,\n y: 0.390625,\n },\n {\n x: 0.515625,\n y: 0.390625,\n },\n {\n x: 0.515625,\n y: 0.390625,\n },\n {\n x: 0.546875,\n y: 0.390625,\n },\n {\n x: 0.546875,\n y: 0.390625,\n },\n {\n x: 0.578125,\n y: 0.390625,\n },\n {\n x: 0.578125,\n y: 0.390625,\n },\n {\n x: 0.609375,\n y: 0.390625,\n },\n {\n x: 0.609375,\n y: 0.390625,\n },\n {\n x: 0.640625,\n y: 0.390625,\n },\n {\n x: 0.640625,\n y: 0.390625,\n },\n {\n x: 0.671875,\n y: 0.390625,\n },\n {\n x: 0.671875,\n y: 0.390625,\n },\n {\n x: 0.703125,\n y: 0.390625,\n },\n {\n x: 0.703125,\n y: 0.390625,\n },\n {\n x: 0.734375,\n y: 0.390625,\n },\n {\n x: 0.734375,\n y: 0.390625,\n },\n {\n x: 0.765625,\n y: 0.390625,\n },\n {\n x: 0.765625,\n y: 0.390625,\n },\n {\n x: 0.796875,\n y: 0.390625,\n },\n {\n x: 0.796875,\n y: 0.390625,\n },\n {\n x: 0.828125,\n y: 0.390625,\n },\n {\n x: 0.828125,\n y: 0.390625,\n },\n {\n x: 0.859375,\n y: 0.390625,\n },\n {\n x: 0.859375,\n y: 0.390625,\n },\n {\n x: 0.890625,\n y: 0.390625,\n },\n {\n x: 0.890625,\n y: 0.390625,\n },\n {\n x: 0.921875,\n y: 0.390625,\n },\n {\n x: 0.921875,\n y: 0.390625,\n },\n {\n x: 0.953125,\n y: 0.390625,\n },\n {\n x: 0.953125,\n y: 0.390625,\n },\n {\n x: 0.984375,\n y: 0.390625,\n },\n {\n x: 0.984375,\n y: 0.390625,\n },\n {\n x: 0.015625,\n y: 0.421875,\n },\n {\n x: 0.015625,\n y: 0.421875,\n },\n {\n x: 0.046875,\n y: 0.421875,\n },\n {\n x: 0.046875,\n y: 0.421875,\n },\n {\n x: 0.078125,\n y: 0.421875,\n },\n {\n x: 0.078125,\n y: 0.421875,\n },\n {\n x: 0.109375,\n y: 0.421875,\n },\n {\n x: 0.109375,\n y: 0.421875,\n },\n {\n x: 0.140625,\n y: 0.421875,\n },\n {\n x: 0.140625,\n y: 0.421875,\n },\n {\n x: 0.171875,\n y: 0.421875,\n },\n {\n x: 0.171875,\n y: 0.421875,\n },\n {\n x: 0.203125,\n y: 0.421875,\n },\n {\n x: 0.203125,\n y: 0.421875,\n },\n {\n x: 0.234375,\n y: 0.421875,\n },\n {\n x: 0.234375,\n y: 0.421875,\n },\n {\n x: 0.265625,\n y: 0.421875,\n },\n {\n x: 0.265625,\n y: 0.421875,\n },\n {\n x: 0.296875,\n y: 0.421875,\n },\n {\n x: 0.296875,\n y: 0.421875,\n },\n {\n x: 0.328125,\n y: 0.421875,\n },\n {\n x: 0.328125,\n y: 0.421875,\n },\n {\n x: 0.359375,\n y: 0.421875,\n },\n {\n x: 0.359375,\n y: 0.421875,\n },\n {\n x: 0.390625,\n y: 0.421875,\n },\n {\n x: 0.390625,\n y: 0.421875,\n },\n {\n x: 0.421875,\n y: 0.421875,\n },\n {\n x: 0.421875,\n y: 0.421875,\n },\n {\n x: 0.453125,\n y: 0.421875,\n },\n {\n x: 0.453125,\n y: 0.421875,\n },\n {\n x: 0.484375,\n y: 0.421875,\n },\n {\n x: 0.484375,\n y: 0.421875,\n },\n {\n x: 0.515625,\n y: 0.421875,\n },\n {\n x: 0.515625,\n y: 0.421875,\n },\n {\n x: 0.546875,\n y: 0.421875,\n },\n {\n x: 0.546875,\n y: 0.421875,\n },\n {\n x: 0.578125,\n y: 0.421875,\n },\n {\n x: 0.578125,\n y: 0.421875,\n },\n {\n x: 0.609375,\n y: 0.421875,\n },\n {\n x: 0.609375,\n y: 0.421875,\n },\n {\n x: 0.640625,\n y: 0.421875,\n },\n {\n x: 0.640625,\n y: 0.421875,\n },\n {\n x: 0.671875,\n y: 0.421875,\n },\n {\n x: 0.671875,\n y: 0.421875,\n },\n {\n x: 0.703125,\n y: 0.421875,\n },\n {\n x: 0.703125,\n y: 0.421875,\n },\n {\n x: 0.734375,\n y: 0.421875,\n },\n {\n x: 0.734375,\n y: 0.421875,\n },\n {\n x: 0.765625,\n y: 0.421875,\n },\n {\n x: 0.765625,\n y: 0.421875,\n },\n {\n x: 0.796875,\n y: 0.421875,\n },\n {\n x: 0.796875,\n y: 0.421875,\n },\n {\n x: 0.828125,\n y: 0.421875,\n },\n {\n x: 0.828125,\n y: 0.421875,\n },\n {\n x: 0.859375,\n y: 0.421875,\n },\n {\n x: 0.859375,\n y: 0.421875,\n },\n {\n x: 0.890625,\n y: 0.421875,\n },\n {\n x: 0.890625,\n y: 0.421875,\n },\n {\n x: 0.921875,\n y: 0.421875,\n },\n {\n x: 0.921875,\n y: 0.421875,\n },\n {\n x: 0.953125,\n y: 0.421875,\n },\n {\n x: 0.953125,\n y: 0.421875,\n },\n {\n x: 0.984375,\n y: 0.421875,\n },\n {\n x: 0.984375,\n y: 0.421875,\n },\n {\n x: 0.015625,\n y: 0.453125,\n },\n {\n x: 0.015625,\n y: 0.453125,\n },\n {\n x: 0.046875,\n y: 0.453125,\n },\n {\n x: 0.046875,\n y: 0.453125,\n },\n {\n x: 0.078125,\n y: 0.453125,\n },\n {\n x: 0.078125,\n y: 0.453125,\n },\n {\n x: 0.109375,\n y: 0.453125,\n },\n {\n x: 0.109375,\n y: 0.453125,\n },\n {\n x: 0.140625,\n y: 0.453125,\n },\n {\n x: 0.140625,\n y: 0.453125,\n },\n {\n x: 0.171875,\n y: 0.453125,\n },\n {\n x: 0.171875,\n y: 0.453125,\n },\n {\n x: 0.203125,\n y: 0.453125,\n },\n {\n x: 0.203125,\n y: 0.453125,\n },\n {\n x: 0.234375,\n y: 0.453125,\n },\n {\n x: 0.234375,\n y: 0.453125,\n },\n {\n x: 0.265625,\n y: 0.453125,\n },\n {\n x: 0.265625,\n y: 0.453125,\n },\n {\n x: 0.296875,\n y: 0.453125,\n },\n {\n x: 0.296875,\n y: 0.453125,\n },\n {\n x: 0.328125,\n y: 0.453125,\n },\n {\n x: 0.328125,\n y: 0.453125,\n },\n {\n x: 0.359375,\n y: 0.453125,\n },\n {\n x: 0.359375,\n y: 0.453125,\n },\n {\n x: 0.390625,\n y: 0.453125,\n },\n {\n x: 0.390625,\n y: 0.453125,\n },\n {\n x: 0.421875,\n y: 0.453125,\n },\n {\n x: 0.421875,\n y: 0.453125,\n },\n {\n x: 0.453125,\n y: 0.453125,\n },\n {\n x: 0.453125,\n y: 0.453125,\n },\n {\n x: 0.484375,\n y: 0.453125,\n },\n {\n x: 0.484375,\n y: 0.453125,\n },\n {\n x: 0.515625,\n y: 0.453125,\n },\n {\n x: 0.515625,\n y: 0.453125,\n },\n {\n x: 0.546875,\n y: 0.453125,\n },\n {\n x: 0.546875,\n y: 0.453125,\n },\n {\n x: 0.578125,\n y: 0.453125,\n },\n {\n x: 0.578125,\n y: 0.453125,\n },\n {\n x: 0.609375,\n y: 0.453125,\n },\n {\n x: 0.609375,\n y: 0.453125,\n },\n {\n x: 0.640625,\n y: 0.453125,\n },\n {\n x: 0.640625,\n y: 0.453125,\n },\n {\n x: 0.671875,\n y: 0.453125,\n },\n {\n x: 0.671875,\n y: 0.453125,\n },\n {\n x: 0.703125,\n y: 0.453125,\n },\n {\n x: 0.703125,\n y: 0.453125,\n },\n {\n x: 0.734375,\n y: 0.453125,\n },\n {\n x: 0.734375,\n y: 0.453125,\n },\n {\n x: 0.765625,\n y: 0.453125,\n },\n {\n x: 0.765625,\n y: 0.453125,\n },\n {\n x: 0.796875,\n y: 0.453125,\n },\n {\n x: 0.796875,\n y: 0.453125,\n },\n {\n x: 0.828125,\n y: 0.453125,\n },\n {\n x: 0.828125,\n y: 0.453125,\n },\n {\n x: 0.859375,\n y: 0.453125,\n },\n {\n x: 0.859375,\n y: 0.453125,\n },\n {\n x: 0.890625,\n y: 0.453125,\n },\n {\n x: 0.890625,\n y: 0.453125,\n },\n {\n x: 0.921875,\n y: 0.453125,\n },\n {\n x: 0.921875,\n y: 0.453125,\n },\n {\n x: 0.953125,\n y: 0.453125,\n },\n {\n x: 0.953125,\n y: 0.453125,\n },\n {\n x: 0.984375,\n y: 0.453125,\n },\n {\n x: 0.984375,\n y: 0.453125,\n },\n {\n x: 0.015625,\n y: 0.484375,\n },\n {\n x: 0.015625,\n y: 0.484375,\n },\n {\n x: 0.046875,\n y: 0.484375,\n },\n {\n x: 0.046875,\n y: 0.484375,\n },\n {\n x: 0.078125,\n y: 0.484375,\n },\n {\n x: 0.078125,\n y: 0.484375,\n },\n {\n x: 0.109375,\n y: 0.484375,\n },\n {\n x: 0.109375,\n y: 0.484375,\n },\n {\n x: 0.140625,\n y: 0.484375,\n },\n {\n x: 0.140625,\n y: 0.484375,\n },\n {\n x: 0.171875,\n y: 0.484375,\n },\n {\n x: 0.171875,\n y: 0.484375,\n },\n {\n x: 0.203125,\n y: 0.484375,\n },\n {\n x: 0.203125,\n y: 0.484375,\n },\n {\n x: 0.234375,\n y: 0.484375,\n },\n {\n x: 0.234375,\n y: 0.484375,\n },\n {\n x: 0.265625,\n y: 0.484375,\n },\n {\n x: 0.265625,\n y: 0.484375,\n },\n {\n x: 0.296875,\n y: 0.484375,\n },\n {\n x: 0.296875,\n y: 0.484375,\n },\n {\n x: 0.328125,\n y: 0.484375,\n },\n {\n x: 0.328125,\n y: 0.484375,\n },\n {\n x: 0.359375,\n y: 0.484375,\n },\n {\n x: 0.359375,\n y: 0.484375,\n },\n {\n x: 0.390625,\n y: 0.484375,\n },\n {\n x: 0.390625,\n y: 0.484375,\n },\n {\n x: 0.421875,\n y: 0.484375,\n },\n {\n x: 0.421875,\n y: 0.484375,\n },\n {\n x: 0.453125,\n y: 0.484375,\n },\n {\n x: 0.453125,\n y: 0.484375,\n },\n {\n x: 0.484375,\n y: 0.484375,\n },\n {\n x: 0.484375,\n y: 0.484375,\n },\n {\n x: 0.515625,\n y: 0.484375,\n },\n {\n x: 0.515625,\n y: 0.484375,\n },\n {\n x: 0.546875,\n y: 0.484375,\n },\n {\n x: 0.546875,\n y: 0.484375,\n },\n {\n x: 0.578125,\n y: 0.484375,\n },\n {\n x: 0.578125,\n y: 0.484375,\n },\n {\n x: 0.609375,\n y: 0.484375,\n },\n {\n x: 0.609375,\n y: 0.484375,\n },\n {\n x: 0.640625,\n y: 0.484375,\n },\n {\n x: 0.640625,\n y: 0.484375,\n },\n {\n x: 0.671875,\n y: 0.484375,\n },\n {\n x: 0.671875,\n y: 0.484375,\n },\n {\n x: 0.703125,\n y: 0.484375,\n },\n {\n x: 0.703125,\n y: 0.484375,\n },\n {\n x: 0.734375,\n y: 0.484375,\n },\n {\n x: 0.734375,\n y: 0.484375,\n },\n {\n x: 0.765625,\n y: 0.484375,\n },\n {\n x: 0.765625,\n y: 0.484375,\n },\n {\n x: 0.796875,\n y: 0.484375,\n },\n {\n x: 0.796875,\n y: 0.484375,\n },\n {\n x: 0.828125,\n y: 0.484375,\n },\n {\n x: 0.828125,\n y: 0.484375,\n },\n {\n x: 0.859375,\n y: 0.484375,\n },\n {\n x: 0.859375,\n y: 0.484375,\n },\n {\n x: 0.890625,\n y: 0.484375,\n },\n {\n x: 0.890625,\n y: 0.484375,\n },\n {\n x: 0.921875,\n y: 0.484375,\n },\n {\n x: 0.921875,\n y: 0.484375,\n },\n {\n x: 0.953125,\n y: 0.484375,\n },\n {\n x: 0.953125,\n y: 0.484375,\n },\n {\n x: 0.984375,\n y: 0.484375,\n },\n {\n x: 0.984375,\n y: 0.484375,\n },\n {\n x: 0.015625,\n y: 0.515625,\n },\n {\n x: 0.015625,\n y: 0.515625,\n },\n {\n x: 0.046875,\n y: 0.515625,\n },\n {\n x: 0.046875,\n y: 0.515625,\n },\n {\n x: 0.078125,\n y: 0.515625,\n },\n {\n x: 0.078125,\n y: 0.515625,\n },\n {\n x: 0.109375,\n y: 0.515625,\n },\n {\n x: 0.109375,\n y: 0.515625,\n },\n {\n x: 0.140625,\n y: 0.515625,\n },\n {\n x: 0.140625,\n y: 0.515625,\n },\n {\n x: 0.171875,\n y: 0.515625,\n },\n {\n x: 0.171875,\n y: 0.515625,\n },\n {\n x: 0.203125,\n y: 0.515625,\n },\n {\n x: 0.203125,\n y: 0.515625,\n },\n {\n x: 0.234375,\n y: 0.515625,\n },\n {\n x: 0.234375,\n y: 0.515625,\n },\n {\n x: 0.265625,\n y: 0.515625,\n },\n {\n x: 0.265625,\n y: 0.515625,\n },\n {\n x: 0.296875,\n y: 0.515625,\n },\n {\n x: 0.296875,\n y: 0.515625,\n },\n {\n x: 0.328125,\n y: 0.515625,\n },\n {\n x: 0.328125,\n y: 0.515625,\n },\n {\n x: 0.359375,\n y: 0.515625,\n },\n {\n x: 0.359375,\n y: 0.515625,\n },\n {\n x: 0.390625,\n y: 0.515625,\n },\n {\n x: 0.390625,\n y: 0.515625,\n },\n {\n x: 0.421875,\n y: 0.515625,\n },\n {\n x: 0.421875,\n y: 0.515625,\n },\n {\n x: 0.453125,\n y: 0.515625,\n },\n {\n x: 0.453125,\n y: 0.515625,\n },\n {\n x: 0.484375,\n y: 0.515625,\n },\n {\n x: 0.484375,\n y: 0.515625,\n },\n {\n x: 0.515625,\n y: 0.515625,\n },\n {\n x: 0.515625,\n y: 0.515625,\n },\n {\n x: 0.546875,\n y: 0.515625,\n },\n {\n x: 0.546875,\n y: 0.515625,\n },\n {\n x: 0.578125,\n y: 0.515625,\n },\n {\n x: 0.578125,\n y: 0.515625,\n },\n {\n x: 0.609375,\n y: 0.515625,\n },\n {\n x: 0.609375,\n y: 0.515625,\n },\n {\n x: 0.640625,\n y: 0.515625,\n },\n {\n x: 0.640625,\n y: 0.515625,\n },\n {\n x: 0.671875,\n y: 0.515625,\n },\n {\n x: 0.671875,\n y: 0.515625,\n },\n {\n x: 0.703125,\n y: 0.515625,\n },\n {\n x: 0.703125,\n y: 0.515625,\n },\n {\n x: 0.734375,\n y: 0.515625,\n },\n {\n x: 0.734375,\n y: 0.515625,\n },\n {\n x: 0.765625,\n y: 0.515625,\n },\n {\n x: 0.765625,\n y: 0.515625,\n },\n {\n x: 0.796875,\n y: 0.515625,\n },\n {\n x: 0.796875,\n y: 0.515625,\n },\n {\n x: 0.828125,\n y: 0.515625,\n },\n {\n x: 0.828125,\n y: 0.515625,\n },\n {\n x: 0.859375,\n y: 0.515625,\n },\n {\n x: 0.859375,\n y: 0.515625,\n },\n {\n x: 0.890625,\n y: 0.515625,\n },\n {\n x: 0.890625,\n y: 0.515625,\n },\n {\n x: 0.921875,\n y: 0.515625,\n },\n {\n x: 0.921875,\n y: 0.515625,\n },\n {\n x: 0.953125,\n y: 0.515625,\n },\n {\n x: 0.953125,\n y: 0.515625,\n },\n {\n x: 0.984375,\n y: 0.515625,\n },\n {\n x: 0.984375,\n y: 0.515625,\n },\n {\n x: 0.015625,\n y: 0.546875,\n },\n {\n x: 0.015625,\n y: 0.546875,\n },\n {\n x: 0.046875,\n y: 0.546875,\n },\n {\n x: 0.046875,\n y: 0.546875,\n },\n {\n x: 0.078125,\n y: 0.546875,\n },\n {\n x: 0.078125,\n y: 0.546875,\n },\n {\n x: 0.109375,\n y: 0.546875,\n },\n {\n x: 0.109375,\n y: 0.546875,\n },\n {\n x: 0.140625,\n y: 0.546875,\n },\n {\n x: 0.140625,\n y: 0.546875,\n },\n {\n x: 0.171875,\n y: 0.546875,\n },\n {\n x: 0.171875,\n y: 0.546875,\n },\n {\n x: 0.203125,\n y: 0.546875,\n },\n {\n x: 0.203125,\n y: 0.546875,\n },\n {\n x: 0.234375,\n y: 0.546875,\n },\n {\n x: 0.234375,\n y: 0.546875,\n },\n {\n x: 0.265625,\n y: 0.546875,\n },\n {\n x: 0.265625,\n y: 0.546875,\n },\n {\n x: 0.296875,\n y: 0.546875,\n },\n {\n x: 0.296875,\n y: 0.546875,\n },\n {\n x: 0.328125,\n y: 0.546875,\n },\n {\n x: 0.328125,\n y: 0.546875,\n },\n {\n x: 0.359375,\n y: 0.546875,\n },\n {\n x: 0.359375,\n y: 0.546875,\n },\n {\n x: 0.390625,\n y: 0.546875,\n },\n {\n x: 0.390625,\n y: 0.546875,\n },\n {\n x: 0.421875,\n y: 0.546875,\n },\n {\n x: 0.421875,\n y: 0.546875,\n },\n {\n x: 0.453125,\n y: 0.546875,\n },\n {\n x: 0.453125,\n y: 0.546875,\n },\n {\n x: 0.484375,\n y: 0.546875,\n },\n {\n x: 0.484375,\n y: 0.546875,\n },\n {\n x: 0.515625,\n y: 0.546875,\n },\n {\n x: 0.515625,\n y: 0.546875,\n },\n {\n x: 0.546875,\n y: 0.546875,\n },\n {\n x: 0.546875,\n y: 0.546875,\n },\n {\n x: 0.578125,\n y: 0.546875,\n },\n {\n x: 0.578125,\n y: 0.546875,\n },\n {\n x: 0.609375,\n y: 0.546875,\n },\n {\n x: 0.609375,\n y: 0.546875,\n },\n {\n x: 0.640625,\n y: 0.546875,\n },\n {\n x: 0.640625,\n y: 0.546875,\n },\n {\n x: 0.671875,\n y: 0.546875,\n },\n {\n x: 0.671875,\n y: 0.546875,\n },\n {\n x: 0.703125,\n y: 0.546875,\n },\n {\n x: 0.703125,\n y: 0.546875,\n },\n {\n x: 0.734375,\n y: 0.546875,\n },\n {\n x: 0.734375,\n y: 0.546875,\n },\n {\n x: 0.765625,\n y: 0.546875,\n },\n {\n x: 0.765625,\n y: 0.546875,\n },\n {\n x: 0.796875,\n y: 0.546875,\n },\n {\n x: 0.796875,\n y: 0.546875,\n },\n {\n x: 0.828125,\n y: 0.546875,\n },\n {\n x: 0.828125,\n y: 0.546875,\n },\n {\n x: 0.859375,\n y: 0.546875,\n },\n {\n x: 0.859375,\n y: 0.546875,\n },\n {\n x: 0.890625,\n y: 0.546875,\n },\n {\n x: 0.890625,\n y: 0.546875,\n },\n {\n x: 0.921875,\n y: 0.546875,\n },\n {\n x: 0.921875,\n y: 0.546875,\n },\n {\n x: 0.953125,\n y: 0.546875,\n },\n {\n x: 0.953125,\n y: 0.546875,\n },\n {\n x: 0.984375,\n y: 0.546875,\n },\n {\n x: 0.984375,\n y: 0.546875,\n },\n {\n x: 0.015625,\n y: 0.578125,\n },\n {\n x: 0.015625,\n y: 0.578125,\n },\n {\n x: 0.046875,\n y: 0.578125,\n },\n {\n x: 0.046875,\n y: 0.578125,\n },\n {\n x: 0.078125,\n y: 0.578125,\n },\n {\n x: 0.078125,\n y: 0.578125,\n },\n {\n x: 0.109375,\n y: 0.578125,\n },\n {\n x: 0.109375,\n y: 0.578125,\n },\n {\n x: 0.140625,\n y: 0.578125,\n },\n {\n x: 0.140625,\n y: 0.578125,\n },\n {\n x: 0.171875,\n y: 0.578125,\n },\n {\n x: 0.171875,\n y: 0.578125,\n },\n {\n x: 0.203125,\n y: 0.578125,\n },\n {\n x: 0.203125,\n y: 0.578125,\n },\n {\n x: 0.234375,\n y: 0.578125,\n },\n {\n x: 0.234375,\n y: 0.578125,\n },\n {\n x: 0.265625,\n y: 0.578125,\n },\n {\n x: 0.265625,\n y: 0.578125,\n },\n {\n x: 0.296875,\n y: 0.578125,\n },\n {\n x: 0.296875,\n y: 0.578125,\n },\n {\n x: 0.328125,\n y: 0.578125,\n },\n {\n x: 0.328125,\n y: 0.578125,\n },\n {\n x: 0.359375,\n y: 0.578125,\n },\n {\n x: 0.359375,\n y: 0.578125,\n },\n {\n x: 0.390625,\n y: 0.578125,\n },\n {\n x: 0.390625,\n y: 0.578125,\n },\n {\n x: 0.421875,\n y: 0.578125,\n },\n {\n x: 0.421875,\n y: 0.578125,\n },\n {\n x: 0.453125,\n y: 0.578125,\n },\n {\n x: 0.453125,\n y: 0.578125,\n },\n {\n x: 0.484375,\n y: 0.578125,\n },\n {\n x: 0.484375,\n y: 0.578125,\n },\n {\n x: 0.515625,\n y: 0.578125,\n },\n {\n x: 0.515625,\n y: 0.578125,\n },\n {\n x: 0.546875,\n y: 0.578125,\n },\n {\n x: 0.546875,\n y: 0.578125,\n },\n {\n x: 0.578125,\n y: 0.578125,\n },\n {\n x: 0.578125,\n y: 0.578125,\n },\n {\n x: 0.609375,\n y: 0.578125,\n },\n {\n x: 0.609375,\n y: 0.578125,\n },\n {\n x: 0.640625,\n y: 0.578125,\n },\n {\n x: 0.640625,\n y: 0.578125,\n },\n {\n x: 0.671875,\n y: 0.578125,\n },\n {\n x: 0.671875,\n y: 0.578125,\n },\n {\n x: 0.703125,\n y: 0.578125,\n },\n {\n x: 0.703125,\n y: 0.578125,\n },\n {\n x: 0.734375,\n y: 0.578125,\n },\n {\n x: 0.734375,\n y: 0.578125,\n },\n {\n x: 0.765625,\n y: 0.578125,\n },\n {\n x: 0.765625,\n y: 0.578125,\n },\n {\n x: 0.796875,\n y: 0.578125,\n },\n {\n x: 0.796875,\n y: 0.578125,\n },\n {\n x: 0.828125,\n y: 0.578125,\n },\n {\n x: 0.828125,\n y: 0.578125,\n },\n {\n x: 0.859375,\n y: 0.578125,\n },\n {\n x: 0.859375,\n y: 0.578125,\n },\n {\n x: 0.890625,\n y: 0.578125,\n },\n {\n x: 0.890625,\n y: 0.578125,\n },\n {\n x: 0.921875,\n y: 0.578125,\n },\n {\n x: 0.921875,\n y: 0.578125,\n },\n {\n x: 0.953125,\n y: 0.578125,\n },\n {\n x: 0.953125,\n y: 0.578125,\n },\n {\n x: 0.984375,\n y: 0.578125,\n },\n {\n x: 0.984375,\n y: 0.578125,\n },\n {\n x: 0.015625,\n y: 0.609375,\n },\n {\n x: 0.015625,\n y: 0.609375,\n },\n {\n x: 0.046875,\n y: 0.609375,\n },\n {\n x: 0.046875,\n y: 0.609375,\n },\n {\n x: 0.078125,\n y: 0.609375,\n },\n {\n x: 0.078125,\n y: 0.609375,\n },\n {\n x: 0.109375,\n y: 0.609375,\n },\n {\n x: 0.109375,\n y: 0.609375,\n },\n {\n x: 0.140625,\n y: 0.609375,\n },\n {\n x: 0.140625,\n y: 0.609375,\n },\n {\n x: 0.171875,\n y: 0.609375,\n },\n {\n x: 0.171875,\n y: 0.609375,\n },\n {\n x: 0.203125,\n y: 0.609375,\n },\n {\n x: 0.203125,\n y: 0.609375,\n },\n {\n x: 0.234375,\n y: 0.609375,\n },\n {\n x: 0.234375,\n y: 0.609375,\n },\n {\n x: 0.265625,\n y: 0.609375,\n },\n {\n x: 0.265625,\n y: 0.609375,\n },\n {\n x: 0.296875,\n y: 0.609375,\n },\n {\n x: 0.296875,\n y: 0.609375,\n },\n {\n x: 0.328125,\n y: 0.609375,\n },\n {\n x: 0.328125,\n y: 0.609375,\n },\n {\n x: 0.359375,\n y: 0.609375,\n },\n {\n x: 0.359375,\n y: 0.609375,\n },\n {\n x: 0.390625,\n y: 0.609375,\n },\n {\n x: 0.390625,\n y: 0.609375,\n },\n {\n x: 0.421875,\n y: 0.609375,\n },\n {\n x: 0.421875,\n y: 0.609375,\n },\n {\n x: 0.453125,\n y: 0.609375,\n },\n {\n x: 0.453125,\n y: 0.609375,\n },\n {\n x: 0.484375,\n y: 0.609375,\n },\n {\n x: 0.484375,\n y: 0.609375,\n },\n {\n x: 0.515625,\n y: 0.609375,\n },\n {\n x: 0.515625,\n y: 0.609375,\n },\n {\n x: 0.546875,\n y: 0.609375,\n },\n {\n x: 0.546875,\n y: 0.609375,\n },\n {\n x: 0.578125,\n y: 0.609375,\n },\n {\n x: 0.578125,\n y: 0.609375,\n },\n {\n x: 0.609375,\n y: 0.609375,\n },\n {\n x: 0.609375,\n y: 0.609375,\n },\n {\n x: 0.640625,\n y: 0.609375,\n },\n {\n x: 0.640625,\n y: 0.609375,\n },\n {\n x: 0.671875,\n y: 0.609375,\n },\n {\n x: 0.671875,\n y: 0.609375,\n },\n {\n x: 0.703125,\n y: 0.609375,\n },\n {\n x: 0.703125,\n y: 0.609375,\n },\n {\n x: 0.734375,\n y: 0.609375,\n },\n {\n x: 0.734375,\n y: 0.609375,\n },\n {\n x: 0.765625,\n y: 0.609375,\n },\n {\n x: 0.765625,\n y: 0.609375,\n },\n {\n x: 0.796875,\n y: 0.609375,\n },\n {\n x: 0.796875,\n y: 0.609375,\n },\n {\n x: 0.828125,\n y: 0.609375,\n },\n {\n x: 0.828125,\n y: 0.609375,\n },\n {\n x: 0.859375,\n y: 0.609375,\n },\n {\n x: 0.859375,\n y: 0.609375,\n },\n {\n x: 0.890625,\n y: 0.609375,\n },\n {\n x: 0.890625,\n y: 0.609375,\n },\n {\n x: 0.921875,\n y: 0.609375,\n },\n {\n x: 0.921875,\n y: 0.609375,\n },\n {\n x: 0.953125,\n y: 0.609375,\n },\n {\n x: 0.953125,\n y: 0.609375,\n },\n {\n x: 0.984375,\n y: 0.609375,\n },\n {\n x: 0.984375,\n y: 0.609375,\n },\n {\n x: 0.015625,\n y: 0.640625,\n },\n {\n x: 0.015625,\n y: 0.640625,\n },\n {\n x: 0.046875,\n y: 0.640625,\n },\n {\n x: 0.046875,\n y: 0.640625,\n },\n {\n x: 0.078125,\n y: 0.640625,\n },\n {\n x: 0.078125,\n y: 0.640625,\n },\n {\n x: 0.109375,\n y: 0.640625,\n },\n {\n x: 0.109375,\n y: 0.640625,\n },\n {\n x: 0.140625,\n y: 0.640625,\n },\n {\n x: 0.140625,\n y: 0.640625,\n },\n {\n x: 0.171875,\n y: 0.640625,\n },\n {\n x: 0.171875,\n y: 0.640625,\n },\n {\n x: 0.203125,\n y: 0.640625,\n },\n {\n x: 0.203125,\n y: 0.640625,\n },\n {\n x: 0.234375,\n y: 0.640625,\n },\n {\n x: 0.234375,\n y: 0.640625,\n },\n {\n x: 0.265625,\n y: 0.640625,\n },\n {\n x: 0.265625,\n y: 0.640625,\n },\n {\n x: 0.296875,\n y: 0.640625,\n },\n {\n x: 0.296875,\n y: 0.640625,\n },\n {\n x: 0.328125,\n y: 0.640625,\n },\n {\n x: 0.328125,\n y: 0.640625,\n },\n {\n x: 0.359375,\n y: 0.640625,\n },\n {\n x: 0.359375,\n y: 0.640625,\n },\n {\n x: 0.390625,\n y: 0.640625,\n },\n {\n x: 0.390625,\n y: 0.640625,\n },\n {\n x: 0.421875,\n y: 0.640625,\n },\n {\n x: 0.421875,\n y: 0.640625,\n },\n {\n x: 0.453125,\n y: 0.640625,\n },\n {\n x: 0.453125,\n y: 0.640625,\n },\n {\n x: 0.484375,\n y: 0.640625,\n },\n {\n x: 0.484375,\n y: 0.640625,\n },\n {\n x: 0.515625,\n y: 0.640625,\n },\n {\n x: 0.515625,\n y: 0.640625,\n },\n {\n x: 0.546875,\n y: 0.640625,\n },\n {\n x: 0.546875,\n y: 0.640625,\n },\n {\n x: 0.578125,\n y: 0.640625,\n },\n {\n x: 0.578125,\n y: 0.640625,\n },\n {\n x: 0.609375,\n y: 0.640625,\n },\n {\n x: 0.609375,\n y: 0.640625,\n },\n {\n x: 0.640625,\n y: 0.640625,\n },\n {\n x: 0.640625,\n y: 0.640625,\n },\n {\n x: 0.671875,\n y: 0.640625,\n },\n {\n x: 0.671875,\n y: 0.640625,\n },\n {\n x: 0.703125,\n y: 0.640625,\n },\n {\n x: 0.703125,\n y: 0.640625,\n },\n {\n x: 0.734375,\n y: 0.640625,\n },\n {\n x: 0.734375,\n y: 0.640625,\n },\n {\n x: 0.765625,\n y: 0.640625,\n },\n {\n x: 0.765625,\n y: 0.640625,\n },\n {\n x: 0.796875,\n y: 0.640625,\n },\n {\n x: 0.796875,\n y: 0.640625,\n },\n {\n x: 0.828125,\n y: 0.640625,\n },\n {\n x: 0.828125,\n y: 0.640625,\n },\n {\n x: 0.859375,\n y: 0.640625,\n },\n {\n x: 0.859375,\n y: 0.640625,\n },\n {\n x: 0.890625,\n y: 0.640625,\n },\n {\n x: 0.890625,\n y: 0.640625,\n },\n {\n x: 0.921875,\n y: 0.640625,\n },\n {\n x: 0.921875,\n y: 0.640625,\n },\n {\n x: 0.953125,\n y: 0.640625,\n },\n {\n x: 0.953125,\n y: 0.640625,\n },\n {\n x: 0.984375,\n y: 0.640625,\n },\n {\n x: 0.984375,\n y: 0.640625,\n },\n {\n x: 0.015625,\n y: 0.671875,\n },\n {\n x: 0.015625,\n y: 0.671875,\n },\n {\n x: 0.046875,\n y: 0.671875,\n },\n {\n x: 0.046875,\n y: 0.671875,\n },\n {\n x: 0.078125,\n y: 0.671875,\n },\n {\n x: 0.078125,\n y: 0.671875,\n },\n {\n x: 0.109375,\n y: 0.671875,\n },\n {\n x: 0.109375,\n y: 0.671875,\n },\n {\n x: 0.140625,\n y: 0.671875,\n },\n {\n x: 0.140625,\n y: 0.671875,\n },\n {\n x: 0.171875,\n y: 0.671875,\n },\n {\n x: 0.171875,\n y: 0.671875,\n },\n {\n x: 0.203125,\n y: 0.671875,\n },\n {\n x: 0.203125,\n y: 0.671875,\n },\n {\n x: 0.234375,\n y: 0.671875,\n },\n {\n x: 0.234375,\n y: 0.671875,\n },\n {\n x: 0.265625,\n y: 0.671875,\n },\n {\n x: 0.265625,\n y: 0.671875,\n },\n {\n x: 0.296875,\n y: 0.671875,\n },\n {\n x: 0.296875,\n y: 0.671875,\n },\n {\n x: 0.328125,\n y: 0.671875,\n },\n {\n x: 0.328125,\n y: 0.671875,\n },\n {\n x: 0.359375,\n y: 0.671875,\n },\n {\n x: 0.359375,\n y: 0.671875,\n },\n {\n x: 0.390625,\n y: 0.671875,\n },\n {\n x: 0.390625,\n y: 0.671875,\n },\n {\n x: 0.421875,\n y: 0.671875,\n },\n {\n x: 0.421875,\n y: 0.671875,\n },\n {\n x: 0.453125,\n y: 0.671875,\n },\n {\n x: 0.453125,\n y: 0.671875,\n },\n {\n x: 0.484375,\n y: 0.671875,\n },\n {\n x: 0.484375,\n y: 0.671875,\n },\n {\n x: 0.515625,\n y: 0.671875,\n },\n {\n x: 0.515625,\n y: 0.671875,\n },\n {\n x: 0.546875,\n y: 0.671875,\n },\n {\n x: 0.546875,\n y: 0.671875,\n },\n {\n x: 0.578125,\n y: 0.671875,\n },\n {\n x: 0.578125,\n y: 0.671875,\n },\n {\n x: 0.609375,\n y: 0.671875,\n },\n {\n x: 0.609375,\n y: 0.671875,\n },\n {\n x: 0.640625,\n y: 0.671875,\n },\n {\n x: 0.640625,\n y: 0.671875,\n },\n {\n x: 0.671875,\n y: 0.671875,\n },\n {\n x: 0.671875,\n y: 0.671875,\n },\n {\n x: 0.703125,\n y: 0.671875,\n },\n {\n x: 0.703125,\n y: 0.671875,\n },\n {\n x: 0.734375,\n y: 0.671875,\n },\n {\n x: 0.734375,\n y: 0.671875,\n },\n {\n x: 0.765625,\n y: 0.671875,\n },\n {\n x: 0.765625,\n y: 0.671875,\n },\n {\n x: 0.796875,\n y: 0.671875,\n },\n {\n x: 0.796875,\n y: 0.671875,\n },\n {\n x: 0.828125,\n y: 0.671875,\n },\n {\n x: 0.828125,\n y: 0.671875,\n },\n {\n x: 0.859375,\n y: 0.671875,\n },\n {\n x: 0.859375,\n y: 0.671875,\n },\n {\n x: 0.890625,\n y: 0.671875,\n },\n {\n x: 0.890625,\n y: 0.671875,\n },\n {\n x: 0.921875,\n y: 0.671875,\n },\n {\n x: 0.921875,\n y: 0.671875,\n },\n {\n x: 0.953125,\n y: 0.671875,\n },\n {\n x: 0.953125,\n y: 0.671875,\n },\n {\n x: 0.984375,\n y: 0.671875,\n },\n {\n x: 0.984375,\n y: 0.671875,\n },\n {\n x: 0.015625,\n y: 0.703125,\n },\n {\n x: 0.015625,\n y: 0.703125,\n },\n {\n x: 0.046875,\n y: 0.703125,\n },\n {\n x: 0.046875,\n y: 0.703125,\n },\n {\n x: 0.078125,\n y: 0.703125,\n },\n {\n x: 0.078125,\n y: 0.703125,\n },\n {\n x: 0.109375,\n y: 0.703125,\n },\n {\n x: 0.109375,\n y: 0.703125,\n },\n {\n x: 0.140625,\n y: 0.703125,\n },\n {\n x: 0.140625,\n y: 0.703125,\n },\n {\n x: 0.171875,\n y: 0.703125,\n },\n {\n x: 0.171875,\n y: 0.703125,\n },\n {\n x: 0.203125,\n y: 0.703125,\n },\n {\n x: 0.203125,\n y: 0.703125,\n },\n {\n x: 0.234375,\n y: 0.703125,\n },\n {\n x: 0.234375,\n y: 0.703125,\n },\n {\n x: 0.265625,\n y: 0.703125,\n },\n {\n x: 0.265625,\n y: 0.703125,\n },\n {\n x: 0.296875,\n y: 0.703125,\n },\n {\n x: 0.296875,\n y: 0.703125,\n },\n {\n x: 0.328125,\n y: 0.703125,\n },\n {\n x: 0.328125,\n y: 0.703125,\n },\n {\n x: 0.359375,\n y: 0.703125,\n },\n {\n x: 0.359375,\n y: 0.703125,\n },\n {\n x: 0.390625,\n y: 0.703125,\n },\n {\n x: 0.390625,\n y: 0.703125,\n },\n {\n x: 0.421875,\n y: 0.703125,\n },\n {\n x: 0.421875,\n y: 0.703125,\n },\n {\n x: 0.453125,\n y: 0.703125,\n },\n {\n x: 0.453125,\n y: 0.703125,\n },\n {\n x: 0.484375,\n y: 0.703125,\n },\n {\n x: 0.484375,\n y: 0.703125,\n },\n {\n x: 0.515625,\n y: 0.703125,\n },\n {\n x: 0.515625,\n y: 0.703125,\n },\n {\n x: 0.546875,\n y: 0.703125,\n },\n {\n x: 0.546875,\n y: 0.703125,\n },\n {\n x: 0.578125,\n y: 0.703125,\n },\n {\n x: 0.578125,\n y: 0.703125,\n },\n {\n x: 0.609375,\n y: 0.703125,\n },\n {\n x: 0.609375,\n y: 0.703125,\n },\n {\n x: 0.640625,\n y: 0.703125,\n },\n {\n x: 0.640625,\n y: 0.703125,\n },\n {\n x: 0.671875,\n y: 0.703125,\n },\n {\n x: 0.671875,\n y: 0.703125,\n },\n {\n x: 0.703125,\n y: 0.703125,\n },\n {\n x: 0.703125,\n y: 0.703125,\n },\n {\n x: 0.734375,\n y: 0.703125,\n },\n {\n x: 0.734375,\n y: 0.703125,\n },\n {\n x: 0.765625,\n y: 0.703125,\n },\n {\n x: 0.765625,\n y: 0.703125,\n },\n {\n x: 0.796875,\n y: 0.703125,\n },\n {\n x: 0.796875,\n y: 0.703125,\n },\n {\n x: 0.828125,\n y: 0.703125,\n },\n {\n x: 0.828125,\n y: 0.703125,\n },\n {\n x: 0.859375,\n y: 0.703125,\n },\n {\n x: 0.859375,\n y: 0.703125,\n },\n {\n x: 0.890625,\n y: 0.703125,\n },\n {\n x: 0.890625,\n y: 0.703125,\n },\n {\n x: 0.921875,\n y: 0.703125,\n },\n {\n x: 0.921875,\n y: 0.703125,\n },\n {\n x: 0.953125,\n y: 0.703125,\n },\n {\n x: 0.953125,\n y: 0.703125,\n },\n {\n x: 0.984375,\n y: 0.703125,\n },\n {\n x: 0.984375,\n y: 0.703125,\n },\n {\n x: 0.015625,\n y: 0.734375,\n },\n {\n x: 0.015625,\n y: 0.734375,\n },\n {\n x: 0.046875,\n y: 0.734375,\n },\n {\n x: 0.046875,\n y: 0.734375,\n },\n {\n x: 0.078125,\n y: 0.734375,\n },\n {\n x: 0.078125,\n y: 0.734375,\n },\n {\n x: 0.109375,\n y: 0.734375,\n },\n {\n x: 0.109375,\n y: 0.734375,\n },\n {\n x: 0.140625,\n y: 0.734375,\n },\n {\n x: 0.140625,\n y: 0.734375,\n },\n {\n x: 0.171875,\n y: 0.734375,\n },\n {\n x: 0.171875,\n y: 0.734375,\n },\n {\n x: 0.203125,\n y: 0.734375,\n },\n {\n x: 0.203125,\n y: 0.734375,\n },\n {\n x: 0.234375,\n y: 0.734375,\n },\n {\n x: 0.234375,\n y: 0.734375,\n },\n {\n x: 0.265625,\n y: 0.734375,\n },\n {\n x: 0.265625,\n y: 0.734375,\n },\n {\n x: 0.296875,\n y: 0.734375,\n },\n {\n x: 0.296875,\n y: 0.734375,\n },\n {\n x: 0.328125,\n y: 0.734375,\n },\n {\n x: 0.328125,\n y: 0.734375,\n },\n {\n x: 0.359375,\n y: 0.734375,\n },\n {\n x: 0.359375,\n y: 0.734375,\n },\n {\n x: 0.390625,\n y: 0.734375,\n },\n {\n x: 0.390625,\n y: 0.734375,\n },\n {\n x: 0.421875,\n y: 0.734375,\n },\n {\n x: 0.421875,\n y: 0.734375,\n },\n {\n x: 0.453125,\n y: 0.734375,\n },\n {\n x: 0.453125,\n y: 0.734375,\n },\n {\n x: 0.484375,\n y: 0.734375,\n },\n {\n x: 0.484375,\n y: 0.734375,\n },\n {\n x: 0.515625,\n y: 0.734375,\n },\n {\n x: 0.515625,\n y: 0.734375,\n },\n {\n x: 0.546875,\n y: 0.734375,\n },\n {\n x: 0.546875,\n y: 0.734375,\n },\n {\n x: 0.578125,\n y: 0.734375,\n },\n {\n x: 0.578125,\n y: 0.734375,\n },\n {\n x: 0.609375,\n y: 0.734375,\n },\n {\n x: 0.609375,\n y: 0.734375,\n },\n {\n x: 0.640625,\n y: 0.734375,\n },\n {\n x: 0.640625,\n y: 0.734375,\n },\n {\n x: 0.671875,\n y: 0.734375,\n },\n {\n x: 0.671875,\n y: 0.734375,\n },\n {\n x: 0.703125,\n y: 0.734375,\n },\n {\n x: 0.703125,\n y: 0.734375,\n },\n {\n x: 0.734375,\n y: 0.734375,\n },\n {\n x: 0.734375,\n y: 0.734375,\n },\n {\n x: 0.765625,\n y: 0.734375,\n },\n {\n x: 0.765625,\n y: 0.734375,\n },\n {\n x: 0.796875,\n y: 0.734375,\n },\n {\n x: 0.796875,\n y: 0.734375,\n },\n {\n x: 0.828125,\n y: 0.734375,\n },\n {\n x: 0.828125,\n y: 0.734375,\n },\n {\n x: 0.859375,\n y: 0.734375,\n },\n {\n x: 0.859375,\n y: 0.734375,\n },\n {\n x: 0.890625,\n y: 0.734375,\n },\n {\n x: 0.890625,\n y: 0.734375,\n },\n {\n x: 0.921875,\n y: 0.734375,\n },\n {\n x: 0.921875,\n y: 0.734375,\n },\n {\n x: 0.953125,\n y: 0.734375,\n },\n {\n x: 0.953125,\n y: 0.734375,\n },\n {\n x: 0.984375,\n y: 0.734375,\n },\n {\n x: 0.984375,\n y: 0.734375,\n },\n {\n x: 0.015625,\n y: 0.765625,\n },\n {\n x: 0.015625,\n y: 0.765625,\n },\n {\n x: 0.046875,\n y: 0.765625,\n },\n {\n x: 0.046875,\n y: 0.765625,\n },\n {\n x: 0.078125,\n y: 0.765625,\n },\n {\n x: 0.078125,\n y: 0.765625,\n },\n {\n x: 0.109375,\n y: 0.765625,\n },\n {\n x: 0.109375,\n y: 0.765625,\n },\n {\n x: 0.140625,\n y: 0.765625,\n },\n {\n x: 0.140625,\n y: 0.765625,\n },\n {\n x: 0.171875,\n y: 0.765625,\n },\n {\n x: 0.171875,\n y: 0.765625,\n },\n {\n x: 0.203125,\n y: 0.765625,\n },\n {\n x: 0.203125,\n y: 0.765625,\n },\n {\n x: 0.234375,\n y: 0.765625,\n },\n {\n x: 0.234375,\n y: 0.765625,\n },\n {\n x: 0.265625,\n y: 0.765625,\n },\n {\n x: 0.265625,\n y: 0.765625,\n },\n {\n x: 0.296875,\n y: 0.765625,\n },\n {\n x: 0.296875,\n y: 0.765625,\n },\n {\n x: 0.328125,\n y: 0.765625,\n },\n {\n x: 0.328125,\n y: 0.765625,\n },\n {\n x: 0.359375,\n y: 0.765625,\n },\n {\n x: 0.359375,\n y: 0.765625,\n },\n {\n x: 0.390625,\n y: 0.765625,\n },\n {\n x: 0.390625,\n y: 0.765625,\n },\n {\n x: 0.421875,\n y: 0.765625,\n },\n {\n x: 0.421875,\n y: 0.765625,\n },\n {\n x: 0.453125,\n y: 0.765625,\n },\n {\n x: 0.453125,\n y: 0.765625,\n },\n {\n x: 0.484375,\n y: 0.765625,\n },\n {\n x: 0.484375,\n y: 0.765625,\n },\n {\n x: 0.515625,\n y: 0.765625,\n },\n {\n x: 0.515625,\n y: 0.765625,\n },\n {\n x: 0.546875,\n y: 0.765625,\n },\n {\n x: 0.546875,\n y: 0.765625,\n },\n {\n x: 0.578125,\n y: 0.765625,\n },\n {\n x: 0.578125,\n y: 0.765625,\n },\n {\n x: 0.609375,\n y: 0.765625,\n },\n {\n x: 0.609375,\n y: 0.765625,\n },\n {\n x: 0.640625,\n y: 0.765625,\n },\n {\n x: 0.640625,\n y: 0.765625,\n },\n {\n x: 0.671875,\n y: 0.765625,\n },\n {\n x: 0.671875,\n y: 0.765625,\n },\n {\n x: 0.703125,\n y: 0.765625,\n },\n {\n x: 0.703125,\n y: 0.765625,\n },\n {\n x: 0.734375,\n y: 0.765625,\n },\n {\n x: 0.734375,\n y: 0.765625,\n },\n {\n x: 0.765625,\n y: 0.765625,\n },\n {\n x: 0.765625,\n y: 0.765625,\n },\n {\n x: 0.796875,\n y: 0.765625,\n },\n {\n x: 0.796875,\n y: 0.765625,\n },\n {\n x: 0.828125,\n y: 0.765625,\n },\n {\n x: 0.828125,\n y: 0.765625,\n },\n {\n x: 0.859375,\n y: 0.765625,\n },\n {\n x: 0.859375,\n y: 0.765625,\n },\n {\n x: 0.890625,\n y: 0.765625,\n },\n {\n x: 0.890625,\n y: 0.765625,\n },\n {\n x: 0.921875,\n y: 0.765625,\n },\n {\n x: 0.921875,\n y: 0.765625,\n },\n {\n x: 0.953125,\n y: 0.765625,\n },\n {\n x: 0.953125,\n y: 0.765625,\n },\n {\n x: 0.984375,\n y: 0.765625,\n },\n {\n x: 0.984375,\n y: 0.765625,\n },\n {\n x: 0.015625,\n y: 0.796875,\n },\n {\n x: 0.015625,\n y: 0.796875,\n },\n {\n x: 0.046875,\n y: 0.796875,\n },\n {\n x: 0.046875,\n y: 0.796875,\n },\n {\n x: 0.078125,\n y: 0.796875,\n },\n {\n x: 0.078125,\n y: 0.796875,\n },\n {\n x: 0.109375,\n y: 0.796875,\n },\n {\n x: 0.109375,\n y: 0.796875,\n },\n {\n x: 0.140625,\n y: 0.796875,\n },\n {\n x: 0.140625,\n y: 0.796875,\n },\n {\n x: 0.171875,\n y: 0.796875,\n },\n {\n x: 0.171875,\n y: 0.796875,\n },\n {\n x: 0.203125,\n y: 0.796875,\n },\n {\n x: 0.203125,\n y: 0.796875,\n },\n {\n x: 0.234375,\n y: 0.796875,\n },\n {\n x: 0.234375,\n y: 0.796875,\n },\n {\n x: 0.265625,\n y: 0.796875,\n },\n {\n x: 0.265625,\n y: 0.796875,\n },\n {\n x: 0.296875,\n y: 0.796875,\n },\n {\n x: 0.296875,\n y: 0.796875,\n },\n {\n x: 0.328125,\n y: 0.796875,\n },\n {\n x: 0.328125,\n y: 0.796875,\n },\n {\n x: 0.359375,\n y: 0.796875,\n },\n {\n x: 0.359375,\n y: 0.796875,\n },\n {\n x: 0.390625,\n y: 0.796875,\n },\n {\n x: 0.390625,\n y: 0.796875,\n },\n {\n x: 0.421875,\n y: 0.796875,\n },\n {\n x: 0.421875,\n y: 0.796875,\n },\n {\n x: 0.453125,\n y: 0.796875,\n },\n {\n x: 0.453125,\n y: 0.796875,\n },\n {\n x: 0.484375,\n y: 0.796875,\n },\n {\n x: 0.484375,\n y: 0.796875,\n },\n {\n x: 0.515625,\n y: 0.796875,\n },\n {\n x: 0.515625,\n y: 0.796875,\n },\n {\n x: 0.546875,\n y: 0.796875,\n },\n {\n x: 0.546875,\n y: 0.796875,\n },\n {\n x: 0.578125,\n y: 0.796875,\n },\n {\n x: 0.578125,\n y: 0.796875,\n },\n {\n x: 0.609375,\n y: 0.796875,\n },\n {\n x: 0.609375,\n y: 0.796875,\n },\n {\n x: 0.640625,\n y: 0.796875,\n },\n {\n x: 0.640625,\n y: 0.796875,\n },\n {\n x: 0.671875,\n y: 0.796875,\n },\n {\n x: 0.671875,\n y: 0.796875,\n },\n {\n x: 0.703125,\n y: 0.796875,\n },\n {\n x: 0.703125,\n y: 0.796875,\n },\n {\n x: 0.734375,\n y: 0.796875,\n },\n {\n x: 0.734375,\n y: 0.796875,\n },\n {\n x: 0.765625,\n y: 0.796875,\n },\n {\n x: 0.765625,\n y: 0.796875,\n },\n {\n x: 0.796875,\n y: 0.796875,\n },\n {\n x: 0.796875,\n y: 0.796875,\n },\n {\n x: 0.828125,\n y: 0.796875,\n },\n {\n x: 0.828125,\n y: 0.796875,\n },\n {\n x: 0.859375,\n y: 0.796875,\n },\n {\n x: 0.859375,\n y: 0.796875,\n },\n {\n x: 0.890625,\n y: 0.796875,\n },\n {\n x: 0.890625,\n y: 0.796875,\n },\n {\n x: 0.921875,\n y: 0.796875,\n },\n {\n x: 0.921875,\n y: 0.796875,\n },\n {\n x: 0.953125,\n y: 0.796875,\n },\n {\n x: 0.953125,\n y: 0.796875,\n },\n {\n x: 0.984375,\n y: 0.796875,\n },\n {\n x: 0.984375,\n y: 0.796875,\n },\n {\n x: 0.015625,\n y: 0.828125,\n },\n {\n x: 0.015625,\n y: 0.828125,\n },\n {\n x: 0.046875,\n y: 0.828125,\n },\n {\n x: 0.046875,\n y: 0.828125,\n },\n {\n x: 0.078125,\n y: 0.828125,\n },\n {\n x: 0.078125,\n y: 0.828125,\n },\n {\n x: 0.109375,\n y: 0.828125,\n },\n {\n x: 0.109375,\n y: 0.828125,\n },\n {\n x: 0.140625,\n y: 0.828125,\n },\n {\n x: 0.140625,\n y: 0.828125,\n },\n {\n x: 0.171875,\n y: 0.828125,\n },\n {\n x: 0.171875,\n y: 0.828125,\n },\n {\n x: 0.203125,\n y: 0.828125,\n },\n {\n x: 0.203125,\n y: 0.828125,\n },\n {\n x: 0.234375,\n y: 0.828125,\n },\n {\n x: 0.234375,\n y: 0.828125,\n },\n {\n x: 0.265625,\n y: 0.828125,\n },\n {\n x: 0.265625,\n y: 0.828125,\n },\n {\n x: 0.296875,\n y: 0.828125,\n },\n {\n x: 0.296875,\n y: 0.828125,\n },\n {\n x: 0.328125,\n y: 0.828125,\n },\n {\n x: 0.328125,\n y: 0.828125,\n },\n {\n x: 0.359375,\n y: 0.828125,\n },\n {\n x: 0.359375,\n y: 0.828125,\n },\n {\n x: 0.390625,\n y: 0.828125,\n },\n {\n x: 0.390625,\n y: 0.828125,\n },\n {\n x: 0.421875,\n y: 0.828125,\n },\n {\n x: 0.421875,\n y: 0.828125,\n },\n {\n x: 0.453125,\n y: 0.828125,\n },\n {\n x: 0.453125,\n y: 0.828125,\n },\n {\n x: 0.484375,\n y: 0.828125,\n },\n {\n x: 0.484375,\n y: 0.828125,\n },\n {\n x: 0.515625,\n y: 0.828125,\n },\n {\n x: 0.515625,\n y: 0.828125,\n },\n {\n x: 0.546875,\n y: 0.828125,\n },\n {\n x: 0.546875,\n y: 0.828125,\n },\n {\n x: 0.578125,\n y: 0.828125,\n },\n {\n x: 0.578125,\n y: 0.828125,\n },\n {\n x: 0.609375,\n y: 0.828125,\n },\n {\n x: 0.609375,\n y: 0.828125,\n },\n {\n x: 0.640625,\n y: 0.828125,\n },\n {\n x: 0.640625,\n y: 0.828125,\n },\n {\n x: 0.671875,\n y: 0.828125,\n },\n {\n x: 0.671875,\n y: 0.828125,\n },\n {\n x: 0.703125,\n y: 0.828125,\n },\n {\n x: 0.703125,\n y: 0.828125,\n },\n {\n x: 0.734375,\n y: 0.828125,\n },\n {\n x: 0.734375,\n y: 0.828125,\n },\n {\n x: 0.765625,\n y: 0.828125,\n },\n {\n x: 0.765625,\n y: 0.828125,\n },\n {\n x: 0.796875,\n y: 0.828125,\n },\n {\n x: 0.796875,\n y: 0.828125,\n },\n {\n x: 0.828125,\n y: 0.828125,\n },\n {\n x: 0.828125,\n y: 0.828125,\n },\n {\n x: 0.859375,\n y: 0.828125,\n },\n {\n x: 0.859375,\n y: 0.828125,\n },\n {\n x: 0.890625,\n y: 0.828125,\n },\n {\n x: 0.890625,\n y: 0.828125,\n },\n {\n x: 0.921875,\n y: 0.828125,\n },\n {\n x: 0.921875,\n y: 0.828125,\n },\n {\n x: 0.953125,\n y: 0.828125,\n },\n {\n x: 0.953125,\n y: 0.828125,\n },\n {\n x: 0.984375,\n y: 0.828125,\n },\n {\n x: 0.984375,\n y: 0.828125,\n },\n {\n x: 0.015625,\n y: 0.859375,\n },\n {\n x: 0.015625,\n y: 0.859375,\n },\n {\n x: 0.046875,\n y: 0.859375,\n },\n {\n x: 0.046875,\n y: 0.859375,\n },\n {\n x: 0.078125,\n y: 0.859375,\n },\n {\n x: 0.078125,\n y: 0.859375,\n },\n {\n x: 0.109375,\n y: 0.859375,\n },\n {\n x: 0.109375,\n y: 0.859375,\n },\n {\n x: 0.140625,\n y: 0.859375,\n },\n {\n x: 0.140625,\n y: 0.859375,\n },\n {\n x: 0.171875,\n y: 0.859375,\n },\n {\n x: 0.171875,\n y: 0.859375,\n },\n {\n x: 0.203125,\n y: 0.859375,\n },\n {\n x: 0.203125,\n y: 0.859375,\n },\n {\n x: 0.234375,\n y: 0.859375,\n },\n {\n x: 0.234375,\n y: 0.859375,\n },\n {\n x: 0.265625,\n y: 0.859375,\n },\n {\n x: 0.265625,\n y: 0.859375,\n },\n {\n x: 0.296875,\n y: 0.859375,\n },\n {\n x: 0.296875,\n y: 0.859375,\n },\n {\n x: 0.328125,\n y: 0.859375,\n },\n {\n x: 0.328125,\n y: 0.859375,\n },\n {\n x: 0.359375,\n y: 0.859375,\n },\n {\n x: 0.359375,\n y: 0.859375,\n },\n {\n x: 0.390625,\n y: 0.859375,\n },\n {\n x: 0.390625,\n y: 0.859375,\n },\n {\n x: 0.421875,\n y: 0.859375,\n },\n {\n x: 0.421875,\n y: 0.859375,\n },\n {\n x: 0.453125,\n y: 0.859375,\n },\n {\n x: 0.453125,\n y: 0.859375,\n },\n {\n x: 0.484375,\n y: 0.859375,\n },\n {\n x: 0.484375,\n y: 0.859375,\n },\n {\n x: 0.515625,\n y: 0.859375,\n },\n {\n x: 0.515625,\n y: 0.859375,\n },\n {\n x: 0.546875,\n y: 0.859375,\n },\n {\n x: 0.546875,\n y: 0.859375,\n },\n {\n x: 0.578125,\n y: 0.859375,\n },\n {\n x: 0.578125,\n y: 0.859375,\n },\n {\n x: 0.609375,\n y: 0.859375,\n },\n {\n x: 0.609375,\n y: 0.859375,\n },\n {\n x: 0.640625,\n y: 0.859375,\n },\n {\n x: 0.640625,\n y: 0.859375,\n },\n {\n x: 0.671875,\n y: 0.859375,\n },\n {\n x: 0.671875,\n y: 0.859375,\n },\n {\n x: 0.703125,\n y: 0.859375,\n },\n {\n x: 0.703125,\n y: 0.859375,\n },\n {\n x: 0.734375,\n y: 0.859375,\n },\n {\n x: 0.734375,\n y: 0.859375,\n },\n {\n x: 0.765625,\n y: 0.859375,\n },\n {\n x: 0.765625,\n y: 0.859375,\n },\n {\n x: 0.796875,\n y: 0.859375,\n },\n {\n x: 0.796875,\n y: 0.859375,\n },\n {\n x: 0.828125,\n y: 0.859375,\n },\n {\n x: 0.828125,\n y: 0.859375,\n },\n {\n x: 0.859375,\n y: 0.859375,\n },\n {\n x: 0.859375,\n y: 0.859375,\n },\n {\n x: 0.890625,\n y: 0.859375,\n },\n {\n x: 0.890625,\n y: 0.859375,\n },\n {\n x: 0.921875,\n y: 0.859375,\n },\n {\n x: 0.921875,\n y: 0.859375,\n },\n {\n x: 0.953125,\n y: 0.859375,\n },\n {\n x: 0.953125,\n y: 0.859375,\n },\n {\n x: 0.984375,\n y: 0.859375,\n },\n {\n x: 0.984375,\n y: 0.859375,\n },\n {\n x: 0.015625,\n y: 0.890625,\n },\n {\n x: 0.015625,\n y: 0.890625,\n },\n {\n x: 0.046875,\n y: 0.890625,\n },\n {\n x: 0.046875,\n y: 0.890625,\n },\n {\n x: 0.078125,\n y: 0.890625,\n },\n {\n x: 0.078125,\n y: 0.890625,\n },\n {\n x: 0.109375,\n y: 0.890625,\n },\n {\n x: 0.109375,\n y: 0.890625,\n },\n {\n x: 0.140625,\n y: 0.890625,\n },\n {\n x: 0.140625,\n y: 0.890625,\n },\n {\n x: 0.171875,\n y: 0.890625,\n },\n {\n x: 0.171875,\n y: 0.890625,\n },\n {\n x: 0.203125,\n y: 0.890625,\n },\n {\n x: 0.203125,\n y: 0.890625,\n },\n {\n x: 0.234375,\n y: 0.890625,\n },\n {\n x: 0.234375,\n y: 0.890625,\n },\n {\n x: 0.265625,\n y: 0.890625,\n },\n {\n x: 0.265625,\n y: 0.890625,\n },\n {\n x: 0.296875,\n y: 0.890625,\n },\n {\n x: 0.296875,\n y: 0.890625,\n },\n {\n x: 0.328125,\n y: 0.890625,\n },\n {\n x: 0.328125,\n y: 0.890625,\n },\n {\n x: 0.359375,\n y: 0.890625,\n },\n {\n x: 0.359375,\n y: 0.890625,\n },\n {\n x: 0.390625,\n y: 0.890625,\n },\n {\n x: 0.390625,\n y: 0.890625,\n },\n {\n x: 0.421875,\n y: 0.890625,\n },\n {\n x: 0.421875,\n y: 0.890625,\n },\n {\n x: 0.453125,\n y: 0.890625,\n },\n {\n x: 0.453125,\n y: 0.890625,\n },\n {\n x: 0.484375,\n y: 0.890625,\n },\n {\n x: 0.484375,\n y: 0.890625,\n },\n {\n x: 0.515625,\n y: 0.890625,\n },\n {\n x: 0.515625,\n y: 0.890625,\n },\n {\n x: 0.546875,\n y: 0.890625,\n },\n {\n x: 0.546875,\n y: 0.890625,\n },\n {\n x: 0.578125,\n y: 0.890625,\n },\n {\n x: 0.578125,\n y: 0.890625,\n },\n {\n x: 0.609375,\n y: 0.890625,\n },\n {\n x: 0.609375,\n y: 0.890625,\n },\n {\n x: 0.640625,\n y: 0.890625,\n },\n {\n x: 0.640625,\n y: 0.890625,\n },\n {\n x: 0.671875,\n y: 0.890625,\n },\n {\n x: 0.671875,\n y: 0.890625,\n },\n {\n x: 0.703125,\n y: 0.890625,\n },\n {\n x: 0.703125,\n y: 0.890625,\n },\n {\n x: 0.734375,\n y: 0.890625,\n },\n {\n x: 0.734375,\n y: 0.890625,\n },\n {\n x: 0.765625,\n y: 0.890625,\n },\n {\n x: 0.765625,\n y: 0.890625,\n },\n {\n x: 0.796875,\n y: 0.890625,\n },\n {\n x: 0.796875,\n y: 0.890625,\n },\n {\n x: 0.828125,\n y: 0.890625,\n },\n {\n x: 0.828125,\n y: 0.890625,\n },\n {\n x: 0.859375,\n y: 0.890625,\n },\n {\n x: 0.859375,\n y: 0.890625,\n },\n {\n x: 0.890625,\n y: 0.890625,\n },\n {\n x: 0.890625,\n y: 0.890625,\n },\n {\n x: 0.921875,\n y: 0.890625,\n },\n {\n x: 0.921875,\n y: 0.890625,\n },\n {\n x: 0.953125,\n y: 0.890625,\n },\n {\n x: 0.953125,\n y: 0.890625,\n },\n {\n x: 0.984375,\n y: 0.890625,\n },\n {\n x: 0.984375,\n y: 0.890625,\n },\n {\n x: 0.015625,\n y: 0.921875,\n },\n {\n x: 0.015625,\n y: 0.921875,\n },\n {\n x: 0.046875,\n y: 0.921875,\n },\n {\n x: 0.046875,\n y: 0.921875,\n },\n {\n x: 0.078125,\n y: 0.921875,\n },\n {\n x: 0.078125,\n y: 0.921875,\n },\n {\n x: 0.109375,\n y: 0.921875,\n },\n {\n x: 0.109375,\n y: 0.921875,\n },\n {\n x: 0.140625,\n y: 0.921875,\n },\n {\n x: 0.140625,\n y: 0.921875,\n },\n {\n x: 0.171875,\n y: 0.921875,\n },\n {\n x: 0.171875,\n y: 0.921875,\n },\n {\n x: 0.203125,\n y: 0.921875,\n },\n {\n x: 0.203125,\n y: 0.921875,\n },\n {\n x: 0.234375,\n y: 0.921875,\n },\n {\n x: 0.234375,\n y: 0.921875,\n },\n {\n x: 0.265625,\n y: 0.921875,\n },\n {\n x: 0.265625,\n y: 0.921875,\n },\n {\n x: 0.296875,\n y: 0.921875,\n },\n {\n x: 0.296875,\n y: 0.921875,\n },\n {\n x: 0.328125,\n y: 0.921875,\n },\n {\n x: 0.328125,\n y: 0.921875,\n },\n {\n x: 0.359375,\n y: 0.921875,\n },\n {\n x: 0.359375,\n y: 0.921875,\n },\n {\n x: 0.390625,\n y: 0.921875,\n },\n {\n x: 0.390625,\n y: 0.921875,\n },\n {\n x: 0.421875,\n y: 0.921875,\n },\n {\n x: 0.421875,\n y: 0.921875,\n },\n {\n x: 0.453125,\n y: 0.921875,\n },\n {\n x: 0.453125,\n y: 0.921875,\n },\n {\n x: 0.484375,\n y: 0.921875,\n },\n {\n x: 0.484375,\n y: 0.921875,\n },\n {\n x: 0.515625,\n y: 0.921875,\n },\n {\n x: 0.515625,\n y: 0.921875,\n },\n {\n x: 0.546875,\n y: 0.921875,\n },\n {\n x: 0.546875,\n y: 0.921875,\n },\n {\n x: 0.578125,\n y: 0.921875,\n },\n {\n x: 0.578125,\n y: 0.921875,\n },\n {\n x: 0.609375,\n y: 0.921875,\n },\n {\n x: 0.609375,\n y: 0.921875,\n },\n {\n x: 0.640625,\n y: 0.921875,\n },\n {\n x: 0.640625,\n y: 0.921875,\n },\n {\n x: 0.671875,\n y: 0.921875,\n },\n {\n x: 0.671875,\n y: 0.921875,\n },\n {\n x: 0.703125,\n y: 0.921875,\n },\n {\n x: 0.703125,\n y: 0.921875,\n },\n {\n x: 0.734375,\n y: 0.921875,\n },\n {\n x: 0.734375,\n y: 0.921875,\n },\n {\n x: 0.765625,\n y: 0.921875,\n },\n {\n x: 0.765625,\n y: 0.921875,\n },\n {\n x: 0.796875,\n y: 0.921875,\n },\n {\n x: 0.796875,\n y: 0.921875,\n },\n {\n x: 0.828125,\n y: 0.921875,\n },\n {\n x: 0.828125,\n y: 0.921875,\n },\n {\n x: 0.859375,\n y: 0.921875,\n },\n {\n x: 0.859375,\n y: 0.921875,\n },\n {\n x: 0.890625,\n y: 0.921875,\n },\n {\n x: 0.890625,\n y: 0.921875,\n },\n {\n x: 0.921875,\n y: 0.921875,\n },\n {\n x: 0.921875,\n y: 0.921875,\n },\n {\n x: 0.953125,\n y: 0.921875,\n },\n {\n x: 0.953125,\n y: 0.921875,\n },\n {\n x: 0.984375,\n y: 0.921875,\n },\n {\n x: 0.984375,\n y: 0.921875,\n },\n {\n x: 0.015625,\n y: 0.953125,\n },\n {\n x: 0.015625,\n y: 0.953125,\n },\n {\n x: 0.046875,\n y: 0.953125,\n },\n {\n x: 0.046875,\n y: 0.953125,\n },\n {\n x: 0.078125,\n y: 0.953125,\n },\n {\n x: 0.078125,\n y: 0.953125,\n },\n {\n x: 0.109375,\n y: 0.953125,\n },\n {\n x: 0.109375,\n y: 0.953125,\n },\n {\n x: 0.140625,\n y: 0.953125,\n },\n {\n x: 0.140625,\n y: 0.953125,\n },\n {\n x: 0.171875,\n y: 0.953125,\n },\n {\n x: 0.171875,\n y: 0.953125,\n },\n {\n x: 0.203125,\n y: 0.953125,\n },\n {\n x: 0.203125,\n y: 0.953125,\n },\n {\n x: 0.234375,\n y: 0.953125,\n },\n {\n x: 0.234375,\n y: 0.953125,\n },\n {\n x: 0.265625,\n y: 0.953125,\n },\n {\n x: 0.265625,\n y: 0.953125,\n },\n {\n x: 0.296875,\n y: 0.953125,\n },\n {\n x: 0.296875,\n y: 0.953125,\n },\n {\n x: 0.328125,\n y: 0.953125,\n },\n {\n x: 0.328125,\n y: 0.953125,\n },\n {\n x: 0.359375,\n y: 0.953125,\n },\n {\n x: 0.359375,\n y: 0.953125,\n },\n {\n x: 0.390625,\n y: 0.953125,\n },\n {\n x: 0.390625,\n y: 0.953125,\n },\n {\n x: 0.421875,\n y: 0.953125,\n },\n {\n x: 0.421875,\n y: 0.953125,\n },\n {\n x: 0.453125,\n y: 0.953125,\n },\n {\n x: 0.453125,\n y: 0.953125,\n },\n {\n x: 0.484375,\n y: 0.953125,\n },\n {\n x: 0.484375,\n y: 0.953125,\n },\n {\n x: 0.515625,\n y: 0.953125,\n },\n {\n x: 0.515625,\n y: 0.953125,\n },\n {\n x: 0.546875,\n y: 0.953125,\n },\n {\n x: 0.546875,\n y: 0.953125,\n },\n {\n x: 0.578125,\n y: 0.953125,\n },\n {\n x: 0.578125,\n y: 0.953125,\n },\n {\n x: 0.609375,\n y: 0.953125,\n },\n {\n x: 0.609375,\n y: 0.953125,\n },\n {\n x: 0.640625,\n y: 0.953125,\n },\n {\n x: 0.640625,\n y: 0.953125,\n },\n {\n x: 0.671875,\n y: 0.953125,\n },\n {\n x: 0.671875,\n y: 0.953125,\n },\n {\n x: 0.703125,\n y: 0.953125,\n },\n {\n x: 0.703125,\n y: 0.953125,\n },\n {\n x: 0.734375,\n y: 0.953125,\n },\n {\n x: 0.734375,\n y: 0.953125,\n },\n {\n x: 0.765625,\n y: 0.953125,\n },\n {\n x: 0.765625,\n y: 0.953125,\n },\n {\n x: 0.796875,\n y: 0.953125,\n },\n {\n x: 0.796875,\n y: 0.953125,\n },\n {\n x: 0.828125,\n y: 0.953125,\n },\n {\n x: 0.828125,\n y: 0.953125,\n },\n {\n x: 0.859375,\n y: 0.953125,\n },\n {\n x: 0.859375,\n y: 0.953125,\n },\n {\n x: 0.890625,\n y: 0.953125,\n },\n {\n x: 0.890625,\n y: 0.953125,\n },\n {\n x: 0.921875,\n y: 0.953125,\n },\n {\n x: 0.921875,\n y: 0.953125,\n },\n {\n x: 0.953125,\n y: 0.953125,\n },\n {\n x: 0.953125,\n y: 0.953125,\n },\n {\n x: 0.984375,\n y: 0.953125,\n },\n {\n x: 0.984375,\n y: 0.953125,\n },\n {\n x: 0.015625,\n y: 0.984375,\n },\n {\n x: 0.015625,\n y: 0.984375,\n },\n {\n x: 0.046875,\n y: 0.984375,\n },\n {\n x: 0.046875,\n y: 0.984375,\n },\n {\n x: 0.078125,\n y: 0.984375,\n },\n {\n x: 0.078125,\n y: 0.984375,\n },\n {\n x: 0.109375,\n y: 0.984375,\n },\n {\n x: 0.109375,\n y: 0.984375,\n },\n {\n x: 0.140625,\n y: 0.984375,\n },\n {\n x: 0.140625,\n y: 0.984375,\n },\n {\n x: 0.171875,\n y: 0.984375,\n },\n {\n x: 0.171875,\n y: 0.984375,\n },\n {\n x: 0.203125,\n y: 0.984375,\n },\n {\n x: 0.203125,\n y: 0.984375,\n },\n {\n x: 0.234375,\n y: 0.984375,\n },\n {\n x: 0.234375,\n y: 0.984375,\n },\n {\n x: 0.265625,\n y: 0.984375,\n },\n {\n x: 0.265625,\n y: 0.984375,\n },\n {\n x: 0.296875,\n y: 0.984375,\n },\n {\n x: 0.296875,\n y: 0.984375,\n },\n {\n x: 0.328125,\n y: 0.984375,\n },\n {\n x: 0.328125,\n y: 0.984375,\n },\n {\n x: 0.359375,\n y: 0.984375,\n },\n {\n x: 0.359375,\n y: 0.984375,\n },\n {\n x: 0.390625,\n y: 0.984375,\n },\n {\n x: 0.390625,\n y: 0.984375,\n },\n {\n x: 0.421875,\n y: 0.984375,\n },\n {\n x: 0.421875,\n y: 0.984375,\n },\n {\n x: 0.453125,\n y: 0.984375,\n },\n {\n x: 0.453125,\n y: 0.984375,\n },\n {\n x: 0.484375,\n y: 0.984375,\n },\n {\n x: 0.484375,\n y: 0.984375,\n },\n {\n x: 0.515625,\n y: 0.984375,\n },\n {\n x: 0.515625,\n y: 0.984375,\n },\n {\n x: 0.546875,\n y: 0.984375,\n },\n {\n x: 0.546875,\n y: 0.984375,\n },\n {\n x: 0.578125,\n y: 0.984375,\n },\n {\n x: 0.578125,\n y: 0.984375,\n },\n {\n x: 0.609375,\n y: 0.984375,\n },\n {\n x: 0.609375,\n y: 0.984375,\n },\n {\n x: 0.640625,\n y: 0.984375,\n },\n {\n x: 0.640625,\n y: 0.984375,\n },\n {\n x: 0.671875,\n y: 0.984375,\n },\n {\n x: 0.671875,\n y: 0.984375,\n },\n {\n x: 0.703125,\n y: 0.984375,\n },\n {\n x: 0.703125,\n y: 0.984375,\n },\n {\n x: 0.734375,\n y: 0.984375,\n },\n {\n x: 0.734375,\n y: 0.984375,\n },\n {\n x: 0.765625,\n y: 0.984375,\n },\n {\n x: 0.765625,\n y: 0.984375,\n },\n {\n x: 0.796875,\n y: 0.984375,\n },\n {\n x: 0.796875,\n y: 0.984375,\n },\n {\n x: 0.828125,\n y: 0.984375,\n },\n {\n x: 0.828125,\n y: 0.984375,\n },\n {\n x: 0.859375,\n y: 0.984375,\n },\n {\n x: 0.859375,\n y: 0.984375,\n },\n {\n x: 0.890625,\n y: 0.984375,\n },\n {\n x: 0.890625,\n y: 0.984375,\n },\n {\n x: 0.921875,\n y: 0.984375,\n },\n {\n x: 0.921875,\n y: 0.984375,\n },\n {\n x: 0.953125,\n y: 0.984375,\n },\n {\n x: 0.953125,\n y: 0.984375,\n },\n {\n x: 0.984375,\n y: 0.984375,\n },\n {\n x: 0.984375,\n y: 0.984375,\n },\n {\n x: 0.03125,\n y: 0.03125,\n },\n {\n x: 0.03125,\n y: 0.03125,\n },\n {\n x: 0.09375,\n y: 0.03125,\n },\n {\n x: 0.09375,\n y: 0.03125,\n },\n {\n x: 0.15625,\n y: 0.03125,\n },\n {\n x: 0.15625,\n y: 0.03125,\n },\n {\n x: 0.21875,\n y: 0.03125,\n },\n {\n x: 0.21875,\n y: 0.03125,\n },\n {\n x: 0.28125,\n y: 0.03125,\n },\n {\n x: 0.28125,\n y: 0.03125,\n },\n {\n x: 0.34375,\n y: 0.03125,\n },\n {\n x: 0.34375,\n y: 0.03125,\n },\n {\n x: 0.40625,\n y: 0.03125,\n },\n {\n x: 0.40625,\n y: 0.03125,\n },\n {\n x: 0.46875,\n y: 0.03125,\n },\n {\n x: 0.46875,\n y: 0.03125,\n },\n {\n x: 0.53125,\n y: 0.03125,\n },\n {\n x: 0.53125,\n y: 0.03125,\n },\n {\n x: 0.59375,\n y: 0.03125,\n },\n {\n x: 0.59375,\n y: 0.03125,\n },\n {\n x: 0.65625,\n y: 0.03125,\n },\n {\n x: 0.65625,\n y: 0.03125,\n },\n {\n x: 0.71875,\n y: 0.03125,\n },\n {\n x: 0.71875,\n y: 0.03125,\n },\n {\n x: 0.78125,\n y: 0.03125,\n },\n {\n x: 0.78125,\n y: 0.03125,\n },\n {\n x: 0.84375,\n y: 0.03125,\n },\n {\n x: 0.84375,\n y: 0.03125,\n },\n {\n x: 0.90625,\n y: 0.03125,\n },\n {\n x: 0.90625,\n y: 0.03125,\n },\n {\n x: 0.96875,\n y: 0.03125,\n },\n {\n x: 0.96875,\n y: 0.03125,\n },\n {\n x: 0.03125,\n y: 0.09375,\n },\n {\n x: 0.03125,\n y: 0.09375,\n },\n {\n x: 0.09375,\n y: 0.09375,\n },\n {\n x: 0.09375,\n y: 0.09375,\n },\n {\n x: 0.15625,\n y: 0.09375,\n },\n {\n x: 0.15625,\n y: 0.09375,\n },\n {\n x: 0.21875,\n y: 0.09375,\n },\n {\n x: 0.21875,\n y: 0.09375,\n },\n {\n x: 0.28125,\n y: 0.09375,\n },\n {\n x: 0.28125,\n y: 0.09375,\n },\n {\n x: 0.34375,\n y: 0.09375,\n },\n {\n x: 0.34375,\n y: 0.09375,\n },\n {\n x: 0.40625,\n y: 0.09375,\n },\n {\n x: 0.40625,\n y: 0.09375,\n },\n {\n x: 0.46875,\n y: 0.09375,\n },\n {\n x: 0.46875,\n y: 0.09375,\n },\n {\n x: 0.53125,\n y: 0.09375,\n },\n {\n x: 0.53125,\n y: 0.09375,\n },\n {\n x: 0.59375,\n y: 0.09375,\n },\n {\n x: 0.59375,\n y: 0.09375,\n },\n {\n x: 0.65625,\n y: 0.09375,\n },\n {\n x: 0.65625,\n y: 0.09375,\n },\n {\n x: 0.71875,\n y: 0.09375,\n },\n {\n x: 0.71875,\n y: 0.09375,\n },\n {\n x: 0.78125,\n y: 0.09375,\n },\n {\n x: 0.78125,\n y: 0.09375,\n },\n {\n x: 0.84375,\n y: 0.09375,\n },\n {\n x: 0.84375,\n y: 0.09375,\n },\n {\n x: 0.90625,\n y: 0.09375,\n },\n {\n x: 0.90625,\n y: 0.09375,\n },\n {\n x: 0.96875,\n y: 0.09375,\n },\n {\n x: 0.96875,\n y: 0.09375,\n },\n {\n x: 0.03125,\n y: 0.15625,\n },\n {\n x: 0.03125,\n y: 0.15625,\n },\n {\n x: 0.09375,\n y: 0.15625,\n },\n {\n x: 0.09375,\n y: 0.15625,\n },\n {\n x: 0.15625,\n y: 0.15625,\n },\n {\n x: 0.15625,\n y: 0.15625,\n },\n {\n x: 0.21875,\n y: 0.15625,\n },\n {\n x: 0.21875,\n y: 0.15625,\n },\n {\n x: 0.28125,\n y: 0.15625,\n },\n {\n x: 0.28125,\n y: 0.15625,\n },\n {\n x: 0.34375,\n y: 0.15625,\n },\n {\n x: 0.34375,\n y: 0.15625,\n },\n {\n x: 0.40625,\n y: 0.15625,\n },\n {\n x: 0.40625,\n y: 0.15625,\n },\n {\n x: 0.46875,\n y: 0.15625,\n },\n {\n x: 0.46875,\n y: 0.15625,\n },\n {\n x: 0.53125,\n y: 0.15625,\n },\n {\n x: 0.53125,\n y: 0.15625,\n },\n {\n x: 0.59375,\n y: 0.15625,\n },\n {\n x: 0.59375,\n y: 0.15625,\n },\n {\n x: 0.65625,\n y: 0.15625,\n },\n {\n x: 0.65625,\n y: 0.15625,\n },\n {\n x: 0.71875,\n y: 0.15625,\n },\n {\n x: 0.71875,\n y: 0.15625,\n },\n {\n x: 0.78125,\n y: 0.15625,\n },\n {\n x: 0.78125,\n y: 0.15625,\n },\n {\n x: 0.84375,\n y: 0.15625,\n },\n {\n x: 0.84375,\n y: 0.15625,\n },\n {\n x: 0.90625,\n y: 0.15625,\n },\n {\n x: 0.90625,\n y: 0.15625,\n },\n {\n x: 0.96875,\n y: 0.15625,\n },\n {\n x: 0.96875,\n y: 0.15625,\n },\n {\n x: 0.03125,\n y: 0.21875,\n },\n {\n x: 0.03125,\n y: 0.21875,\n },\n {\n x: 0.09375,\n y: 0.21875,\n },\n {\n x: 0.09375,\n y: 0.21875,\n },\n {\n x: 0.15625,\n y: 0.21875,\n },\n {\n x: 0.15625,\n y: 0.21875,\n },\n {\n x: 0.21875,\n y: 0.21875,\n },\n {\n x: 0.21875,\n y: 0.21875,\n },\n {\n x: 0.28125,\n y: 0.21875,\n },\n {\n x: 0.28125,\n y: 0.21875,\n },\n {\n x: 0.34375,\n y: 0.21875,\n },\n {\n x: 0.34375,\n y: 0.21875,\n },\n {\n x: 0.40625,\n y: 0.21875,\n },\n {\n x: 0.40625,\n y: 0.21875,\n },\n {\n x: 0.46875,\n y: 0.21875,\n },\n {\n x: 0.46875,\n y: 0.21875,\n },\n {\n x: 0.53125,\n y: 0.21875,\n },\n {\n x: 0.53125,\n y: 0.21875,\n },\n {\n x: 0.59375,\n y: 0.21875,\n },\n {\n x: 0.59375,\n y: 0.21875,\n },\n {\n x: 0.65625,\n y: 0.21875,\n },\n {\n x: 0.65625,\n y: 0.21875,\n },\n {\n x: 0.71875,\n y: 0.21875,\n },\n {\n x: 0.71875,\n y: 0.21875,\n },\n {\n x: 0.78125,\n y: 0.21875,\n },\n {\n x: 0.78125,\n y: 0.21875,\n },\n {\n x: 0.84375,\n y: 0.21875,\n },\n {\n x: 0.84375,\n y: 0.21875,\n },\n {\n x: 0.90625,\n y: 0.21875,\n },\n {\n x: 0.90625,\n y: 0.21875,\n },\n {\n x: 0.96875,\n y: 0.21875,\n },\n {\n x: 0.96875,\n y: 0.21875,\n },\n {\n x: 0.03125,\n y: 0.28125,\n },\n {\n x: 0.03125,\n y: 0.28125,\n },\n {\n x: 0.09375,\n y: 0.28125,\n },\n {\n x: 0.09375,\n y: 0.28125,\n },\n {\n x: 0.15625,\n y: 0.28125,\n },\n {\n x: 0.15625,\n y: 0.28125,\n },\n {\n x: 0.21875,\n y: 0.28125,\n },\n {\n x: 0.21875,\n y: 0.28125,\n },\n {\n x: 0.28125,\n y: 0.28125,\n },\n {\n x: 0.28125,\n y: 0.28125,\n },\n {\n x: 0.34375,\n y: 0.28125,\n },\n {\n x: 0.34375,\n y: 0.28125,\n },\n {\n x: 0.40625,\n y: 0.28125,\n },\n {\n x: 0.40625,\n y: 0.28125,\n },\n {\n x: 0.46875,\n y: 0.28125,\n },\n {\n x: 0.46875,\n y: 0.28125,\n },\n {\n x: 0.53125,\n y: 0.28125,\n },\n {\n x: 0.53125,\n y: 0.28125,\n },\n {\n x: 0.59375,\n y: 0.28125,\n },\n {\n x: 0.59375,\n y: 0.28125,\n },\n {\n x: 0.65625,\n y: 0.28125,\n },\n {\n x: 0.65625,\n y: 0.28125,\n },\n {\n x: 0.71875,\n y: 0.28125,\n },\n {\n x: 0.71875,\n y: 0.28125,\n },\n {\n x: 0.78125,\n y: 0.28125,\n },\n {\n x: 0.78125,\n y: 0.28125,\n },\n {\n x: 0.84375,\n y: 0.28125,\n },\n {\n x: 0.84375,\n y: 0.28125,\n },\n {\n x: 0.90625,\n y: 0.28125,\n },\n {\n x: 0.90625,\n y: 0.28125,\n },\n {\n x: 0.96875,\n y: 0.28125,\n },\n {\n x: 0.96875,\n y: 0.28125,\n },\n {\n x: 0.03125,\n y: 0.34375,\n },\n {\n x: 0.03125,\n y: 0.34375,\n },\n {\n x: 0.09375,\n y: 0.34375,\n },\n {\n x: 0.09375,\n y: 0.34375,\n },\n {\n x: 0.15625,\n y: 0.34375,\n },\n {\n x: 0.15625,\n y: 0.34375,\n },\n {\n x: 0.21875,\n y: 0.34375,\n },\n {\n x: 0.21875,\n y: 0.34375,\n },\n {\n x: 0.28125,\n y: 0.34375,\n },\n {\n x: 0.28125,\n y: 0.34375,\n },\n {\n x: 0.34375,\n y: 0.34375,\n },\n {\n x: 0.34375,\n y: 0.34375,\n },\n {\n x: 0.40625,\n y: 0.34375,\n },\n {\n x: 0.40625,\n y: 0.34375,\n },\n {\n x: 0.46875,\n y: 0.34375,\n },\n {\n x: 0.46875,\n y: 0.34375,\n },\n {\n x: 0.53125,\n y: 0.34375,\n },\n {\n x: 0.53125,\n y: 0.34375,\n },\n {\n x: 0.59375,\n y: 0.34375,\n },\n {\n x: 0.59375,\n y: 0.34375,\n },\n {\n x: 0.65625,\n y: 0.34375,\n },\n {\n x: 0.65625,\n y: 0.34375,\n },\n {\n x: 0.71875,\n y: 0.34375,\n },\n {\n x: 0.71875,\n y: 0.34375,\n },\n {\n x: 0.78125,\n y: 0.34375,\n },\n {\n x: 0.78125,\n y: 0.34375,\n },\n {\n x: 0.84375,\n y: 0.34375,\n },\n {\n x: 0.84375,\n y: 0.34375,\n },\n {\n x: 0.90625,\n y: 0.34375,\n },\n {\n x: 0.90625,\n y: 0.34375,\n },\n {\n x: 0.96875,\n y: 0.34375,\n },\n {\n x: 0.96875,\n y: 0.34375,\n },\n {\n x: 0.03125,\n y: 0.40625,\n },\n {\n x: 0.03125,\n y: 0.40625,\n },\n {\n x: 0.09375,\n y: 0.40625,\n },\n {\n x: 0.09375,\n y: 0.40625,\n },\n {\n x: 0.15625,\n y: 0.40625,\n },\n {\n x: 0.15625,\n y: 0.40625,\n },\n {\n x: 0.21875,\n y: 0.40625,\n },\n {\n x: 0.21875,\n y: 0.40625,\n },\n {\n x: 0.28125,\n y: 0.40625,\n },\n {\n x: 0.28125,\n y: 0.40625,\n },\n {\n x: 0.34375,\n y: 0.40625,\n },\n {\n x: 0.34375,\n y: 0.40625,\n },\n {\n x: 0.40625,\n y: 0.40625,\n },\n {\n x: 0.40625,\n y: 0.40625,\n },\n {\n x: 0.46875,\n y: 0.40625,\n },\n {\n x: 0.46875,\n y: 0.40625,\n },\n {\n x: 0.53125,\n y: 0.40625,\n },\n {\n x: 0.53125,\n y: 0.40625,\n },\n {\n x: 0.59375,\n y: 0.40625,\n },\n {\n x: 0.59375,\n y: 0.40625,\n },\n {\n x: 0.65625,\n y: 0.40625,\n },\n {\n x: 0.65625,\n y: 0.40625,\n },\n {\n x: 0.71875,\n y: 0.40625,\n },\n {\n x: 0.71875,\n y: 0.40625,\n },\n {\n x: 0.78125,\n y: 0.40625,\n },\n {\n x: 0.78125,\n y: 0.40625,\n },\n {\n x: 0.84375,\n y: 0.40625,\n },\n {\n x: 0.84375,\n y: 0.40625,\n },\n {\n x: 0.90625,\n y: 0.40625,\n },\n {\n x: 0.90625,\n y: 0.40625,\n },\n {\n x: 0.96875,\n y: 0.40625,\n },\n {\n x: 0.96875,\n y: 0.40625,\n },\n {\n x: 0.03125,\n y: 0.46875,\n },\n {\n x: 0.03125,\n y: 0.46875,\n },\n {\n x: 0.09375,\n y: 0.46875,\n },\n {\n x: 0.09375,\n y: 0.46875,\n },\n {\n x: 0.15625,\n y: 0.46875,\n },\n {\n x: 0.15625,\n y: 0.46875,\n },\n {\n x: 0.21875,\n y: 0.46875,\n },\n {\n x: 0.21875,\n y: 0.46875,\n },\n {\n x: 0.28125,\n y: 0.46875,\n },\n {\n x: 0.28125,\n y: 0.46875,\n },\n {\n x: 0.34375,\n y: 0.46875,\n },\n {\n x: 0.34375,\n y: 0.46875,\n },\n {\n x: 0.40625,\n y: 0.46875,\n },\n {\n x: 0.40625,\n y: 0.46875,\n },\n {\n x: 0.46875,\n y: 0.46875,\n },\n {\n x: 0.46875,\n y: 0.46875,\n },\n {\n x: 0.53125,\n y: 0.46875,\n },\n {\n x: 0.53125,\n y: 0.46875,\n },\n {\n x: 0.59375,\n y: 0.46875,\n },\n {\n x: 0.59375,\n y: 0.46875,\n },\n {\n x: 0.65625,\n y: 0.46875,\n },\n {\n x: 0.65625,\n y: 0.46875,\n },\n {\n x: 0.71875,\n y: 0.46875,\n },\n {\n x: 0.71875,\n y: 0.46875,\n },\n {\n x: 0.78125,\n y: 0.46875,\n },\n {\n x: 0.78125,\n y: 0.46875,\n },\n {\n x: 0.84375,\n y: 0.46875,\n },\n {\n x: 0.84375,\n y: 0.46875,\n },\n {\n x: 0.90625,\n y: 0.46875,\n },\n {\n x: 0.90625,\n y: 0.46875,\n },\n {\n x: 0.96875,\n y: 0.46875,\n },\n {\n x: 0.96875,\n y: 0.46875,\n },\n {\n x: 0.03125,\n y: 0.53125,\n },\n {\n x: 0.03125,\n y: 0.53125,\n },\n {\n x: 0.09375,\n y: 0.53125,\n },\n {\n x: 0.09375,\n y: 0.53125,\n },\n {\n x: 0.15625,\n y: 0.53125,\n },\n {\n x: 0.15625,\n y: 0.53125,\n },\n {\n x: 0.21875,\n y: 0.53125,\n },\n {\n x: 0.21875,\n y: 0.53125,\n },\n {\n x: 0.28125,\n y: 0.53125,\n },\n {\n x: 0.28125,\n y: 0.53125,\n },\n {\n x: 0.34375,\n y: 0.53125,\n },\n {\n x: 0.34375,\n y: 0.53125,\n },\n {\n x: 0.40625,\n y: 0.53125,\n },\n {\n x: 0.40625,\n y: 0.53125,\n },\n {\n x: 0.46875,\n y: 0.53125,\n },\n {\n x: 0.46875,\n y: 0.53125,\n },\n {\n x: 0.53125,\n y: 0.53125,\n },\n {\n x: 0.53125,\n y: 0.53125,\n },\n {\n x: 0.59375,\n y: 0.53125,\n },\n {\n x: 0.59375,\n y: 0.53125,\n },\n {\n x: 0.65625,\n y: 0.53125,\n },\n {\n x: 0.65625,\n y: 0.53125,\n },\n {\n x: 0.71875,\n y: 0.53125,\n },\n {\n x: 0.71875,\n y: 0.53125,\n },\n {\n x: 0.78125,\n y: 0.53125,\n },\n {\n x: 0.78125,\n y: 0.53125,\n },\n {\n x: 0.84375,\n y: 0.53125,\n },\n {\n x: 0.84375,\n y: 0.53125,\n },\n {\n x: 0.90625,\n y: 0.53125,\n },\n {\n x: 0.90625,\n y: 0.53125,\n },\n {\n x: 0.96875,\n y: 0.53125,\n },\n {\n x: 0.96875,\n y: 0.53125,\n },\n {\n x: 0.03125,\n y: 0.59375,\n },\n {\n x: 0.03125,\n y: 0.59375,\n },\n {\n x: 0.09375,\n y: 0.59375,\n },\n {\n x: 0.09375,\n y: 0.59375,\n },\n {\n x: 0.15625,\n y: 0.59375,\n },\n {\n x: 0.15625,\n y: 0.59375,\n },\n {\n x: 0.21875,\n y: 0.59375,\n },\n {\n x: 0.21875,\n y: 0.59375,\n },\n {\n x: 0.28125,\n y: 0.59375,\n },\n {\n x: 0.28125,\n y: 0.59375,\n },\n {\n x: 0.34375,\n y: 0.59375,\n },\n {\n x: 0.34375,\n y: 0.59375,\n },\n {\n x: 0.40625,\n y: 0.59375,\n },\n {\n x: 0.40625,\n y: 0.59375,\n },\n {\n x: 0.46875,\n y: 0.59375,\n },\n {\n x: 0.46875,\n y: 0.59375,\n },\n {\n x: 0.53125,\n y: 0.59375,\n },\n {\n x: 0.53125,\n y: 0.59375,\n },\n {\n x: 0.59375,\n y: 0.59375,\n },\n {\n x: 0.59375,\n y: 0.59375,\n },\n {\n x: 0.65625,\n y: 0.59375,\n },\n {\n x: 0.65625,\n y: 0.59375,\n },\n {\n x: 0.71875,\n y: 0.59375,\n },\n {\n x: 0.71875,\n y: 0.59375,\n },\n {\n x: 0.78125,\n y: 0.59375,\n },\n {\n x: 0.78125,\n y: 0.59375,\n },\n {\n x: 0.84375,\n y: 0.59375,\n },\n {\n x: 0.84375,\n y: 0.59375,\n },\n {\n x: 0.90625,\n y: 0.59375,\n },\n {\n x: 0.90625,\n y: 0.59375,\n },\n {\n x: 0.96875,\n y: 0.59375,\n },\n {\n x: 0.96875,\n y: 0.59375,\n },\n {\n x: 0.03125,\n y: 0.65625,\n },\n {\n x: 0.03125,\n y: 0.65625,\n },\n {\n x: 0.09375,\n y: 0.65625,\n },\n {\n x: 0.09375,\n y: 0.65625,\n },\n {\n x: 0.15625,\n y: 0.65625,\n },\n {\n x: 0.15625,\n y: 0.65625,\n },\n {\n x: 0.21875,\n y: 0.65625,\n },\n {\n x: 0.21875,\n y: 0.65625,\n },\n {\n x: 0.28125,\n y: 0.65625,\n },\n {\n x: 0.28125,\n y: 0.65625,\n },\n {\n x: 0.34375,\n y: 0.65625,\n },\n {\n x: 0.34375,\n y: 0.65625,\n },\n {\n x: 0.40625,\n y: 0.65625,\n },\n {\n x: 0.40625,\n y: 0.65625,\n },\n {\n x: 0.46875,\n y: 0.65625,\n },\n {\n x: 0.46875,\n y: 0.65625,\n },\n {\n x: 0.53125,\n y: 0.65625,\n },\n {\n x: 0.53125,\n y: 0.65625,\n },\n {\n x: 0.59375,\n y: 0.65625,\n },\n {\n x: 0.59375,\n y: 0.65625,\n },\n {\n x: 0.65625,\n y: 0.65625,\n },\n {\n x: 0.65625,\n y: 0.65625,\n },\n {\n x: 0.71875,\n y: 0.65625,\n },\n {\n x: 0.71875,\n y: 0.65625,\n },\n {\n x: 0.78125,\n y: 0.65625,\n },\n {\n x: 0.78125,\n y: 0.65625,\n },\n {\n x: 0.84375,\n y: 0.65625,\n },\n {\n x: 0.84375,\n y: 0.65625,\n },\n {\n x: 0.90625,\n y: 0.65625,\n },\n {\n x: 0.90625,\n y: 0.65625,\n },\n {\n x: 0.96875,\n y: 0.65625,\n },\n {\n x: 0.96875,\n y: 0.65625,\n },\n {\n x: 0.03125,\n y: 0.71875,\n },\n {\n x: 0.03125,\n y: 0.71875,\n },\n {\n x: 0.09375,\n y: 0.71875,\n },\n {\n x: 0.09375,\n y: 0.71875,\n },\n {\n x: 0.15625,\n y: 0.71875,\n },\n {\n x: 0.15625,\n y: 0.71875,\n },\n {\n x: 0.21875,\n y: 0.71875,\n },\n {\n x: 0.21875,\n y: 0.71875,\n },\n {\n x: 0.28125,\n y: 0.71875,\n },\n {\n x: 0.28125,\n y: 0.71875,\n },\n {\n x: 0.34375,\n y: 0.71875,\n },\n {\n x: 0.34375,\n y: 0.71875,\n },\n {\n x: 0.40625,\n y: 0.71875,\n },\n {\n x: 0.40625,\n y: 0.71875,\n },\n {\n x: 0.46875,\n y: 0.71875,\n },\n {\n x: 0.46875,\n y: 0.71875,\n },\n {\n x: 0.53125,\n y: 0.71875,\n },\n {\n x: 0.53125,\n y: 0.71875,\n },\n {\n x: 0.59375,\n y: 0.71875,\n },\n {\n x: 0.59375,\n y: 0.71875,\n },\n {\n x: 0.65625,\n y: 0.71875,\n },\n {\n x: 0.65625,\n y: 0.71875,\n },\n {\n x: 0.71875,\n y: 0.71875,\n },\n {\n x: 0.71875,\n y: 0.71875,\n },\n {\n x: 0.78125,\n y: 0.71875,\n },\n {\n x: 0.78125,\n y: 0.71875,\n },\n {\n x: 0.84375,\n y: 0.71875,\n },\n {\n x: 0.84375,\n y: 0.71875,\n },\n {\n x: 0.90625,\n y: 0.71875,\n },\n {\n x: 0.90625,\n y: 0.71875,\n },\n {\n x: 0.96875,\n y: 0.71875,\n },\n {\n x: 0.96875,\n y: 0.71875,\n },\n {\n x: 0.03125,\n y: 0.78125,\n },\n {\n x: 0.03125,\n y: 0.78125,\n },\n {\n x: 0.09375,\n y: 0.78125,\n },\n {\n x: 0.09375,\n y: 0.78125,\n },\n {\n x: 0.15625,\n y: 0.78125,\n },\n {\n x: 0.15625,\n y: 0.78125,\n },\n {\n x: 0.21875,\n y: 0.78125,\n },\n {\n x: 0.21875,\n y: 0.78125,\n },\n {\n x: 0.28125,\n y: 0.78125,\n },\n {\n x: 0.28125,\n y: 0.78125,\n },\n {\n x: 0.34375,\n y: 0.78125,\n },\n {\n x: 0.34375,\n y: 0.78125,\n },\n {\n x: 0.40625,\n y: 0.78125,\n },\n {\n x: 0.40625,\n y: 0.78125,\n },\n {\n x: 0.46875,\n y: 0.78125,\n },\n {\n x: 0.46875,\n y: 0.78125,\n },\n {\n x: 0.53125,\n y: 0.78125,\n },\n {\n x: 0.53125,\n y: 0.78125,\n },\n {\n x: 0.59375,\n y: 0.78125,\n },\n {\n x: 0.59375,\n y: 0.78125,\n },\n {\n x: 0.65625,\n y: 0.78125,\n },\n {\n x: 0.65625,\n y: 0.78125,\n },\n {\n x: 0.71875,\n y: 0.78125,\n },\n {\n x: 0.71875,\n y: 0.78125,\n },\n {\n x: 0.78125,\n y: 0.78125,\n },\n {\n x: 0.78125,\n y: 0.78125,\n },\n {\n x: 0.84375,\n y: 0.78125,\n },\n {\n x: 0.84375,\n y: 0.78125,\n },\n {\n x: 0.90625,\n y: 0.78125,\n },\n {\n x: 0.90625,\n y: 0.78125,\n },\n {\n x: 0.96875,\n y: 0.78125,\n },\n {\n x: 0.96875,\n y: 0.78125,\n },\n {\n x: 0.03125,\n y: 0.84375,\n },\n {\n x: 0.03125,\n y: 0.84375,\n },\n {\n x: 0.09375,\n y: 0.84375,\n },\n {\n x: 0.09375,\n y: 0.84375,\n },\n {\n x: 0.15625,\n y: 0.84375,\n },\n {\n x: 0.15625,\n y: 0.84375,\n },\n {\n x: 0.21875,\n y: 0.84375,\n },\n {\n x: 0.21875,\n y: 0.84375,\n },\n {\n x: 0.28125,\n y: 0.84375,\n },\n {\n x: 0.28125,\n y: 0.84375,\n },\n {\n x: 0.34375,\n y: 0.84375,\n },\n {\n x: 0.34375,\n y: 0.84375,\n },\n {\n x: 0.40625,\n y: 0.84375,\n },\n {\n x: 0.40625,\n y: 0.84375,\n },\n {\n x: 0.46875,\n y: 0.84375,\n },\n {\n x: 0.46875,\n y: 0.84375,\n },\n {\n x: 0.53125,\n y: 0.84375,\n },\n {\n x: 0.53125,\n y: 0.84375,\n },\n {\n x: 0.59375,\n y: 0.84375,\n },\n {\n x: 0.59375,\n y: 0.84375,\n },\n {\n x: 0.65625,\n y: 0.84375,\n },\n {\n x: 0.65625,\n y: 0.84375,\n },\n {\n x: 0.71875,\n y: 0.84375,\n },\n {\n x: 0.71875,\n y: 0.84375,\n },\n {\n x: 0.78125,\n y: 0.84375,\n },\n {\n x: 0.78125,\n y: 0.84375,\n },\n {\n x: 0.84375,\n y: 0.84375,\n },\n {\n x: 0.84375,\n y: 0.84375,\n },\n {\n x: 0.90625,\n y: 0.84375,\n },\n {\n x: 0.90625,\n y: 0.84375,\n },\n {\n x: 0.96875,\n y: 0.84375,\n },\n {\n x: 0.96875,\n y: 0.84375,\n },\n {\n x: 0.03125,\n y: 0.90625,\n },\n {\n x: 0.03125,\n y: 0.90625,\n },\n {\n x: 0.09375,\n y: 0.90625,\n },\n {\n x: 0.09375,\n y: 0.90625,\n },\n {\n x: 0.15625,\n y: 0.90625,\n },\n {\n x: 0.15625,\n y: 0.90625,\n },\n {\n x: 0.21875,\n y: 0.90625,\n },\n {\n x: 0.21875,\n y: 0.90625,\n },\n {\n x: 0.28125,\n y: 0.90625,\n },\n {\n x: 0.28125,\n y: 0.90625,\n },\n {\n x: 0.34375,\n y: 0.90625,\n },\n {\n x: 0.34375,\n y: 0.90625,\n },\n {\n x: 0.40625,\n y: 0.90625,\n },\n {\n x: 0.40625,\n y: 0.90625,\n },\n {\n x: 0.46875,\n y: 0.90625,\n },\n {\n x: 0.46875,\n y: 0.90625,\n },\n {\n x: 0.53125,\n y: 0.90625,\n },\n {\n x: 0.53125,\n y: 0.90625,\n },\n {\n x: 0.59375,\n y: 0.90625,\n },\n {\n x: 0.59375,\n y: 0.90625,\n },\n {\n x: 0.65625,\n y: 0.90625,\n },\n {\n x: 0.65625,\n y: 0.90625,\n },\n {\n x: 0.71875,\n y: 0.90625,\n },\n {\n x: 0.71875,\n y: 0.90625,\n },\n {\n x: 0.78125,\n y: 0.90625,\n },\n {\n x: 0.78125,\n y: 0.90625,\n },\n {\n x: 0.84375,\n y: 0.90625,\n },\n {\n x: 0.84375,\n y: 0.90625,\n },\n {\n x: 0.90625,\n y: 0.90625,\n },\n {\n x: 0.90625,\n y: 0.90625,\n },\n {\n x: 0.96875,\n y: 0.90625,\n },\n {\n x: 0.96875,\n y: 0.90625,\n },\n {\n x: 0.03125,\n y: 0.96875,\n },\n {\n x: 0.03125,\n y: 0.96875,\n },\n {\n x: 0.09375,\n y: 0.96875,\n },\n {\n x: 0.09375,\n y: 0.96875,\n },\n {\n x: 0.15625,\n y: 0.96875,\n },\n {\n x: 0.15625,\n y: 0.96875,\n },\n {\n x: 0.21875,\n y: 0.96875,\n },\n {\n x: 0.21875,\n y: 0.96875,\n },\n {\n x: 0.28125,\n y: 0.96875,\n },\n {\n x: 0.28125,\n y: 0.96875,\n },\n {\n x: 0.34375,\n y: 0.96875,\n },\n {\n x: 0.34375,\n y: 0.96875,\n },\n {\n x: 0.40625,\n y: 0.96875,\n },\n {\n x: 0.40625,\n y: 0.96875,\n },\n {\n x: 0.46875,\n y: 0.96875,\n },\n {\n x: 0.46875,\n y: 0.96875,\n },\n {\n x: 0.53125,\n y: 0.96875,\n },\n {\n x: 0.53125,\n y: 0.96875,\n },\n {\n x: 0.59375,\n y: 0.96875,\n },\n {\n x: 0.59375,\n y: 0.96875,\n },\n {\n x: 0.65625,\n y: 0.96875,\n },\n {\n x: 0.65625,\n y: 0.96875,\n },\n {\n x: 0.71875,\n y: 0.96875,\n },\n {\n x: 0.71875,\n y: 0.96875,\n },\n {\n x: 0.78125,\n y: 0.96875,\n },\n {\n x: 0.78125,\n y: 0.96875,\n },\n {\n x: 0.84375,\n y: 0.96875,\n },\n {\n x: 0.84375,\n y: 0.96875,\n },\n {\n x: 0.90625,\n y: 0.96875,\n },\n {\n x: 0.90625,\n y: 0.96875,\n },\n {\n x: 0.96875,\n y: 0.96875,\n },\n {\n x: 0.96875,\n y: 0.96875,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.1875,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.3125,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.4375,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.5625,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.6875,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.8125,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.9375,\n y: 0.0625,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.1875,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.3125,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.4375,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.5625,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.6875,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.8125,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.9375,\n y: 0.1875,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.1875,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.3125,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.4375,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.5625,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.6875,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.8125,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.9375,\n y: 0.3125,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.1875,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.3125,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.4375,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.5625,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.6875,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.8125,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.9375,\n y: 0.4375,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.1875,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.3125,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.4375,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.5625,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.6875,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.8125,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.9375,\n y: 0.5625,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.1875,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.3125,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.4375,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.5625,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.6875,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.8125,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.9375,\n y: 0.6875,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.1875,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.3125,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.4375,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.5625,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.6875,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.8125,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.9375,\n y: 0.8125,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.0625,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.1875,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.3125,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.4375,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.5625,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.6875,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.8125,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n {\n x: 0.9375,\n y: 0.9375,\n },\n];\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as anchors from './anchors';\n\nexport class HandDetector {\n model: any;\n anchors: any;\n anchorsTensor: any;\n inputSize: number;\n inputSizeTensor: any;\n doubleInputSizeTensor: any;\n\n constructor(model) {\n this.model = model;\n this.anchors = anchors.anchors.map((anchor) => [anchor.x, anchor.y]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSize = this.model?.inputs[0].shape[2];\n this.inputSizeTensor = tf.tensor1d([this.inputSize, this.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([this.inputSize * 2, this.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(rawPalmLandmarks.reshape([-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const batched = this.model.predict(input);\n const predictions = batched.squeeze();\n batched.dispose();\n const scoresT = tf.tidy(() => tf.sigmoid(tf.slice(predictions, [0, 0], [-1, 1])).squeeze());\n const scores = scoresT.dataSync();\n const rawBoxes = tf.slice(predictions, [0, 1], [-1, 4]);\n const boxes = this.normalizeBoxes(rawBoxes);\n rawBoxes.dispose();\n const filteredT = await tf.image.nonMaxSuppressionAsync(boxes, scores, config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const filtered = filteredT.arraySync();\n\n scoresT.dispose();\n filteredT.dispose();\n const hands: Array<{ box: any, palmLandmarks: any, confidence: number }> = [];\n for (const index of filtered) {\n if (scores[index] >= config.hand.minConfidence) {\n const matchingBox = tf.slice(boxes, [index, 0], [1, -1]);\n const rawPalmLandmarks = tf.slice(predictions, [index, 5], [1, 14]);\n const palmLandmarks = tf.tidy(() => this.normalizeLandmarks(rawPalmLandmarks, index).reshape([-1, 2]));\n rawPalmLandmarks.dispose();\n hands.push({ box: matchingBox, palmLandmarks, confidence: scores[index] });\n }\n }\n predictions.dispose();\n boxes.dispose();\n return hands;\n }\n\n async estimateHandBounds(input, config) {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => input.resizeBilinear([this.inputSize, this.inputSize]).div(127.5).sub(1));\n const predictions = await this.getBoxes(image, config);\n image.dispose();\n const hands: Array<{}> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = prediction.box.dataSync();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = prediction.palmLandmarks.arraySync();\n prediction.box.dispose();\n prediction.palmLandmarks.dispose();\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\n\n// const PALM_BOX_SHIFT_VECTOR = [0, -0.4];\nconst PALM_BOX_ENLARGE_FACTOR = 5; // default 3\n// const HAND_BOX_SHIFT_VECTOR = [0, -0.1]; // move detected hand box by x,y to ease landmark detection\nconst HAND_BOX_ENLARGE_FACTOR = 1.65; // default 1.65\nconst PALM_LANDMARK_IDS = [0, 5, 9, 13, 17, 1, 2];\nconst PALM_LANDMARKS_INDEX_OF_PALM_BASE = 0;\nconst PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE = 2;\n\nexport class HandPipeline {\n handDetector: any;\n landmarkDetector: any;\n inputSize: number;\n storedBoxes: any;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, landmarkDetector) {\n this.handDetector = handDetector;\n this.landmarkDetector = landmarkDetector;\n this.inputSize = this.landmarkDetector?.inputs[0].shape[2];\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n // return box.enlargeBox(box.squarifyBox(box.shiftBox(boxAroundPalm, PALM_BOX_SHIFT_VECTOR)), PALM_BOX_ENLARGE_FACTOR);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), PALM_BOX_ENLARGE_FACTOR);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n // const boxAroundHand = box.enlargeBox(box.squarifyBox(box.shiftBox(boundingBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), HAND_BOX_ENLARGE_FACTOR);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < PALM_LANDMARK_IDS.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[PALM_LANDMARK_IDS[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n coord[0] + originalBoxCenter[0],\n coord[1] + originalBoxCenter[1],\n coord[2],\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.videoOptimized) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.videoOptimized) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{}> = [];\n\n if (config.hand.skipInitial && this.detectedHands === 0) this.skipped = 0;\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_PALM_BASE], currentBox.palmLandmarks[PALM_LANDMARKS_INDEX_OF_MIDDLE_FINGER_BASE]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = croppedInput.div(255);\n croppedInput.dispose();\n rotatedImage.dispose();\n const [confidenceT, keypoints] = await this.landmarkDetector.predict(handImage);\n handImage.dispose();\n const confidence = confidenceT.dataSync()[0];\n confidenceT.dispose();\n if (confidence >= config.hand.minConfidence) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = keypointsReshaped.arraySync();\n keypoints.dispose();\n keypointsReshaped.dispose();\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = nextBoundingBox;\n const result = {\n landmarks: coords,\n confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n keypoints.dispose();\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), HAND_BOX_ENLARGE_FACTOR);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), HAND_BOX_ENLARGE_FACTOR);\n const result = {\n confidence: currentBox.confidence,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n return hands;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n}\n", "// paper: https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html\n\nimport { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as annotations from './annotations';\n\nlet model;\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath));\n model.width = parseInt(model.signature.inputs['input_1:0'].tensorShape.dim[2].size);\n model.height = parseInt(model.signature.inputs['input_1:0'].tensorShape.dim[1].size);\n if (!model || !model.modelUrl) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n if (!config.body.enabled) return null;\n const imgSize = { width: image.shape[2], height: image.shape[1] };\n const resize = tf.image.resizeBilinear(image, [model.width, model.height], false);\n const normalize = tf.div(resize, [255.0]);\n resize.dispose();\n const resT = await model.predict(normalize);\n const points = resT.find((t) => (t.size === 195 || t.size === 155)).dataSync(); // order of output tensors may change between models, full has 195 and upper has 155 items\n resT.forEach((t) => t.dispose());\n normalize.dispose();\n const keypoints: Array<{ id, part, position: { x, y, z }, score, presence }> = [];\n const labels = points.length === 195 ? annotations.full : annotations.upper; // full model has 39 keypoints, upper has 31 keypoints\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n keypoints.push({\n id: i,\n part: labels[i],\n position: {\n x: Math.trunc(imgSize.width * points[depth * i + 0] / 255), // return normalized x value istead of 0..255\n y: Math.trunc(imgSize.height * points[depth * i + 1] / 255), // return normalized y value istead of 0..255\n z: Math.trunc(points[depth * i + 2]) + 0, // fix negative zero\n },\n score: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100, // reverse sigmoid value\n presence: (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100, // reverse sigmoid value\n });\n }\n const score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n return [{ score, keypoints }];\n}\n", "export const full = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftPalm',\n 'rightPalm',\n 'leftIndex',\n 'rightIndex',\n 'leftPinky',\n 'rightPinky',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n 'leftHeel',\n 'rightHeel',\n 'leftFoot',\n 'rightFoot',\n 'midHip',\n 'forehead',\n 'leftThumb',\n 'leftHand',\n 'rightThumb',\n 'rightHand',\n];\n\nexport const upper = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'left:15',\n 'right:16',\n 'left:17',\n 'right:18',\n 'left:19',\n 'right:20',\n 'left:21',\n 'right:22',\n 'leftChest',\n 'rightChest',\n 'neck',\n 'forehead',\n 'left:27',\n 'right:28',\n 'left:29',\n 'right:30',\n];\n", "import { log, join } from '../helpers';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\n\nlet model;\nlet last: Array<{}> = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config) {\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`Human: Cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array<{ score: number, strideSize: number, class: number, label: string, center: number[], centerRaw: number[], box: number[], boxRaw: number[] }> = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(() => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = boxesMax.argMax(2).arraySync(); // what we need is indexes of features with highest scores, not values itself\n const scores = scoresT.arraySync(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))); // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)),\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => a.boxRaw);\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: any[] = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = nms.dataSync();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((a, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image, config) {\n if (!model) return null;\n // console.log(skipped, config.object.skipFrames, config.videoOptimized, ((skipped < config.object.skipFrames) && config.videoOptimized && (last.length > 0)));\n if ((skipped < config.object.skipFrames) && config.videoOptimized && (last.length > 0)) {\n skipped++;\n return last;\n }\n if (config.videoOptimized) skipped = 0;\n else skipped = Number.MAX_SAFE_INTEGER;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = resize.div(255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n norm.dispose();\n resize.dispose();\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n transpose.dispose();\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "export const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "export const body = (res) => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res) => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 0) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res) => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.rightEyeIris) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].annotations.rightEyeIris[0][0];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].annotations.leftEyeIris[0][0];\n if (leftIrisCenterX > 0.033 || rightIrisCenterX > 0.033) center = false;\n if (leftIrisCenterX > 0.033) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.033) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].annotations.rightEyeIris[0][1];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].annotations.leftEyeIris[0][1];\n if (leftIrisCenterY < 0.015 || rightIrisCenterY < 0.015 || leftIrisCenterY > 0.030 || rightIrisCenterY > 0.030) center = false;\n if (leftIrisCenterY < 0.015 || rightIrisCenterY < 0.015) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.030 || rightIrisCenterY > 0.030) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res) => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: string }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos)) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });\n }\n }\n return gestures;\n};\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// instance of fximage\nlet fx;\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input, config): { tensor: typeof tf.Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement } {\n let tensor;\n if (!input) throw new Error('Human: Input is missing');\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('Human: Input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if (input.shape && input.shape.length === 4 && input.shape[0] === 1 && input.shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`Human: Input tensor shape must be [1, height, width, 3] and instead was ${input.shape}`);\n } else {\n // check if resizing will be needed\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = targetWidth * originalHeight / originalWidth;\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = targetHeight * originalWidth / originalHeight;\n }\n\n // create our canvas and resize it if needed\n if (config.filter.width > 0) targetWidth = config.filter.width;\n else if (config.filter.height > 0) targetWidth = originalWidth * (config.filter.height / originalHeight);\n if (config.filter.height > 0) targetHeight = config.filter.height;\n else if (config.filter.width > 0) targetHeight = originalHeight * (config.filter.width / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('Human: Input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) {\n inCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n if (inCanvas?.width !== targetWidth) inCanvas.width = targetWidth;\n if (inCanvas?.height !== targetHeight) inCanvas.height = targetHeight;\n }\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if (input instanceof ImageData) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n\n // imagefx transforms using gl\n if (config.filter.enabled) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(inCanvas?.width, inCanvas?.height) : document.createElement('canvas');\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = tf.ENV.flags.IS_BROWSER ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n\n // create tensor from image\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'int32');\n } else if (outCanvas instanceof ImageData) { // if input is imagedata, just use it\n pixels = tf.browser.fromPixels(outCanvas);\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n pixels = tf.browser.fromPixels(tempCanvas);\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we can use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(targetWidth, targetHeight) : document.createElement('canvas');\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n const data = tempCtx?.getImageData(0, 0, targetWidth, targetHeight);\n pixels = tf.browser.fromPixels(data);\n }\n const casted = pixels.toFloat();\n tensor = casted.expandDims(0);\n pixels.dispose();\n casted.dispose();\n }\n const canvas = config.filter.return ? outCanvas : null;\n return { tensor, canvas };\n}\n", "/*\nWebGLImageFilter - MIT Licensed\n2013, Dominic Szablewski - phoboslab.org\n\n*/\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('Filter: GL compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('Filter: GL link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('Filter: getContext() failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "import { defaults } from '../config';\nimport { TRI468 as triangulation } from '../blazeface/coords';\nimport { mergeDeep } from '../helpers';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n * -useRawBoxes: Boolean: internal: use non-normalized coordinates when performing draw methods,\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: Boolean,\n drawLabels: Boolean,\n drawBoxes: Boolean,\n drawPolygons: Boolean,\n fillPolygons: Boolean,\n useDepth: Boolean,\n useCurves: Boolean,\n bufferedOutput: Boolean,\n useRawBoxes: Boolean,\n calculateHandBox: Boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.3)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 16px \"Segoe UI\"',\n lineHeight: 24,\n lineWidth: 6,\n pointSize: 2,\n roundRect: 28,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: false,\n drawPolygons: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: false,\n useRawBoxes: false,\n calculateHandBox: true,\n};\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: number[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n ctx.strokeStyle = localOptions.useDepth && pt[2] ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && pt[2] ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], parseInt(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: number[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where:any[] = [];\n let what:any[] = [];\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && (what[1].length > 0)) {\n const person = where[1] > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${person}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) {\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * f.boxRaw[0], inCanvas.height * f.boxRaw[1], inCanvas.width * f.boxRaw[2], inCanvas.height * f.boxRaw[3], localOptions);\n else rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n }\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face confidence: ${Math.trunc(100 * f.confidence)}%`);\n if (f.genderConfidence) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderConfidence)}% confident`);\n // if (f.genderConfidence) labels.push(f.gender);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`iris distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.angle.roll) labels.push(`roll: ${Math.trunc(100 * f.rotation.angle.roll) / 100} yaw:${Math.trunc(100 * f.rotation.angle.yaw) / 100} pitch:${Math.trunc(100 * f.rotation.angle.pitch) / 100}`);\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n // for (const pt of f.meshRaw) point(ctx, pt[0] * inCanvas.offsetWidth, pt[1] * inCanvas.offsetHeight, pt[2]);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations.leftEyeIris) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations.leftEyeIris[3][0] - f.annotations.leftEyeIris[1][0]) / 2;\n const sizeY = Math.abs(f.annotations.leftEyeIris[4][1] - f.annotations.leftEyeIris[2][1]) / 2;\n ctx.ellipse(f.annotations.leftEyeIris[0][0], f.annotations.leftEyeIris[0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations.rightEyeIris) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations.rightEyeIris[3][0] - f.annotations.rightEyeIris[1][0]) / 2;\n const sizeY = Math.abs(f.annotations.rightEyeIris[4][1] - f.annotations.rightEyeIris[2][1]) / 2;\n ctx.ellipse(f.annotations.rightEyeIris[0][0], f.annotations.rightEyeIris[0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n }\n }\n }\n}\n\nconst lastDrawnPose:any[] = [];\nexport async function body(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n // result[i].keypoints = result[i].keypoints.filter((a) => a.score > 0.5);\n if (!lastDrawnPose[i] && localOptions.bufferedOutput) lastDrawnPose[i] = { ...result[i] };\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position.z ? `rgba(${127.5 + (2 * result[i].keypoints[pt].position.z)}, ${127.5 - (2 * result[i].keypoints[pt].position.z)}, 255, 0.5)` : localOptions.color;\n if (localOptions.bufferedOutput) {\n lastDrawnPose[i].keypoints[pt][0] = (lastDrawnPose[i].keypoints[pt][0] + result[i].keypoints[pt].position.x) / 2;\n lastDrawnPose[i].keypoints[pt][1] = (lastDrawnPose[i].keypoints[pt][1] + result[i].keypoints[pt].position.y) / 2;\n point(ctx, lastDrawnPose[i].keypoints[pt][0], lastDrawnPose[i].keypoints[pt][1], 0, localOptions);\n } else {\n point(ctx, result[i].keypoints[pt].position.x, result[i].keypoints[pt].position.y, 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels) {\n ctx.font = localOptions.font;\n if (result[i].keypoints) {\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position.z ? `rgba(${127.5 + (2 * pt.position.z)}, ${127.5 - (2 * pt.position.z)}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position.x + 4, pt.position.y + 4);\n }\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints) {\n let part;\n const points: any[] = [];\n // shoulder line\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // torso main\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n if (points.length === 4) lines(ctx, points, localOptions); // only draw if we have complete torso\n // leg left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftKnee');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftAnkle');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftHeel');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftFoot');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // leg right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightKnee');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightAnkle');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightHeel');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightFoot');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // arm left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftElbow');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftWrist');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'leftPalm');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // arm right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightElbow');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightWrist');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n part = result[i].keypoints.find((a) => a.part === 'rightPalm');\n if (part && part.score > defaults.body.minConfidence) points.push([part.position.x, part.position.y]);\n curves(ctx, points, localOptions);\n // draw all\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n let box;\n if (!localOptions.calculateHandBox) {\n box = localOptions.useRawBoxes ? h.boxRaw : h.box;\n } else {\n box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0];\n if (h.landmarks && h.landmarks.length > 0) {\n for (const pt of h.landmarks) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n }\n }\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * box[0], inCanvas.height * box[1], inCanvas.width * box[2], inCanvas.height * box[3], localOptions);\n else rect(ctx, box[0], box[1], box[2], box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText('hand', box[0] + 3, 1 + box[1] + localOptions.lineHeight, box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText('hand', box[0] + 2, 0 + box[1] + localOptions.lineHeight, box[2]);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.landmarks && h.landmarks.length > 0) {\n for (const pt of h.landmarks) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * pt[2])}, ${127.5 - (2 * pt[2])}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawPolygons) {\n const addPart = (part) => {\n if (!part) return;\n for (let i = 0; i < part.length; i++) {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n addPart(h.annotations.indexFinger);\n addPart(h.annotations.middleFinger);\n addPart(h.annotations.ringFinger);\n addPart(h.annotations.pinky);\n addPart(h.annotations.thumb);\n // addPart(hand.annotations.palmBase);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement, result: Array, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n const ctx = inCanvas.getContext('2d');\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.useRawBoxes) rect(ctx, inCanvas.width * h.boxRaw[0], inCanvas.height * h.boxRaw[1], inCanvas.width * h.boxRaw[2], inCanvas.height * h.boxRaw[3], localOptions);\n else rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${Math.round(100 * h.score)}% ${h.label}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement) {\n if (!inCanvas || !outCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement) || !(outCanvas instanceof HTMLCanvasElement)) return;\n const outCtx = inCanvas.getContext('2d');\n outCtx?.drawImage(inCanvas, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement, result:any, drawOptions?: DrawOptions) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (!(inCanvas instanceof HTMLCanvasElement)) return;\n face(inCanvas, result.face, localOptions);\n body(inCanvas, result.body, localOptions);\n hand(inCanvas, result.hand, localOptions);\n gesture(inCanvas, result.gesture, localOptions);\n object(inCanvas, result.object, localOptions);\n}\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n */\nexport interface Config {\n /** Backend used for TFJS operations */\n backend: null | '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow',\n\n /** Path to *.wasm files if backend is set to `wasm` */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** Perform additional optimizations when input is video,\n * - must be disabled for images\n * - automatically disabled for Image, ImageData, ImageBitmap and Tensor inputs\n * - skips boundary detection for every `skipFrames` frames specified for each model\n * - while maintaining in-box detection since objects don't change definition as fast */\n videoOptimized: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n */\n filter: {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n },\n // type definition end\n\n /** Controlls gesture detection */\n gesture: {\n enabled: boolean,\n },\n\n /** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - skipFrames: how many frames to go without re-running the face detector and just run modified face mesh analysis, only valid if videoOptimized is set to true\n * - skipInitial: if previous detection resulted in no faces detected, should skipFrames be reset immediately to force new detection cycle\n * - return: return extracted face as tensor for futher user processing\n */\n face: {\n enabled: boolean,\n detector: {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n skipInitial: boolean,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n },\n mesh: {\n enabled: boolean,\n modelPath: string,\n },\n iris: {\n enabled: boolean,\n modelPath: string,\n },\n description: {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n },\n emotion: {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n },\n },\n\n /** Controlls and configures all body detection specific options\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n */\n body: {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n },\n\n /** Controlls and configures all hand detection specific options\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n * - skipFrames: how many frames to go without re-running the hand bounding box detector and just run modified hand skeleton detector, only valid if videoOptimized is set to true\n * - skipInitial: if previous detection resulted in no hands detected, should skipFrames be reset immediately to force new detection cycle\n */\n hand: {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n skipInitial: boolean,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath: string,\n },\n skeleton: {\n modelPath: string,\n },\n },\n\n /** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n * - skipFrames: run object detection every n input frames, only valid if videoOptimized is set to true\n */\n object: {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n },\n}\n\nconst config: Config = {\n backend: 'webgl', // select tfjs backend to use, leave empty to use default backend\n // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl\n modelBasePath: '../models/', // base path for all models\n wasmPath: '../assets/', // path for wasm binariesm, only used for backend: wasm\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n videoOptimized: true, // perform additional optimizations when input is video,\n // automatically disabled for Image, ImageData, ImageBitmap\n // skips boundary detection for every n frames\n // while maintaining in-box detection since objects cannot move that fast\n warmup: 'face', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: false, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 10, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 21, // how many frames to go without re-running the face bounding box detector\n // only used for video inputs\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head probably hasn't moved much\n // in short time (10 * 1/25 = 0.25 sec)\n skipInitial: false, // if previous detection resulted in no faces detected,\n // should skipFrames be reset immediately to force new detection cycle\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 31, // how many frames to go without re-running the detector\n // only used for video inputs\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 32, // how many frames to go without re-running the detector\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'posenet.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet' or 'blazepose'\n maxDetected: 1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet as blazepose only detects single pose\n minConfidence: 0.2, // threshold for discarding a prediction\n },\n\n hand: {\n enabled: true,\n rotation: false, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n skipFrames: 12, // how many frames to go without re-running the hand bounding box detector\n // only used for video inputs\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand probably\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n skipInitial: false, // if previous detection resulted in no hands detected,\n // should skipFrames be reset immediately to force new detection cycle\n minConfidence: 0.1, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 1, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handdetect.json', // hand detector model, can be absolute path or relative to modelBasePath\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'nanodet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 41, // how many frames to go without re-running the detector\n },\n};\nexport { config as defaults };\n", "// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAA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AAAAAAAAAASAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAABAAAAAAAAAAAAACBKAAAAAAAQ\nJQAAAhICEbJAYTWJ7wx8KvpC0BV4ceieWGewDHlNmWwCNjZICNhIDmcZredBecdpiY69FXCOLW+i\nUiZidukulmxxlx2paN4mNng+K4+I8Hy2yaTfl37TXetoCPfRxfp1qi3F48ofKMvtvxak8s6LDv61\nrZji9rPaLUf5PC+bfttS0q8q3p9W/wBrRMdpUZuKdN99nzvFqPbTVz7nD8OKs+do2/mW3h4D7Xaq\nZnPrtNpqz35aRaYOHY9Zk4pNt9rR+rl6zi+OnS+WN57Rv1lXp/YrNaYtruL6zNPnGO3hxP6O5w/2\nf0HDuun09Yv55Le9afznqcOvO4tBreMTHu30unnva0bWt8on+70nDuE4OHYYx4Kbesz3tPrMuhGO\nIjpDOKrK9YVpsyiGUQnYGOyUgI2SlAIEmwMWMs9kTAMJYzDOYRMArmGErZhhMArlHmzmGMwDE3Ts\nbAbs4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "import { log, now, mergeDeep } from './helpers';\nimport * as sysinfo from './sysinfo';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as backend from './tfjs/backend';\nimport * as faceall from './faceall';\nimport * as facemesh from './blazeface/facemesh';\nimport * as faceres from './faceres/faceres';\nimport * as emotion from './emotion/emotion';\nimport * as posenet from './posenet/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as blazepose from './blazepose/blazepose';\nimport * as nanodet from './nanodet/nanodet';\nimport * as gesture from './gesture/gesture';\nimport * as image from './image/image';\nimport * as draw from './draw/draw';\nimport { Config, defaults } from './config';\nimport { Result } from './result';\nimport * as sample from './sample';\nimport * as app from '../package.json';\n\n/** Generic Tensor object type */\nexport type Tensor = typeof tf.Tensor;\n\nexport type { Config } from './config';\nexport type { Result } from './result';\nexport type { DrawOptions } from './draw/draw';\n\n/** Defines all possible input types for **Human** detection */\nexport type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\n/** Error message */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS */\nexport type TensorFlow = typeof tf;\n\n/** Generic Model object type, holds instance of individual models */\ntype Model = Object;\n\n/**\n * **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n */\nexport class Human {\n /** Current version of Human library in semver format */\n version: string;\n /** Current configuration\n * - Details: {@link Config}\n */\n config: Config;\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n */\n state: string;\n /** Internal: Instance of current image being processed */\n image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n /** Internal: Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n */\n tf: TensorFlow;\n /** Draw helper classes that can draw detected objects on canvas using specified draw styles\n * - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: {\n options: draw.DrawOptions,\n gesture: typeof draw.gesture,\n face: typeof draw.face,\n body: typeof draw.body,\n hand: typeof draw.hand,\n canvas: typeof draw.canvas,\n all: typeof draw.all,\n };\n /** Internal: Currently loaded models */\n models: {\n face: [Model, Model, Model] | null,\n posenet: Model | null,\n blazepose: Model | null,\n efficientpose: Model | null,\n handpose: [Model, Model] | null,\n iris: Model | null,\n age: Model | null,\n gender: Model | null,\n emotion: Model | null,\n embedding: Model | null,\n nanodet: Model | null,\n faceres: Model | null,\n };\n /** Internal: Currently loaded classes */\n classes: {\n facemesh: typeof facemesh;\n emotion: typeof emotion;\n body: typeof posenet | typeof blazepose;\n hand: typeof handpose;\n nanodet: typeof nanodet;\n faceres: typeof faceres;\n };\n /** Face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Platform and agent information detected by Human */\n sysinfo: { platform: string, agent: string };\n /** Performance object that contains values for all recently performed operations */\n perf: any;\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n #firstRun: boolean;\n\n // definition end\n\n /**\n * Creates instance of Human library that is futher used for all operations\n * - @param userConfig: {@link Config}\n */\n constructor(userConfig: Config | Object = {}) {\n this.tf = tf;\n this.draw = draw;\n this.version = app.version;\n this.config = mergeDeep(defaults, userConfig);\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.#firstRun = true;\n this.perf = {};\n // object that contains all initialized models\n this.models = {\n face: null,\n posenet: null,\n blazepose: null,\n efficientpose: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n embedding: null,\n nanodet: null,\n faceres: null,\n };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.image = (input: Input) => image.process(input, this.config);\n // export raw access to underlying models\n this.classes = {\n facemesh,\n emotion,\n faceres,\n body: this.config.body.modelPath.includes('posenet') ? posenet : blazepose,\n hand: handpose,\n nanodet,\n };\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // include platform info\n this.sysinfo = sysinfo.info();\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg) => {\n if (!this.#analyzeMemoryLeaks) return;\n const current = this.tf.engine().state.numTensors;\n const previous = this.#numTensors;\n this.#numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)\n * - Calculation is based on normalized Minkowski distance between\n */\n // eslint-disable-next-line class-methods-use-this\n similarity(embedding1: Array, embedding2: Array): number {\n return faceres.similarity(embedding1, embedding2);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n * @param input Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n return faceres.enhance(input);\n }\n\n /**\n * Math method find best match between provided face descriptor and predefined database of known descriptors\n * @param faceEmbedding: face descriptor previsouly calculated on any face\n * @param db: array of mapping of face descriptors to known values\n * @param threshold: minimum score for matching to be considered in the result\n * @returns best match\n */\n // eslint-disable-next-line class-methods-use-this\n match(faceEmbedding: Array, db: Array<{ name: string, source: string, embedding: number[] }>, threshold = 0): { name: string, source: string, similarity: number, embedding: number[] } {\n return faceres.match(faceEmbedding, db, threshold);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n */\n async load(userConfig: Config | Object = {}) {\n this.state = 'load';\n const timeStamp = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n\n if (this.#firstRun) {\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (this.config.debug) log('platform:', this.sysinfo.platform);\n if (this.config.debug) log('agent:', this.sysinfo.agent);\n\n await this.#checkBackend(true);\n if (this.tf.ENV.flags.IS_BROWSER) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n if (this.config.async) {\n [\n this.models.face,\n this.models.emotion,\n this.models.handpose,\n this.models.posenet,\n this.models.blazepose,\n this.models.nanodet,\n this.models.faceres,\n ] = await Promise.all([\n this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),\n this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),\n this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),\n this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),\n this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),\n this.models.nanodet || (this.config.object.enabled ? nanodet.load(this.config) : null),\n this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),\n ]);\n } else {\n if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);\n if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);\n if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);\n if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);\n if (this.config.object.enabled && !this.models.nanodet) this.models.nanodet = await nanodet.load(this.config);\n if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);\n }\n\n if (this.#firstRun) {\n if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');\n this.#firstRun = false;\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.perf.load || 0)) this.perf.load = current;\n }\n\n // check if backend needs initialization if it changed\n /** @hidden */\n #checkBackend = async (force = false) => {\n if (this.config.backend && (this.config.backend.length > 0) && force || (this.tf.getBackend() !== this.config.backend)) {\n const timeStamp = now();\n this.state = 'backend';\n /* force backend reload\n if (this.config.backend in tf.engine().registry) {\n const backendFactory = tf.findBackendFactory(this.config.backend);\n tf.removeBackend(this.config.backend);\n tf.registerBackend(this.config.backend, backendFactory);\n } else {\n log('Backend not registred:', this.config.backend);\n }\n */\n\n if (this.config.backend && this.config.backend.length > 0) {\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');\n\n // force browser vs node backend\n if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';\n if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';\n\n if (this.config.debug) log('setting backend:', this.config.backend);\n\n if (this.config.backend === 'wasm') {\n if (this.config.debug) log('wasm path:', this.config.wasmPath);\n if (typeof this.tf?.setWasmPaths !== 'undefined') this.tf.setWasmPaths(this.config.wasmPath);\n else throw new Error('Human: WASM backend is not loaded');\n const simd = await this.tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await this.tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (this.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (this.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n if (this.config.backend === 'humangl') backend.register();\n try {\n await this.tf.setBackend(this.config.backend);\n } catch (err) {\n log('error: cannot set backend:', this.config.backend, err);\n }\n }\n this.tf.enableProdMode();\n // this.tf.enableDebugMode();\n if (this.tf.getBackend() === 'webgl' || this.tf.getBackend() === 'humangl') {\n this.tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n this.tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n if (typeof this.config['deallocate'] !== 'undefined') {\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n this.tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n const gl = await this.tf.backend().getGPGPUContext().gl;\n if (this.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n await this.tf.ready();\n this.perf.backend = Math.trunc(now() - timeStamp);\n }\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n */\n async detect(input: Input, userConfig: Config | Object = {}): Promise {\n // detection happens inside a promise\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig);\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend\n await this.#checkBackend();\n\n // load models if enabled\n await this.load();\n\n // disable video optimization for inputs of type image, but skip if inside worker thread\n let previousVideoOptimized;\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (\n (typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n || (typeof Image !== 'undefined' && input instanceof Image)\n || (typeof ImageData !== 'undefined' && input instanceof ImageData)\n || (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap))\n ) {\n log('disabling video optimization');\n previousVideoOptimized = this.config.videoOptimized;\n this.config.videoOptimized = false;\n }\n\n timeStamp = now();\n const process = image.process(input, this.config);\n if (!process || !process.tensor) {\n log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.perf.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n // prepare where to store model results\n let bodyRes;\n let handRes;\n let faceRes;\n let objectRes;\n let current;\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n if (this.config.async) {\n faceRes = this.config.face.enabled ? faceall.detectFace(this, process.tensor) : [];\n if (this.perf.face) delete this.perf.face;\n } else {\n this.state = 'run:face';\n timeStamp = now();\n faceRes = this.config.face.enabled ? await faceall.detectFace(this, process.tensor) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.face = current;\n }\n\n // run body: can be posenet or blazepose\n this.analyze('Start Body:');\n if (this.config.async) {\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(process.tensor, this.config) : [];\n if (this.perf.body) delete this.perf.body;\n } else {\n this.state = 'run:body';\n timeStamp = now();\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.body = current;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n if (this.config.async) {\n handRes = this.config.hand.enabled ? handpose.predict(process.tensor, this.config) : [];\n if (this.perf.hand) delete this.perf.hand;\n } else {\n this.state = 'run:hand';\n timeStamp = now();\n handRes = this.config.hand.enabled ? await handpose.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.hand = current;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n if (this.config.async) {\n objectRes = this.config.object.enabled ? nanodet.predict(process.tensor, this.config) : [];\n if (this.perf.object) delete this.perf.object;\n } else {\n this.state = 'run:object';\n timeStamp = now();\n objectRes = this.config.object.enabled ? await nanodet.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.object = current;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n if (this.config.async) {\n [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n }\n tf.dispose(process.tensor);\n\n // run gesture analysis last\n let gestureRes: any[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.perf.gesture = Math.trunc(now() - timeStamp);\n else if (this.perf.gesture) delete this.perf.gesture;\n }\n\n // restore video optimizations if previously disabled\n if (previousVideoOptimized) this.config.videoOptimized = previousVideoOptimized;\n\n this.perf.total = Math.trunc(now() - timeStart);\n this.state = 'idle';\n const result = {\n face: faceRes,\n body: bodyRes,\n hand: handRes,\n gesture: gestureRes,\n object: objectRes,\n performance: this.perf,\n canvas: process.canvas,\n };\n // log('Result:', result);\n resolve(result);\n });\n }\n\n /** @hidden */\n #warmupBitmap = async () => {\n const b64toBlob = (base64, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (this.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await this.detect(bitmap, this.config);\n bitmap.close();\n }\n return res;\n }\n\n /** @hidden */\n #warmupCanvas = async () => new Promise((resolve) => {\n let src;\n let size = 0;\n switch (this.config.warmup) {\n case 'face':\n size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n const img = new Image();\n img.onload = async () => {\n const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx?.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const res = await this.detect(canvas, this.config);\n resolve(res);\n };\n if (src) img.src = src;\n else resolve(null);\n });\n\n /** @hidden */\n #warmupNode = async () => {\n const atob = (str) => Buffer.from(str, 'base64');\n let img;\n if (this.config.warmup === 'face') img = atob(sample.face);\n if (this.config.warmup === 'body' || this.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n this.tf.dispose(data);\n // log('Input:', expanded);\n res = await this.detect(expanded, this.config);\n this.tf.dispose(expanded);\n } else {\n if (this.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await this.detect(input, this.config);\n */\n }\n return res;\n }\n\n /** Warmup metho pre-initializes all models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n async warmup(userConfig: Config | Object = {}): Promise {\n const t0 = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n if (!this.config.warmup || this.config.warmup === 'none') return { error: 'null' };\n const save = this.config.videoOptimized;\n this.config.videoOptimized = false;\n let res;\n if (typeof createImageBitmap === 'function') res = await this.#warmupBitmap();\n else if (typeof Image !== 'undefined') res = await this.#warmupCanvas();\n else res = await this.#warmupNode();\n this.config.videoOptimized = save;\n const t1 = now();\n if (this.config.debug) log('Warmup', this.config.warmup, Math.round(t1 - t0), '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AAiB,EAC7B,GAAM,GAAK,IACX,MAAI,MAAK,OAAO,OAAO,EAAI,SAAU,KAAK,OAAO,OAAQ,KAAK,MAAM,EAAK,GAAK,KAAM,GAC7E,IA1dT,eACA,eACA,eACA,eAiEA,eAoGA,eAmNA,eAkBA,eAiCA", "names": [] } diff --git a/dist/human.esm.js b/dist/human.esm.js index 85756962..3b05100b 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -5,35 +5,35 @@ author: ' */ -var Ek=Object.defineProperty;var Mr=(e,t)=>{for(var n in t)Ek(e,n,{get:t[n],enumerable:!0})};var Fg=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var rr=(e,t,n)=>(Fg(e,t,"read from private field"),n?n.call(e):t.get(e)),rs=(e,t,n,r)=>(Fg(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function Yt(e,t){let n=e.endsWith("/")?"":"/",a=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!a.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${a} Expecting JSON file`);return a}function pe(...e){let t=new Date,n=`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`;e&&console.log(n,"Human:",...e)}var it=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Hn(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,r)=>(Object.keys(r||{}).forEach(a=>{let s=n[a],i=r[a];Array.isArray(s)&&Array.isArray(i)?n[a]=s.concat(...i):t(s)&&t(i)?n[a]=Hn(s,i):n[a]=i}),n),{})}function $g(){let e,t;if(typeof navigator!="undefined"){let n=navigator.userAgent.match(/\(([^()]+)\)/g);if(n&&n[0]){let r=n[0].match(/\(([^()]+)\)/g);e=r?r[0].replace(/\(|\)/g,""):"",t=navigator.userAgent.replace(n[0],""),e[1]&&(t=t.replace(n[1],"")),t=t.replace(/ /g," ")}}else typeof process!="undefined"&&(e=`${process.platform} ${process.arch}`,t=`NodeJS ${process.version}`);return{platform:e,agent:t}}var lu={};Mr(lu,{Abs:()=>eo,Acos:()=>to,Acosh:()=>no,AdadeltaOptimizer:()=>qd,AdagradOptimizer:()=>Xd,AdamOptimizer:()=>Kd,AdamaxOptimizer:()=>Zd,Add:()=>Ia,AddN:()=>is,All:()=>ro,Any:()=>ao,ArgMax:()=>os,ArgMin:()=>pu,Asin:()=>so,Asinh:()=>io,Atan:()=>oo,Atan2:()=>uo,Atanh:()=>lo,AvgPool:()=>ls,AvgPool3D:()=>fu,AvgPool3DGrad:()=>Nh,AvgPoolGrad:()=>Sh,BackendWasm:()=>sv,BatchMatMul:()=>us,BatchToSpaceND:()=>mu,Bincount:()=>Th,BroadcastTo:()=>Sx,Callback:()=>Y6,CallbackList:()=>Xv,Cast:()=>cs,Ceil:()=>hs,ClipByValue:()=>Sa,Complex:()=>Eh,ComplexAbs:()=>Au,Concat:()=>co,Conv2D:()=>ds,Conv2DBackpropFilter:()=>Ch,Conv2DBackpropInput:()=>ps,Conv3D:()=>yu,Conv3DBackpropFilterV2:()=>Rh,Conv3DBackpropInputV2:()=>Mh,Cos:()=>fs,Cosh:()=>ho,CropAndResize:()=>po,Cumsum:()=>ms,CustomCallback:()=>Zv,DataStorage:()=>_h,DenseBincount:()=>Fh,DepthToSpace:()=>fo,DepthwiseConv2dNative:()=>As,DepthwiseConv2dNativeBackpropFilter:()=>$h,DepthwiseConv2dNativeBackpropInput:()=>Dh,Diag:()=>Oh,Dilation2D:()=>gu,Dilation2DBackpropFilter:()=>Ph,Dilation2DBackpropInput:()=>zh,ENV:()=>mr,EarlyStopping:()=>Q6,Einsum:()=>Lh,Elu:()=>mo,EluGrad:()=>Wh,Environment:()=>kx,Equal:()=>yo,Erf:()=>Ao,Exp:()=>gs,ExpandDims:()=>go,Expm1:()=>xo,FFT:()=>Bh,Fill:()=>xu,FlipLeftRight:()=>wo,Floor:()=>xs,FloorDiv:()=>ws,FromPixels:()=>rd,FusedBatchNorm:()=>bs,FusedConv2D:()=>ti,FusedDepthwiseConv2D:()=>ni,GPGPUContext:()=>pp,GatherNd:()=>_o,GatherV2:()=>bo,GraphModel:()=>E4,Greater:()=>vo,GreaterEqual:()=>_s,History:()=>Kv,IFFT:()=>Vh,Identity:()=>vs,Imag:()=>jh,InputSpec:()=>Rt,IsFinite:()=>ko,IsInf:()=>Io,IsNan:()=>So,KernelBackend:()=>cu,LRN:()=>_u,LRNGrad:()=>Hh,LayerVariable:()=>jv,LayersModel:()=>pa,LeakyRelu:()=>ks,Less:()=>No,LessEqual:()=>To,LinSpace:()=>Uh,Log:()=>Is,Log1p:()=>Eo,LogSoftmax:()=>Nx,LogicalAnd:()=>Co,LogicalNot:()=>wu,LogicalOr:()=>bu,MathBackendCPU:()=>ep,MathBackendWebGL:()=>Fl,Max:()=>Ss,MaxPool:()=>Ts,MaxPool3D:()=>vu,MaxPool3DGrad:()=>qh,MaxPoolGrad:()=>Gh,MaxPoolWithArgmax:()=>Xh,Maximum:()=>Ns,Mean:()=>Es,Min:()=>Cs,Minimum:()=>Rs,MirrorPad:()=>Ms,Mod:()=>Ro,MomentumOptimizer:()=>Yd,Multinomial:()=>Kh,Multiply:()=>Fs,Neg:()=>Mo,NonMaxSuppressionV3:()=>$o,NonMaxSuppressionV4:()=>Do,NonMaxSuppressionV5:()=>Oo,NotEqual:()=>Fo,OP_SCOPE_SUFFIX:()=>Px,OneHot:()=>$s,OnesLike:()=>zo,Optimizer:()=>ua,Pack:()=>Po,PadV2:()=>Ds,Pool:()=>C9,Pow:()=>Os,Prelu:()=>zs,Prod:()=>Lo,RMSPropOptimizer:()=>Jd,RNN:()=>Hr,Range:()=>ku,Rank:()=>_f,Real:()=>Zh,RealDiv:()=>ys,Reciprocal:()=>Wo,Reduction:()=>un,Relu:()=>Ps,Relu6:()=>Ws,Reshape:()=>Bo,ResizeBilinear:()=>Ls,ResizeBilinearGrad:()=>Jh,ResizeNearestNeighbor:()=>Iu,ResizeNearestNeighborGrad:()=>Yh,Reverse:()=>Bs,RotateWithOffset:()=>el,Round:()=>Vs,Rsqrt:()=>js,SGDOptimizer:()=>rc,ScatterNd:()=>Vo,Select:()=>jo,Selu:()=>Uo,Sequential:()=>Vl,Sigmoid:()=>Hs,Sign:()=>qo,Sin:()=>Us,Sinh:()=>Go,Slice:()=>Ho,Softmax:()=>Xs,Softplus:()=>Xo,SpaceToBatchND:()=>Su,SparseReshape:()=>Qh,SparseToDense:()=>ed,SplitV:()=>Ko,Sqrt:()=>Gs,Square:()=>Nu,SquaredDifference:()=>Ks,Step:()=>Ta,StridedSlice:()=>Zo,Sub:()=>Zs,Sum:()=>qs,SymbolicTensor:()=>Ir,Tan:()=>Ys,Tanh:()=>Js,Tensor:()=>Le,TensorBuffer:()=>$t,Tile:()=>Na,TopK:()=>Yo,Transform:()=>td,Transpose:()=>Qs,Unique:()=>nd,Unpack:()=>Jo,UnsortedSegmentSum:()=>Tu,Variable:()=>Du,ZerosLike:()=>Qo,_FusedMatMul:()=>ei,abs:()=>Dt,acos:()=>Xf,acosh:()=>Kf,add:()=>se,addN:()=>md,all:()=>Ad,any:()=>Wu,argMax:()=>Bu,argMin:()=>Zf,asin:()=>Yf,asinh:()=>Jf,atan:()=>Qf,atan2:()=>em,atanh:()=>tm,avgPool:()=>ju,avgPool3d:()=>am,backend:()=>xw,backend_util:()=>E,basicLSTMCell:()=>uN,batchNorm:()=>hi,batchNorm2d:()=>vw,batchNorm3d:()=>kw,batchNorm4d:()=>Iw,batchToSpaceND:()=>Uu,bincount:()=>Sw,booleanMaskAsync:()=>mC,broadcastTo:()=>hl,browser:()=>oi,buffer:()=>We,callbacks:()=>dae,cast:()=>Ae,ceil:()=>sm,clipByValue:()=>vn,clone:()=>Dr,complex:()=>Ea,concat:()=>ot,concat1d:()=>Nw,concat2d:()=>dl,concat3d:()=>Tw,concat4d:()=>Ew,constraints:()=>Av,conv1d:()=>gd,conv2d:()=>sa,conv2dTranspose:()=>xd,conv3d:()=>om,conv3dTranspose:()=>Rw,copyRegisteredKernels:()=>F9,cos:()=>Hu,cosh:()=>wd,cosineWindow:()=>Dm,cumsum:()=>bd,customGrad:()=>zr,data:()=>C4,denseBincount:()=>Mw,deprecationWarn:()=>Gf,depthToSpace:()=>lm,depthwiseConv2d:()=>pl,deregisterOp:()=>fae,device_util:()=>zu,diag:()=>PN,dilation2d:()=>um,disableDeprecationWarnings:()=>_S,dispose:()=>Te,disposeVariables:()=>vS,div:()=>ge,divNoNan:()=>cm,dot:()=>Fw,dropout:()=>eb,einsum:()=>$w,elu:()=>fl,enableDebugMode:()=>bS,enableProdMode:()=>wS,enclosingPowerOfTwo:()=>tb,engine:()=>aa,env:()=>J,equal:()=>$a,erf:()=>hm,exp:()=>qn,expandDims:()=>on,expm1:()=>dm,eye:()=>pm,fft:()=>tc,fill:()=>Gu,findBackend:()=>qf,findBackendFactory:()=>CS,floor:()=>ml,floorDiv:()=>fd,forceHalfFloat:()=>y3,fused:()=>Pa,gather:()=>di,gatherND:()=>Qw,gather_util:()=>Lf,getBackend:()=>TS,getGradient:()=>xf,getKernel:()=>ad,getKernelsForBackend:()=>nl,gpgpu_util:()=>B_,grad:()=>fT,grads:()=>mT,greater:()=>or,greaterEqual:()=>Oa,ifft:()=>xl,imag:()=>_d,image:()=>Ye,inTopKAsync:()=>SC,initializers:()=>vv,input:()=>Ov,io:()=>bn,irfft:()=>Pd,isFinite:()=>Dw,isInf:()=>Ow,isNaN:()=>fm,keep:()=>Vt,kernel_impls:()=>Wr,layers:()=>Dv,leakyRelu:()=>qu,less:()=>vd,lessEqual:()=>pi,linalg:()=>pb,linspace:()=>zw,loadGraphModel:()=>Ht,loadLayersModel:()=>Mre,localResponseNormalization:()=>mm,log:()=>Mn,log1p:()=>kd,logSigmoid:()=>Lw,logSoftmax:()=>Sd,logSumExp:()=>gm,logicalAnd:()=>lr,logicalNot:()=>Xu,logicalOr:()=>Nd,logicalXor:()=>jw,losses:()=>HR,matMul:()=>Be,math:()=>ew,max:()=>Xn,maxPool:()=>Ku,maxPool3d:()=>xm,maxPoolWithArgmax:()=>Uw,maximum:()=>Pr,mean:()=>vt,memory:()=>pd,meshgrid:()=>zT,metrics:()=>X6,min:()=>Al,minimum:()=>yl,mirrorPad:()=>wm,mod:()=>bm,model:()=>Cre,models:()=>K6,moments:()=>Td,movingAverage:()=>gC,mul:()=>B,multiRNNCell:()=>HT,multinomial:()=>Hw,neg:()=>_t,nextFrame:()=>Qd,norm:()=>Vd,notEqual:()=>Ai,oneHot:()=>ol,ones:()=>Fn,onesLike:()=>$n,op:()=>D,outerProduct:()=>ZT,pad:()=>ia,pad1d:()=>QT,pad2d:()=>tE,pad3d:()=>rE,pad4d:()=>sE,pool:()=>Gw,pow:()=>oa,prelu:()=>Yu,print:()=>Xx,prod:()=>Ed,profile:()=>kS,rand:()=>fE,randomGamma:()=>gE,randomNormal:()=>qw,randomUniform:()=>gl,range:()=>Cd,ready:()=>NS,real:()=>Ju,reciprocal:()=>km,registerBackend:()=>ul,registerCallbackConstructor:()=>Fre,registerGradient:()=>Tx,registerKernel:()=>ri,registerOp:()=>pae,regularizers:()=>Z6,relu:()=>Lr,relu6:()=>Rd,removeBackend:()=>ES,reshape:()=>H,reverse:()=>Dn,reverse1d:()=>NE,reverse2d:()=>EE,reverse3d:()=>RE,reverse4d:()=>FE,rfft:()=>nc,round:()=>Im,rsqrt:()=>Md,scalar:()=>ke,scatterND:()=>Jw,scatter_util:()=>Wf,selu:()=>Fd,separableConv2d:()=>Sm,sequential:()=>Rre,serialization:()=>re,setBackend:()=>SS,setPlatform:()=>RS,setWasmPath:()=>SJ,setWasmPaths:()=>NJ,setWebGLContext:()=>up,setdiff1dAsync:()=>Xw,shared:()=>Wm,sigmoid:()=>_n,sign:()=>Nm,signal:()=>UR,sin:()=>$d,sinh:()=>Dd,slice:()=>Re,slice1d:()=>Od,slice2d:()=>Tm,slice3d:()=>zd,slice4d:()=>Qu,slice_util:()=>sn,softmax:()=>ec,softplus:()=>fi,spaceToBatchND:()=>Zu,sparse:()=>fb,sparseToDense:()=>$m,spectral:()=>jR,split:()=>ln,sqrt:()=>Jt,square:()=>st,squaredDifference:()=>Ld,squeeze:()=>za,stack:()=>On,step:()=>wl,stridedSlice:()=>Em,sub:()=>ye,sum:()=>Ne,sumOutType:()=>ld,tan:()=>Cm,tanh:()=>ci,tensor:()=>gr,tensor1d:()=>nn,tensor2d:()=>Kn,tensor3d:()=>hd,tensor4d:()=>sC,tensor5d:()=>iC,tensor6d:()=>oC,tensor_util:()=>Ar,test_util:()=>Aw,tidy:()=>L,tile:()=>Da,time:()=>IS,topk:()=>Rm,train:()=>gi,transpose:()=>Ze,truncatedNormal:()=>Wd,unique:()=>Bd,unregisterGradient:()=>M9,unregisterKernel:()=>R9,unsortedSegmentSum:()=>Mm,unstack:()=>ur,upcastType:()=>ir,util:()=>_,valueAndGrad:()=>AT,valueAndGrads:()=>yT,variable:()=>Kw,variableGrads:()=>Pw,version:()=>eie,version_converter:()=>fse,version_core:()=>xS,version_cpu:()=>qb,version_layers:()=>sy,version_wasm:()=>ov,version_webgl:()=>A3,webgl:()=>EW,webgl_util:()=>m_,where:()=>kn,whereAsync:()=>Fm,zeros:()=>Et,zerosLike:()=>Ue});var Ck=Object.create,bh=Object.defineProperty,Rk=Object.getPrototypeOf,Mk=Object.prototype.hasOwnProperty,Fk=Object.getOwnPropertyNames,$k=Object.getOwnPropertyDescriptor,Dk=e=>bh(e,"__esModule",{value:!0}),wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Me=(e,t)=>{for(var n in t)bh(e,n,{get:t[n],enumerable:!0})},Ok=(e,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fk(t))!Mk.call(e,r)&&r!=="default"&&bh(e,r,{get:()=>t[r],enumerable:!(n=$k(t,r))||n.enumerable});return e},Yi=e=>Ok(Dk(bh(e!=null?Ck(Rk(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),zk=wt(()=>{}),Pk=wt((e,t)=>{(function(n,r,a){function s(c){var u=this,h=l();u.next=function(){var d=2091639*u.s0+u.c*23283064365386963e-26;return u.s0=u.s1,u.s1=u.s2,u.s2=d-(u.c=d|0)},u.c=1,u.s0=h(" "),u.s1=h(" "),u.s2=h(" "),u.s0-=h(c),u.s0<0&&(u.s0+=1),u.s1-=h(c),u.s1<0&&(u.s1+=1),u.s2-=h(c),u.s2<0&&(u.s2+=1),h=null}function i(c,u){return u.c=c.c,u.s0=c.s0,u.s1=c.s1,u.s2=c.s2,u}function o(c,u){var h=new s(c),d=u&&u.state,p=h.next;return p.int32=function(){return h.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,d&&(typeof d=="object"&&i(d,h),p.state=function(){return i(h,{})}),p}function l(){var c=4022871197,u=function(h){h=h.toString();for(var d=0;d>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return u}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Lk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var d=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^d^d>>>8},l===(l|0)?c.x=l:u+=l;for(var h=0;h>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Wk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.next=function(){var d=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(d^d<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,l===(l|0)?c.x=l:u+=l;for(var h=0;h>>4),c.next()}function i(l,c){return c.x=l.x,c.y=l.y,c.z=l.z,c.w=l.w,c.v=l.v,c.d=l.d,c}function o(l,c){var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Bk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this;c.next=function(){var h=c.x,d=c.i,p,m,f;return p=h[d],p^=p>>>7,m=p^p<<24,p=h[d+1&7],m^=p^p>>>10,p=h[d+3&7],m^=p^p>>>3,p=h[d+4&7],m^=p^p<<7,p=h[d+7&7],p=p^p<<13,m^=p^p<<9,h[d]=m,c.i=d+1&7,m};function u(h,d){var p,m,f=[];if(d===(d|0))m=f[0]=d;else for(d=""+d,p=0;p0;--p)h.next()}u(c,l)}function i(l,c){return c.x=l.x.slice(),c.i=l.i,c}function o(l,c){l==null&&(l=+new Date);var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(h.x&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Vk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this;c.next=function(){var h=c.w,d=c.X,p=c.i,m,f;return c.w=h=h+1640531527|0,f=d[p+34&127],m=d[p=p+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=d[p]=f^m,c.i=p,f+(h^h>>>16)|0};function u(h,d){var p,m,f,A,y,g=[],x=128;for(d===(d|0)?(m=d,d=null):(d=d+"\0",m=0,x=Math.max(x,d.length)),f=0,A=-32;A>>15,m^=m<<4,m^=m>>>13,A>=0&&(y=y+1640531527|0,p=g[A&127]^=m+y,f=p==0?f+1:0);for(f>=128&&(g[(d&&d.length||0)&127]=-1),f=127,A=4*128;A>0;--A)m=g[f+34&127],p=g[f=f+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,g[f]=m^p;h.w=y,h.X=g,h.i=f}u(c,l)}function i(l,c){return c.i=l.i,c.w=l.w,c.X=l.X.slice(),c}function o(l,c){l==null&&(l=+new Date);var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(h.X&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),jk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.next=function(){var d=c.b,p=c.c,m=c.d,f=c.a;return d=d<<25^d>>>7^p,p=p-m|0,m=m<<24^m>>>8^f,f=f-d|0,c.b=d=d<<20^d>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^f,c.a=f-d|0},c.a=0,c.b=0,c.c=2654435769|0,c.d=1367130551,l===Math.floor(l)?(c.a=l/4294967296|0,c.b=l|0):u+=l;for(var h=0;h>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Dg=wt(()=>{}),Uk=wt((e,t)=>{(function(n,r){var a=this,s=256,i=6,o=52,l="random",c=r.pow(s,i),u=r.pow(2,o),h=u*2,d=s-1,p;function m(w,b,k){var N=[];b=b==!0?{entropy:!0}:b||{};var C=g(y(b.entropy?[w,v(n)]:w==null?x():w,3),N),F=new f(N),O=function(){for(var z=F.g(i),V=c,j=0;z=h;)z/=2,V/=2,j>>>=1;return(z+j)/V};return O.int32=function(){return F.g(4)|0},O.quick=function(){return F.g(4)/4294967296},O.double=O,g(v(F.S),n),(b.pass||k||function(z,V,j,U){return U&&(U.S&&A(U,F),z.state=function(){return A(F,{})}),j?(r[l]=z,V):z})(O,C,"global"in b?b.global:this==r,b.state)}r["seed"+l]=m;function f(w){var b,k=w.length,N=this,C=0,F=N.i=N.j=0,O=N.S=[];for(k||(w=[k++]);C{var n=Pk(),r=Lk(),a=Wk(),s=Bk(),i=Vk(),o=jk(),l=Uk();l.alea=n,l.xor128=r,l.xorwow=a,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),uu=wt(()=>{}),Hk=wt(()=>{}),Gk=wt(()=>{}),qk=wt((e,t)=>{var n=function(){var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(a){a=a||{};function s(){return Q.buffer!=Ve&&Kt(Q.buffer),An}function i(){return Q.buffer!=Ve&&Kt(Q.buffer),xt}function o(){return Q.buffer!=Ve&&Kt(Q.buffer),yn}function l(){return Q.buffer!=Ve&&Kt(Q.buffer),jn}function c(){return Q.buffer!=Ve&&Kt(Q.buffer),rn}var u=typeof a!="undefined"?a:{},h,d;u.ready=new Promise(function(S,T){h=S,d=T});var p={},m;for(m in u)u.hasOwnProperty(m)&&(p[m]=u[m]);var f=[],A="./this.program",y=function(S,T){throw T},g=!1,x=!1,v=!1,w=!1;g=typeof window=="object",x=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",w=!g&&!v&&!x;var b=u.ENVIRONMENT_IS_PTHREAD||!1;b&&(Ve=u.buffer);var k="";function N(S){return u.locateFile?u.locateFile(S,k):k+S}var C,F,O,z,V,j;if(v){x?k=uu().dirname(k)+"/":k=__dirname+"/",C=function(S,T){return V||(V=require("fs")),j||(j=uu()),S=j.normalize(S),V.readFileSync(S,T?null:"utf8")},O=function(S){var T=C(S,!0);return T.buffer||(T=new Uint8Array(T)),de(T.buffer),T},process.argv.length>1&&(A=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(S){if(!(S instanceof ou))throw S}),process.on("unhandledRejection",Qr),y=function(S){process.exit(S)},u.inspect=function(){return"[Emscripten Module object]"};var U;try{U=Hk()}catch(S){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),S}global.Worker=U.Worker}else w?(typeof read!="undefined"&&(C=function(S){return read(S)}),O=function(S){var T;return typeof readbuffer=="function"?new Uint8Array(readbuffer(S)):(T=read(S,"binary"),de(typeof T=="object"),T)},typeof scriptArgs!="undefined"?f=scriptArgs:typeof arguments!="undefined"&&(f=arguments),typeof quit=="function"&&(y=function(S){quit(S)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(g||x)&&(x?k=self.location.href:typeof document!="undefined"&&document.currentScript&&(k=document.currentScript.src),typeof r!="undefined"&&r&&(k=r),k.indexOf("blob:")!==0?k=k.substr(0,k.lastIndexOf("/")+1):k="",v?(C=function(S,T){return V||(V=require("fs")),j||(j=uu()),S=j.normalize(S),V.readFileSync(S,T?null:"utf8")},O=function(S){var T=C(S,!0);return T.buffer||(T=new Uint8Array(T)),de(T.buffer),T}):(C=function(S){var T=new XMLHttpRequest;return T.open("GET",S,!1),T.send(null),T.responseText},x&&(O=function(S){var T=new XMLHttpRequest;return T.open("GET",S,!1),T.responseType="arraybuffer",T.send(null),new Uint8Array(T.response)}),F=function(S,T,P){var q=new XMLHttpRequest;q.open("GET",S,!0),q.responseType="arraybuffer",q.onload=function(){if(q.status==200||q.status==0&&q.response){T(q.response);return}P()},q.onerror=P,q.send(null)}),z=function(S){document.title=S});v&&typeof performance=="undefined"&&(global.performance=Gk().performance);var X=u.print||console.log.bind(console),G=u.printErr||console.warn.bind(console);for(m in p)p.hasOwnProperty(m)&&(u[m]=p[m]);p=null,u.arguments&&(f=u.arguments),u.thisProgram&&(A=u.thisProgram),u.quit&&(y=u.quit);var ee=Atomics.load,Y=Atomics.store,ae=Atomics.compareExchange,te;u.wasmBinary&&(te=u.wasmBinary);var ie=u.noExitRuntime||!0;typeof WebAssembly!="object"&&Qr("no native wasm support detected");var Q,ce,oe=!1,me;function de(S,T){S||Qr("Assertion failed: "+T)}function ve(S){var T=u["_"+S];return de(T,"Cannot call unknown function "+S+", make sure it is exported"),T}function Ie(S,T,P,q,he){var le={string:function(wn){var Zi=0;if(wn!=null&&wn!==0){var Mg=(wn.length<<2)+1;Zi=qi(Mg),et(wn,Zi,Mg)}return Zi},array:function(wn){var Zi=qi(wn.length);return Xe(wn,Zi),Zi}};function ue(wn){return T==="string"?$e(wn):T==="boolean"?Boolean(wn):wn}var we=ve(S),tt=[],Wt=0;if(q)for(var Ft=0;Ft=q);){var le=S[T++];if(!le)return he;if(!(le&128)){he+=String.fromCharCode(le);continue}var ue=S[T++]&63;if((le&224)==192){he+=String.fromCharCode((le&31)<<6|ue);continue}var we=S[T++]&63;if((le&240)==224?le=(le&15)<<12|ue<<6|we:le=(le&7)<<18|ue<<12|we<<6|S[T++]&63,le<65536)he+=String.fromCharCode(le);else{var tt=le-65536;he+=String.fromCharCode(55296|tt>>10,56320|tt&1023)}}return he}function $e(S,T){return S?Oe(i(),S,T):""}function Qe(S,T,P,q){if(!(q>0))return 0;for(var he=P,le=P+q-1,ue=0;ue=55296&&we<=57343){var tt=S.charCodeAt(++ue);we=65536+((we&1023)<<10)|tt&1023}if(we<=127){if(P>=le)break;T[P++]=we}else if(we<=2047){if(P+1>=le)break;T[P++]=192|we>>6,T[P++]=128|we&63}else if(we<=65535){if(P+2>=le)break;T[P++]=224|we>>12,T[P++]=128|we>>6&63,T[P++]=128|we&63}else{if(P+3>=le)break;T[P++]=240|we>>18,T[P++]=128|we>>12&63,T[P++]=128|we>>6&63,T[P++]=128|we&63}}return T[P]=0,P-he}function et(S,T,P){return Qe(S,i(),T,P)}function at(S){for(var T=0,P=0;P=55296&&q<=57343&&(q=65536+((q&1023)<<10)|S.charCodeAt(++P)&1023),q<=127?++T:q<=2047?T+=2:q<=65535?T+=3:T+=4}return T}function Xe(S,T){s().set(S,T)}function ht(S,T){return S%T>0&&(S+=T-S%T),S}var Ve,An,xt,Vn,Xt,yn,jn,Rn,rn;function Kt(S){Ve=S,u.HEAP8=An=new Int8Array(S),u.HEAP16=Vn=new Int16Array(S),u.HEAP32=yn=new Int32Array(S),u.HEAPU8=xt=new Uint8Array(S),u.HEAPU16=Xt=new Uint16Array(S),u.HEAPU32=jn=new Uint32Array(S),u.HEAPF32=Rn=new Float32Array(S),u.HEAPF64=rn=new Float64Array(S)}var Cr=u.INITIAL_MEMORY||16777216;if(b)Q=u.wasmMemory,Ve=u.buffer;else if(u.wasmMemory)Q=u.wasmMemory;else if(Q=new WebAssembly.Memory({initial:Cr/65536,maximum:2147483648/65536,shared:!0}),!(Q.buffer instanceof SharedArrayBuffer))throw G("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),v&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Q&&(Ve=Q.buffer),Cr=Ve.byteLength,Kt(Ve);var tr,nr=[],Aa=[],Yr=[],ya=[],Wi=[],Rr=!1,Qc=!1;b||Aa.push({func:function(){fh()}});function z0(){if(!b){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)th(u.preRun.shift());Vi(nr)}}function Yl(){Rr=!0,!b&&Vi(Aa)}function P0(){b||Vi(Yr)}function eh(){b||(Qc=!0)}function gn(){if(!b){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)L0(u.postRun.shift());Vi(Wi)}}function th(S){nr.unshift(S)}function L0(S){Wi.unshift(S)}var Jr=0,ga=null,es=null;function W0(S){de(!b,"addRunDependency cannot be used in a pthread worker"),Jr++,u.monitorRunDependencies&&u.monitorRunDependencies(Jr)}function B0(S){if(Jr--,u.monitorRunDependencies&&u.monitorRunDependencies(Jr),Jr==0&&(ga!==null&&(clearInterval(ga),ga=null),es)){var T=es;es=null,T()}}u.preloadedImages={},u.preloadedAudios={};function Qr(S){u.onAbort&&u.onAbort(S),b&&console.error("Pthread aborting at "+new Error().stack),S+="",G(S),oe=!0,me=1,S="abort("+S+"). Build with -s ASSERTIONS=1 for more info.";var T=new WebAssembly.RuntimeError(S);throw d(T),T}function nh(S,T){return String.prototype.startsWith?S.startsWith(T):S.indexOf(T)===0}var Bi="data:application/octet-stream;base64,";function rh(S){return nh(S,Bi)}var V0="file://";function ah(S){return nh(S,V0)}var xn="tfjs-backend-wasm-threaded-simd.wasm";rh(xn)||(xn=N(xn));function sh(S){try{if(S==xn&&te)return new Uint8Array(te);if(O)return O(S);throw"both async and sync fetching of the wasm failed"}catch(T){Qr(T)}}function j0(){if(!te&&(g||x)){if(typeof fetch=="function"&&!ah(xn))return fetch(xn,{credentials:"same-origin"}).then(function(S){if(!S.ok)throw"failed to load wasm binary file at '"+xn+"'";return S.arrayBuffer()}).catch(function(){return sh(xn)});if(F)return new Promise(function(S,T){F(xn,function(P){S(new Uint8Array(P))},T)})}return Promise.resolve().then(function(){return sh(xn)})}function U0(){var S={a:$1};function T(ue,we){var tt=ue.exports;if(u.asm=tt,tr=u.asm.F,ce=we,!b){var Wt=_e.unusedWorkers.length;_e.unusedWorkers.forEach(function(Ft){_e.loadWasmModuleToWorker(Ft,function(){--Wt||B0("wasm-instantiate")})})}}b||W0("wasm-instantiate");function P(ue){T(ue.instance,ue.module)}function q(ue){return j0().then(function(we){return WebAssembly.instantiate(we,S)}).then(ue,function(we){G("failed to asynchronously prepare wasm: "+we),Qr(we)})}function he(){return!te&&typeof WebAssembly.instantiateStreaming=="function"&&!rh(xn)&&!ah(xn)&&typeof fetch=="function"?fetch(xn,{credentials:"same-origin"}).then(function(ue){var we=WebAssembly.instantiateStreaming(ue,S);return we.then(P,function(tt){return G("wasm streaming compile failed: "+tt),G("falling back to ArrayBuffer instantiation"),q(P)})}):q(P)}if(u.instantiateWasm)try{var le=u.instantiateWasm(S,T);return le}catch(ue){return G("Module.instantiateWasm callback failed with error: "+ue),!1}return he().catch(d),{}}var H0={9816:function(){throw"Canceled!"},9834:function(S,T){setTimeout(function(){Sg(S,T)},0)}};function ih(){_e.initRuntime()}function Vi(S){for(;S.length>0;){var T=S.shift();if(typeof T=="function"){T(u);continue}var P=T.func;typeof P=="number"?T.arg===void 0?tr.get(P)():tr.get(P)(T.arg):P(T.arg===void 0?null:T.arg)}}function Jl(S,T){if(S<=0||S>s().length||S&!0||T<0)return-28;if(T==0)return 0;T>=2147483647&&(T=Infinity);var P=Atomics.load(o(),Xi>>2),q=0;if(P==S){var he=Atomics.compareExchange(o(),Xi>>2,P,0);if(he==P&&(--T,q=1,T<=0))return 1}var le=Atomics.notify(o(),S>>2,T);if(le>=0)return le+q;throw"Atomics.notify returned an unexpected value "+le}u._emscripten_futex_wake=Jl;function G0(S){if(b)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!S)throw"Internal Error! Null pthread_ptr in killThread!";o()[S+12>>2]=0;var T=_e.pthreads[S];T.worker.terminate(),_e.freeThreadData(T),_e.runningWorkers.splice(_e.runningWorkers.indexOf(T.worker),1),T.worker.pthread=void 0}function q0(S){if(b)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!S)throw"Internal Error! Null pthread_ptr in cancelThread!";var T=_e.pthreads[S];T.worker.postMessage({cmd:"cancel"})}function X0(S){if(b)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!S)throw"Internal Error! Null pthread_ptr in cleanupThread!";var T=_e.pthreads[S];if(T){o()[S+12>>2]=0;var P=T.worker;_e.returnWorkerToPool(P)}}var _e={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){for(var S=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2)),T=0;T>2]=S;var P=S+152;o()[P>>2]=P;for(var q=ns(512),T=0;T<128;++T)l()[q/4+T]=0;Atomics.store(l(),S+100>>2,q),Atomics.store(l(),S+40>>2,S),af(S,!x,1),Ig(S)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){for(;_e.threadExitHandlers.length>0;)_e.threadExitHandlers.pop()();b&&Hi()&&kg()},runExitHandlersAndDeinitThread:function(S,T){Atomics.store(l(),S+56>>2,1),Atomics.store(l(),S+60>>2,0),_e.runExitHandlers(),Atomics.store(l(),S+4>>2,T),Atomics.store(l(),S+0>>2,1),Jl(S+0,2147483647),af(0,0,0)},threadExit:function(S){var T=Hi();T&&(_e.runExitHandlersAndDeinitThread(T,S),b&&postMessage({cmd:"exit"}))},threadCancel:function(){_e.runExitHandlersAndDeinitThread(Hi(),-1),postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var S in _e.pthreads){var T=_e.pthreads[S];T&&T.worker&&_e.returnWorkerToPool(T.worker)}_e.pthreads={};for(var P=0;P<_e.unusedWorkers.length;++P){var q=_e.unusedWorkers[P];q.terminate()}_e.unusedWorkers=[];for(var P=0;P<_e.runningWorkers.length;++P){var q=_e.runningWorkers[P],T=q.pthread;_e.freeThreadData(T),q.terminate()}_e.runningWorkers=[]},freeThreadData:function(S){if(S){if(S.threadInfoStruct){var T=o()[S.threadInfoStruct+100>>2];o()[S.threadInfoStruct+100>>2]=0,su(T),su(S.threadInfoStruct)}S.threadInfoStruct=0,S.allocatedOwnStack&&S.stackBase&&su(S.stackBase),S.stackBase=0,S.worker&&(S.worker.pthread=null)}},returnWorkerToPool:function(S){_e.runWithoutMainThreadQueuedCalls(function(){delete _e.pthreads[S.pthread.threadInfoStruct],_e.unusedWorkers.push(S),_e.runningWorkers.splice(_e.runningWorkers.indexOf(S),1),_e.freeThreadData(S.pthread),S.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(S){o()[Rg>>2]=0;try{S()}finally{o()[Rg>>2]=1}},receiveObjectTransfer:function(S){},loadWasmModuleToWorker:function(S,T){S.onmessage=function(P){var q=P.data,he=q.cmd;if(S.pthread&&(_e.currentProxiedOperationCallerThread=S.pthread.threadInfoStruct),q.targetThread&&q.targetThread!=Hi()){var le=_e.pthreads[q.targetThread];le?le.worker.postMessage(P.data,q.transferList):console.error('Internal error! Worker sent a message "'+he+'" to target pthread '+q.targetThread+", but that thread no longer exists!"),_e.currentProxiedOperationCallerThread=void 0;return}if(he==="processQueuedMainThreadWork")nf();else if(he==="spawnThread")dh(P.data);else if(he==="cleanupThread")X0(q.thread);else if(he==="killThread")G0(q.thread);else if(he==="cancelThread")q0(q.thread);else if(he==="loaded")S.loaded=!0,T&&T(S),S.runPthread&&(S.runPthread(),delete S.runPthread);else if(he==="print")X("Thread "+q.threadId+": "+q.text);else if(he==="printErr")G("Thread "+q.threadId+": "+q.text);else if(he==="alert")alert("Thread "+q.threadId+": "+q.text);else if(he==="exit"){var ue=S.pthread&&Atomics.load(l(),S.pthread.threadInfoStruct+64>>2);ue&&_e.returnWorkerToPool(S)}else if(he==="exitProcess")try{Tk(q.returnCode)}catch(we){if(we instanceof ou)return;throw we}else he==="cancelDone"?_e.returnWorkerToPool(S):he==="objectTransfer"?_e.receiveObjectTransfer(P.data):P.data.target==="setimmediate"?S.postMessage(P.data):G("worker sent an unknown command "+he);_e.currentProxiedOperationCallerThread=void 0},S.onerror=function(P){G("pthread sent an error! "+P.filename+":"+P.lineno+": "+P.message)},v&&(S.on("message",function(P){S.onmessage({data:P})}),S.on("error",function(P){S.onerror(P)}),S.on("exit",function(P){})),S.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:Q,wasmModule:ce})},allocateUnusedWorker:function(){var S=N("tfjs-backend-wasm-threaded-simd.worker.js");_e.unusedWorkers.push(new Worker(S))},getNewWorker:function(){return _e.unusedWorkers.length==0&&(_e.allocateUnusedWorker(),_e.loadWasmModuleToWorker(_e.unusedWorkers[0])),_e.unusedWorkers.length>0?_e.unusedWorkers.pop():null},busySpinWait:function(S){for(var T=performance.now()+S;performance.now()>2]=S,S}function t1(S,T){if(b)return xa(1,1,S,T)}function n1(S,T){if(S==T)postMessage({cmd:"processQueuedMainThreadWork"});else if(b)postMessage({targetThread:S,cmd:"processThreadQueue"});else{var P=_e.pthreads[S],q=P&&P.worker;if(!q)return;q.postMessage({cmd:"processThreadQueue"})}return 1}function r1(){Qr()}function a1(S,T,P){var q=u1(T,P);return H0[S].apply(null,q)}function s1(S,T){}function i1(S,T,P){if(S<=0||S>s().length||S&!0)return-28;if(g){if(Atomics.load(o(),S>>2)!=T)return-6;for(var q=performance.now(),he=q+P,le=Atomics.exchange(o(),Xi>>2,S);;){if(q=performance.now(),q>he)return le=Atomics.exchange(o(),Xi>>2,0),-73;if(le=Atomics.exchange(o(),Xi>>2,0),le==0)break;if(nf(),Atomics.load(o(),S>>2)!=T)return-6;le=Atomics.exchange(o(),Xi>>2,S)}return 0}else{var ue=Atomics.wait(o(),S>>2,T,P);if(ue==="timed-out")return-73;if(ue==="not-equal")return-6;if(ue==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ue}}function o1(S,T,P){i().copyWithin(S,T,T+P)}function l1(){return v?require("os").cpus().length:navigator.hardwareConcurrency}function xa(S,T){for(var P=arguments.length-2,q=iu(),he=P,le=qi(he*8),ue=le>>3,we=0;we>=2;P=i()[S++];){var q=P<105;q&&T&1&&T++,eu.push(q?c()[T++>>1]:o()[T]),++T}return eu}function c1(S,T,P){Ql.length=T;for(var q=P>>3,he=0;he>>16),Kt(Q.buffer),1}catch(T){}}function p1(S){var T=h1();if(S<=T)return!1;var P=2147483648;if(S>P)return!1;for(var q=1;q<=4;q*=2){var he=T*(1+.2/q);he=Math.min(he,S+100663296);var le=Math.min(P,ht(Math.max(S,he),65536)),ue=d1(le);if(ue)return!0}return!1}var Pe={inEventHandler:0,removeAllEventListeners:function(){for(var S=Pe.eventHandlers.length-1;S>=0;--S)Pe._removeHandler(S);Pe.eventHandlers=[],Pe.deferredCalls=[]},registerRemoveEventListeners:function(){Pe.removeEventListenersRegistered||(ya.push(Pe.removeAllEventListeners),Pe.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(S,T,P){function q(ue,we){if(ue.length!=we.length)return!1;for(var tt in ue)if(ue[tt]!=we[tt])return!1;return!0}for(var he in Pe.deferredCalls){var le=Pe.deferredCalls[he];if(le.targetFunction==S&&q(le.argsList,P))return}Pe.deferredCalls.push({targetFunction:S,precedence:T,argsList:P}),Pe.deferredCalls.sort(function(ue,we){return ue.precedence>2]=P,o()[ue+4>>2]=q,o()[ue+8>>2]=he,rf(0,S,637534208,T,q,ue),Gi(le)},getTargetThreadForEventCallback:function(S){switch(S){case 1:return 0;case 2:return _e.currentProxiedOperationCallerThread;default:return S}},getNodeNameForTarget:function(S){return S?S==window?"#window":S==screen?"#screen":S&&S.nodeName?S.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function f1(S){var T=at(S)+1,P=ns(T);return et(S,P,T),P}function m1(S,T,P,q){var he=iu(),le=qi(12),ue=0;T&&(ue=f1(T)),o()[le>>2]=ue,o()[le+4>>2]=P,o()[le+8>>2]=q,rf(0,S,657457152,0,ue,le),Gi(he)}function A1(S,T,P,q){T=T?$e(T):"",m1(S,T,P,q)}function y1(S){return S>2?$e(S):S}var g1=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function x1(S){S=y1(S);var T=g1[S]||(typeof document!="undefined"?document.querySelector(S):void 0);return T}function tu(S){return x1(S)}function oh(S,T,P){var q=tu(S);if(!q)return-4;if(q.canvasSharedPtr&&(o()[q.canvasSharedPtr>>2]=T,o()[q.canvasSharedPtr+4>>2]=P),q.offscreenCanvas||!q.controlTransferredOffscreen){q.offscreenCanvas&&(q=q.offscreenCanvas);var he=!1;if(q.GLctxObject&&q.GLctxObject.GLctx){var le=q.GLctxObject.GLctx.getParameter(2978);he=le[0]===0&&le[1]===0&&le[2]===q.width&&le[3]===q.height}q.width=T,q.height=P,he&&q.GLctxObject.GLctx.viewport(0,0,T,P)}else if(q.canvasSharedPtr){var ue=o()[q.canvasSharedPtr+8>>2];return A1(ue,S,T,P),1}else return-4;return 0}function lh(S,T,P){return b?xa(2,1,S,T,P):oh(S,T,P)}function w1(S,T,P){var q=tu(S);return q?oh(S,T,P):lh(S,T,P)}function b1(S){}function _1(S,T){}function v1(S){var T=S.getExtension("ANGLE_instanced_arrays");if(T)return S.vertexAttribDivisor=function(P,q){T.vertexAttribDivisorANGLE(P,q)},S.drawArraysInstanced=function(P,q,he,le){T.drawArraysInstancedANGLE(P,q,he,le)},S.drawElementsInstanced=function(P,q,he,le,ue){T.drawElementsInstancedANGLE(P,q,he,le,ue)},1}function k1(S){var T=S.getExtension("OES_vertex_array_object");if(T)return S.createVertexArray=function(){return T.createVertexArrayOES()},S.deleteVertexArray=function(P){T.deleteVertexArrayOES(P)},S.bindVertexArray=function(P){T.bindVertexArrayOES(P)},S.isVertexArray=function(P){return T.isVertexArrayOES(P)},1}function I1(S){var T=S.getExtension("WEBGL_draw_buffers");if(T)return S.drawBuffers=function(P,q){T.drawBuffersWEBGL(P,q)},1}function S1(S){return!!(S.multiDrawWebgl=S.getExtension("WEBGL_multi_draw"))}var Je={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(S){Je.lastError||(Je.lastError=S)},getNewId:function(S){for(var T=Je.counter++,P=S.length;P>2]:-1;he+=$e(o()[P+le*4>>2],ue<0?void 0:ue)}return he},createContext:function(S,T){var P=S.getContext("webgl",T);if(!P)return 0;var q=Je.registerContext(P,T);return q},registerContext:function(S,T){var P=ns(8);o()[P+4>>2]=Hi();var q={handle:P,attributes:T,version:T.majorVersion,GLctx:S};return S.canvas&&(S.canvas.GLctxObject=q),Je.contexts[P]=q,(typeof T.enableExtensionsByDefault=="undefined"||T.enableExtensionsByDefault)&&Je.initExtensions(q),P},makeContextCurrent:function(S){return Je.currentContext=Je.contexts[S],u.ctx=wa=Je.currentContext&&Je.currentContext.GLctx,!(S&&!wa)},getContext:function(S){return Je.contexts[S]},deleteContext:function(S){Je.currentContext===Je.contexts[S]&&(Je.currentContext=null),typeof Pe=="object"&&Pe.removeAllHandlersOnTarget(Je.contexts[S].GLctx.canvas),Je.contexts[S]&&Je.contexts[S].GLctx.canvas&&(Je.contexts[S].GLctx.canvas.GLctxObject=void 0),su(Je.contexts[S].handle),Je.contexts[S]=null},initExtensions:function(S){if(S||(S=Je.currentContext),!S.initExtensionsDone){S.initExtensionsDone=!0;var T=S.GLctx;v1(T),k1(T),I1(T),T.disjointTimerQueryExt=T.getExtension("EXT_disjoint_timer_query"),S1(T);var P=T.getSupportedExtensions()||[];P.forEach(function(q){q.indexOf("lose_context")<0&&q.indexOf("debug")<0&&T.getExtension(q)})}},populateUniformTable:function(S){for(var T=Je.programs[S],P=Je.programInfos[S]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},q=P.uniforms,he=wa.getProgramParameter(T,35718),le=0;le>2,q=o()[P+(24>>2)],he={alpha:!!o()[P+(0>>2)],depth:!!o()[P+(4>>2)],stencil:!!o()[P+(8>>2)],antialias:!!o()[P+(12>>2)],premultipliedAlpha:!!o()[P+(16>>2)],preserveDrawingBuffer:!!o()[P+(20>>2)],powerPreference:N1[q],failIfMajorPerformanceCaveat:!!o()[P+(28>>2)],majorVersion:o()[P+(32>>2)],minorVersion:o()[P+(36>>2)],enableExtensionsByDefault:o()[P+(40>>2)],explicitSwapControl:o()[P+(44>>2)],proxyContextToMainThread:o()[P+(48>>2)],renderViaOffscreenBackBuffer:o()[P+(52>>2)]},le=tu(S);if(!le||he.explicitSwapControl)return 0;var ue=Je.createContext(le,he);return ue}function E1(S,T){return T1(S,T)}var ji={mappings:{},buffers:[null,[],[]],printChar:function(S,T){var P=ji.buffers[S];T===0||T===10?((S===1?X:G)(Oe(P,0)),P.length=0):P.push(T)},varargs:void 0,get:function(){ji.varargs+=4;var S=o()[ji.varargs-4>>2];return S},getStr:function(S){var T=$e(S);return T},get64:function(S,T){return S}};function uh(S){return b?xa(3,1,S):0}function ch(S,T,P,q,he){if(b)return xa(4,1,S,T,P,q,he)}function hh(S,T,P,q){if(b)return xa(5,1,S,T,P,q);for(var he=0,le=0;le>2],we=o()[T+(le*8+4)>>2],tt=0;tt>2]=he,0}function C1(S){var T=_e.threadExitHandlers.pop();S&&T()}function R1(S,T){_e.threadExitHandlers.push(function(){tr.get(S)(T)})}function dh(S){if(b)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var T=_e.getNewWorker();if(T.pthread!==void 0)throw"Internal error!";if(!S.pthread_ptr)throw"Internal error, no pthread ptr!";_e.runningWorkers.push(T);for(var P=ns(128*4),q=0;q<128;++q)o()[P+q*4>>2]=0;var he=S.stackBase+S.stackSize,le=_e.pthreads[S.pthread_ptr]={worker:T,stackBase:S.stackBase,stackSize:S.stackSize,allocatedOwnStack:S.allocatedOwnStack,threadInfoStruct:S.pthread_ptr},ue=le.threadInfoStruct>>2;Atomics.store(l(),ue+(64>>2),S.detached),Atomics.store(l(),ue+(100>>2),P),Atomics.store(l(),ue+(40>>2),le.threadInfoStruct),Atomics.store(l(),ue+(80>>2),S.stackSize),Atomics.store(l(),ue+(76>>2),he),Atomics.store(l(),ue+(104>>2),S.stackSize),Atomics.store(l(),ue+(104+8>>2),he),Atomics.store(l(),ue+(104+12>>2),S.detached);var we=vg(),tt=we+40;Atomics.store(l(),ue+(172>>2),tt),T.pthread=le;var Wt={cmd:"run",start_routine:S.startRoutine,arg:S.arg,threadInfoStruct:S.pthread_ptr,stackBase:S.stackBase,stackSize:S.stackSize};T.runPthread=function(){Wt.time=performance.now(),T.postMessage(Wt,S.transferList)},T.loaded&&(T.runPthread(),delete T.runPthread)}function M1(S,T,P,q){if(typeof SharedArrayBuffer=="undefined")return G("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!S)return G("pthread_create called with a null thread pointer!"),28;var he=[],le=0;if(b&&(he.length===0||le))return Ng(687865856,S,T,P,q);if(le)return le;var ue=0,we=0,tt=0;T&&T!=-1?(ue=o()[T>>2],ue+=81920,we=o()[T+8>>2],tt=o()[T+12>>2]!==0):ue=2097152;var Wt=we==0;Wt?we=Cg(16,ue):(we-=ue,de(we>0));for(var Ft=ns(228),_a=0;_a<228>>2;++_a)l()[(Ft>>2)+_a]=0;o()[S>>2]=Ft,o()[Ft+12>>2]=Ft;var Ki=Ft+152;o()[Ki>>2]=Ki;var wn={stackBase:we,stackSize:ue,allocatedOwnStack:Wt,detached:tt,startRoutine:P,pthread_ptr:Ft,arg:q,transferList:he};return b?(wn.cmd="spawnThread",postMessage(wn,he)):dh(wn),0}function ph(S){if(b)return xa(6,1,S);switch(S){case 30:return 16384;case 85:var T=2147483648;return T/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return e1(28),-1}b||_e.initMainThreadBlock();var wa,F1=[null,t1,lh,uh,ch,hh,ph],$1={e:J0,r:Q0,x:n1,b:r1,y:a1,j:s1,c:i1,d:Jl,f:ts,p:o1,z:l1,u:c1,q:p1,v:w1,i:b1,t:_1,w:E1,m:uh,n:ch,g:hh,o:ih,a:Q||u.wasmMemory,k:C1,l:R1,h:M1,s:ph},bg=U0(),fh=u.___wasm_call_ctors=function(){return(fh=u.___wasm_call_ctors=u.asm.A).apply(null,arguments)},D1=u._init=function(){return(D1=u._init=u.asm.B).apply(null,arguments)},O1=u._register_tensor=function(){return(O1=u._register_tensor=u.asm.C).apply(null,arguments)},z1=u._dispose_data=function(){return(z1=u._dispose_data=u.asm.D).apply(null,arguments)},P1=u._dispose=function(){return(P1=u._dispose=u.asm.E).apply(null,arguments)},L1=u._Abs=function(){return(L1=u._Abs=u.asm.G).apply(null,arguments)},W1=u._Add=function(){return(W1=u._Add=u.asm.H).apply(null,arguments)},B1=u._AddN=function(){return(B1=u._AddN=u.asm.I).apply(null,arguments)},V1=u._All=function(){return(V1=u._All=u.asm.J).apply(null,arguments)},j1=u._Any=function(){return(j1=u._Any=u.asm.K).apply(null,arguments)},U1=u._ArgMax=function(){return(U1=u._ArgMax=u.asm.L).apply(null,arguments)},H1=u._AvgPool=function(){return(H1=u._AvgPool=u.asm.M).apply(null,arguments)},G1=u._BatchMatMul=function(){return(G1=u._BatchMatMul=u.asm.N).apply(null,arguments)},q1=u._Ceil=function(){return(q1=u._Ceil=u.asm.O).apply(null,arguments)},X1=u._ClipByValue=function(){return(X1=u._ClipByValue=u.asm.P).apply(null,arguments)},K1=u._Conv2D=function(){return(K1=u._Conv2D=u.asm.Q).apply(null,arguments)},Z1=u._Conv2DBackpropInput=function(){return(Z1=u._Conv2DBackpropInput=u.asm.R).apply(null,arguments)},Y1=u._Cos=function(){return(Y1=u._Cos=u.asm.S).apply(null,arguments)},J1=u._CropAndResize=function(){return(J1=u._CropAndResize=u.asm.T).apply(null,arguments)},Q1=u._Cumsum=function(){return(Q1=u._Cumsum=u.asm.U).apply(null,arguments)},ef=u._DepthToSpace=function(){return(ef=u._DepthToSpace=u.asm.V).apply(null,arguments)},mh=u._DepthwiseConv2dNative=function(){return(mh=u._DepthwiseConv2dNative=u.asm.W).apply(null,arguments)},Ah=u._Equal=function(){return(Ah=u._Equal=u.asm.X).apply(null,arguments)},yh=u._Exp=function(){return(yh=u._Exp=u.asm.Y).apply(null,arguments)},nu=u._FlipLeftRight=function(){return(nu=u._FlipLeftRight=u.asm.Z).apply(null,arguments)},Ui=u._Floor=function(){return(Ui=u._Floor=u.asm._).apply(null,arguments)},tf=u._FloorDiv=function(){return(tf=u._FloorDiv=u.asm.$).apply(null,arguments)},ru=u._FusedBatchNorm=function(){return(ru=u._FusedBatchNorm=u.asm.aa).apply(null,arguments)},K=u._FusedConv2D=function(){return(K=u._FusedConv2D=u.asm.ba).apply(null,arguments)},ne=u._FusedDepthwiseConv2D=function(){return(ne=u._FusedDepthwiseConv2D=u.asm.ca).apply(null,arguments)},Se=u._Gather=function(){return(Se=u._Gather=u.asm.da).apply(null,arguments)},Ke=u._GatherNd=function(){return(Ke=u._GatherNd=u.asm.ea).apply(null,arguments)},It=u._Greater=function(){return(It=u._Greater=u.asm.fa).apply(null,arguments)},mt=u._GreaterEqual=function(){return(mt=u._GreaterEqual=u.asm.ga).apply(null,arguments)},je=u._LeakyRelu=function(){return(je=u._LeakyRelu=u.asm.ha).apply(null,arguments)},He=u._Less=function(){return(He=u._Less=u.asm.ia).apply(null,arguments)},Zt=u._LessEqual=function(){return(Zt=u._LessEqual=u.asm.ja).apply(null,arguments)},ea=u._Log=function(){return(ea=u._Log=u.asm.ka).apply(null,arguments)},ta=u._LogicalAnd=function(){return(ta=u._LogicalAnd=u.asm.la).apply(null,arguments)},gh=u._Max=function(){return(gh=u._Max=u.asm.ma).apply(null,arguments)},au=u._MaxPool=function(){return(au=u._MaxPool=u.asm.na).apply(null,arguments)},Un=u._Maximum=function(){return(Un=u._Maximum=u.asm.oa).apply(null,arguments)},ba=u._Mean=function(){return(ba=u._Mean=u.asm.pa).apply(null,arguments)},xh=u._Min=function(){return(xh=u._Min=u.asm.qa).apply(null,arguments)},B8=u._Minimum=function(){return(B8=u._Minimum=u.asm.ra).apply(null,arguments)},V8=u._MirrorPad=function(){return(V8=u._MirrorPad=u.asm.sa).apply(null,arguments)},j8=u._Multiply=function(){return(j8=u._Multiply=u.asm.ta).apply(null,arguments)},U8=u._Neg=function(){return(U8=u._Neg=u.asm.ua).apply(null,arguments)},H8=u._NonMaxSuppressionV3=function(){return(H8=u._NonMaxSuppressionV3=u.asm.va).apply(null,arguments)},G8=u._NonMaxSuppressionV4=function(){return(G8=u._NonMaxSuppressionV4=u.asm.wa).apply(null,arguments)},q8=u._NonMaxSuppressionV5=function(){return(q8=u._NonMaxSuppressionV5=u.asm.xa).apply(null,arguments)},X8=u._NotEqual=function(){return(X8=u._NotEqual=u.asm.ya).apply(null,arguments)},K8=u._OneHot=function(){return(K8=u._OneHot=u.asm.za).apply(null,arguments)},Z8=u._PadV2=function(){return(Z8=u._PadV2=u.asm.Aa).apply(null,arguments)},Y8=u._Pow=function(){return(Y8=u._Pow=u.asm.Ba).apply(null,arguments)},J8=u._Prelu=function(){return(J8=u._Prelu=u.asm.Ca).apply(null,arguments)},Q8=u._Prod=function(){return(Q8=u._Prod=u.asm.Da).apply(null,arguments)},ek=u._RealDiv=function(){return(ek=u._RealDiv=u.asm.Ea).apply(null,arguments)},tk=u._Relu=function(){return(tk=u._Relu=u.asm.Fa).apply(null,arguments)},nk=u._Relu6=function(){return(nk=u._Relu6=u.asm.Ga).apply(null,arguments)},rk=u._ResizeBilinear=function(){return(rk=u._ResizeBilinear=u.asm.Ha).apply(null,arguments)},ak=u._Reverse=function(){return(ak=u._Reverse=u.asm.Ia).apply(null,arguments)},sk=u._RotateWithOffset=function(){return(sk=u._RotateWithOffset=u.asm.Ja).apply(null,arguments)},ik=u._Round=function(){return(ik=u._Round=u.asm.Ka).apply(null,arguments)},ok=u._Rsqrt=function(){return(ok=u._Rsqrt=u.asm.La).apply(null,arguments)},lk=u._ScatterNd=function(){return(lk=u._ScatterNd=u.asm.Ma).apply(null,arguments)},uk=u._SelectV2=function(){return(uk=u._SelectV2=u.asm.Na).apply(null,arguments)},ck=u._Sigmoid=function(){return(ck=u._Sigmoid=u.asm.Oa).apply(null,arguments)},hk=u._Sin=function(){return(hk=u._Sin=u.asm.Pa).apply(null,arguments)},dk=u._Softmax=function(){return(dk=u._Softmax=u.asm.Qa).apply(null,arguments)},pk=u._Sqrt=function(){return(pk=u._Sqrt=u.asm.Ra).apply(null,arguments)},fk=u._Square=function(){return(fk=u._Square=u.asm.Sa).apply(null,arguments)},mk=u._SquaredDifference=function(){return(mk=u._SquaredDifference=u.asm.Ta).apply(null,arguments)},Ak=u._Step=function(){return(Ak=u._Step=u.asm.Ua).apply(null,arguments)},yk=u._StridedSlice=function(){return(yk=u._StridedSlice=u.asm.Va).apply(null,arguments)},gk=u._Sub=function(){return(gk=u._Sub=u.asm.Wa).apply(null,arguments)},xk=u._Sum=function(){return(xk=u._Sum=u.asm.Xa).apply(null,arguments)},wk=u._Tan=function(){return(wk=u._Tan=u.asm.Ya).apply(null,arguments)},bk=u._Tanh=function(){return(bk=u._Tanh=u.asm.Za).apply(null,arguments)},_k=u._Tile=function(){return(_k=u._Tile=u.asm._a).apply(null,arguments)},vk=u._TopK=function(){return(vk=u._TopK=u.asm.$a).apply(null,arguments)},kk=u._Transpose=function(){return(kk=u._Transpose=u.asm.ab).apply(null,arguments)},Ik=u.__FusedMatMul=function(){return(Ik=u.__FusedMatMul=u.asm.bb).apply(null,arguments)},ns=u._malloc=function(){return(ns=u._malloc=u.asm.cb).apply(null,arguments)},su=u._free=function(){return(su=u._free=u.asm.db).apply(null,arguments)},_g=u.___errno_location=function(){return(_g=u.___errno_location=u.asm.eb).apply(null,arguments)},vg=u._emscripten_get_global_libc=function(){return(vg=u._emscripten_get_global_libc=u.asm.fb).apply(null,arguments)},Hi=u._pthread_self=function(){return(Hi=u._pthread_self=u.asm.gb).apply(null,arguments)},kg=u.___pthread_tsd_run_dtors=function(){return(kg=u.___pthread_tsd_run_dtors=u.asm.hb).apply(null,arguments)},nf=u._emscripten_main_thread_process_queued_calls=function(){return(nf=u._emscripten_main_thread_process_queued_calls=u.asm.ib).apply(null,arguments)},Sk=u._emscripten_current_thread_process_queued_calls=function(){return(Sk=u._emscripten_current_thread_process_queued_calls=u.asm.jb).apply(null,arguments)},Ig=u._emscripten_register_main_browser_thread_id=function(){return(Ig=u._emscripten_register_main_browser_thread_id=u.asm.kb).apply(null,arguments)},Sg=u.__emscripten_do_dispatch_to_thread=function(){return(Sg=u.__emscripten_do_dispatch_to_thread=u.asm.lb).apply(null,arguments)},Ng=u._emscripten_sync_run_in_main_thread_4=function(){return(Ng=u._emscripten_sync_run_in_main_thread_4=u.asm.mb).apply(null,arguments)},Tg=u._emscripten_run_in_main_runtime_thread_js=function(){return(Tg=u._emscripten_run_in_main_runtime_thread_js=u.asm.nb).apply(null,arguments)},rf=u.__emscripten_call_on_thread=function(){return(rf=u.__emscripten_call_on_thread=u.asm.ob).apply(null,arguments)},Nk=u._emscripten_tls_init=function(){return(Nk=u._emscripten_tls_init=u.asm.pb).apply(null,arguments)},af=u.__emscripten_thread_init=function(){return(af=u.__emscripten_thread_init=u.asm.qb).apply(null,arguments)},iu=u.stackSave=function(){return(iu=u.stackSave=u.asm.rb).apply(null,arguments)},Gi=u.stackRestore=function(){return(Gi=u.stackRestore=u.asm.sb).apply(null,arguments)},qi=u.stackAlloc=function(){return(qi=u.stackAlloc=u.asm.tb).apply(null,arguments)},Eg=u._emscripten_stack_set_limits=function(){return(Eg=u._emscripten_stack_set_limits=u.asm.ub).apply(null,arguments)},Cg=u._memalign=function(){return(Cg=u._memalign=u.asm.vb).apply(null,arguments)},Rg=u.__emscripten_allow_main_runtime_queued_calls=9808,Xi=u.__emscripten_main_thread_futex=11432;u.cwrap=Fe,u.PThread=_e,u.PThread=_e,u.wasmMemory=Q,u.ExitStatus=ou;var wh;function ou(S){this.name="ExitStatus",this.message="Program terminated with exit("+S+")",this.status=S}es=function S(){wh||sf(),wh||(es=S)};function sf(S){if(S=S||f,Jr>0)return;if(b){h(u),Yl(),postMessage({cmd:"loaded"});return}if(z0(),Jr>0)return;function T(){wh||(wh=!0,u.calledRun=!0,!oe&&(Yl(),P0(),h(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),gn()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),T()},1)):T()}u.run=sf;function Tk(S,T){if(!(T&&ie&&S===0)){if(!T&&b)throw postMessage({cmd:"exitProcess",returnCode:S}),new ou(S);ie||(_e.terminateAllThreads(),me=S,eh(),u.onExit&&u.onExit(S),oe=!0),y(S,new ou(S))}}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return b&&(ie=!1,_e.initWorker()),sf(),a.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=n)}),Xk=wt((e,t)=>{var n=function(){var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(a){a=a||{};var s=typeof a!="undefined"?a:{},i,o;s.ready=new Promise(function(K,ne){i=K,o=ne});var l={},c;for(c in s)s.hasOwnProperty(c)&&(l[c]=s[c]);var u=[],h="./this.program",d=function(K,ne){throw ne},p=!1,m=!1,f=!1,A=!1;p=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",A=!p&&!f&&!m;var y="";function g(K){return s.locateFile?s.locateFile(K,y):y+K}var x,v,w,b,k,N;f?(m?y=uu().dirname(y)+"/":y=__dirname+"/",x=function(K,ne){return k||(k=require("fs")),N||(N=uu()),K=N.normalize(K),k.readFileSync(K,ne?null:"utf8")},w=function(K){var ne=x(K,!0);return ne.buffer||(ne=new Uint8Array(ne)),X(ne.buffer),ne},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",function(K){if(!(K instanceof tf))throw K}),process.on("unhandledRejection",Rr),d=function(K){process.exit(K)},s.inspect=function(){return"[Emscripten Module object]"}):A?(typeof read!="undefined"&&(x=function(K){return read(K)}),w=function(K){var ne;return typeof readbuffer=="function"?new Uint8Array(readbuffer(K)):(ne=read(K,"binary"),X(typeof ne=="object"),ne)},typeof scriptArgs!="undefined"?u=scriptArgs:typeof arguments!="undefined"&&(u=arguments),typeof quit=="function"&&(d=function(K){quit(K)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(p||m)&&(m?y=self.location.href:typeof document!="undefined"&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y.indexOf("blob:")!==0?y=y.substr(0,y.lastIndexOf("/")+1):y="",x=function(K){var ne=new XMLHttpRequest;return ne.open("GET",K,!1),ne.send(null),ne.responseText},m&&(w=function(K){var ne=new XMLHttpRequest;return ne.open("GET",K,!1),ne.responseType="arraybuffer",ne.send(null),new Uint8Array(ne.response)}),v=function(K,ne,Se){var Ke=new XMLHttpRequest;Ke.open("GET",K,!0),Ke.responseType="arraybuffer",Ke.onload=function(){if(Ke.status==200||Ke.status==0&&Ke.response){ne(Ke.response);return}Se()},Ke.onerror=Se,Ke.send(null)},b=function(K){document.title=K});var C=s.print||console.log.bind(console),F=s.printErr||console.warn.bind(console);for(c in l)l.hasOwnProperty(c)&&(s[c]=l[c]);l=null,s.arguments&&(u=s.arguments),s.thisProgram&&(h=s.thisProgram),s.quit&&(d=s.quit);var O;s.wasmBinary&&(O=s.wasmBinary);var z=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Rr("no native wasm support detected");var V,j=!1,U;function X(K,ne){K||Rr("Assertion failed: "+ne)}function G(K){var ne=s["_"+K];return X(ne,"Cannot call unknown function "+K+", make sure it is exported"),ne}function ee(K,ne,Se,Ke,It){var mt={string:function(Un){var ba=0;if(Un!=null&&Un!==0){var xh=(Un.length<<2)+1;ba=nu(xh),ce(Un,ba,xh)}return ba},array:function(Un){var ba=nu(Un.length);return oe(Un,ba),ba}};function je(Un){return ne==="string"?ie(Un):ne==="boolean"?Boolean(Un):Un}var He=G(K),Zt=[],ea=0;if(Ke)for(var ta=0;ta=Ke);)++It;if(It-ne>16&&K.subarray&&ae)return ae.decode(K.subarray(ne,It));for(var mt="";ne>10,56320|ea&1023)}}return mt}function ie(K,ne){return K?te(Ie,K,ne):""}function Q(K,ne,Se,Ke){if(!(Ke>0))return 0;for(var It=Se,mt=Se+Ke-1,je=0;je=55296&&He<=57343){var Zt=K.charCodeAt(++je);He=65536+((He&1023)<<10)|Zt&1023}if(He<=127){if(Se>=mt)break;ne[Se++]=He}else if(He<=2047){if(Se+1>=mt)break;ne[Se++]=192|He>>6,ne[Se++]=128|He&63}else if(He<=65535){if(Se+2>=mt)break;ne[Se++]=224|He>>12,ne[Se++]=128|He>>6&63,ne[Se++]=128|He&63}else{if(Se+3>=mt)break;ne[Se++]=240|He>>18,ne[Se++]=128|He>>12&63,ne[Se++]=128|He>>6&63,ne[Se++]=128|He&63}}return ne[Se]=0,Se-It}function ce(K,ne,Se){return Q(K,Ie,ne,Se)}function oe(K,ne){ve.set(K,ne)}function me(K,ne){return K%ne>0&&(K+=ne-K%ne),K}var de,ve,Ie,Fe,Oe,$e,Qe,et,at;function Xe(K){de=K,s.HEAP8=ve=new Int8Array(K),s.HEAP16=Fe=new Int16Array(K),s.HEAP32=$e=new Int32Array(K),s.HEAPU8=Ie=new Uint8Array(K),s.HEAPU16=Oe=new Uint16Array(K),s.HEAPU32=Qe=new Uint32Array(K),s.HEAPF32=et=new Float32Array(K),s.HEAPF64=at=new Float64Array(K)}var ht=s.INITIAL_MEMORY||16777216,Ve,An=[],xt=[],Vn=[],Xt=[],yn=!1;xt.push({func:function(){ih()}});function jn(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Cr(s.preRun.shift());ga(An)}function Rn(){yn=!0,ga(xt)}function rn(){ga(Vn)}function Kt(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)tr(s.postRun.shift());ga(Xt)}function Cr(K){An.unshift(K)}function tr(K){Xt.unshift(K)}var nr=0,Aa=null,Yr=null;function ya(K){nr++,s.monitorRunDependencies&&s.monitorRunDependencies(nr)}function Wi(K){if(nr--,s.monitorRunDependencies&&s.monitorRunDependencies(nr),nr==0&&(Aa!==null&&(clearInterval(Aa),Aa=null),Yr)){var ne=Yr;Yr=null,ne()}}s.preloadedImages={},s.preloadedAudios={};function Rr(K){s.onAbort&&s.onAbort(K),K+="",F(K),j=!0,U=1,K="abort("+K+"). Build with -s ASSERTIONS=1 for more info.";var ne=new WebAssembly.RuntimeError(K);throw o(ne),ne}function Qc(K,ne){return String.prototype.startsWith?K.startsWith(ne):K.indexOf(ne)===0}var z0="data:application/octet-stream;base64,";function Yl(K){return Qc(K,z0)}var P0="file://";function eh(K){return Qc(K,P0)}var gn="tfjs-backend-wasm.wasm";Yl(gn)||(gn=g(gn));function th(K){try{if(K==gn&&O)return new Uint8Array(O);if(w)return w(K);throw"both async and sync fetching of the wasm failed"}catch(ne){Rr(ne)}}function L0(){if(!O&&(p||m)){if(typeof fetch=="function"&&!eh(gn))return fetch(gn,{credentials:"same-origin"}).then(function(K){if(!K.ok)throw"failed to load wasm binary file at '"+gn+"'";return K.arrayBuffer()}).catch(function(){return th(gn)});if(v)return new Promise(function(K,ne){v(gn,function(Se){K(new Uint8Array(Se))},ne)})}return Promise.resolve().then(function(){return th(gn)})}function Jr(){var K={a:U0};function ne(je,He){var Zt=je.exports;s.asm=Zt,V=s.asm.i,Xe(V.buffer),Ve=s.asm.o,Wi("wasm-instantiate")}ya("wasm-instantiate");function Se(je){ne(je.instance)}function Ke(je){return L0().then(function(He){return WebAssembly.instantiate(He,K)}).then(je,function(He){F("failed to asynchronously prepare wasm: "+He),Rr(He)})}function It(){return!O&&typeof WebAssembly.instantiateStreaming=="function"&&!Yl(gn)&&!eh(gn)&&typeof fetch=="function"?fetch(gn,{credentials:"same-origin"}).then(function(je){var He=WebAssembly.instantiateStreaming(je,K);return He.then(Se,function(Zt){return F("wasm streaming compile failed: "+Zt),F("falling back to ArrayBuffer instantiation"),Ke(Se)})}):Ke(Se)}if(s.instantiateWasm)try{var mt=s.instantiateWasm(K,ne);return mt}catch(je){return F("Module.instantiateWasm callback failed with error: "+je),!1}return It().catch(o),{}}function ga(K){for(;K.length>0;){var ne=K.shift();if(typeof ne=="function"){ne(s);continue}var Se=ne.func;typeof Se=="number"?ne.arg===void 0?Ve.get(Se)():Ve.get(Se)(ne.arg):Se(ne.arg===void 0?null:ne.arg)}}function es(){Rr()}function W0(K,ne,Se){Ie.copyWithin(K,ne,ne+Se)}function B0(){return Ie.length}function Qr(K){try{return V.grow(K-de.byteLength+65535>>>16),Xe(V.buffer),1}catch(ne){}}function nh(K){var ne=B0(),Se=2147483648;if(K>Se)return!1;for(var Ke=1;Ke<=4;Ke*=2){var It=ne*(1+.2/Ke);It=Math.min(It,K+100663296);var mt=Math.min(Se,me(Math.max(K,It),65536)),je=Qr(mt);if(je)return!0}return!1}var Bi={mappings:{},buffers:[null,[],[]],printChar:function(K,ne){var Se=Bi.buffers[K];ne===0||ne===10?((K===1?C:F)(te(Se,0)),Se.length=0):Se.push(ne)},varargs:void 0,get:function(){Bi.varargs+=4;var K=$e[Bi.varargs-4>>2];return K},getStr:function(K){var ne=ie(K);return ne},get64:function(K,ne){return K}};function rh(K){return 0}function V0(K,ne,Se,Ke,It){}function ah(K,ne,Se,Ke){for(var It=0,mt=0;mt>2],He=$e[ne+(mt*8+4)>>2],Zt=0;Zt>2]=It,0}function xn(){return 6}function sh(K){return $e[mh()>>2]=K,K}function j0(K){switch(K){case 30:return 16384;case 85:var ne=2147483648;return ne/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return sh(28),-1}var U0={a:es,d:W0,e:nh,f:rh,c:V0,b:ah,g:xn,h:j0},H0=Jr(),ih=s.___wasm_call_ctors=function(){return(ih=s.___wasm_call_ctors=s.asm.j).apply(null,arguments)},Vi=s._init=function(){return(Vi=s._init=s.asm.k).apply(null,arguments)},Jl=s._register_tensor=function(){return(Jl=s._register_tensor=s.asm.l).apply(null,arguments)},G0=s._dispose_data=function(){return(G0=s._dispose_data=s.asm.m).apply(null,arguments)},q0=s._dispose=function(){return(q0=s._dispose=s.asm.n).apply(null,arguments)},X0=s._Abs=function(){return(X0=s._Abs=s.asm.p).apply(null,arguments)},_e=s._Add=function(){return(_e=s._Add=s.asm.q).apply(null,arguments)},K0=s._AddN=function(){return(K0=s._AddN=s.asm.r).apply(null,arguments)},Z0=s._All=function(){return(Z0=s._All=s.asm.s).apply(null,arguments)},Y0=s._Any=function(){return(Y0=s._Any=s.asm.t).apply(null,arguments)},J0=s._ArgMax=function(){return(J0=s._ArgMax=s.asm.u).apply(null,arguments)},Q0=s._AvgPool=function(){return(Q0=s._AvgPool=s.asm.v).apply(null,arguments)},ts=s._BatchMatMul=function(){return(ts=s._BatchMatMul=s.asm.w).apply(null,arguments)},e1=s._Ceil=function(){return(e1=s._Ceil=s.asm.x).apply(null,arguments)},t1=s._ClipByValue=function(){return(t1=s._ClipByValue=s.asm.y).apply(null,arguments)},n1=s._Conv2D=function(){return(n1=s._Conv2D=s.asm.z).apply(null,arguments)},r1=s._Conv2DBackpropInput=function(){return(r1=s._Conv2DBackpropInput=s.asm.A).apply(null,arguments)},a1=s._Cos=function(){return(a1=s._Cos=s.asm.B).apply(null,arguments)},s1=s._CropAndResize=function(){return(s1=s._CropAndResize=s.asm.C).apply(null,arguments)},i1=s._Cumsum=function(){return(i1=s._Cumsum=s.asm.D).apply(null,arguments)},o1=s._DepthToSpace=function(){return(o1=s._DepthToSpace=s.asm.E).apply(null,arguments)},l1=s._DepthwiseConv2dNative=function(){return(l1=s._DepthwiseConv2dNative=s.asm.F).apply(null,arguments)},xa=s._Equal=function(){return(xa=s._Equal=s.asm.G).apply(null,arguments)},Ql=s._Exp=function(){return(Ql=s._Exp=s.asm.H).apply(null,arguments)},eu=s._FlipLeftRight=function(){return(eu=s._FlipLeftRight=s.asm.I).apply(null,arguments)},u1=s._Floor=function(){return(u1=s._Floor=s.asm.J).apply(null,arguments)},c1=s._FloorDiv=function(){return(c1=s._FloorDiv=s.asm.K).apply(null,arguments)},h1=s._FusedBatchNorm=function(){return(h1=s._FusedBatchNorm=s.asm.L).apply(null,arguments)},d1=s._FusedConv2D=function(){return(d1=s._FusedConv2D=s.asm.M).apply(null,arguments)},p1=s._FusedDepthwiseConv2D=function(){return(p1=s._FusedDepthwiseConv2D=s.asm.N).apply(null,arguments)},Pe=s._Gather=function(){return(Pe=s._Gather=s.asm.O).apply(null,arguments)},f1=s._GatherNd=function(){return(f1=s._GatherNd=s.asm.P).apply(null,arguments)},m1=s._Greater=function(){return(m1=s._Greater=s.asm.Q).apply(null,arguments)},A1=s._GreaterEqual=function(){return(A1=s._GreaterEqual=s.asm.R).apply(null,arguments)},y1=s._LeakyRelu=function(){return(y1=s._LeakyRelu=s.asm.S).apply(null,arguments)},g1=s._Less=function(){return(g1=s._Less=s.asm.T).apply(null,arguments)},x1=s._LessEqual=function(){return(x1=s._LessEqual=s.asm.U).apply(null,arguments)},tu=s._Log=function(){return(tu=s._Log=s.asm.V).apply(null,arguments)},oh=s._LogicalAnd=function(){return(oh=s._LogicalAnd=s.asm.W).apply(null,arguments)},lh=s._Max=function(){return(lh=s._Max=s.asm.X).apply(null,arguments)},w1=s._MaxPool=function(){return(w1=s._MaxPool=s.asm.Y).apply(null,arguments)},b1=s._Maximum=function(){return(b1=s._Maximum=s.asm.Z).apply(null,arguments)},_1=s._Mean=function(){return(_1=s._Mean=s.asm._).apply(null,arguments)},v1=s._Min=function(){return(v1=s._Min=s.asm.$).apply(null,arguments)},k1=s._Minimum=function(){return(k1=s._Minimum=s.asm.aa).apply(null,arguments)},I1=s._MirrorPad=function(){return(I1=s._MirrorPad=s.asm.ba).apply(null,arguments)},S1=s._Multiply=function(){return(S1=s._Multiply=s.asm.ca).apply(null,arguments)},Je=s._Neg=function(){return(Je=s._Neg=s.asm.da).apply(null,arguments)},N1=s._NonMaxSuppressionV3=function(){return(N1=s._NonMaxSuppressionV3=s.asm.ea).apply(null,arguments)},T1=s._NonMaxSuppressionV4=function(){return(T1=s._NonMaxSuppressionV4=s.asm.fa).apply(null,arguments)},E1=s._NonMaxSuppressionV5=function(){return(E1=s._NonMaxSuppressionV5=s.asm.ga).apply(null,arguments)},ji=s._NotEqual=function(){return(ji=s._NotEqual=s.asm.ha).apply(null,arguments)},uh=s._OneHot=function(){return(uh=s._OneHot=s.asm.ia).apply(null,arguments)},ch=s._PadV2=function(){return(ch=s._PadV2=s.asm.ja).apply(null,arguments)},hh=s._Pow=function(){return(hh=s._Pow=s.asm.ka).apply(null,arguments)},C1=s._Prelu=function(){return(C1=s._Prelu=s.asm.la).apply(null,arguments)},R1=s._Prod=function(){return(R1=s._Prod=s.asm.ma).apply(null,arguments)},dh=s._RealDiv=function(){return(dh=s._RealDiv=s.asm.na).apply(null,arguments)},M1=s._Relu=function(){return(M1=s._Relu=s.asm.oa).apply(null,arguments)},ph=s._Relu6=function(){return(ph=s._Relu6=s.asm.pa).apply(null,arguments)},wa=s._ResizeBilinear=function(){return(wa=s._ResizeBilinear=s.asm.qa).apply(null,arguments)},F1=s._Reverse=function(){return(F1=s._Reverse=s.asm.ra).apply(null,arguments)},$1=s._RotateWithOffset=function(){return($1=s._RotateWithOffset=s.asm.sa).apply(null,arguments)},bg=s._Round=function(){return(bg=s._Round=s.asm.ta).apply(null,arguments)},fh=s._Rsqrt=function(){return(fh=s._Rsqrt=s.asm.ua).apply(null,arguments)},D1=s._ScatterNd=function(){return(D1=s._ScatterNd=s.asm.va).apply(null,arguments)},O1=s._SelectV2=function(){return(O1=s._SelectV2=s.asm.wa).apply(null,arguments)},z1=s._Sigmoid=function(){return(z1=s._Sigmoid=s.asm.xa).apply(null,arguments)},P1=s._Sin=function(){return(P1=s._Sin=s.asm.ya).apply(null,arguments)},L1=s._Softmax=function(){return(L1=s._Softmax=s.asm.za).apply(null,arguments)},W1=s._Sqrt=function(){return(W1=s._Sqrt=s.asm.Aa).apply(null,arguments)},B1=s._Square=function(){return(B1=s._Square=s.asm.Ba).apply(null,arguments)},V1=s._SquaredDifference=function(){return(V1=s._SquaredDifference=s.asm.Ca).apply(null,arguments)},j1=s._Step=function(){return(j1=s._Step=s.asm.Da).apply(null,arguments)},U1=s._StridedSlice=function(){return(U1=s._StridedSlice=s.asm.Ea).apply(null,arguments)},H1=s._Sub=function(){return(H1=s._Sub=s.asm.Fa).apply(null,arguments)},G1=s._Sum=function(){return(G1=s._Sum=s.asm.Ga).apply(null,arguments)},q1=s._Tan=function(){return(q1=s._Tan=s.asm.Ha).apply(null,arguments)},X1=s._Tanh=function(){return(X1=s._Tanh=s.asm.Ia).apply(null,arguments)},K1=s._Tile=function(){return(K1=s._Tile=s.asm.Ja).apply(null,arguments)},Z1=s._TopK=function(){return(Z1=s._TopK=s.asm.Ka).apply(null,arguments)},Y1=s._Transpose=function(){return(Y1=s._Transpose=s.asm.La).apply(null,arguments)},J1=s.__FusedMatMul=function(){return(J1=s.__FusedMatMul=s.asm.Ma).apply(null,arguments)},Q1=s._malloc=function(){return(Q1=s._malloc=s.asm.Na).apply(null,arguments)},ef=s._free=function(){return(ef=s._free=s.asm.Oa).apply(null,arguments)},mh=s.___errno_location=function(){return(mh=s.___errno_location=s.asm.Pa).apply(null,arguments)},Ah=s.stackSave=function(){return(Ah=s.stackSave=s.asm.Qa).apply(null,arguments)},yh=s.stackRestore=function(){return(yh=s.stackRestore=s.asm.Ra).apply(null,arguments)},nu=s.stackAlloc=function(){return(nu=s.stackAlloc=s.asm.Sa).apply(null,arguments)};s.cwrap=Y;var Ui;function tf(K){this.name="ExitStatus",this.message="Program terminated with exit("+K+")",this.status=K}Yr=function K(){Ui||ru(),Ui||(Yr=K)};function ru(K){if(K=K||u,nr>0||(jn(),nr>0))return;function ne(){Ui||(Ui=!0,s.calledRun=!0,!j&&(Rn(),rn(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),Kt()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),ne()},1)):ne()}if(s.run=ru,s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return ru(),a.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModule=n)}),Kk=wt((e,t)=>{(function(n,r,a){function s(c){var u=this,h=l();u.next=function(){var d=2091639*u.s0+u.c*23283064365386963e-26;return u.s0=u.s1,u.s1=u.s2,u.s2=d-(u.c=d|0)},u.c=1,u.s0=h(" "),u.s1=h(" "),u.s2=h(" "),u.s0-=h(c),u.s0<0&&(u.s0+=1),u.s1-=h(c),u.s1<0&&(u.s1+=1),u.s2-=h(c),u.s2<0&&(u.s2+=1),h=null}function i(c,u){return u.c=c.c,u.s0=c.s0,u.s1=c.s1,u.s2=c.s2,u}function o(c,u){var h=new s(c),d=u&&u.state,p=h.next;return p.int32=function(){return h.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,d&&(typeof d=="object"&&i(d,h),p.state=function(){return i(h,{})}),p}function l(){var c=4022871197,u=function(h){h=String(h);for(var d=0;d>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return u}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Zk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var d=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^d^d>>>8},l===(l|0)?c.x=l:u+=l;for(var h=0;h>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Yk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.next=function(){var d=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(d^d<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,l===(l|0)?c.x=l:u+=l;for(var h=0;h>>4),c.next()}function i(l,c){return c.x=l.x,c.y=l.y,c.z=l.z,c.w=l.w,c.v=l.v,c.d=l.d,c}function o(l,c){var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Jk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this;c.next=function(){var h=c.x,d=c.i,p,m,f;return p=h[d],p^=p>>>7,m=p^p<<24,p=h[d+1&7],m^=p^p>>>10,p=h[d+3&7],m^=p^p>>>3,p=h[d+4&7],m^=p^p<<7,p=h[d+7&7],p=p^p<<13,m^=p^p<<9,h[d]=m,c.i=d+1&7,m};function u(h,d){var p,m,f=[];if(d===(d|0))m=f[0]=d;else for(d=""+d,p=0;p0;--p)h.next()}u(c,l)}function i(l,c){return c.x=l.x.slice(),c.i=l.i,c}function o(l,c){l==null&&(l=+new Date);var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(h.x&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),Qk=wt((e,t)=>{(function(n,r,a){function s(l){var c=this;c.next=function(){var h=c.w,d=c.X,p=c.i,m,f;return c.w=h=h+1640531527|0,f=d[p+34&127],m=d[p=p+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=d[p]=f^m,c.i=p,f+(h^h>>>16)|0};function u(h,d){var p,m,f,A,y,g=[],x=128;for(d===(d|0)?(m=d,d=null):(d=d+"\0",m=0,x=Math.max(x,d.length)),f=0,A=-32;A>>15,m^=m<<4,m^=m>>>13,A>=0&&(y=y+1640531527|0,p=g[A&127]^=m+y,f=p==0?f+1:0);for(f>=128&&(g[(d&&d.length||0)&127]=-1),f=127,A=4*128;A>0;--A)m=g[f+34&127],p=g[f=f+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,g[f]=m^p;h.w=y,h.X=g,h.i=f}u(c,l)}function i(l,c){return c.i=l.i,c.w=l.w,c.X=l.X.slice(),c}function o(l,c){l==null&&(l=+new Date);var u=new s(l),h=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(h.X&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),e9=wt((e,t)=>{(function(n,r,a){function s(l){var c=this,u="";c.next=function(){var d=c.b,p=c.c,m=c.d,f=c.a;return d=d<<25^d>>>7^p,p=p-m|0,m=m<<24^m>>>8^f,f=f-d|0,c.b=d=d<<20^d>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^f,c.a=f-d|0},c.a=0,c.b=0,c.c=2654435769|0,c.d=1367130551,l===Math.floor(l)?(c.a=l/4294967296|0,c.b=l|0):u+=l;for(var h=0;h>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(p+m)/(1<<21);while(f===0);return f},d.int32=u.next,d.quick=d,h&&(typeof h=="object"&&i(h,u),d.state=function(){return i(u,{})}),d}r&&r.exports?r.exports=o:a&&a.amd?a(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),t9=wt((e,t)=>{(function(n,r,a){var s=256,i=6,o=52,l="random",c=a.pow(s,i),u=a.pow(2,o),h=u*2,d=s-1,p;function m(w,b,k){var N=[];b=b==!0?{entropy:!0}:b||{};var C=g(y(b.entropy?[w,v(r)]:w==null?x():w,3),N),F=new f(N),O=function(){for(var z=F.g(i),V=c,j=0;z=h;)z/=2,V/=2,j>>>=1;return(z+j)/V};return O.int32=function(){return F.g(4)|0},O.quick=function(){return F.g(4)/4294967296},O.double=O,g(v(F.S),r),(b.pass||k||function(z,V,j,U){return U&&(U.S&&A(U,F),z.state=function(){return A(F,{})}),j?(a[l]=z,V):z})(O,C,"global"in b?b.global:this==a,b.state)}function f(w){var b,k=w.length,N=this,C=0,F=N.i=N.j=0,O=N.S=[];for(k||(w=[k++]);C{var n=Kk(),r=Zk(),a=Yk(),s=Jk(),i=Qk(),o=e9(),l=t9();l.alea=n,l.xor128=r,l.xorwow=a,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),n9=wt(()=>{}),of={};Me(of,{bin:()=>Xg,browser:()=>e5,default:()=>r9,dependencies:()=>Qg,description:()=>Wg,devDependencies:()=>Yg,jsdelivr:()=>Ug,license:()=>Zg,main:()=>Vg,miniprogram:()=>qg,module:()=>jg,name:()=>Pg,private:()=>Bg,repository:()=>Kg,scripts:()=>Jg,types:()=>Gg,unpkg:()=>Hg,version:()=>Lg});var Pg="@tensorflow/tfjs",Lg="3.5.0",Wg="An open-source machine learning framework.",Bg=!1,Vg="dist/tf.node.js",jg="dist/index.js",Ug="dist/tf.min.js",Hg="dist/tf.min.js",Gg="dist/index.d.ts",qg="dist/miniprogram",Xg={"tfjs-custom-module":"dist/tools/custom_module/cli.js"},Kg={type:"git",url:"https://github.com/tensorflow/tfjs.git"},Zg="Apache-2.0",Yg={"@babel/core":"^7.9.0","@babel/polyfill":"^7.10.4","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@types/argparse":"^1.0.38","@types/jasmine":"2.8.7","@types/node":"~10.17.50","@types/shelljs":"^0.8.4","@types/yargs":"^15.0.7","clang-format":"~1.2.2",commander:"~2.14.1",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~4.2.2",shelljs:"~0.8.1","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"1.0.0-pre.50"},Jg={build:"tsc && yarn build-cli && yarn bundle","build-ci":"tsc && yarn build-cli && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-converter":"cd ../tfjs-converter && yarn && yarn build","build-converter-ci":"cd ../tfjs-converter && yarn && yarn build-ci","build-data":"cd ../tfjs-data && yarn && yarn build","build-data-ci":"cd ../tfjs-data && yarn && yarn build-ci","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-converter && yarn build-data && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-cli":"tsc --project ./tools/custom_module/tsconfig.json && chmod +x ./dist/tools/custom_module/cli.js","run-custom-build":"ts-node -s ./tools/custom_module/cli.ts","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",test:"yarn && yarn build-deps && yarn build && karma start","test-dev":"karma start","test-tools":"ts-node --project ./tools/custom_module/tsconfig.json run_tools_tests.ts","test-ci":"./scripts/test-ci.sh"},Qg={"@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-backend-webgl":"3.5.0","@tensorflow/tfjs-converter":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@tensorflow/tfjs-data":"3.5.0","@tensorflow/tfjs-layers":"3.5.0",argparse:"^1.0.10",chalk:"^4.1.0","core-js":"3","regenerator-runtime":"^0.13.5",yargs:"^16.0.3"},e5={"node-fetch":!1,util:!1,crypto:!1},r9={name:Pg,version:Lg,description:Wg,private:Bg,main:Vg,module:jg,jsdelivr:Ug,unpkg:Hg,types:Gg,miniprogram:qg,bin:Xg,repository:Kg,license:Zg,devDependencies:Yg,scripts:Jg,dependencies:Qg,browser:e5},lf={};Me(lf,{browser:()=>g5,default:()=>a9,dependencies:()=>y5,description:()=>r5,devDependencies:()=>m5,engines:()=>d5,jsdelivr:()=>i5,"jsnext:main":()=>u5,license:()=>f5,main:()=>s5,miniprogram:()=>h5,module:()=>c5,name:()=>t5,private:()=>a5,repository:()=>p5,scripts:()=>A5,sideEffects:()=>x5,types:()=>l5,unpkg:()=>o5,version:()=>n5});var t5="@tensorflow/tfjs-core",n5="3.5.0",r5="Hardware-accelerated JavaScript library for machine intelligence",a5=!1,s5="dist/tf-core.node.js",i5="dist/tf-core.min.js",o5="dist/tf-core.min.js",l5="dist/index.d.ts",u5="dist/index.js",c5="dist/index.js",h5="dist/miniprogram",d5={yarn:">= 1.3.2"},p5={type:"git",url:"https://github.com/tensorflow/tfjs-core.git"},f5="Apache-2.0",m5={"@bazel/bazelisk":"^1.3.0","@bazel/typescript":"^0.27.8","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"link:../tfjs-backend-cpu","@types/jasmine":"~3.0.0","@types/node":"~9.6.0","@types/node-fetch":"~2.1.2","clang-format":"~1.2.4",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-jasmine":"~1.1.0","karma-typescript":"~4.1.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2",shelljs:"~0.8.3","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"~1.0.0-pre.21",yargs:"~13.2.2"},A5={"build-ci":"./scripts/enumerate-tests.js --ci && tsc && yarn bundle-ci && yarn build-test-snippets",build:"node ./scripts/enumerate-tests.js && tsc && yarn bundle",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-npm":"./scripts/build-npm.sh","build-deps":"yarn build && yarn build-cpu-backend","build-cpu-backend":"cd ../tfjs-backend-cpu && yarn && yarn build","build-cpu-backend-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build:bazel":"bazelisk build //...","build-test-snippets":"yarn tsc --project ./scripts/test_snippets/tsconfig.json","format-all":"clang-format -i -style=Google --glob=src/**/*.ts","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build && rollup -c && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-webworker":"karma start --worker","run-browserstack":"karma start --browserstack","test-bundle-size":"./scripts/test-bundle-size.js","test-node":"rimraf dist/ && yarn build-deps && yarn build && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-dev":"tsc && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_node.js","test-async-backends":"rimraf dist/ && yarn build && ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-async-backends-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-snippets":"yarn build && yarn build-cpu-backend && ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts","test-snippets-ci":"ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts"},y5={"@types/offscreencanvas":"~2019.3.0","@types/seedrandom":"2.4.27","@types/webgl-ext":"0.0.30","node-fetch":"~2.6.1",seedrandom:"2.4.3"},g5={"node-fetch":!1,util:!1,crypto:!1,worker_threads:!1},x5=["./dist/index.js","./dist/engine.js","./dist/tensor.js","./dist/base_side_effects.js","./dist/flags.js","./dist/platforms/*.js","./dist/register_all_gradients.js","./dist/public/chained_ops/*.js","./dist/io/*.js"],a9={name:t5,version:n5,description:r5,private:a5,main:s5,jsdelivr:i5,unpkg:o5,types:l5,"jsnext:main":u5,module:c5,miniprogram:h5,engines:d5,repository:p5,license:f5,devDependencies:m5,scripts:A5,dependencies:y5,browser:g5,sideEffects:x5},uf={};Me(uf,{browser:()=>O5,default:()=>s9,dependencies:()=>D5,description:()=>_5,devDependencies:()=>M5,jsdelivr:()=>I5,"jsnext:main":()=>T5,license:()=>R5,main:()=>k5,miniprogram:()=>C5,module:()=>E5,name:()=>w5,peerDependencies:()=>$5,private:()=>v5,scripts:()=>F5,types:()=>N5,unpkg:()=>S5,version:()=>b5});var w5="@tensorflow/tfjs-data",b5="3.5.0",_5="TensorFlow Data API in JavaScript",v5=!1,k5="dist/tf-data.node.js",I5="dist/tf-data.min.js",S5="dist/tf-data.min.js",N5="dist/index.d.ts",T5="dist/index.js",E5="dist/index.js",C5="dist/miniprogram",R5="Apache-2.0",M5={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@tensorflow/tfjs-layers":"3.5.0","@types/jasmine":"~2.5.53","@types/seedrandom":"^2.4.27","@types/utf8":"~2.1.6","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~7.0.0",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"^1.0.0-pre.50"},F5={build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-backend-cpu-ci","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-dev":"tsc && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-browsers":"karma start --browsers='Chrome,Firefox'","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/test_node.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose"},$5={"@tensorflow/tfjs-core":"3.5.0",seedrandom:"~2.4.3"},D5={"@types/node-fetch":"^2.1.2","node-fetch":"~2.6.1"},O5={fs:!1,"node-fetch":!1,string_decoder:!1,crypto:!1},s9={name:w5,version:b5,description:_5,private:v5,main:k5,jsdelivr:I5,unpkg:S5,types:N5,"jsnext:main":T5,module:E5,miniprogram:C5,license:R5,devDependencies:M5,scripts:F5,peerDependencies:$5,dependencies:D5,browser:O5},cf={};Me(cf,{default:()=>i9,description:()=>L5,devDependencies:()=>K5,jsdelivr:()=>G5,"jsnext:main":()=>U5,license:()=>W5,main:()=>V5,miniprogram:()=>X5,module:()=>H5,name:()=>z5,peerDependencies:()=>Y5,private:()=>B5,scripts:()=>Z5,types:()=>j5,unpkg:()=>q5,version:()=>P5});var z5="@tensorflow/tfjs-layers",P5="3.5.0",L5="TensorFlow layers API in JavaScript",W5="Apache-2.0 AND MIT",B5=!1,V5="dist/tf-layers.node.js",j5="dist/index.d.ts",U5="dist/index.js",H5="dist/index.js",G5="dist/tf-layers.min.js",q5="dist/tf-layers.min.js",X5="dist/miniprogram",K5={"@babel/polyfill":"^7.8.7","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-backend-webgl":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@types/jasmine":"~2.5.53","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},Z5={prep:"yarn install && yarn build-ci",build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-npm":"./scripts/build-npm.sh",format:"./tools/clang_format_ts.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts","run-browserstack":"karma start --browsers='bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'",lint:"tslint -p . -t verbose"},Y5={"@tensorflow/tfjs-core":"3.5.0"},i9={name:z5,version:P5,description:L5,license:W5,private:B5,main:V5,types:j5,"jsnext:main":U5,module:H5,jsdelivr:G5,unpkg:q5,miniprogram:X5,devDependencies:K5,scripts:Z5,peerDependencies:Y5},hf={};Me(hf,{default:()=>o9,description:()=>ex,devDependencies:()=>hx,jsdelivr:()=>ix,"jsnext:main":()=>nx,license:()=>ux,main:()=>tx,miniprogram:()=>ox,module:()=>rx,name:()=>J5,peerDependencies:()=>cx,repository:()=>lx,scripts:()=>dx,types:()=>ax,unpkg:()=>sx,version:()=>Q5});var J5="@tensorflow/tfjs-converter",Q5="3.5.0",ex="Tensorflow model converter for javascript",tx="dist/tf-converter.node.js",nx="dist/index.js",rx="dist/index.js",ax="dist/index.d.ts",sx="dist/tf-converter.min.js",ix="dist/tf-converter.min.js",ox="dist/miniprogram",lx={type:"git",url:"https://github.com/tensorflow/tfjs-converter.git"},ux="Apache-2.0",cx={"@tensorflow/tfjs-core":"3.5.0"},hx={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-replace":"^2.3.3","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@types/argparse":"^1.0.38","@types/deep-equal":"^1.0.1","@types/jasmine":"~2.8.6","@types/long":"~3.0.32","@types/node-fetch":"1.6.9",ajv:"~6.3.0",argparse:"^1.0.10","babel-core":"~6.26.3","babel-plugin-external-helpers":"~6.22.0","babel-preset-env":"~1.7.0","clang-format":"~1.2.2",copyfiles:"~1.2.0","deep-equal":"^1.0.1","jasmine-core":"~3.5.0","node-fetch":"~2.6.1",opn:"~5.1.0",protobufjs:"~6.8.6",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-morph":"^7.1.3","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"~0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},dx={build:"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle","build-ci":"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && yarn gen-json --test && yarn gen-kernel2ops && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts","test-dev":"tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose","make-version":"sh -c ./scripts/make-version","gen-doc":"ts-node -s ./scripts/gen_doc.ts","gen-json":"ts-node -s ./scripts/gen_json.ts","model-summary":"ts-node -s ./tools/model_summary.ts",pb2json:"ts-node -s ./tools/pb2json_converter.ts","build-pip-package":"yarn gen-json --test && cd python && ./build-pip-package.sh --test /tmp/tfjs-pips","run-python-tests":"yarn gen-json --test && cd python && ./run-python-tests.sh","gen-kernel2ops":"ts-node -s scripts/kernels_to_ops.ts --out metadata/kernel2op.json"},o9={name:J5,version:Q5,description:ex,main:tx,"jsnext:main":nx,module:rx,types:ax,unpkg:sx,jsdelivr:ix,miniprogram:ox,repository:lx,license:ux,peerDependencies:cx,devDependencies:hx,scripts:dx},l9=1e-7,u9=1e-4,_h=class{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}},cu=class{refCount(e){return ar("refCount")}incRef(e){return ar("incRef")}timerAvailable(){return!0}time(e){return ar("time")}read(e){return ar("read")}readSync(e){return ar("readSync")}numDataIds(){return ar("numDataIds")}disposeData(e,t){return ar("disposeData")}write(e,t,n){return ar("write")}move(e,t,n,r,a){return ar("move")}memory(){return ar("memory")}floatPrecision(){return ar("floatPrecision")}epsilon(){return this.floatPrecision()===32?l9:u9}dispose(){return ar("dispose")}};function ar(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function px(e){let t=e.length,n=0,r=0;for(;t>0;)r=Math.random()*t|0,t--,n=e[t],e[t]=e[r],e[r]=n}function c9(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,r,a,s=0;for(;n>0;)s=Math.random()*n|0,n--,r=e[n],a=t[n],e[n]=e[s],t[n]=t[s],e[s]=r,t[s]=a}function hu(e,t,n){return Math.max(e,Math.min(t,n))}function h9(e){return e%2==0?e:e+1}function d9(e){let t=0;for(let n=0;nn+` Shapes ${e} and ${t} must match`)}function as(e){M(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ss(e,t=[],n=!1){if(t==null&&(t=[]),Array.isArray(e)||tn(e)&&!n)for(let r=0;r0,n){return new Promise((r,a)=>{let s=0,i=()=>{if(e()){r();return}s++;let o=t(s);if(n!=null&&s>=n){a();return}setTimeout(i,o)};i()})}function w9(e,t){let n=1,r=-1;for(let s=0;s=0)n*=e[s];else if(e[s]===-1){if(r!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${s}`);r=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(r===-1){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(n===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);let a=e.slice();return a[r]=t/n,a}function sr(e,t){let n=t.length;return e=e==null?t.map((r,a)=>a):[].concat(e),M(e.every(r=>r>=-n&&r`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),M(e.every(r=>Bt(r)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(r=>r<0?n+r:r)}function fx(e,t){let n=[],r=[],a=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||a?null:sr(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(n.push(e[o]),r.push(o)),s[i]<=o&&i++}e[o]!==1&&(n.push(e[o]),r.push(o))}return{newShape:n,keptDims:r}}function mx(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else throw new Error(`Unknown data type ${e}`);return n}function Ax(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else if(e==="string")n=new Array(t);else throw new Error(`Unknown data type ${e}`);return n}function yx(e,t){for(let n=0;nt+=n.length),t}function va(e){return typeof e=="string"||e instanceof String}function wx(e){return typeof e=="boolean"}function bx(e){return typeof e=="number"}function vh(e){return Array.isArray(e)?vh(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":bx(e)?"float32":va(e)?"string":wx(e)?"bool":"float32"}function ka(e){return!!(e&&e.constructor&&e.call&&e.apply)}function kh(e,t){for(let n=t;n=0;--r)n[r]=n[r+1]*e[r+1];return n}function _x(e,t,n,r=!1){let a=new Array;if(t.length===1){let s=t[0]*(r?2:1);for(let i=0;il*c)*(r?2:1);for(let l=0;la*s)*(n?2:1);if(r===0)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return _x(0,e,t,n)}function pf(e,t){let n=Ih(e,t);for(let r=0;rr*a,1);if(t==null||t==="float32")return Qi(e,new Float32Array(n));if(t==="int32")return Qi(e,new Int32Array(n));if(t==="bool")return Qi(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function ff(e){e.forEach(t=>{M(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function v9(e,t,n){if(t===0)return 0;if(t===1)return e[0];let r=e[e.length-1];for(let a=0;a{let[n,r]=t.split(":");this.urlFlags[n]=S9(n,r)})}};function I9(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...r)=>(N9(t,r[0],r[1]),r.join("="))),t}function N9(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function S9(e,t){if(t=t.toLowerCase(),t==="true"||t==="false")return t==="true";if(`${+t}`===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}function J(){return mr}var mr=null;function T9(e){mr=e}var Af;function Ix(){if(Af==null){let e;if(typeof window!="undefined")e=window;else if(typeof global!="undefined")e=global;else if(typeof process!="undefined")e=process;else if(typeof self!="undefined")e=self;else throw new Error("Could not find a global object");Af=e}return Af}function E9(){let e=Ix();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function yf(e,t){let n=E9();if(n.has(e))return n.get(e);{let r=t();return n.set(e,r),n.get(e)}}var eo="Abs",to="Acos",no="Acosh",Ia="Add",is="AddN",ro="All",ao="Any",os="ArgMax",pu="ArgMin",so="Asin",io="Asinh",oo="Atan",lo="Atanh",uo="Atan2",ls="AvgPool",Sh="AvgPoolGrad",fu="AvgPool3D",Nh="AvgPool3DGrad",us="BatchMatMul",mu="BatchToSpaceND",Th="Bincount",Sx="BroadcastTo",cs="Cast",hs="Ceil",Sa="ClipByValue",Eh="Complex",Au="ComplexAbs",co="Concat",ds="Conv2D",Ch="Conv2DBackpropFilter",ps="Conv2DBackpropInput",yu="Conv3D",Rh="Conv3DBackpropFilterV2",Mh="Conv3DBackpropInputV2",fs="Cos",ho="Cosh",ms="Cumsum",po="CropAndResize",Fh="DenseBincount",fo="DepthToSpace",As="DepthwiseConv2dNative",$h="DepthwiseConv2dNativeBackpropFilter",Dh="DepthwiseConv2dNativeBackpropInput",Oh="Diag",gu="Dilation2D",zh="Dilation2DBackpropInput",Ph="Dilation2DBackpropFilter",ys="RealDiv",Lh="Einsum",mo="Elu",Wh="EluGrad",Ao="Erf",yo="Equal",gs="Exp",go="ExpandDims",xo="Expm1",Bh="FFT",xu="Fill",wo="FlipLeftRight",xs="Floor",ws="FloorDiv",bs="FusedBatchNorm",bo="GatherV2",_o="GatherNd",vo="Greater",_s="GreaterEqual",vs="Identity",Vh="IFFT",jh="Imag",ko="IsFinite",Io="IsInf",So="IsNan",ks="LeakyRelu",No="Less",To="LessEqual",Uh="LinSpace",Is="Log",Eo="Log1p",Co="LogicalAnd",wu="LogicalNot",bu="LogicalOr",Nx="LogSoftmax",_u="LRN",Hh="LRNGrad",Ss="Max",Ns="Maximum",Ts="MaxPool",Gh="MaxPoolGrad",vu="MaxPool3D",qh="MaxPool3DGrad",Xh="MaxPoolWithArgmax",Es="Mean",Cs="Min",Rs="Minimum",Ms="MirrorPad",Ro="Mod",Kh="Multinomial",Fs="Multiply",Mo="Neg",Fo="NotEqual",$o="NonMaxSuppressionV3",Do="NonMaxSuppressionV4",Oo="NonMaxSuppressionV5",zo="OnesLike",$s="OneHot",Po="Pack",Ds="PadV2",C9="Pool",Os="Pow",zs="Prelu",Lo="Prod",ku="Range",Zh="Real",Wo="Reciprocal",Ps="Relu",Bo="Reshape",Iu="ResizeNearestNeighbor",Yh="ResizeNearestNeighborGrad",Ls="ResizeBilinear",Jh="ResizeBilinearGrad",Ws="Relu6",Bs="Reverse",Vs="Round",js="Rsqrt",Vo="ScatterNd",jo="Select",Uo="Selu",Ho="Slice",Us="Sin",Go="Sinh",qo="Sign",Hs="Sigmoid",Xo="Softplus",Gs="Sqrt",qs="Sum",Su="SpaceToBatchND",Ko="SplitV",Xs="Softmax",Qh="SparseReshape",ed="SparseToDense",Ks="SquaredDifference",Nu="Square",Zo="StridedSlice",Zs="Sub",Ys="Tan",Js="Tanh",Na="Tile",Yo="TopK",td="Transform",Qs="Transpose",nd="Unique",Jo="Unpack",Tu="UnsortedSegmentSum",Qo="ZerosLike",Ta="Step",rd="FromPixels",el="RotateWithOffset",ei="_FusedMatMul",ti="FusedConv2D",ni="FusedDepthwiseConv2D",tl=yf("kernelRegistry",()=>new Map),Eu=yf("gradRegistry",()=>new Map);function ad(e,t){let n=gf(e,t);return tl.get(n)}function xf(e){return Eu.get(e)}function nl(e){let t=tl.entries(),n=[];for(;;){let{done:r,value:a}=t.next();if(r)break;let[s,i]=a,[o]=s.split("_");o===e&&n.push(i)}return n}function ri(e){let{kernelName:t,backendName:n}=e,r=gf(t,n);tl.has(r)&&console.warn(`The kernel '${t}' for backend '${n}' is already registered`),tl.set(r,e)}function Tx(e){let{kernelName:t}=e;Eu.has(t)&&J().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${t}'`),Eu.set(t,e)}function R9(e,t){let n=gf(e,t);if(!tl.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);tl.delete(n)}function M9(e){if(!Eu.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);Eu.delete(e)}function F9(e,t){nl(e).forEach(n=>{let r=Object.assign({},n,{backendName:t});ri(r)})}function gf(e,t){return`${t}_${e}`}var _={};Me(_,{arraysEqual:()=>na,assert:()=>M,assertNonNegativeIntegerDimensions:()=>ff,assertNonNull:()=>as,assertShapesMatch:()=>an,bytesFromStringArray:()=>xx,bytesPerElement:()=>df,checkConversionForErrors:()=>yx,clamp:()=>hu,computeStrides:()=>Ji,createScalarValue:()=>$9,createShuffledIndices:()=>g9,decodeString:()=>id,distSquared:()=>f9,encodeString:()=>Ru,fetch:()=>D9,flatten:()=>ss,getArrayFromDType:()=>Ax,getTypedArrayFromDType:()=>mx,hasEncodingLoss:()=>b9,indexToLoc:()=>k9,inferDtype:()=>vh,inferFromImplicitShape:()=>w9,isBoolean:()=>wx,isFunction:()=>ka,isInt:()=>Bt,isNumber:()=>bx,isPromise:()=>mf,isScalarShape:()=>m9,isString:()=>va,isTypedArray:()=>tn,isValidDtype:()=>gx,locToIndex:()=>v9,makeOnesTypedArray:()=>pf,makeZerosNestedTypedArray:()=>_9,makeZerosTypedArray:()=>Ih,nearestDivisor:()=>kh,nearestLargerEven:()=>h9,now:()=>Cu,parseAxisParam:()=>sr,randUniform:()=>p9,repeatedTry:()=>x9,rightPad:()=>du,shuffle:()=>px,shuffleCombo:()=>c9,sizeFromShape:()=>Nt,sizeToSquarishShape:()=>y9,squeezeShape:()=>fx,sum:()=>d9,tanh:()=>A9,toNestedArray:()=>Qi,toTypedArray:()=>sd});function $9(e,t){return t==="string"?Ru(e):sd([e],t)}function O9(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function sd(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=ss(e)),J().getBool("DEBUG")&&yx(e,t),O9(e,t))return e;if(t==null||t==="float32"||t==="complex64")return new Float32Array(e);if(t==="int32")return new Int32Array(e);if(t==="bool"){let n=new Uint8Array(e.length);for(let r=0;r{r=n()},s,i=Cu();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(a);else{a();for(let o of r)o.dataSync();s=Promise.resolve({kernelMs:Cu()-i})}if(J().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{z9(c,l.dtype,e)})}return{kernelName:e,outputs:r,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:n,timeMs:r,inputs:a,extraInfo:s}=e;n.forEach(i=>{Promise.all([i.data(),r,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],a,o[2])})})}};function z9(e,t,n){if(t!=="float32")return!1;for(let r=0;r0?m:""} `}}console.log(`%c${o} %c${i} %c${l}D ${u} %c${c} %c${h} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function W9(e,t,n){let r={},a={};for(let l=0;lr[f.id]=!0),p=!0,a[c.id]=!0;break}if(p)break}}let s={};s[n.id]=!0;let i={};for(let l=e.length-1;l>=0;l--){let c=e[l],u=c.inputs;for(let h=0;h=0;a--){let s=t[a],i=[];if(s.outputs.forEach(l=>{let c=e[l.id];c!=null?i.push(c):i.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let o=s.gradient(i);for(let l in s.inputs){if(!(l in o))throw new Error(`Cannot backprop through input ${l}. Available gradients found: ${Object.keys(o)}.`);let c=n(()=>o[l]());if(c.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${l} must have 'float32' dtype, but has '${c.dtype}'`);let u=s.inputs[l];if(!na(c.shape,u.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${l}' has shape '${c.shape}', which does not match the shape of the input '${u.shape}'`);if(e[u.id]==null)e[u.id]=c;else{let h=e[u.id];e[u.id]=r(h,c),h.dispose()}}}}var Ex=20,Mu=3,wf=7;function j9(e,t,n,r){let a=Ji(t),s=V9(e,t,n,a),i=t.length,o=od(e,t,n,a,s),l=["Tensor"];return r&&(l.push(` dtype: ${n}`),l.push(` rank: ${i}`),l.push(` shape: [${t}]`),l.push(" values:")),l.push(o.map(c=>" "+c).join(` +var D9=Object.defineProperty;var Fa=(e,t)=>{for(var n in t)D9(e,n,{get:t[n],enumerable:!0})};var Dg=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var aa=(e,t,n)=>(Dg(e,t,"read from private field"),n?n.call(e):t.get(e)),as=(e,t,n,a)=>(Dg(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);function Yt(e,t){let n=e.endsWith("/")?"":"/",r=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!r.toLocaleLowerCase().includes(".json"))throw new Error(`Human: ModelPath Error: ${r} Expecting JSON file`);return r}function he(...e){let t=new Date,n=`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`;e&&console.log(n,"Human:",...e)}var it=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Hn(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,a)=>(Object.keys(a||{}).forEach(r=>{let s=n[r],i=a[r];Array.isArray(s)&&Array.isArray(i)?n[r]=s.concat(...i):t(s)&&t(i)?n[r]=Hn(s,i):n[r]=i}),n),{})}function Og(){let e,t;if(typeof navigator!="undefined"){let n=navigator.userAgent.match(/\(([^()]+)\)/g);if(n&&n[0]){let a=n[0].match(/\(([^()]+)\)/g);e=a?a[0].replace(/\(|\)/g,""):"",t=navigator.userAgent.replace(n[0],""),e[1]&&(t=t.replace(n[1],"")),t=t.replace(/ /g," ")}}else typeof process!="undefined"&&(e=`${process.platform} ${process.arch}`,t=`NodeJS ${process.version}`);return{platform:e,agent:t}}var lu={};Fa(lu,{Abs:()=>eo,Acos:()=>to,Acosh:()=>no,AdadeltaOptimizer:()=>qc,AdagradOptimizer:()=>Xc,AdamOptimizer:()=>Kc,AdamaxOptimizer:()=>Zc,Add:()=>kr,AddN:()=>is,All:()=>ao,Any:()=>ro,ArgMax:()=>os,ArgMin:()=>hu,Asin:()=>so,Asinh:()=>io,Atan:()=>oo,Atan2:()=>uo,Atanh:()=>lo,AvgPool:()=>ls,AvgPool3D:()=>fu,AvgPool3DGrad:()=>Tp,AvgPoolGrad:()=>Np,BackendWasm:()=>iw,BatchMatMul:()=>us,BatchToSpaceND:()=>mu,Bincount:()=>Ep,BroadcastTo:()=>Tx,Callback:()=>J4,CallbackList:()=>Kw,Cast:()=>ds,Ceil:()=>ps,ClipByValue:()=>Ir,Complex:()=>Cp,ComplexAbs:()=>Au,Concat:()=>po,Conv2D:()=>cs,Conv2DBackpropFilter:()=>Rp,Conv2DBackpropInput:()=>hs,Conv3D:()=>yu,Conv3DBackpropFilterV2:()=>Mp,Conv3DBackpropInputV2:()=>Fp,Cos:()=>fs,Cosh:()=>co,CropAndResize:()=>ho,Cumsum:()=>ms,CustomCallback:()=>Yw,DataStorage:()=>wp,DenseBincount:()=>$p,DepthToSpace:()=>fo,DepthwiseConv2dNative:()=>As,DepthwiseConv2dNativeBackpropFilter:()=>Dp,DepthwiseConv2dNativeBackpropInput:()=>Op,Diag:()=>zp,Dilation2D:()=>gu,Dilation2DBackpropFilter:()=>Pp,Dilation2DBackpropInput:()=>_p,ENV:()=>ma,EarlyStopping:()=>e8,Einsum:()=>Lp,Elu:()=>mo,EluGrad:()=>Wp,Environment:()=>Sx,Equal:()=>yo,Erf:()=>Ao,Exp:()=>gs,ExpandDims:()=>go,Expm1:()=>xo,FFT:()=>Bp,Fill:()=>xu,FlipLeftRight:()=>bo,Floor:()=>xs,FloorDiv:()=>bs,FromPixels:()=>ac,FusedBatchNorm:()=>vs,FusedConv2D:()=>ti,FusedDepthwiseConv2D:()=>ni,GPGPUContext:()=>hh,GatherNd:()=>wo,GatherV2:()=>vo,GraphModel:()=>R8,Greater:()=>ko,GreaterEqual:()=>ws,History:()=>Zw,IFFT:()=>Vp,Identity:()=>ks,Imag:()=>jp,InputSpec:()=>Mt,IsFinite:()=>Io,IsInf:()=>So,IsNan:()=>No,KernelBackend:()=>du,LRN:()=>wu,LRNGrad:()=>Hp,LayerVariable:()=>Uw,LayersModel:()=>pr,LeakyRelu:()=>Is,Less:()=>To,LessEqual:()=>Eo,LinSpace:()=>Up,Log:()=>Ss,Log1p:()=>Co,LogSoftmax:()=>Ex,LogicalAnd:()=>Ro,LogicalNot:()=>bu,LogicalOr:()=>vu,MathBackendCPU:()=>eh,MathBackendWebGL:()=>$l,Max:()=>Ns,MaxPool:()=>Es,MaxPool3D:()=>ku,MaxPool3DGrad:()=>qp,MaxPoolGrad:()=>Gp,MaxPoolWithArgmax:()=>Xp,Maximum:()=>Ts,Mean:()=>Cs,Min:()=>Rs,Minimum:()=>Ms,MirrorPad:()=>Fs,Mod:()=>Mo,MomentumOptimizer:()=>Yc,Multinomial:()=>Kp,Multiply:()=>$s,Neg:()=>Fo,NonMaxSuppressionV3:()=>Do,NonMaxSuppressionV4:()=>Oo,NonMaxSuppressionV5:()=>zo,NotEqual:()=>$o,OP_SCOPE_SUFFIX:()=>Lx,OneHot:()=>Ds,OnesLike:()=>_o,Optimizer:()=>or,Pack:()=>Po,PadV2:()=>Os,Pool:()=>OI,Pow:()=>zs,Prelu:()=>_s,Prod:()=>Lo,RMSPropOptimizer:()=>Jc,RNN:()=>Ha,Range:()=>Iu,Rank:()=>wm,Real:()=>Zp,RealDiv:()=>ys,Reciprocal:()=>Wo,Reduction:()=>un,Relu:()=>Ps,Relu6:()=>Ws,Reshape:()=>Bo,ResizeBilinear:()=>Ls,ResizeBilinearGrad:()=>Jp,ResizeNearestNeighbor:()=>Su,ResizeNearestNeighborGrad:()=>Yp,Reverse:()=>Bs,RotateWithOffset:()=>el,Round:()=>Vs,Rsqrt:()=>js,SGDOptimizer:()=>ad,ScatterNd:()=>Vo,Select:()=>jo,Selu:()=>Uo,Sequential:()=>Vl,Sigmoid:()=>Hs,Sign:()=>qo,Sin:()=>Us,Sinh:()=>Go,Slice:()=>Ho,Softmax:()=>Xs,Softplus:()=>Xo,SpaceToBatchND:()=>Nu,SparseReshape:()=>Qp,SparseToDense:()=>ec,SplitV:()=>Ko,Sqrt:()=>Gs,Square:()=>Tu,SquaredDifference:()=>Ks,Step:()=>Nr,StridedSlice:()=>Zo,Sub:()=>Zs,Sum:()=>qs,SymbolicTensor:()=>Sa,Tan:()=>Ys,Tanh:()=>Js,Tensor:()=>Le,TensorBuffer:()=>Dt,Tile:()=>Sr,TopK:()=>Yo,Transform:()=>tc,Transpose:()=>Qs,Unique:()=>nc,Unpack:()=>Jo,UnsortedSegmentSum:()=>Eu,Variable:()=>Ou,ZerosLike:()=>Qo,_FusedMatMul:()=>ei,abs:()=>Ot,acos:()=>Xm,acosh:()=>Km,add:()=>se,addN:()=>mc,all:()=>Ac,any:()=>Wu,argMax:()=>Bu,argMin:()=>Zm,asin:()=>Ym,asinh:()=>Jm,atan:()=>Qm,atan2:()=>eA,atanh:()=>tA,avgPool:()=>ju,avgPool3d:()=>rA,backend:()=>bb,backend_util:()=>C,basicLSTMCell:()=>fT,batchNorm:()=>pi,batchNorm2d:()=>Ib,batchNorm3d:()=>Sb,batchNorm4d:()=>Nb,batchToSpaceND:()=>Uu,bincount:()=>Tb,booleanMaskAsync:()=>bR,broadcastTo:()=>pl,browser:()=>oi,buffer:()=>We,callbacks:()=>yre,cast:()=>Ae,ceil:()=>sA,clipByValue:()=>kn,clone:()=>Oa,complex:()=>Tr,concat:()=>ot,concat1d:()=>Eb,concat2d:()=>cl,concat3d:()=>Cb,concat4d:()=>Rb,constraints:()=>yw,conv1d:()=>gc,conv2d:()=>ar,conv2dTranspose:()=>xc,conv3d:()=>oA,conv3dTranspose:()=>Fb,copyRegisteredKernels:()=>PI,cos:()=>Hu,cosh:()=>bc,cosineWindow:()=>OA,cumsum:()=>vc,customGrad:()=>_a,data:()=>M8,denseBincount:()=>$b,deprecationWarn:()=>Gm,depthToSpace:()=>lA,depthwiseConv2d:()=>hl,deregisterOp:()=>xre,device_util:()=>_u,diag:()=>jT,dilation2d:()=>uA,disableDeprecationWarnings:()=>TN,dispose:()=>Ee,disposeVariables:()=>EN,div:()=>ge,divNoNan:()=>dA,dot:()=>Db,dropout:()=>t3,einsum:()=>Ob,elu:()=>fl,enableDebugMode:()=>NN,enableProdMode:()=>SN,enclosingPowerOfTwo:()=>n3,engine:()=>nr,env:()=>J,equal:()=>Fr,erf:()=>pA,exp:()=>qn,expandDims:()=>on,expm1:()=>cA,eye:()=>hA,fft:()=>td,fill:()=>Gu,findBackend:()=>qm,findBackendFactory:()=>ON,floor:()=>ml,floorDiv:()=>fc,forceHalfFloat:()=>gv,fused:()=>zr,gather:()=>ci,gatherND:()=>e3,gather_util:()=>Lm,getBackend:()=>$N,getGradient:()=>xm,getKernel:()=>rc,getKernelsForBackend:()=>nl,gpgpu_util:()=>V7,grad:()=>xE,grads:()=>bE,greater:()=>oa,greaterEqual:()=>Dr,ifft:()=>xl,imag:()=>wc,image:()=>Ye,inTopKAsync:()=>MR,initializers:()=>Iw,input:()=>_w,io:()=>vn,irfft:()=>Pc,isFinite:()=>zb,isInf:()=>_b,isNaN:()=>fA,keep:()=>jt,kernel_impls:()=>Wa,layers:()=>zw,leakyRelu:()=>qu,less:()=>kc,lessEqual:()=>hi,linalg:()=>f3,linspace:()=>Pb,loadGraphModel:()=>Gt,loadLayersModel:()=>_ae,localResponseNormalization:()=>mA,log:()=>Fn,log1p:()=>Ic,logSigmoid:()=>Wb,logSoftmax:()=>Nc,logSumExp:()=>gA,logicalAnd:()=>la,logicalNot:()=>Xu,logicalOr:()=>Tc,logicalXor:()=>Ub,losses:()=>ZM,matMul:()=>Be,math:()=>tb,max:()=>Xn,maxPool:()=>Ku,maxPool3d:()=>xA,maxPoolWithArgmax:()=>Hb,maximum:()=>Pa,mean:()=>kt,memory:()=>hc,meshgrid:()=>VE,metrics:()=>K4,min:()=>Al,minimum:()=>yl,mirrorPad:()=>bA,mod:()=>vA,model:()=>Oae,models:()=>Z4,moments:()=>Ec,movingAverage:()=>kR,mul:()=>B,multiRNNCell:()=>ZE,multinomial:()=>Gb,neg:()=>wt,nextFrame:()=>Qc,norm:()=>Vc,notEqual:()=>Ai,oneHot:()=>ol,ones:()=>$n,onesLike:()=>Dn,op:()=>O,outerProduct:()=>tC,pad:()=>rr,pad1d:()=>rC,pad2d:()=>iC,pad3d:()=>lC,pad4d:()=>dC,pool:()=>qb,pow:()=>sr,prelu:()=>Yu,print:()=>Kx,prod:()=>Cc,profile:()=>CN,rand:()=>xC,randomGamma:()=>kC,randomNormal:()=>Xb,randomUniform:()=>gl,range:()=>Rc,ready:()=>FN,real:()=>Ju,reciprocal:()=>IA,registerBackend:()=>ul,registerCallbackConstructor:()=>Pae,registerGradient:()=>Cx,registerKernel:()=>ai,registerOp:()=>gre,regularizers:()=>Y4,relu:()=>La,relu6:()=>Mc,removeBackend:()=>DN,reshape:()=>H,reverse:()=>On,reverse1d:()=>FC,reverse2d:()=>DC,reverse3d:()=>zC,reverse4d:()=>PC,rfft:()=>nd,round:()=>SA,rsqrt:()=>Fc,scalar:()=>Ie,scatterND:()=>Qb,scatter_util:()=>Wm,selu:()=>$c,separableConv2d:()=>NA,sequential:()=>zae,serialization:()=>ae,setBackend:()=>MN,setPlatform:()=>zN,setWasmPath:()=>MJ,setWasmPaths:()=>FJ,setWebGLContext:()=>uh,setdiff1dAsync:()=>Kb,shared:()=>WA,sigmoid:()=>wn,sign:()=>TA,signal:()=>KM,sin:()=>Dc,sinh:()=>Oc,slice:()=>Me,slice1d:()=>zc,slice2d:()=>EA,slice3d:()=>_c,slice4d:()=>Qu,slice_util:()=>sn,softmax:()=>ed,softplus:()=>fi,spaceToBatchND:()=>Zu,sparse:()=>m3,sparseToDense:()=>DA,spectral:()=>XM,split:()=>ln,sqrt:()=>Jt,square:()=>st,squaredDifference:()=>Lc,squeeze:()=>Or,stack:()=>zn,step:()=>bl,stridedSlice:()=>CA,sub:()=>ye,sum:()=>Te,sumOutType:()=>lc,tan:()=>RA,tanh:()=>di,tensor:()=>ga,tensor1d:()=>nn,tensor2d:()=>Kn,tensor3d:()=>pc,tensor4d:()=>dR,tensor5d:()=>pR,tensor6d:()=>cR,tensor_util:()=>Aa,test_util:()=>yb,tidy:()=>L,tile:()=>$r,time:()=>RN,topk:()=>MA,train:()=>gi,transpose:()=>Ze,truncatedNormal:()=>Wc,unique:()=>Bc,unregisterGradient:()=>_I,unregisterKernel:()=>zI,unsortedSegmentSum:()=>FA,unstack:()=>ua,upcastType:()=>ia,util:()=>w,valueAndGrad:()=>vE,valueAndGrads:()=>wE,variable:()=>Zb,variableGrads:()=>Lb,version:()=>sie,version_converter:()=>xse,version_core:()=>IN,version_cpu:()=>X3,version_layers:()=>sy,version_wasm:()=>lw,version_webgl:()=>yv,webgl:()=>DW,webgl_util:()=>A7,where:()=>In,whereAsync:()=>$A,zeros:()=>Ct,zerosLike:()=>Ue});var O9=Object.create,vp=Object.defineProperty,z9=Object.getPrototypeOf,_9=Object.prototype.hasOwnProperty,P9=Object.getOwnPropertyNames,L9=Object.getOwnPropertyDescriptor,W9=e=>vp(e,"__esModule",{value:!0}),bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fe=(e,t)=>{for(var n in t)vp(e,n,{get:t[n],enumerable:!0})},B9=(e,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of P9(t))!_9.call(e,a)&&a!=="default"&&vp(e,a,{get:()=>t[a],enumerable:!(n=L9(t,a))||n.enumerable});return e},Yi=e=>B9(W9(vp(e!=null?O9(z9(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),V9=bt(()=>{}),j9=bt((e,t)=>{(function(n,a,r){function s(d){var u=this,p=l();u.next=function(){var c=2091639*u.s0+u.c*23283064365386963e-26;return u.s0=u.s1,u.s1=u.s2,u.s2=c-(u.c=c|0)},u.c=1,u.s0=p(" "),u.s1=p(" "),u.s2=p(" "),u.s0-=p(d),u.s0<0&&(u.s0+=1),u.s1-=p(d),u.s1<0&&(u.s1+=1),u.s2-=p(d),u.s2<0&&(u.s2+=1),p=null}function i(d,u){return u.c=d.c,u.s0=d.s0,u.s1=d.s1,u.s2=d.s2,u}function o(d,u){var p=new s(d),c=u&&u.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function l(){var d=4022871197,u=function(p){p=p.toString();for(var c=0;c>>0,h-=d,h*=d,d=h>>>0,h-=d,d+=h*4294967296}return(d>>>0)*23283064365386963e-26};return u}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),U9=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.x=0,d.y=0,d.z=0,d.w=0,d.next=function(){var c=d.x^d.x<<11;return d.x=d.y,d.y=d.z,d.z=d.w,d.w^=d.w>>>19^c^c>>>8},l===(l|0)?d.x=l:u+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),H9=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.next=function(){var c=d.x^d.x>>>2;return d.x=d.y,d.y=d.z,d.z=d.w,d.w=d.v,(d.d=d.d+362437|0)+(d.v=d.v^d.v<<4^(c^c<<1))|0},d.x=0,d.y=0,d.z=0,d.w=0,d.v=0,l===(l|0)?d.x=l:u+=l;for(var p=0;p>>4),d.next()}function i(l,d){return d.x=l.x,d.y=l.y,d.z=l.z,d.w=l.w,d.v=l.v,d.d=l.d,d}function o(l,d){var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),G9=bt((e,t)=>{(function(n,a,r){function s(l){var d=this;d.next=function(){var p=d.x,c=d.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,d.i=c+1&7,m};function u(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}u(d,l)}function i(l,d){return d.x=l.x.slice(),d.i=l.i,d}function o(l,d){l==null&&(l=+new Date);var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(p.x&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),q9=bt((e,t)=>{(function(n,a,r){function s(l){var d=this;d.next=function(){var p=d.w,c=d.X,h=d.i,m,f;return d.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,d.i=h,f+(p^p>>>16)|0};function u(p,c){var h,m,f,A,y,g=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,A=-32;A>>15,m^=m<<4,m^=m>>>13,A>=0&&(y=y+1640531527|0,h=g[A&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(g[(c&&c.length||0)&127]=-1),f=127,A=4*128;A>0;--A)m=g[f+34&127],h=g[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,g[f]=m^h;p.w=y,p.X=g,p.i=f}u(d,l)}function i(l,d){return d.i=l.i,d.w=l.w,d.X=l.X.slice(),d}function o(l,d){l==null&&(l=+new Date);var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(p.X&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),X9=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.next=function(){var c=d.b,h=d.c,m=d.d,f=d.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,d.b=c=c<<20^c>>>12^h,d.c=h=h-m|0,d.d=m<<16^h>>>16^f,d.a=f-c|0},d.a=0,d.b=0,d.c=2654435769|0,d.d=1367130551,l===Math.floor(l)?(d.a=l/4294967296|0,d.b=l|0):u+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),zg=bt(()=>{}),K9=bt((e,t)=>{(function(n,a){var r=this,s=256,i=6,o=52,l="random",d=a.pow(s,i),u=a.pow(2,o),p=u*2,c=s-1,h;function m(b,v,I){var T=[];v=v==!0?{entropy:!0}:v||{};var R=g(y(v.entropy?[b,k(n)]:b==null?x():b,3),T),$=new f(T),z=function(){for(var _=$.g(i),V=d,j=0;_=p;)_/=2,V/=2,j>>>=1;return(_+j)/V};return z.int32=function(){return $.g(4)|0},z.quick=function(){return $.g(4)/4294967296},z.double=z,g(k($.S),n),(v.pass||I||function(_,V,j,U){return U&&(U.S&&A(U,$),_.state=function(){return A($,{})}),j?(a[l]=_,V):_})(z,R,"global"in v?v.global:this==a,v.state)}a["seed"+l]=m;function f(b){var v,I=b.length,T=this,R=0,$=T.i=T.j=0,z=T.S=[];for(I||(b=[I++]);R{var n=j9(),a=U9(),r=H9(),s=G9(),i=q9(),o=X9(),l=K9();l.alea=n,l.xor128=a,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),uu=bt(()=>{}),Z9=bt(()=>{}),Y9=bt(()=>{}),J9=bt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};function s(){return Q.buffer!=Ve&&Kt(Q.buffer),An}function i(){return Q.buffer!=Ve&&Kt(Q.buffer),xt}function o(){return Q.buffer!=Ve&&Kt(Q.buffer),yn}function l(){return Q.buffer!=Ve&&Kt(Q.buffer),jn}function d(){return Q.buffer!=Ve&&Kt(Q.buffer),an}var u=typeof r!="undefined"?r:{},p,c;u.ready=new Promise(function(N,E){p=N,c=E});var h={},m;for(m in u)u.hasOwnProperty(m)&&(h[m]=u[m]);var f=[],A="./this.program",y=function(N,E){throw E},g=!1,x=!1,k=!1,b=!1;g=typeof window=="object",x=typeof importScripts=="function",k=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",b=!g&&!k&&!x;var v=u.ENVIRONMENT_IS_PTHREAD||!1;v&&(Ve=u.buffer);var I="";function T(N){return u.locateFile?u.locateFile(N,I):I+N}var R,$,z,_,V,j;if(k){x?I=uu().dirname(I)+"/":I=__dirname+"/",R=function(N,E){return V||(V=require("fs")),j||(j=uu()),N=j.normalize(N),V.readFileSync(N,E?null:"utf8")},z=function(N){var E=R(N,!0);return E.buffer||(E=new Uint8Array(E)),ce(E.buffer),E},process.argv.length>1&&(A=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(N){if(!(N instanceof ou))throw N}),process.on("unhandledRejection",Ya),y=function(N){process.exit(N)},u.inspect=function(){return"[Emscripten Module object]"};var U;try{U=Z9()}catch(N){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),N}global.Worker=U.Worker}else b?(typeof read!="undefined"&&(R=function(N){return read(N)}),z=function(N){var E;return typeof readbuffer=="function"?new Uint8Array(readbuffer(N)):(E=read(N,"binary"),ce(typeof E=="object"),E)},typeof scriptArgs!="undefined"?f=scriptArgs:typeof arguments!="undefined"&&(f=arguments),typeof quit=="function"&&(y=function(N){quit(N)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(g||x)&&(x?I=self.location.href:typeof document!="undefined"&&document.currentScript&&(I=document.currentScript.src),typeof a!="undefined"&&a&&(I=a),I.indexOf("blob:")!==0?I=I.substr(0,I.lastIndexOf("/")+1):I="",k?(R=function(N,E){return V||(V=require("fs")),j||(j=uu()),N=j.normalize(N),V.readFileSync(N,E?null:"utf8")},z=function(N){var E=R(N,!0);return E.buffer||(E=new Uint8Array(E)),ce(E.buffer),E}):(R=function(N){var E=new XMLHttpRequest;return E.open("GET",N,!1),E.send(null),E.responseText},x&&(z=function(N){var E=new XMLHttpRequest;return E.open("GET",N,!1),E.responseType="arraybuffer",E.send(null),new Uint8Array(E.response)}),$=function(N,E,P){var q=new XMLHttpRequest;q.open("GET",N,!0),q.responseType="arraybuffer",q.onload=function(){if(q.status==200||q.status==0&&q.response){E(q.response);return}P()},q.onerror=P,q.send(null)}),_=function(N){document.title=N});k&&typeof performance=="undefined"&&(global.performance=Y9().performance);var X=u.print||console.log.bind(console),G=u.printErr||console.warn.bind(console);for(m in h)h.hasOwnProperty(m)&&(u[m]=h[m]);h=null,u.arguments&&(f=u.arguments),u.thisProgram&&(A=u.thisProgram),u.quit&&(y=u.quit);var ee=Atomics.load,Y=Atomics.store,re=Atomics.compareExchange,te;u.wasmBinary&&(te=u.wasmBinary);var ie=u.noExitRuntime||!0;typeof WebAssembly!="object"&&Ya("no native wasm support detected");var Q,de,oe=!1,me;function ce(N,E){N||Ya("Assertion failed: "+E)}function ke(N){var E=u["_"+N];return ce(E,"Cannot call unknown function "+N+", make sure it is exported"),E}function Se(N,E,P,q,pe){var le={string:function(bn){var Zi=0;if(bn!=null&&bn!==0){var $g=(bn.length<<2)+1;Zi=qi($g),et(bn,Zi,$g)}return Zi},array:function(bn){var Zi=qi(bn.length);return Xe(bn,Zi),Zi}};function ue(bn){return E==="string"?De(bn):E==="boolean"?Boolean(bn):bn}var be=ke(N),tt=[],Bt=0;if(q)for(var $t=0;$t=q);){var le=N[E++];if(!le)return pe;if(!(le&128)){pe+=String.fromCharCode(le);continue}var ue=N[E++]&63;if((le&224)==192){pe+=String.fromCharCode((le&31)<<6|ue);continue}var be=N[E++]&63;if((le&240)==224?le=(le&15)<<12|ue<<6|be:le=(le&7)<<18|ue<<12|be<<6|N[E++]&63,le<65536)pe+=String.fromCharCode(le);else{var tt=le-65536;pe+=String.fromCharCode(55296|tt>>10,56320|tt&1023)}}return pe}function De(N,E){return N?ze(i(),N,E):""}function Qe(N,E,P,q){if(!(q>0))return 0;for(var pe=P,le=P+q-1,ue=0;ue=55296&&be<=57343){var tt=N.charCodeAt(++ue);be=65536+((be&1023)<<10)|tt&1023}if(be<=127){if(P>=le)break;E[P++]=be}else if(be<=2047){if(P+1>=le)break;E[P++]=192|be>>6,E[P++]=128|be&63}else if(be<=65535){if(P+2>=le)break;E[P++]=224|be>>12,E[P++]=128|be>>6&63,E[P++]=128|be&63}else{if(P+3>=le)break;E[P++]=240|be>>18,E[P++]=128|be>>12&63,E[P++]=128|be>>6&63,E[P++]=128|be&63}}return E[P]=0,P-pe}function et(N,E,P){return Qe(N,i(),E,P)}function rt(N){for(var E=0,P=0;P=55296&&q<=57343&&(q=65536+((q&1023)<<10)|N.charCodeAt(++P)&1023),q<=127?++E:q<=2047?E+=2:q<=65535?E+=3:E+=4}return E}function Xe(N,E){s().set(N,E)}function pt(N,E){return N%E>0&&(N+=E-N%E),N}var Ve,An,xt,Vn,Xt,yn,jn,Mn,an;function Kt(N){Ve=N,u.HEAP8=An=new Int8Array(N),u.HEAP16=Vn=new Int16Array(N),u.HEAP32=yn=new Int32Array(N),u.HEAPU8=xt=new Uint8Array(N),u.HEAPU16=Xt=new Uint16Array(N),u.HEAPU32=jn=new Uint32Array(N),u.HEAPF32=Mn=new Float32Array(N),u.HEAPF64=an=new Float64Array(N)}var Ra=u.INITIAL_MEMORY||16777216;if(v)Q=u.wasmMemory,Ve=u.buffer;else if(u.wasmMemory)Q=u.wasmMemory;else if(Q=new WebAssembly.Memory({initial:Ra/65536,maximum:2147483648/65536,shared:!0}),!(Q.buffer instanceof SharedArrayBuffer))throw G("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),k&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Q&&(Ve=Q.buffer),Ra=Ve.byteLength,Kt(Ve);var ta,na=[],fr=[],Ka=[],mr=[],Wi=[],Ma=!1,Qd=!1;v||fr.push({func:function(){fp()}});function _0(){if(!v){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)tp(u.preRun.shift());Vi(na)}}function Yl(){Ma=!0,!v&&Vi(fr)}function P0(){v||Vi(Ka)}function ep(){v||(Qd=!0)}function gn(){if(!v){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)L0(u.postRun.shift());Vi(Wi)}}function tp(N){na.unshift(N)}function L0(N){Wi.unshift(N)}var Za=0,Ar=null,es=null;function W0(N){ce(!v,"addRunDependency cannot be used in a pthread worker"),Za++,u.monitorRunDependencies&&u.monitorRunDependencies(Za)}function B0(N){if(Za--,u.monitorRunDependencies&&u.monitorRunDependencies(Za),Za==0&&(Ar!==null&&(clearInterval(Ar),Ar=null),es)){var E=es;es=null,E()}}u.preloadedImages={},u.preloadedAudios={};function Ya(N){u.onAbort&&u.onAbort(N),v&&console.error("Pthread aborting at "+new Error().stack),N+="",G(N),oe=!0,me=1,N="abort("+N+"). Build with -s ASSERTIONS=1 for more info.";var E=new WebAssembly.RuntimeError(N);throw c(E),E}function np(N,E){return String.prototype.startsWith?N.startsWith(E):N.indexOf(E)===0}var Bi="data:application/octet-stream;base64,";function ap(N){return np(N,Bi)}var V0="file://";function rp(N){return np(N,V0)}var xn="tfjs-backend-wasm-threaded-simd.wasm";ap(xn)||(xn=T(xn));function sp(N){try{if(N==xn&&te)return new Uint8Array(te);if(z)return z(N);throw"both async and sync fetching of the wasm failed"}catch(E){Ya(E)}}function j0(){if(!te&&(g||x)){if(typeof fetch=="function"&&!rp(xn))return fetch(xn,{credentials:"same-origin"}).then(function(N){if(!N.ok)throw"failed to load wasm binary file at '"+xn+"'";return N.arrayBuffer()}).catch(function(){return sp(xn)});if($)return new Promise(function(N,E){$(xn,function(P){N(new Uint8Array(P))},E)})}return Promise.resolve().then(function(){return sp(xn)})}function U0(){var N={a:Of};function E(ue,be){var tt=ue.exports;if(u.asm=tt,ta=u.asm.F,de=be,!v){var Bt=we.unusedWorkers.length;we.unusedWorkers.forEach(function($t){we.loadWasmModuleToWorker($t,function(){--Bt||B0("wasm-instantiate")})})}}v||W0("wasm-instantiate");function P(ue){E(ue.instance,ue.module)}function q(ue){return j0().then(function(be){return WebAssembly.instantiate(be,N)}).then(ue,function(be){G("failed to asynchronously prepare wasm: "+be),Ya(be)})}function pe(){return!te&&typeof WebAssembly.instantiateStreaming=="function"&&!ap(xn)&&!rp(xn)&&typeof fetch=="function"?fetch(xn,{credentials:"same-origin"}).then(function(ue){var be=WebAssembly.instantiateStreaming(ue,N);return be.then(P,function(tt){return G("wasm streaming compile failed: "+tt),G("falling back to ArrayBuffer instantiation"),q(P)})}):q(P)}if(u.instantiateWasm)try{var le=u.instantiateWasm(N,E);return le}catch(ue){return G("Module.instantiateWasm callback failed with error: "+ue),!1}return pe().catch(c),{}}var H0={9816:function(){throw"Canceled!"},9834:function(N,E){setTimeout(function(){Tg(N,E)},0)}};function ip(){we.initRuntime()}function Vi(N){for(;N.length>0;){var E=N.shift();if(typeof E=="function"){E(u);continue}var P=E.func;typeof P=="number"?E.arg===void 0?ta.get(P)():ta.get(P)(E.arg):P(E.arg===void 0?null:E.arg)}}function Jl(N,E){if(N<=0||N>s().length||N&!0||E<0)return-28;if(E==0)return 0;E>=2147483647&&(E=Infinity);var P=Atomics.load(o(),Xi>>2),q=0;if(P==N){var pe=Atomics.compareExchange(o(),Xi>>2,P,0);if(pe==P&&(--E,q=1,E<=0))return 1}var le=Atomics.notify(o(),N>>2,E);if(le>=0)return le+q;throw"Atomics.notify returned an unexpected value "+le}u._emscripten_futex_wake=Jl;function G0(N){if(v)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!N)throw"Internal Error! Null pthread_ptr in killThread!";o()[N+12>>2]=0;var E=we.pthreads[N];E.worker.terminate(),we.freeThreadData(E),we.runningWorkers.splice(we.runningWorkers.indexOf(E.worker),1),E.worker.pthread=void 0}function q0(N){if(v)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!N)throw"Internal Error! Null pthread_ptr in cancelThread!";var E=we.pthreads[N];E.worker.postMessage({cmd:"cancel"})}function X0(N){if(v)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!N)throw"Internal Error! Null pthread_ptr in cleanupThread!";var E=we.pthreads[N];if(E){o()[N+12>>2]=0;var P=E.worker;we.returnWorkerToPool(P)}}var we={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){for(var N=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2)),E=0;E>2]=N;var P=N+152;o()[P>>2]=P;for(var q=ns(512),E=0;E<128;++E)l()[q/4+E]=0;Atomics.store(l(),N+100>>2,q),Atomics.store(l(),N+40>>2,N),sm(N,!x,1),Ng(N)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){for(;we.threadExitHandlers.length>0;)we.threadExitHandlers.pop()();v&&Hi()&&Sg()},runExitHandlersAndDeinitThread:function(N,E){Atomics.store(l(),N+56>>2,1),Atomics.store(l(),N+60>>2,0),we.runExitHandlers(),Atomics.store(l(),N+4>>2,E),Atomics.store(l(),N+0>>2,1),Jl(N+0,2147483647),sm(0,0,0)},threadExit:function(N){var E=Hi();E&&(we.runExitHandlersAndDeinitThread(E,N),v&&postMessage({cmd:"exit"}))},threadCancel:function(){we.runExitHandlersAndDeinitThread(Hi(),-1),postMessage({cmd:"cancelDone"})},terminateAllThreads:function(){for(var N in we.pthreads){var E=we.pthreads[N];E&&E.worker&&we.returnWorkerToPool(E.worker)}we.pthreads={};for(var P=0;P>2];o()[N.threadInfoStruct+100>>2]=0,su(E),su(N.threadInfoStruct)}N.threadInfoStruct=0,N.allocatedOwnStack&&N.stackBase&&su(N.stackBase),N.stackBase=0,N.worker&&(N.worker.pthread=null)}},returnWorkerToPool:function(N){we.runWithoutMainThreadQueuedCalls(function(){delete we.pthreads[N.pthread.threadInfoStruct],we.unusedWorkers.push(N),we.runningWorkers.splice(we.runningWorkers.indexOf(N),1),we.freeThreadData(N.pthread),N.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(N){o()[Fg>>2]=0;try{N()}finally{o()[Fg>>2]=1}},receiveObjectTransfer:function(N){},loadWasmModuleToWorker:function(N,E){N.onmessage=function(P){var q=P.data,pe=q.cmd;if(N.pthread&&(we.currentProxiedOperationCallerThread=N.pthread.threadInfoStruct),q.targetThread&&q.targetThread!=Hi()){var le=we.pthreads[q.targetThread];le?le.worker.postMessage(P.data,q.transferList):console.error('Internal error! Worker sent a message "'+pe+'" to target pthread '+q.targetThread+", but that thread no longer exists!"),we.currentProxiedOperationCallerThread=void 0;return}if(pe==="processQueuedMainThreadWork")am();else if(pe==="spawnThread")cp(P.data);else if(pe==="cleanupThread")X0(q.thread);else if(pe==="killThread")G0(q.thread);else if(pe==="cancelThread")q0(q.thread);else if(pe==="loaded")N.loaded=!0,E&&E(N),N.runPthread&&(N.runPthread(),delete N.runPthread);else if(pe==="print")X("Thread "+q.threadId+": "+q.text);else if(pe==="printErr")G("Thread "+q.threadId+": "+q.text);else if(pe==="alert")alert("Thread "+q.threadId+": "+q.text);else if(pe==="exit"){var ue=N.pthread&&Atomics.load(l(),N.pthread.threadInfoStruct+64>>2);ue&&we.returnWorkerToPool(N)}else if(pe==="exitProcess")try{$9(q.returnCode)}catch(be){if(be instanceof ou)return;throw be}else pe==="cancelDone"?we.returnWorkerToPool(N):pe==="objectTransfer"?we.receiveObjectTransfer(P.data):P.data.target==="setimmediate"?N.postMessage(P.data):G("worker sent an unknown command "+pe);we.currentProxiedOperationCallerThread=void 0},N.onerror=function(P){G("pthread sent an error! "+P.filename+":"+P.lineno+": "+P.message)},k&&(N.on("message",function(P){N.onmessage({data:P})}),N.on("error",function(P){N.onerror(P)}),N.on("exit",function(P){})),N.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||a,wasmMemory:Q,wasmModule:de})},allocateUnusedWorker:function(){var N=T("tfjs-backend-wasm-threaded-simd.worker.js");we.unusedWorkers.push(new Worker(N))},getNewWorker:function(){return we.unusedWorkers.length==0&&(we.allocateUnusedWorker(),we.loadWasmModuleToWorker(we.unusedWorkers[0])),we.unusedWorkers.length>0?we.unusedWorkers.pop():null},busySpinWait:function(N){for(var E=performance.now()+N;performance.now()>2]=N,N}function tf(N,E){if(v)return yr(1,1,N,E)}function nf(N,E){if(N==E)postMessage({cmd:"processQueuedMainThreadWork"});else if(v)postMessage({targetThread:N,cmd:"processThreadQueue"});else{var P=we.pthreads[N],q=P&&P.worker;if(!q)return;q.postMessage({cmd:"processThreadQueue"})}return 1}function af(){Ya()}function rf(N,E,P){var q=df(E,P);return H0[N].apply(null,q)}function sf(N,E){}function of(N,E,P){if(N<=0||N>s().length||N&!0)return-28;if(g){if(Atomics.load(o(),N>>2)!=E)return-6;for(var q=performance.now(),pe=q+P,le=Atomics.exchange(o(),Xi>>2,N);;){if(q=performance.now(),q>pe)return le=Atomics.exchange(o(),Xi>>2,0),-73;if(le=Atomics.exchange(o(),Xi>>2,0),le==0)break;if(am(),Atomics.load(o(),N>>2)!=E)return-6;le=Atomics.exchange(o(),Xi>>2,N)}return 0}else{var ue=Atomics.wait(o(),N>>2,E,P);if(ue==="timed-out")return-73;if(ue==="not-equal")return-6;if(ue==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ue}}function lf(N,E,P){i().copyWithin(N,E,E+P)}function uf(){return k?require("os").cpus().length:navigator.hardwareConcurrency}function yr(N,E){for(var P=arguments.length-2,q=iu(),pe=P,le=qi(pe*8),ue=le>>3,be=0;be>=2;P=i()[N++];){var q=P<105;q&&E&1&&E++,eu.push(q?d()[E++>>1]:o()[E]),++E}return eu}function pf(N,E,P){Ql.length=E;for(var q=P>>3,pe=0;pe>>16),Kt(Q.buffer),1}catch(E){}}function ff(N){var E=cf();if(N<=E)return!1;var P=2147483648;if(N>P)return!1;for(var q=1;q<=4;q*=2){var pe=E*(1+.2/q);pe=Math.min(pe,N+100663296);var le=Math.min(P,pt(Math.max(N,pe),65536)),ue=hf(le);if(ue)return!0}return!1}var Pe={inEventHandler:0,removeAllEventListeners:function(){for(var N=Pe.eventHandlers.length-1;N>=0;--N)Pe._removeHandler(N);Pe.eventHandlers=[],Pe.deferredCalls=[]},registerRemoveEventListeners:function(){Pe.removeEventListenersRegistered||(mr.push(Pe.removeAllEventListeners),Pe.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(N,E,P){function q(ue,be){if(ue.length!=be.length)return!1;for(var tt in ue)if(ue[tt]!=be[tt])return!1;return!0}for(var pe in Pe.deferredCalls){var le=Pe.deferredCalls[pe];if(le.targetFunction==N&&q(le.argsList,P))return}Pe.deferredCalls.push({targetFunction:N,precedence:E,argsList:P}),Pe.deferredCalls.sort(function(ue,be){return ue.precedence>2]=P,o()[ue+4>>2]=q,o()[ue+8>>2]=pe,rm(0,N,637534208,E,q,ue),Gi(le)},getTargetThreadForEventCallback:function(N){switch(N){case 1:return 0;case 2:return we.currentProxiedOperationCallerThread;default:return N}},getNodeNameForTarget:function(N){return N?N==window?"#window":N==screen?"#screen":N&&N.nodeName?N.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function mf(N){var E=rt(N)+1,P=ns(E);return et(N,P,E),P}function Af(N,E,P,q){var pe=iu(),le=qi(12),ue=0;E&&(ue=mf(E)),o()[le>>2]=ue,o()[le+4>>2]=P,o()[le+8>>2]=q,rm(0,N,657457152,0,ue,le),Gi(pe)}function yf(N,E,P,q){E=E?De(E):"",Af(N,E,P,q)}function gf(N){return N>2?De(N):N}var xf=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function bf(N){N=gf(N);var E=xf[N]||(typeof document!="undefined"?document.querySelector(N):void 0);return E}function tu(N){return bf(N)}function op(N,E,P){var q=tu(N);if(!q)return-4;if(q.canvasSharedPtr&&(o()[q.canvasSharedPtr>>2]=E,o()[q.canvasSharedPtr+4>>2]=P),q.offscreenCanvas||!q.controlTransferredOffscreen){q.offscreenCanvas&&(q=q.offscreenCanvas);var pe=!1;if(q.GLctxObject&&q.GLctxObject.GLctx){var le=q.GLctxObject.GLctx.getParameter(2978);pe=le[0]===0&&le[1]===0&&le[2]===q.width&&le[3]===q.height}q.width=E,q.height=P,pe&&q.GLctxObject.GLctx.viewport(0,0,E,P)}else if(q.canvasSharedPtr){var ue=o()[q.canvasSharedPtr+8>>2];return yf(ue,N,E,P),1}else return-4;return 0}function lp(N,E,P){return v?yr(2,1,N,E,P):op(N,E,P)}function vf(N,E,P){var q=tu(N);return q?op(N,E,P):lp(N,E,P)}function wf(N){}function kf(N,E){}function If(N){var E=N.getExtension("ANGLE_instanced_arrays");if(E)return N.vertexAttribDivisor=function(P,q){E.vertexAttribDivisorANGLE(P,q)},N.drawArraysInstanced=function(P,q,pe,le){E.drawArraysInstancedANGLE(P,q,pe,le)},N.drawElementsInstanced=function(P,q,pe,le,ue){E.drawElementsInstancedANGLE(P,q,pe,le,ue)},1}function Sf(N){var E=N.getExtension("OES_vertex_array_object");if(E)return N.createVertexArray=function(){return E.createVertexArrayOES()},N.deleteVertexArray=function(P){E.deleteVertexArrayOES(P)},N.bindVertexArray=function(P){E.bindVertexArrayOES(P)},N.isVertexArray=function(P){return E.isVertexArrayOES(P)},1}function Nf(N){var E=N.getExtension("WEBGL_draw_buffers");if(E)return N.drawBuffers=function(P,q){E.drawBuffersWEBGL(P,q)},1}function Tf(N){return!!(N.multiDrawWebgl=N.getExtension("WEBGL_multi_draw"))}var Je={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(N){Je.lastError||(Je.lastError=N)},getNewId:function(N){for(var E=Je.counter++,P=N.length;P>2]:-1;pe+=De(o()[P+le*4>>2],ue<0?void 0:ue)}return pe},createContext:function(N,E){var P=N.getContext("webgl",E);if(!P)return 0;var q=Je.registerContext(P,E);return q},registerContext:function(N,E){var P=ns(8);o()[P+4>>2]=Hi();var q={handle:P,attributes:E,version:E.majorVersion,GLctx:N};return N.canvas&&(N.canvas.GLctxObject=q),Je.contexts[P]=q,(typeof E.enableExtensionsByDefault=="undefined"||E.enableExtensionsByDefault)&&Je.initExtensions(q),P},makeContextCurrent:function(N){return Je.currentContext=Je.contexts[N],u.ctx=gr=Je.currentContext&&Je.currentContext.GLctx,!(N&&!gr)},getContext:function(N){return Je.contexts[N]},deleteContext:function(N){Je.currentContext===Je.contexts[N]&&(Je.currentContext=null),typeof Pe=="object"&&Pe.removeAllHandlersOnTarget(Je.contexts[N].GLctx.canvas),Je.contexts[N]&&Je.contexts[N].GLctx.canvas&&(Je.contexts[N].GLctx.canvas.GLctxObject=void 0),su(Je.contexts[N].handle),Je.contexts[N]=null},initExtensions:function(N){if(N||(N=Je.currentContext),!N.initExtensionsDone){N.initExtensionsDone=!0;var E=N.GLctx;If(E),Sf(E),Nf(E),E.disjointTimerQueryExt=E.getExtension("EXT_disjoint_timer_query"),Tf(E);var P=E.getSupportedExtensions()||[];P.forEach(function(q){q.indexOf("lose_context")<0&&q.indexOf("debug")<0&&E.getExtension(q)})}},populateUniformTable:function(N){for(var E=Je.programs[N],P=Je.programInfos[N]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},q=P.uniforms,pe=gr.getProgramParameter(E,35718),le=0;le>2,q=o()[P+(24>>2)],pe={alpha:!!o()[P+(0>>2)],depth:!!o()[P+(4>>2)],stencil:!!o()[P+(8>>2)],antialias:!!o()[P+(12>>2)],premultipliedAlpha:!!o()[P+(16>>2)],preserveDrawingBuffer:!!o()[P+(20>>2)],powerPreference:Ef[q],failIfMajorPerformanceCaveat:!!o()[P+(28>>2)],majorVersion:o()[P+(32>>2)],minorVersion:o()[P+(36>>2)],enableExtensionsByDefault:o()[P+(40>>2)],explicitSwapControl:o()[P+(44>>2)],proxyContextToMainThread:o()[P+(48>>2)],renderViaOffscreenBackBuffer:o()[P+(52>>2)]},le=tu(N);if(!le||pe.explicitSwapControl)return 0;var ue=Je.createContext(le,pe);return ue}function Rf(N,E){return Cf(N,E)}var ji={mappings:{},buffers:[null,[],[]],printChar:function(N,E){var P=ji.buffers[N];E===0||E===10?((N===1?X:G)(ze(P,0)),P.length=0):P.push(E)},varargs:void 0,get:function(){ji.varargs+=4;var N=o()[ji.varargs-4>>2];return N},getStr:function(N){var E=De(N);return E},get64:function(N,E){return N}};function up(N){return v?yr(3,1,N):0}function dp(N,E,P,q,pe){if(v)return yr(4,1,N,E,P,q,pe)}function pp(N,E,P,q){if(v)return yr(5,1,N,E,P,q);for(var pe=0,le=0;le>2],be=o()[E+(le*8+4)>>2],tt=0;tt>2]=pe,0}function Mf(N){var E=we.threadExitHandlers.pop();N&&E()}function Ff(N,E){we.threadExitHandlers.push(function(){ta.get(N)(E)})}function cp(N){if(v)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var E=we.getNewWorker();if(E.pthread!==void 0)throw"Internal error!";if(!N.pthread_ptr)throw"Internal error, no pthread ptr!";we.runningWorkers.push(E);for(var P=ns(128*4),q=0;q<128;++q)o()[P+q*4>>2]=0;var pe=N.stackBase+N.stackSize,le=we.pthreads[N.pthread_ptr]={worker:E,stackBase:N.stackBase,stackSize:N.stackSize,allocatedOwnStack:N.allocatedOwnStack,threadInfoStruct:N.pthread_ptr},ue=le.threadInfoStruct>>2;Atomics.store(l(),ue+(64>>2),N.detached),Atomics.store(l(),ue+(100>>2),P),Atomics.store(l(),ue+(40>>2),le.threadInfoStruct),Atomics.store(l(),ue+(80>>2),N.stackSize),Atomics.store(l(),ue+(76>>2),pe),Atomics.store(l(),ue+(104>>2),N.stackSize),Atomics.store(l(),ue+(104+8>>2),pe),Atomics.store(l(),ue+(104+12>>2),N.detached);var be=Ig(),tt=be+40;Atomics.store(l(),ue+(172>>2),tt),E.pthread=le;var Bt={cmd:"run",start_routine:N.startRoutine,arg:N.arg,threadInfoStruct:N.pthread_ptr,stackBase:N.stackBase,stackSize:N.stackSize};E.runPthread=function(){Bt.time=performance.now(),E.postMessage(Bt,N.transferList)},E.loaded&&(E.runPthread(),delete E.runPthread)}function $f(N,E,P,q){if(typeof SharedArrayBuffer=="undefined")return G("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!N)return G("pthread_create called with a null thread pointer!"),28;var pe=[],le=0;if(v&&(pe.length===0||le))return Eg(687865856,N,E,P,q);if(le)return le;var ue=0,be=0,tt=0;E&&E!=-1?(ue=o()[E>>2],ue+=81920,be=o()[E+8>>2],tt=o()[E+12>>2]!==0):ue=2097152;var Bt=be==0;Bt?be=Mg(16,ue):(be-=ue,ce(be>0));for(var $t=ns(228),br=0;br<228>>2;++br)l()[($t>>2)+br]=0;o()[N>>2]=$t,o()[$t+12>>2]=$t;var Ki=$t+152;o()[Ki>>2]=Ki;var bn={stackBase:be,stackSize:ue,allocatedOwnStack:Bt,detached:tt,startRoutine:P,pthread_ptr:$t,arg:q,transferList:pe};return v?(bn.cmd="spawnThread",postMessage(bn,pe)):cp(bn),0}function hp(N){if(v)return yr(6,1,N);switch(N){case 30:return 16384;case 85:var E=2147483648;return E/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return ef(28),-1}v||we.initMainThreadBlock();var gr,Df=[null,tf,lp,up,dp,pp,hp],Of={e:J0,r:Q0,x:nf,b:af,y:rf,j:sf,c:of,d:Jl,f:ts,p:lf,z:uf,u:pf,q:ff,v:vf,i:wf,t:kf,w:Rf,m:up,n:dp,g:pp,o:ip,a:Q||u.wasmMemory,k:Mf,l:Ff,h:$f,s:hp},wg=U0(),fp=u.___wasm_call_ctors=function(){return(fp=u.___wasm_call_ctors=u.asm.A).apply(null,arguments)},zf=u._init=function(){return(zf=u._init=u.asm.B).apply(null,arguments)},_f=u._register_tensor=function(){return(_f=u._register_tensor=u.asm.C).apply(null,arguments)},Pf=u._dispose_data=function(){return(Pf=u._dispose_data=u.asm.D).apply(null,arguments)},Lf=u._dispose=function(){return(Lf=u._dispose=u.asm.E).apply(null,arguments)},Wf=u._Abs=function(){return(Wf=u._Abs=u.asm.G).apply(null,arguments)},Bf=u._Add=function(){return(Bf=u._Add=u.asm.H).apply(null,arguments)},Vf=u._AddN=function(){return(Vf=u._AddN=u.asm.I).apply(null,arguments)},jf=u._All=function(){return(jf=u._All=u.asm.J).apply(null,arguments)},Uf=u._Any=function(){return(Uf=u._Any=u.asm.K).apply(null,arguments)},Hf=u._ArgMax=function(){return(Hf=u._ArgMax=u.asm.L).apply(null,arguments)},Gf=u._AvgPool=function(){return(Gf=u._AvgPool=u.asm.M).apply(null,arguments)},qf=u._BatchMatMul=function(){return(qf=u._BatchMatMul=u.asm.N).apply(null,arguments)},Xf=u._Ceil=function(){return(Xf=u._Ceil=u.asm.O).apply(null,arguments)},Kf=u._ClipByValue=function(){return(Kf=u._ClipByValue=u.asm.P).apply(null,arguments)},Zf=u._Conv2D=function(){return(Zf=u._Conv2D=u.asm.Q).apply(null,arguments)},Yf=u._Conv2DBackpropInput=function(){return(Yf=u._Conv2DBackpropInput=u.asm.R).apply(null,arguments)},Jf=u._Cos=function(){return(Jf=u._Cos=u.asm.S).apply(null,arguments)},Qf=u._CropAndResize=function(){return(Qf=u._CropAndResize=u.asm.T).apply(null,arguments)},em=u._Cumsum=function(){return(em=u._Cumsum=u.asm.U).apply(null,arguments)},tm=u._DepthToSpace=function(){return(tm=u._DepthToSpace=u.asm.V).apply(null,arguments)},mp=u._DepthwiseConv2dNative=function(){return(mp=u._DepthwiseConv2dNative=u.asm.W).apply(null,arguments)},Ap=u._Equal=function(){return(Ap=u._Equal=u.asm.X).apply(null,arguments)},yp=u._Exp=function(){return(yp=u._Exp=u.asm.Y).apply(null,arguments)},nu=u._FlipLeftRight=function(){return(nu=u._FlipLeftRight=u.asm.Z).apply(null,arguments)},Ui=u._Floor=function(){return(Ui=u._Floor=u.asm._).apply(null,arguments)},nm=u._FloorDiv=function(){return(nm=u._FloorDiv=u.asm.$).apply(null,arguments)},au=u._FusedBatchNorm=function(){return(au=u._FusedBatchNorm=u.asm.aa).apply(null,arguments)},K=u._FusedConv2D=function(){return(K=u._FusedConv2D=u.asm.ba).apply(null,arguments)},ne=u._FusedDepthwiseConv2D=function(){return(ne=u._FusedDepthwiseConv2D=u.asm.ca).apply(null,arguments)},Ne=u._Gather=function(){return(Ne=u._Gather=u.asm.da).apply(null,arguments)},Ke=u._GatherNd=function(){return(Ke=u._GatherNd=u.asm.ea).apply(null,arguments)},St=u._Greater=function(){return(St=u._Greater=u.asm.fa).apply(null,arguments)},mt=u._GreaterEqual=function(){return(mt=u._GreaterEqual=u.asm.ga).apply(null,arguments)},je=u._LeakyRelu=function(){return(je=u._LeakyRelu=u.asm.ha).apply(null,arguments)},He=u._Less=function(){return(He=u._Less=u.asm.ia).apply(null,arguments)},Zt=u._LessEqual=function(){return(Zt=u._LessEqual=u.asm.ja).apply(null,arguments)},Ja=u._Log=function(){return(Ja=u._Log=u.asm.ka).apply(null,arguments)},Qa=u._LogicalAnd=function(){return(Qa=u._LogicalAnd=u.asm.la).apply(null,arguments)},gp=u._Max=function(){return(gp=u._Max=u.asm.ma).apply(null,arguments)},ru=u._MaxPool=function(){return(ru=u._MaxPool=u.asm.na).apply(null,arguments)},Un=u._Maximum=function(){return(Un=u._Maximum=u.asm.oa).apply(null,arguments)},xr=u._Mean=function(){return(xr=u._Mean=u.asm.pa).apply(null,arguments)},xp=u._Min=function(){return(xp=u._Min=u.asm.qa).apply(null,arguments)},Gk=u._Minimum=function(){return(Gk=u._Minimum=u.asm.ra).apply(null,arguments)},qk=u._MirrorPad=function(){return(qk=u._MirrorPad=u.asm.sa).apply(null,arguments)},Xk=u._Multiply=function(){return(Xk=u._Multiply=u.asm.ta).apply(null,arguments)},Kk=u._Neg=function(){return(Kk=u._Neg=u.asm.ua).apply(null,arguments)},Zk=u._NonMaxSuppressionV3=function(){return(Zk=u._NonMaxSuppressionV3=u.asm.va).apply(null,arguments)},Yk=u._NonMaxSuppressionV4=function(){return(Yk=u._NonMaxSuppressionV4=u.asm.wa).apply(null,arguments)},Jk=u._NonMaxSuppressionV5=function(){return(Jk=u._NonMaxSuppressionV5=u.asm.xa).apply(null,arguments)},Qk=u._NotEqual=function(){return(Qk=u._NotEqual=u.asm.ya).apply(null,arguments)},e9=u._OneHot=function(){return(e9=u._OneHot=u.asm.za).apply(null,arguments)},t9=u._PadV2=function(){return(t9=u._PadV2=u.asm.Aa).apply(null,arguments)},n9=u._Pow=function(){return(n9=u._Pow=u.asm.Ba).apply(null,arguments)},a9=u._Prelu=function(){return(a9=u._Prelu=u.asm.Ca).apply(null,arguments)},r9=u._Prod=function(){return(r9=u._Prod=u.asm.Da).apply(null,arguments)},s9=u._RealDiv=function(){return(s9=u._RealDiv=u.asm.Ea).apply(null,arguments)},i9=u._Relu=function(){return(i9=u._Relu=u.asm.Fa).apply(null,arguments)},o9=u._Relu6=function(){return(o9=u._Relu6=u.asm.Ga).apply(null,arguments)},l9=u._ResizeBilinear=function(){return(l9=u._ResizeBilinear=u.asm.Ha).apply(null,arguments)},u9=u._Reverse=function(){return(u9=u._Reverse=u.asm.Ia).apply(null,arguments)},d9=u._RotateWithOffset=function(){return(d9=u._RotateWithOffset=u.asm.Ja).apply(null,arguments)},p9=u._Round=function(){return(p9=u._Round=u.asm.Ka).apply(null,arguments)},c9=u._Rsqrt=function(){return(c9=u._Rsqrt=u.asm.La).apply(null,arguments)},h9=u._ScatterNd=function(){return(h9=u._ScatterNd=u.asm.Ma).apply(null,arguments)},f9=u._SelectV2=function(){return(f9=u._SelectV2=u.asm.Na).apply(null,arguments)},m9=u._Sigmoid=function(){return(m9=u._Sigmoid=u.asm.Oa).apply(null,arguments)},A9=u._Sin=function(){return(A9=u._Sin=u.asm.Pa).apply(null,arguments)},y9=u._Softmax=function(){return(y9=u._Softmax=u.asm.Qa).apply(null,arguments)},g9=u._Sqrt=function(){return(g9=u._Sqrt=u.asm.Ra).apply(null,arguments)},x9=u._Square=function(){return(x9=u._Square=u.asm.Sa).apply(null,arguments)},b9=u._SquaredDifference=function(){return(b9=u._SquaredDifference=u.asm.Ta).apply(null,arguments)},v9=u._Step=function(){return(v9=u._Step=u.asm.Ua).apply(null,arguments)},w9=u._StridedSlice=function(){return(w9=u._StridedSlice=u.asm.Va).apply(null,arguments)},k9=u._Sub=function(){return(k9=u._Sub=u.asm.Wa).apply(null,arguments)},I9=u._Sum=function(){return(I9=u._Sum=u.asm.Xa).apply(null,arguments)},S9=u._Tan=function(){return(S9=u._Tan=u.asm.Ya).apply(null,arguments)},N9=u._Tanh=function(){return(N9=u._Tanh=u.asm.Za).apply(null,arguments)},T9=u._Tile=function(){return(T9=u._Tile=u.asm._a).apply(null,arguments)},E9=u._TopK=function(){return(E9=u._TopK=u.asm.$a).apply(null,arguments)},C9=u._Transpose=function(){return(C9=u._Transpose=u.asm.ab).apply(null,arguments)},R9=u.__FusedMatMul=function(){return(R9=u.__FusedMatMul=u.asm.bb).apply(null,arguments)},ns=u._malloc=function(){return(ns=u._malloc=u.asm.cb).apply(null,arguments)},su=u._free=function(){return(su=u._free=u.asm.db).apply(null,arguments)},kg=u.___errno_location=function(){return(kg=u.___errno_location=u.asm.eb).apply(null,arguments)},Ig=u._emscripten_get_global_libc=function(){return(Ig=u._emscripten_get_global_libc=u.asm.fb).apply(null,arguments)},Hi=u._pthread_self=function(){return(Hi=u._pthread_self=u.asm.gb).apply(null,arguments)},Sg=u.___pthread_tsd_run_dtors=function(){return(Sg=u.___pthread_tsd_run_dtors=u.asm.hb).apply(null,arguments)},am=u._emscripten_main_thread_process_queued_calls=function(){return(am=u._emscripten_main_thread_process_queued_calls=u.asm.ib).apply(null,arguments)},M9=u._emscripten_current_thread_process_queued_calls=function(){return(M9=u._emscripten_current_thread_process_queued_calls=u.asm.jb).apply(null,arguments)},Ng=u._emscripten_register_main_browser_thread_id=function(){return(Ng=u._emscripten_register_main_browser_thread_id=u.asm.kb).apply(null,arguments)},Tg=u.__emscripten_do_dispatch_to_thread=function(){return(Tg=u.__emscripten_do_dispatch_to_thread=u.asm.lb).apply(null,arguments)},Eg=u._emscripten_sync_run_in_main_thread_4=function(){return(Eg=u._emscripten_sync_run_in_main_thread_4=u.asm.mb).apply(null,arguments)},Cg=u._emscripten_run_in_main_runtime_thread_js=function(){return(Cg=u._emscripten_run_in_main_runtime_thread_js=u.asm.nb).apply(null,arguments)},rm=u.__emscripten_call_on_thread=function(){return(rm=u.__emscripten_call_on_thread=u.asm.ob).apply(null,arguments)},F9=u._emscripten_tls_init=function(){return(F9=u._emscripten_tls_init=u.asm.pb).apply(null,arguments)},sm=u.__emscripten_thread_init=function(){return(sm=u.__emscripten_thread_init=u.asm.qb).apply(null,arguments)},iu=u.stackSave=function(){return(iu=u.stackSave=u.asm.rb).apply(null,arguments)},Gi=u.stackRestore=function(){return(Gi=u.stackRestore=u.asm.sb).apply(null,arguments)},qi=u.stackAlloc=function(){return(qi=u.stackAlloc=u.asm.tb).apply(null,arguments)},Rg=u._emscripten_stack_set_limits=function(){return(Rg=u._emscripten_stack_set_limits=u.asm.ub).apply(null,arguments)},Mg=u._memalign=function(){return(Mg=u._memalign=u.asm.vb).apply(null,arguments)},Fg=u.__emscripten_allow_main_runtime_queued_calls=9808,Xi=u.__emscripten_main_thread_futex=11432;u.cwrap=$e,u.PThread=we,u.PThread=we,u.wasmMemory=Q,u.ExitStatus=ou;var bp;function ou(N){this.name="ExitStatus",this.message="Program terminated with exit("+N+")",this.status=N}es=function N(){bp||im(),bp||(es=N)};function im(N){if(N=N||f,Za>0)return;if(v){p(u),Yl(),postMessage({cmd:"loaded"});return}if(_0(),Za>0)return;function E(){bp||(bp=!0,u.calledRun=!0,!oe&&(Yl(),P0(),p(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),gn()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),E()},1)):E()}u.run=im;function $9(N,E){if(!(E&&ie&&N===0)){if(!E&&v)throw postMessage({cmd:"exitProcess",returnCode:N}),new ou(N);ie||(we.terminateAllThreads(),me=N,ep(),u.onExit&&u.onExit(N),oe=!0),y(N,new ou(N))}}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return v&&(ie=!1,we.initWorker()),im(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=n)}),Q9=bt((e,t)=>{var n=function(){var a=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(a=a||__filename),function(r){r=r||{};var s=typeof r!="undefined"?r:{},i,o;s.ready=new Promise(function(K,ne){i=K,o=ne});var l={},d;for(d in s)s.hasOwnProperty(d)&&(l[d]=s[d]);var u=[],p="./this.program",c=function(K,ne){throw ne},h=!1,m=!1,f=!1,A=!1;h=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",A=!h&&!f&&!m;var y="";function g(K){return s.locateFile?s.locateFile(K,y):y+K}var x,k,b,v,I,T;f?(m?y=uu().dirname(y)+"/":y=__dirname+"/",x=function(K,ne){return I||(I=require("fs")),T||(T=uu()),K=T.normalize(K),I.readFileSync(K,ne?null:"utf8")},b=function(K){var ne=x(K,!0);return ne.buffer||(ne=new Uint8Array(ne)),X(ne.buffer),ne},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",function(K){if(!(K instanceof nm))throw K}),process.on("unhandledRejection",Ma),c=function(K){process.exit(K)},s.inspect=function(){return"[Emscripten Module object]"}):A?(typeof read!="undefined"&&(x=function(K){return read(K)}),b=function(K){var ne;return typeof readbuffer=="function"?new Uint8Array(readbuffer(K)):(ne=read(K,"binary"),X(typeof ne=="object"),ne)},typeof scriptArgs!="undefined"?u=scriptArgs:typeof arguments!="undefined"&&(u=arguments),typeof quit=="function"&&(c=function(K){quit(K)}),typeof print!="undefined"&&(typeof console=="undefined"&&(console={}),console.log=print,console.warn=console.error=typeof printErr!="undefined"?printErr:print)):(h||m)&&(m?y=self.location.href:typeof document!="undefined"&&document.currentScript&&(y=document.currentScript.src),a&&(y=a),y.indexOf("blob:")!==0?y=y.substr(0,y.lastIndexOf("/")+1):y="",x=function(K){var ne=new XMLHttpRequest;return ne.open("GET",K,!1),ne.send(null),ne.responseText},m&&(b=function(K){var ne=new XMLHttpRequest;return ne.open("GET",K,!1),ne.responseType="arraybuffer",ne.send(null),new Uint8Array(ne.response)}),k=function(K,ne,Ne){var Ke=new XMLHttpRequest;Ke.open("GET",K,!0),Ke.responseType="arraybuffer",Ke.onload=function(){if(Ke.status==200||Ke.status==0&&Ke.response){ne(Ke.response);return}Ne()},Ke.onerror=Ne,Ke.send(null)},v=function(K){document.title=K});var R=s.print||console.log.bind(console),$=s.printErr||console.warn.bind(console);for(d in l)l.hasOwnProperty(d)&&(s[d]=l[d]);l=null,s.arguments&&(u=s.arguments),s.thisProgram&&(p=s.thisProgram),s.quit&&(c=s.quit);var z;s.wasmBinary&&(z=s.wasmBinary);var _=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Ma("no native wasm support detected");var V,j=!1,U;function X(K,ne){K||Ma("Assertion failed: "+ne)}function G(K){var ne=s["_"+K];return X(ne,"Cannot call unknown function "+K+", make sure it is exported"),ne}function ee(K,ne,Ne,Ke,St){var mt={string:function(Un){var xr=0;if(Un!=null&&Un!==0){var xp=(Un.length<<2)+1;xr=nu(xp),de(Un,xr,xp)}return xr},array:function(Un){var xr=nu(Un.length);return oe(Un,xr),xr}};function je(Un){return ne==="string"?ie(Un):ne==="boolean"?Boolean(Un):Un}var He=G(K),Zt=[],Ja=0;if(Ke)for(var Qa=0;Qa=Ke);)++St;if(St-ne>16&&K.subarray&&re)return re.decode(K.subarray(ne,St));for(var mt="";ne>10,56320|Ja&1023)}}return mt}function ie(K,ne){return K?te(Se,K,ne):""}function Q(K,ne,Ne,Ke){if(!(Ke>0))return 0;for(var St=Ne,mt=Ne+Ke-1,je=0;je=55296&&He<=57343){var Zt=K.charCodeAt(++je);He=65536+((He&1023)<<10)|Zt&1023}if(He<=127){if(Ne>=mt)break;ne[Ne++]=He}else if(He<=2047){if(Ne+1>=mt)break;ne[Ne++]=192|He>>6,ne[Ne++]=128|He&63}else if(He<=65535){if(Ne+2>=mt)break;ne[Ne++]=224|He>>12,ne[Ne++]=128|He>>6&63,ne[Ne++]=128|He&63}else{if(Ne+3>=mt)break;ne[Ne++]=240|He>>18,ne[Ne++]=128|He>>12&63,ne[Ne++]=128|He>>6&63,ne[Ne++]=128|He&63}}return ne[Ne]=0,Ne-St}function de(K,ne,Ne){return Q(K,Se,ne,Ne)}function oe(K,ne){ke.set(K,ne)}function me(K,ne){return K%ne>0&&(K+=ne-K%ne),K}var ce,ke,Se,$e,ze,De,Qe,et,rt;function Xe(K){ce=K,s.HEAP8=ke=new Int8Array(K),s.HEAP16=$e=new Int16Array(K),s.HEAP32=De=new Int32Array(K),s.HEAPU8=Se=new Uint8Array(K),s.HEAPU16=ze=new Uint16Array(K),s.HEAPU32=Qe=new Uint32Array(K),s.HEAPF32=et=new Float32Array(K),s.HEAPF64=rt=new Float64Array(K)}var pt=s.INITIAL_MEMORY||16777216,Ve,An=[],xt=[],Vn=[],Xt=[],yn=!1;xt.push({func:function(){ip()}});function jn(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Ra(s.preRun.shift());Ar(An)}function Mn(){yn=!0,Ar(xt)}function an(){Ar(Vn)}function Kt(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)ta(s.postRun.shift());Ar(Xt)}function Ra(K){An.unshift(K)}function ta(K){Xt.unshift(K)}var na=0,fr=null,Ka=null;function mr(K){na++,s.monitorRunDependencies&&s.monitorRunDependencies(na)}function Wi(K){if(na--,s.monitorRunDependencies&&s.monitorRunDependencies(na),na==0&&(fr!==null&&(clearInterval(fr),fr=null),Ka)){var ne=Ka;Ka=null,ne()}}s.preloadedImages={},s.preloadedAudios={};function Ma(K){s.onAbort&&s.onAbort(K),K+="",$(K),j=!0,U=1,K="abort("+K+"). Build with -s ASSERTIONS=1 for more info.";var ne=new WebAssembly.RuntimeError(K);throw o(ne),ne}function Qd(K,ne){return String.prototype.startsWith?K.startsWith(ne):K.indexOf(ne)===0}var _0="data:application/octet-stream;base64,";function Yl(K){return Qd(K,_0)}var P0="file://";function ep(K){return Qd(K,P0)}var gn="tfjs-backend-wasm.wasm";Yl(gn)||(gn=g(gn));function tp(K){try{if(K==gn&&z)return new Uint8Array(z);if(b)return b(K);throw"both async and sync fetching of the wasm failed"}catch(ne){Ma(ne)}}function L0(){if(!z&&(h||m)){if(typeof fetch=="function"&&!ep(gn))return fetch(gn,{credentials:"same-origin"}).then(function(K){if(!K.ok)throw"failed to load wasm binary file at '"+gn+"'";return K.arrayBuffer()}).catch(function(){return tp(gn)});if(k)return new Promise(function(K,ne){k(gn,function(Ne){K(new Uint8Array(Ne))},ne)})}return Promise.resolve().then(function(){return tp(gn)})}function Za(){var K={a:U0};function ne(je,He){var Zt=je.exports;s.asm=Zt,V=s.asm.i,Xe(V.buffer),Ve=s.asm.o,Wi("wasm-instantiate")}mr("wasm-instantiate");function Ne(je){ne(je.instance)}function Ke(je){return L0().then(function(He){return WebAssembly.instantiate(He,K)}).then(je,function(He){$("failed to asynchronously prepare wasm: "+He),Ma(He)})}function St(){return!z&&typeof WebAssembly.instantiateStreaming=="function"&&!Yl(gn)&&!ep(gn)&&typeof fetch=="function"?fetch(gn,{credentials:"same-origin"}).then(function(je){var He=WebAssembly.instantiateStreaming(je,K);return He.then(Ne,function(Zt){return $("wasm streaming compile failed: "+Zt),$("falling back to ArrayBuffer instantiation"),Ke(Ne)})}):Ke(Ne)}if(s.instantiateWasm)try{var mt=s.instantiateWasm(K,ne);return mt}catch(je){return $("Module.instantiateWasm callback failed with error: "+je),!1}return St().catch(o),{}}function Ar(K){for(;K.length>0;){var ne=K.shift();if(typeof ne=="function"){ne(s);continue}var Ne=ne.func;typeof Ne=="number"?ne.arg===void 0?Ve.get(Ne)():Ve.get(Ne)(ne.arg):Ne(ne.arg===void 0?null:ne.arg)}}function es(){Ma()}function W0(K,ne,Ne){Se.copyWithin(K,ne,ne+Ne)}function B0(){return Se.length}function Ya(K){try{return V.grow(K-ce.byteLength+65535>>>16),Xe(V.buffer),1}catch(ne){}}function np(K){var ne=B0(),Ne=2147483648;if(K>Ne)return!1;for(var Ke=1;Ke<=4;Ke*=2){var St=ne*(1+.2/Ke);St=Math.min(St,K+100663296);var mt=Math.min(Ne,me(Math.max(K,St),65536)),je=Ya(mt);if(je)return!0}return!1}var Bi={mappings:{},buffers:[null,[],[]],printChar:function(K,ne){var Ne=Bi.buffers[K];ne===0||ne===10?((K===1?R:$)(te(Ne,0)),Ne.length=0):Ne.push(ne)},varargs:void 0,get:function(){Bi.varargs+=4;var K=De[Bi.varargs-4>>2];return K},getStr:function(K){var ne=ie(K);return ne},get64:function(K,ne){return K}};function ap(K){return 0}function V0(K,ne,Ne,Ke,St){}function rp(K,ne,Ne,Ke){for(var St=0,mt=0;mt>2],He=De[ne+(mt*8+4)>>2],Zt=0;Zt>2]=St,0}function xn(){return 6}function sp(K){return De[mp()>>2]=K,K}function j0(K){switch(K){case 30:return 16384;case 85:var ne=2147483648;return ne/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return sp(28),-1}var U0={a:es,d:W0,e:np,f:ap,c:V0,b:rp,g:xn,h:j0},H0=Za(),ip=s.___wasm_call_ctors=function(){return(ip=s.___wasm_call_ctors=s.asm.j).apply(null,arguments)},Vi=s._init=function(){return(Vi=s._init=s.asm.k).apply(null,arguments)},Jl=s._register_tensor=function(){return(Jl=s._register_tensor=s.asm.l).apply(null,arguments)},G0=s._dispose_data=function(){return(G0=s._dispose_data=s.asm.m).apply(null,arguments)},q0=s._dispose=function(){return(q0=s._dispose=s.asm.n).apply(null,arguments)},X0=s._Abs=function(){return(X0=s._Abs=s.asm.p).apply(null,arguments)},we=s._Add=function(){return(we=s._Add=s.asm.q).apply(null,arguments)},K0=s._AddN=function(){return(K0=s._AddN=s.asm.r).apply(null,arguments)},Z0=s._All=function(){return(Z0=s._All=s.asm.s).apply(null,arguments)},Y0=s._Any=function(){return(Y0=s._Any=s.asm.t).apply(null,arguments)},J0=s._ArgMax=function(){return(J0=s._ArgMax=s.asm.u).apply(null,arguments)},Q0=s._AvgPool=function(){return(Q0=s._AvgPool=s.asm.v).apply(null,arguments)},ts=s._BatchMatMul=function(){return(ts=s._BatchMatMul=s.asm.w).apply(null,arguments)},ef=s._Ceil=function(){return(ef=s._Ceil=s.asm.x).apply(null,arguments)},tf=s._ClipByValue=function(){return(tf=s._ClipByValue=s.asm.y).apply(null,arguments)},nf=s._Conv2D=function(){return(nf=s._Conv2D=s.asm.z).apply(null,arguments)},af=s._Conv2DBackpropInput=function(){return(af=s._Conv2DBackpropInput=s.asm.A).apply(null,arguments)},rf=s._Cos=function(){return(rf=s._Cos=s.asm.B).apply(null,arguments)},sf=s._CropAndResize=function(){return(sf=s._CropAndResize=s.asm.C).apply(null,arguments)},of=s._Cumsum=function(){return(of=s._Cumsum=s.asm.D).apply(null,arguments)},lf=s._DepthToSpace=function(){return(lf=s._DepthToSpace=s.asm.E).apply(null,arguments)},uf=s._DepthwiseConv2dNative=function(){return(uf=s._DepthwiseConv2dNative=s.asm.F).apply(null,arguments)},yr=s._Equal=function(){return(yr=s._Equal=s.asm.G).apply(null,arguments)},Ql=s._Exp=function(){return(Ql=s._Exp=s.asm.H).apply(null,arguments)},eu=s._FlipLeftRight=function(){return(eu=s._FlipLeftRight=s.asm.I).apply(null,arguments)},df=s._Floor=function(){return(df=s._Floor=s.asm.J).apply(null,arguments)},pf=s._FloorDiv=function(){return(pf=s._FloorDiv=s.asm.K).apply(null,arguments)},cf=s._FusedBatchNorm=function(){return(cf=s._FusedBatchNorm=s.asm.L).apply(null,arguments)},hf=s._FusedConv2D=function(){return(hf=s._FusedConv2D=s.asm.M).apply(null,arguments)},ff=s._FusedDepthwiseConv2D=function(){return(ff=s._FusedDepthwiseConv2D=s.asm.N).apply(null,arguments)},Pe=s._Gather=function(){return(Pe=s._Gather=s.asm.O).apply(null,arguments)},mf=s._GatherNd=function(){return(mf=s._GatherNd=s.asm.P).apply(null,arguments)},Af=s._Greater=function(){return(Af=s._Greater=s.asm.Q).apply(null,arguments)},yf=s._GreaterEqual=function(){return(yf=s._GreaterEqual=s.asm.R).apply(null,arguments)},gf=s._LeakyRelu=function(){return(gf=s._LeakyRelu=s.asm.S).apply(null,arguments)},xf=s._Less=function(){return(xf=s._Less=s.asm.T).apply(null,arguments)},bf=s._LessEqual=function(){return(bf=s._LessEqual=s.asm.U).apply(null,arguments)},tu=s._Log=function(){return(tu=s._Log=s.asm.V).apply(null,arguments)},op=s._LogicalAnd=function(){return(op=s._LogicalAnd=s.asm.W).apply(null,arguments)},lp=s._Max=function(){return(lp=s._Max=s.asm.X).apply(null,arguments)},vf=s._MaxPool=function(){return(vf=s._MaxPool=s.asm.Y).apply(null,arguments)},wf=s._Maximum=function(){return(wf=s._Maximum=s.asm.Z).apply(null,arguments)},kf=s._Mean=function(){return(kf=s._Mean=s.asm._).apply(null,arguments)},If=s._Min=function(){return(If=s._Min=s.asm.$).apply(null,arguments)},Sf=s._Minimum=function(){return(Sf=s._Minimum=s.asm.aa).apply(null,arguments)},Nf=s._MirrorPad=function(){return(Nf=s._MirrorPad=s.asm.ba).apply(null,arguments)},Tf=s._Multiply=function(){return(Tf=s._Multiply=s.asm.ca).apply(null,arguments)},Je=s._Neg=function(){return(Je=s._Neg=s.asm.da).apply(null,arguments)},Ef=s._NonMaxSuppressionV3=function(){return(Ef=s._NonMaxSuppressionV3=s.asm.ea).apply(null,arguments)},Cf=s._NonMaxSuppressionV4=function(){return(Cf=s._NonMaxSuppressionV4=s.asm.fa).apply(null,arguments)},Rf=s._NonMaxSuppressionV5=function(){return(Rf=s._NonMaxSuppressionV5=s.asm.ga).apply(null,arguments)},ji=s._NotEqual=function(){return(ji=s._NotEqual=s.asm.ha).apply(null,arguments)},up=s._OneHot=function(){return(up=s._OneHot=s.asm.ia).apply(null,arguments)},dp=s._PadV2=function(){return(dp=s._PadV2=s.asm.ja).apply(null,arguments)},pp=s._Pow=function(){return(pp=s._Pow=s.asm.ka).apply(null,arguments)},Mf=s._Prelu=function(){return(Mf=s._Prelu=s.asm.la).apply(null,arguments)},Ff=s._Prod=function(){return(Ff=s._Prod=s.asm.ma).apply(null,arguments)},cp=s._RealDiv=function(){return(cp=s._RealDiv=s.asm.na).apply(null,arguments)},$f=s._Relu=function(){return($f=s._Relu=s.asm.oa).apply(null,arguments)},hp=s._Relu6=function(){return(hp=s._Relu6=s.asm.pa).apply(null,arguments)},gr=s._ResizeBilinear=function(){return(gr=s._ResizeBilinear=s.asm.qa).apply(null,arguments)},Df=s._Reverse=function(){return(Df=s._Reverse=s.asm.ra).apply(null,arguments)},Of=s._RotateWithOffset=function(){return(Of=s._RotateWithOffset=s.asm.sa).apply(null,arguments)},wg=s._Round=function(){return(wg=s._Round=s.asm.ta).apply(null,arguments)},fp=s._Rsqrt=function(){return(fp=s._Rsqrt=s.asm.ua).apply(null,arguments)},zf=s._ScatterNd=function(){return(zf=s._ScatterNd=s.asm.va).apply(null,arguments)},_f=s._SelectV2=function(){return(_f=s._SelectV2=s.asm.wa).apply(null,arguments)},Pf=s._Sigmoid=function(){return(Pf=s._Sigmoid=s.asm.xa).apply(null,arguments)},Lf=s._Sin=function(){return(Lf=s._Sin=s.asm.ya).apply(null,arguments)},Wf=s._Softmax=function(){return(Wf=s._Softmax=s.asm.za).apply(null,arguments)},Bf=s._Sqrt=function(){return(Bf=s._Sqrt=s.asm.Aa).apply(null,arguments)},Vf=s._Square=function(){return(Vf=s._Square=s.asm.Ba).apply(null,arguments)},jf=s._SquaredDifference=function(){return(jf=s._SquaredDifference=s.asm.Ca).apply(null,arguments)},Uf=s._Step=function(){return(Uf=s._Step=s.asm.Da).apply(null,arguments)},Hf=s._StridedSlice=function(){return(Hf=s._StridedSlice=s.asm.Ea).apply(null,arguments)},Gf=s._Sub=function(){return(Gf=s._Sub=s.asm.Fa).apply(null,arguments)},qf=s._Sum=function(){return(qf=s._Sum=s.asm.Ga).apply(null,arguments)},Xf=s._Tan=function(){return(Xf=s._Tan=s.asm.Ha).apply(null,arguments)},Kf=s._Tanh=function(){return(Kf=s._Tanh=s.asm.Ia).apply(null,arguments)},Zf=s._Tile=function(){return(Zf=s._Tile=s.asm.Ja).apply(null,arguments)},Yf=s._TopK=function(){return(Yf=s._TopK=s.asm.Ka).apply(null,arguments)},Jf=s._Transpose=function(){return(Jf=s._Transpose=s.asm.La).apply(null,arguments)},Qf=s.__FusedMatMul=function(){return(Qf=s.__FusedMatMul=s.asm.Ma).apply(null,arguments)},em=s._malloc=function(){return(em=s._malloc=s.asm.Na).apply(null,arguments)},tm=s._free=function(){return(tm=s._free=s.asm.Oa).apply(null,arguments)},mp=s.___errno_location=function(){return(mp=s.___errno_location=s.asm.Pa).apply(null,arguments)},Ap=s.stackSave=function(){return(Ap=s.stackSave=s.asm.Qa).apply(null,arguments)},yp=s.stackRestore=function(){return(yp=s.stackRestore=s.asm.Ra).apply(null,arguments)},nu=s.stackAlloc=function(){return(nu=s.stackAlloc=s.asm.Sa).apply(null,arguments)};s.cwrap=Y;var Ui;function nm(K){this.name="ExitStatus",this.message="Program terminated with exit("+K+")",this.status=K}Ka=function K(){Ui||au(),Ui||(Ka=K)};function au(K){if(K=K||u,na>0||(jn(),na>0))return;function ne(){Ui||(Ui=!0,s.calledRun=!0,!j&&(Mn(),an(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),Kt()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),ne()},1)):ne()}if(s.run=au,s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return au(),r.ready}}();typeof e=="object"&&typeof t=="object"?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):typeof e=="object"&&(e.WasmBackendModule=n)}),eI=bt((e,t)=>{(function(n,a,r){function s(d){var u=this,p=l();u.next=function(){var c=2091639*u.s0+u.c*23283064365386963e-26;return u.s0=u.s1,u.s1=u.s2,u.s2=c-(u.c=c|0)},u.c=1,u.s0=p(" "),u.s1=p(" "),u.s2=p(" "),u.s0-=p(d),u.s0<0&&(u.s0+=1),u.s1-=p(d),u.s1<0&&(u.s1+=1),u.s2-=p(d),u.s2<0&&(u.s2+=1),p=null}function i(d,u){return u.c=d.c,u.s0=d.s0,u.s1=d.s1,u.s2=d.s2,u}function o(d,u){var p=new s(d),c=u&&u.state,h=p.next;return h.int32=function(){return p.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,c&&(typeof c=="object"&&i(c,p),h.state=function(){return i(p,{})}),h}function l(){var d=4022871197,u=function(p){p=String(p);for(var c=0;c>>0,h-=d,h*=d,d=h>>>0,h-=d,d+=h*4294967296}return(d>>>0)*23283064365386963e-26};return u}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),tI=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.x=0,d.y=0,d.z=0,d.w=0,d.next=function(){var c=d.x^d.x<<11;return d.x=d.y,d.y=d.z,d.z=d.w,d.w^=d.w>>>19^c^c>>>8},l===(l|0)?d.x=l:u+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),nI=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.next=function(){var c=d.x^d.x>>>2;return d.x=d.y,d.y=d.z,d.z=d.w,d.w=d.v,(d.d=d.d+362437|0)+(d.v=d.v^d.v<<4^(c^c<<1))|0},d.x=0,d.y=0,d.z=0,d.w=0,d.v=0,l===(l|0)?d.x=l:u+=l;for(var p=0;p>>4),d.next()}function i(l,d){return d.x=l.x,d.y=l.y,d.z=l.z,d.w=l.w,d.v=l.v,d.d=l.d,d}function o(l,d){var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),aI=bt((e,t)=>{(function(n,a,r){function s(l){var d=this;d.next=function(){var p=d.x,c=d.i,h,m,f;return h=p[c],h^=h>>>7,m=h^h<<24,h=p[c+1&7],m^=h^h>>>10,h=p[c+3&7],m^=h^h>>>3,h=p[c+4&7],m^=h^h<<7,h=p[c+7&7],h=h^h<<13,m^=h^h<<9,p[c]=m,d.i=c+1&7,m};function u(p,c){var h,m,f=[];if(c===(c|0))m=f[0]=c;else for(c=""+c,h=0;h0;--h)p.next()}u(d,l)}function i(l,d){return d.x=l.x.slice(),d.i=l.i,d}function o(l,d){l==null&&(l=+new Date);var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(p.x&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),rI=bt((e,t)=>{(function(n,a,r){function s(l){var d=this;d.next=function(){var p=d.w,c=d.X,h=d.i,m,f;return d.w=p=p+1640531527|0,f=c[h+34&127],m=c[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=c[h]=f^m,d.i=h,f+(p^p>>>16)|0};function u(p,c){var h,m,f,A,y,g=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),f=0,A=-32;A>>15,m^=m<<4,m^=m>>>13,A>=0&&(y=y+1640531527|0,h=g[A&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(g[(c&&c.length||0)&127]=-1),f=127,A=4*128;A>0;--A)m=g[f+34&127],h=g[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,g[f]=m^h;p.w=y,p.X=g,p.i=f}u(d,l)}function i(l,d){return d.i=l.i,d.w=l.w,d.X=l.X.slice(),d}function o(l,d){l==null&&(l=+new Date);var u=new s(l),p=d&&d.state,c=function(){return(u.next()>>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(p.X&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),sI=bt((e,t)=>{(function(n,a,r){function s(l){var d=this,u="";d.next=function(){var c=d.b,h=d.c,m=d.d,f=d.a;return c=c<<25^c>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-c|0,d.b=c=c<<20^c>>>12^h,d.c=h=h-m|0,d.d=m<<16^h>>>16^f,d.a=f-c|0},d.a=0,d.b=0,d.c=2654435769|0,d.d=1367130551,l===Math.floor(l)?(d.a=l/4294967296|0,d.b=l|0):u+=l;for(var p=0;p>>0)/4294967296};return c.double=function(){do var h=u.next()>>>11,m=(u.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},c.int32=u.next,c.quick=c,p&&(typeof p=="object"&&i(p,u),c.state=function(){return i(u,{})}),c}a&&a.exports?a.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),iI=bt((e,t)=>{(function(n,a,r){var s=256,i=6,o=52,l="random",d=r.pow(s,i),u=r.pow(2,o),p=u*2,c=s-1,h;function m(b,v,I){var T=[];v=v==!0?{entropy:!0}:v||{};var R=g(y(v.entropy?[b,k(a)]:b==null?x():b,3),T),$=new f(T),z=function(){for(var _=$.g(i),V=d,j=0;_=p;)_/=2,V/=2,j>>>=1;return(_+j)/V};return z.int32=function(){return $.g(4)|0},z.quick=function(){return $.g(4)/4294967296},z.double=z,g(k($.S),a),(v.pass||I||function(_,V,j,U){return U&&(U.S&&A(U,$),_.state=function(){return A($,{})}),j?(r[l]=_,V):_})(z,R,"global"in v?v.global:this==r,v.state)}function f(b){var v,I=b.length,T=this,R=0,$=T.i=T.j=0,z=T.S=[];for(I||(b=[I++]);R{var n=eI(),a=tI(),r=nI(),s=aI(),i=rI(),o=sI(),l=iI();l.alea=n,l.xor128=a,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),oI=bt(()=>{}),om={};Fe(om,{bin:()=>Kg,browser:()=>t5,default:()=>lI,dependencies:()=>e5,description:()=>Bg,devDependencies:()=>Jg,jsdelivr:()=>Hg,license:()=>Yg,main:()=>jg,miniprogram:()=>Xg,module:()=>Ug,name:()=>Lg,private:()=>Vg,repository:()=>Zg,scripts:()=>Qg,types:()=>qg,unpkg:()=>Gg,version:()=>Wg});var Lg="@tensorflow/tfjs",Wg="3.5.0",Bg="An open-source machine learning framework.",Vg=!1,jg="dist/tf.node.js",Ug="dist/index.js",Hg="dist/tf.min.js",Gg="dist/tf.min.js",qg="dist/index.d.ts",Xg="dist/miniprogram",Kg={"tfjs-custom-module":"dist/tools/custom_module/cli.js"},Zg={type:"git",url:"https://github.com/tensorflow/tfjs.git"},Yg="Apache-2.0",Jg={"@babel/core":"^7.9.0","@babel/polyfill":"^7.10.4","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@types/argparse":"^1.0.38","@types/jasmine":"2.8.7","@types/node":"~10.17.50","@types/shelljs":"^0.8.4","@types/yargs":"^15.0.7","clang-format":"~1.2.2",commander:"~2.14.1",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.2","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.5.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~4.2.2",shelljs:"~0.8.1","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"1.0.0-pre.50"},Qg={build:"tsc && yarn build-cli && yarn bundle","build-ci":"tsc && yarn build-cli && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-converter":"cd ../tfjs-converter && yarn && yarn build","build-converter-ci":"cd ../tfjs-converter && yarn && yarn build-ci","build-data":"cd ../tfjs-data && yarn && yarn build","build-data-ci":"cd ../tfjs-data && yarn && yarn build-ci","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-converter && yarn build-data && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-cli":"tsc --project ./tools/custom_module/tsconfig.json && chmod +x ./dist/tools/custom_module/cli.js","run-custom-build":"ts-node -s ./tools/custom_module/cli.ts","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",test:"yarn && yarn build-deps && yarn build && karma start","test-dev":"karma start","test-tools":"ts-node --project ./tools/custom_module/tsconfig.json run_tools_tests.ts","test-ci":"./scripts/test-ci.sh"},e5={"@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-backend-webgl":"3.5.0","@tensorflow/tfjs-converter":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@tensorflow/tfjs-data":"3.5.0","@tensorflow/tfjs-layers":"3.5.0",argparse:"^1.0.10",chalk:"^4.1.0","core-js":"3","regenerator-runtime":"^0.13.5",yargs:"^16.0.3"},t5={"node-fetch":!1,util:!1,crypto:!1},lI={name:Lg,version:Wg,description:Bg,private:Vg,main:jg,module:Ug,jsdelivr:Hg,unpkg:Gg,types:qg,miniprogram:Xg,bin:Kg,repository:Zg,license:Yg,devDependencies:Jg,scripts:Qg,dependencies:e5,browser:t5},lm={};Fe(lm,{browser:()=>x5,default:()=>uI,dependencies:()=>g5,description:()=>r5,devDependencies:()=>A5,engines:()=>h5,jsdelivr:()=>o5,"jsnext:main":()=>d5,license:()=>m5,main:()=>i5,miniprogram:()=>c5,module:()=>p5,name:()=>n5,private:()=>s5,repository:()=>f5,scripts:()=>y5,sideEffects:()=>b5,types:()=>u5,unpkg:()=>l5,version:()=>a5});var n5="@tensorflow/tfjs-core",a5="3.5.0",r5="Hardware-accelerated JavaScript library for machine intelligence",s5=!1,i5="dist/tf-core.node.js",o5="dist/tf-core.min.js",l5="dist/tf-core.min.js",u5="dist/index.d.ts",d5="dist/index.js",p5="dist/index.js",c5="dist/miniprogram",h5={yarn:">= 1.3.2"},f5={type:"git",url:"https://github.com/tensorflow/tfjs-core.git"},m5="Apache-2.0",A5={"@bazel/bazelisk":"^1.3.0","@bazel/typescript":"^0.27.8","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"link:../tfjs-backend-cpu","@types/jasmine":"~3.0.0","@types/node":"~9.6.0","@types/node-fetch":"~2.1.2","clang-format":"~1.2.4",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-jasmine":"~1.1.0","karma-typescript":"~4.1.1","npm-run-all":"~4.1.3",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2",shelljs:"~0.8.3","ts-node":"~8.8.2",tslint:"~5.11.0","tslint-no-circular-imports":"~0.5.0",typescript:"3.5.3",yalc:"~1.0.0-pre.21",yargs:"~13.2.2"},y5={"build-ci":"./scripts/enumerate-tests.js --ci && tsc && yarn bundle-ci && yarn build-test-snippets",build:"node ./scripts/enumerate-tests.js && tsc && yarn bundle",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-npm":"./scripts/build-npm.sh","build-deps":"yarn build && yarn build-cpu-backend","build-cpu-backend":"cd ../tfjs-backend-cpu && yarn && yarn build","build-cpu-backend-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build:bazel":"bazelisk build //...","build-test-snippets":"yarn tsc --project ./scripts/test_snippets/tsconfig.json","format-all":"clang-format -i -style=Google --glob=src/**/*.ts","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build && rollup -c && yalc push","publish-npm":"npm publish",lint:"tslint -p . -t verbose",coverage:"KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-webworker":"karma start --worker","run-browserstack":"karma start --browserstack","test-bundle-size":"./scripts/test-bundle-size.js","test-node":"rimraf dist/ && yarn build-deps && yarn build && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-dev":"tsc && ts-node --transpile-only --skip-ignore -P tsconfig.test.json dist/test_node.js","test-node-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_node.js","test-async-backends":"rimraf dist/ && yarn build && ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-async-backends-ci":"ts-node --transpile-only -P tsconfig.test.json dist/test_async_backends.js","test-snippets":"yarn build && yarn build-cpu-backend && ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts","test-snippets-ci":"ts-node -P tsconfig.test.json ./scripts/test_snippets/test_snippets.ts"},g5={"@types/offscreencanvas":"~2019.3.0","@types/seedrandom":"2.4.27","@types/webgl-ext":"0.0.30","node-fetch":"~2.6.1",seedrandom:"2.4.3"},x5={"node-fetch":!1,util:!1,crypto:!1,worker_threads:!1},b5=["./dist/index.js","./dist/engine.js","./dist/tensor.js","./dist/base_side_effects.js","./dist/flags.js","./dist/platforms/*.js","./dist/register_all_gradients.js","./dist/public/chained_ops/*.js","./dist/io/*.js"],uI={name:n5,version:a5,description:r5,private:s5,main:i5,jsdelivr:o5,unpkg:l5,types:u5,"jsnext:main":d5,module:p5,miniprogram:c5,engines:h5,repository:f5,license:m5,devDependencies:A5,scripts:y5,dependencies:g5,browser:x5,sideEffects:b5},um={};Fe(um,{browser:()=>_5,default:()=>dI,dependencies:()=>z5,description:()=>k5,devDependencies:()=>$5,jsdelivr:()=>N5,"jsnext:main":()=>C5,license:()=>F5,main:()=>S5,miniprogram:()=>M5,module:()=>R5,name:()=>v5,peerDependencies:()=>O5,private:()=>I5,scripts:()=>D5,types:()=>E5,unpkg:()=>T5,version:()=>w5});var v5="@tensorflow/tfjs-data",w5="3.5.0",k5="TensorFlow Data API in JavaScript",I5=!1,S5="dist/tf-data.node.js",N5="dist/tf-data.min.js",T5="dist/tf-data.min.js",E5="dist/index.d.ts",C5="dist/index.js",R5="dist/index.js",M5="dist/miniprogram",F5="Apache-2.0",$5={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@tensorflow/tfjs-layers":"3.5.0","@types/jasmine":"~2.5.53","@types/seedrandom":"^2.4.27","@types/utf8":"~2.1.6","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~7.0.0",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"^1.0.0-pre.50"},D5={build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-layers":"cd ../tfjs-layers && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-layers-ci":"cd ../tfjs-layers && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-layers && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-layers-ci && yarn build-backend-cpu-ci","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"rimraf dist/ && yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-dev":"tsc && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts","test-browsers":"karma start --browsers='Chrome,Firefox'","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/test_node.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose"},O5={"@tensorflow/tfjs-core":"3.5.0",seedrandom:"~2.4.3"},z5={"@types/node-fetch":"^2.1.2","node-fetch":"~2.6.1"},_5={fs:!1,"node-fetch":!1,string_decoder:!1,crypto:!1},dI={name:v5,version:w5,description:k5,private:I5,main:S5,jsdelivr:N5,unpkg:T5,types:E5,"jsnext:main":C5,module:R5,miniprogram:M5,license:F5,devDependencies:$5,scripts:D5,peerDependencies:O5,dependencies:z5,browser:_5},dm={};Fe(dm,{default:()=>pI,description:()=>W5,devDependencies:()=>Z5,jsdelivr:()=>q5,"jsnext:main":()=>H5,license:()=>B5,main:()=>j5,miniprogram:()=>K5,module:()=>G5,name:()=>P5,peerDependencies:()=>J5,private:()=>V5,scripts:()=>Y5,types:()=>U5,unpkg:()=>X5,version:()=>L5});var P5="@tensorflow/tfjs-layers",L5="3.5.0",W5="TensorFlow layers API in JavaScript",B5="Apache-2.0 AND MIT",V5=!1,j5="dist/tf-layers.node.js",U5="dist/index.d.ts",H5="dist/index.js",G5="dist/index.js",q5="dist/tf-layers.min.js",X5="dist/tf-layers.min.js",K5="dist/miniprogram",Z5={"@babel/polyfill":"^7.8.7","@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-backend-webgl":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@types/jasmine":"~2.5.53","clang-format":"~1.2.2","http-server":"~0.12.3",jasmine:"~3.1.0","jasmine-core":"~3.1.0",karma:"~6.3.1","karma-browserstack-launcher":"~1.6.0","karma-chrome-launcher":"~2.2.0","karma-firefox-launcher":"~1.1.0","karma-jasmine":"~1.1.1","karma-typescript":"~5.5.1","karma-typescript-es6-transform":"^5.0.2",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"^0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},Y5={prep:"yarn install && yarn build-ci",build:"tsc && yarn bundle","build-ci":"tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-backend-webgl":"cd ../tfjs-backend-webgl && yarn && yarn build","build-backend-webgl-ci":"cd ../tfjs-backend-webgl && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci","build-npm":"./scripts/build-npm.sh",format:"./tools/clang_format_ts.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && karma start","test-dev":"karma start","test-ci":"./scripts/test-ci.sh","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts","run-browserstack":"karma start --browsers='bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'",lint:"tslint -p . -t verbose"},J5={"@tensorflow/tfjs-core":"3.5.0"},pI={name:P5,version:L5,description:W5,license:B5,private:V5,main:j5,types:U5,"jsnext:main":H5,module:G5,jsdelivr:q5,unpkg:X5,miniprogram:K5,devDependencies:Z5,scripts:Y5,peerDependencies:J5},pm={};Fe(pm,{default:()=>cI,description:()=>tx,devDependencies:()=>cx,jsdelivr:()=>ox,"jsnext:main":()=>ax,license:()=>dx,main:()=>nx,miniprogram:()=>lx,module:()=>rx,name:()=>Q5,peerDependencies:()=>px,repository:()=>ux,scripts:()=>hx,types:()=>sx,unpkg:()=>ix,version:()=>ex});var Q5="@tensorflow/tfjs-converter",ex="3.5.0",tx="Tensorflow model converter for javascript",nx="dist/tf-converter.node.js",ax="dist/index.js",rx="dist/index.js",sx="dist/index.d.ts",ix="dist/tf-converter.min.js",ox="dist/tf-converter.min.js",lx="dist/miniprogram",ux={type:"git",url:"https://github.com/tensorflow/tfjs-converter.git"},dx="Apache-2.0",px={"@tensorflow/tfjs-core":"3.5.0"},cx={"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-replace":"^2.3.3","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-backend-cpu":"3.5.0","@tensorflow/tfjs-core":"3.5.0","@types/argparse":"^1.0.38","@types/deep-equal":"^1.0.1","@types/jasmine":"~2.8.6","@types/long":"~3.0.32","@types/node-fetch":"1.6.9",ajv:"~6.3.0",argparse:"^1.0.10","babel-core":"~6.26.3","babel-plugin-external-helpers":"~6.22.0","babel-preset-env":"~1.7.0","clang-format":"~1.2.2",copyfiles:"~1.2.0","deep-equal":"^1.0.1","jasmine-core":"~3.5.0","node-fetch":"~2.6.1",opn:"~5.1.0",protobufjs:"~6.8.6",rimraf:"~2.6.2",rollup:"~2.3.2","rollup-plugin-terser":"~7.0.2","rollup-plugin-visualizer":"~3.3.2","ts-morph":"^7.1.3","ts-node":"~8.8.2",tslint:"~6.1.3","tslint-no-circular-imports":"~0.7.0",typescript:"3.5.3",yalc:"~1.0.0-pre.50"},hx={build:"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle","build-ci":"yarn gen-json --test && yarn gen-kernel2ops && tsc && yarn bundle-ci",bundle:"rollup -c","bundle-ci":"rollup -c --ci","build-core":"cd ../tfjs-core && yarn && yarn build","build-backend-cpu":"cd ../tfjs-backend-cpu && yarn && yarn build","build-backend-cpu-ci":"cd ../tfjs-backend-cpu && yarn && yarn build-ci","build-core-ci":"cd ../tfjs-core && yarn && yarn build-ci","build-deps":"yarn build-core && yarn build-backend-cpu","build-deps-ci":"yarn build-core-ci && yarn build-backend-cpu","build-npm":"./scripts/build-npm.sh","link-local":"yalc link","publish-local":"yarn build-npm && yalc push","publish-npm":"npm publish",test:"yarn && yarn build-deps && yarn build && yarn gen-json --test && yarn gen-kernel2ops && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-ci":"ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts","test-dev":"tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts","test-snippets":"yarn && yarn build-deps && yarn build && ts-node --skip-ignore -s ./scripts/test_snippets.ts","test-snippets-ci":"ts-node --skip-ignore -s ./scripts/test_snippets.ts",lint:"tslint -p . -t verbose","make-version":"sh -c ./scripts/make-version","gen-doc":"ts-node -s ./scripts/gen_doc.ts","gen-json":"ts-node -s ./scripts/gen_json.ts","model-summary":"ts-node -s ./tools/model_summary.ts",pb2json:"ts-node -s ./tools/pb2json_converter.ts","build-pip-package":"yarn gen-json --test && cd python && ./build-pip-package.sh --test /tmp/tfjs-pips","run-python-tests":"yarn gen-json --test && cd python && ./run-python-tests.sh","gen-kernel2ops":"ts-node -s scripts/kernels_to_ops.ts --out metadata/kernel2op.json"},cI={name:Q5,version:ex,description:tx,main:nx,"jsnext:main":ax,module:rx,types:sx,unpkg:ix,jsdelivr:ox,miniprogram:lx,repository:ux,license:dx,peerDependencies:px,devDependencies:cx,scripts:hx},hI=1e-7,fI=1e-4,wp=class{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}},du=class{refCount(e){return ra("refCount")}incRef(e){return ra("incRef")}timerAvailable(){return!0}time(e){return ra("time")}read(e){return ra("read")}readSync(e){return ra("readSync")}numDataIds(){return ra("numDataIds")}disposeData(e,t){return ra("disposeData")}write(e,t,n){return ra("write")}move(e,t,n,a,r){return ra("move")}memory(){return ra("memory")}floatPrecision(){return ra("floatPrecision")}epsilon(){return this.floatPrecision()===32?hI:fI}dispose(){return ra("dispose")}};function ra(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function fx(e){let t=e.length,n=0,a=0;for(;t>0;)a=Math.random()*t|0,t--,n=e[t],e[t]=e[a],e[a]=n}function mI(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,a,r,s=0;for(;n>0;)s=Math.random()*n|0,n--,a=e[n],r=t[n],e[n]=e[s],t[n]=t[s],e[s]=a,t[s]=r}function pu(e,t,n){return Math.max(e,Math.min(t,n))}function AI(e){return e%2==0?e:e+1}function yI(e){let t=0;for(let n=0;nn+` Shapes ${e} and ${t} must match`)}function rs(e){F(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ss(e,t=[],n=!1){if(t==null&&(t=[]),Array.isArray(e)||tn(e)&&!n)for(let a=0;a0,n){return new Promise((a,r)=>{let s=0,i=()=>{if(e()){a();return}s++;let o=t(s);if(n!=null&&s>=n){r();return}setTimeout(i,o)};i()})}function SI(e,t){let n=1,a=-1;for(let s=0;s=0)n*=e[s];else if(e[s]===-1){if(a!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${a} and dim ${s}`);a=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(a===-1){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(n===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);let r=e.slice();return r[a]=t/n,r}function sa(e,t){let n=t.length;return e=e==null?t.map((a,r)=>r):[].concat(e),F(e.every(a=>a>=-n&&a`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),F(e.every(a=>Vt(a)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(a=>a<0?n+a:a)}function mx(e,t){let n=[],a=[],r=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||r?null:sa(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(n.push(e[o]),a.push(o)),s[i]<=o&&i++}e[o]!==1&&(n.push(e[o]),a.push(o))}return{newShape:n,keptDims:a}}function Ax(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else throw new Error(`Unknown data type ${e}`);return n}function yx(e,t){let n=null;if(e==null||e==="float32")n=new Float32Array(t);else if(e==="int32")n=new Int32Array(t);else if(e==="bool")n=new Uint8Array(t);else if(e==="string")n=new Array(t);else throw new Error(`Unknown data type ${e}`);return n}function gx(e,t){for(let n=0;nt+=n.length),t}function vr(e){return typeof e=="string"||e instanceof String}function vx(e){return typeof e=="boolean"}function wx(e){return typeof e=="number"}function kp(e){return Array.isArray(e)?kp(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":wx(e)?"float32":vr(e)?"string":vx(e)?"bool":"float32"}function wr(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Ip(e,t){for(let n=t;n=0;--a)n[a]=n[a+1]*e[a+1];return n}function kx(e,t,n,a=!1){let r=new Array;if(t.length===1){let s=t[0]*(a?2:1);for(let i=0;il*d)*(a?2:1);for(let l=0;lr*s)*(n?2:1);if(a===0)return[];if(a!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return kx(0,e,t,n)}function hm(e,t){let n=Sp(e,t);for(let a=0;aa*r,1);if(t==null||t==="float32")return Qi(e,new Float32Array(n));if(t==="int32")return Qi(e,new Int32Array(n));if(t==="bool")return Qi(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function fm(e){e.forEach(t=>{F(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function EI(e,t,n){if(t===0)return 0;if(t===1)return e[0];let a=e[e.length-1];for(let r=0;r{let[n,a]=t.split(":");this.urlFlags[n]=MI(n,a)})}};function RI(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...a)=>(FI(t,a[0],a[1]),a.join("="))),t}function FI(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function MI(e,t){if(t=t.toLowerCase(),t==="true"||t==="false")return t==="true";if(`${+t}`===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}function J(){return ma}var ma=null;function $I(e){ma=e}var Am;function Nx(){if(Am==null){let e;if(typeof window!="undefined")e=window;else if(typeof global!="undefined")e=global;else if(typeof process!="undefined")e=process;else if(typeof self!="undefined")e=self;else throw new Error("Could not find a global object");Am=e}return Am}function DI(){let e=Nx();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function ym(e,t){let n=DI();if(n.has(e))return n.get(e);{let a=t();return n.set(e,a),n.get(e)}}var eo="Abs",to="Acos",no="Acosh",kr="Add",is="AddN",ao="All",ro="Any",os="ArgMax",hu="ArgMin",so="Asin",io="Asinh",oo="Atan",lo="Atanh",uo="Atan2",ls="AvgPool",Np="AvgPoolGrad",fu="AvgPool3D",Tp="AvgPool3DGrad",us="BatchMatMul",mu="BatchToSpaceND",Ep="Bincount",Tx="BroadcastTo",ds="Cast",ps="Ceil",Ir="ClipByValue",Cp="Complex",Au="ComplexAbs",po="Concat",cs="Conv2D",Rp="Conv2DBackpropFilter",hs="Conv2DBackpropInput",yu="Conv3D",Mp="Conv3DBackpropFilterV2",Fp="Conv3DBackpropInputV2",fs="Cos",co="Cosh",ms="Cumsum",ho="CropAndResize",$p="DenseBincount",fo="DepthToSpace",As="DepthwiseConv2dNative",Dp="DepthwiseConv2dNativeBackpropFilter",Op="DepthwiseConv2dNativeBackpropInput",zp="Diag",gu="Dilation2D",_p="Dilation2DBackpropInput",Pp="Dilation2DBackpropFilter",ys="RealDiv",Lp="Einsum",mo="Elu",Wp="EluGrad",Ao="Erf",yo="Equal",gs="Exp",go="ExpandDims",xo="Expm1",Bp="FFT",xu="Fill",bo="FlipLeftRight",xs="Floor",bs="FloorDiv",vs="FusedBatchNorm",vo="GatherV2",wo="GatherNd",ko="Greater",ws="GreaterEqual",ks="Identity",Vp="IFFT",jp="Imag",Io="IsFinite",So="IsInf",No="IsNan",Is="LeakyRelu",To="Less",Eo="LessEqual",Up="LinSpace",Ss="Log",Co="Log1p",Ro="LogicalAnd",bu="LogicalNot",vu="LogicalOr",Ex="LogSoftmax",wu="LRN",Hp="LRNGrad",Ns="Max",Ts="Maximum",Es="MaxPool",Gp="MaxPoolGrad",ku="MaxPool3D",qp="MaxPool3DGrad",Xp="MaxPoolWithArgmax",Cs="Mean",Rs="Min",Ms="Minimum",Fs="MirrorPad",Mo="Mod",Kp="Multinomial",$s="Multiply",Fo="Neg",$o="NotEqual",Do="NonMaxSuppressionV3",Oo="NonMaxSuppressionV4",zo="NonMaxSuppressionV5",_o="OnesLike",Ds="OneHot",Po="Pack",Os="PadV2",OI="Pool",zs="Pow",_s="Prelu",Lo="Prod",Iu="Range",Zp="Real",Wo="Reciprocal",Ps="Relu",Bo="Reshape",Su="ResizeNearestNeighbor",Yp="ResizeNearestNeighborGrad",Ls="ResizeBilinear",Jp="ResizeBilinearGrad",Ws="Relu6",Bs="Reverse",Vs="Round",js="Rsqrt",Vo="ScatterNd",jo="Select",Uo="Selu",Ho="Slice",Us="Sin",Go="Sinh",qo="Sign",Hs="Sigmoid",Xo="Softplus",Gs="Sqrt",qs="Sum",Nu="SpaceToBatchND",Ko="SplitV",Xs="Softmax",Qp="SparseReshape",ec="SparseToDense",Ks="SquaredDifference",Tu="Square",Zo="StridedSlice",Zs="Sub",Ys="Tan",Js="Tanh",Sr="Tile",Yo="TopK",tc="Transform",Qs="Transpose",nc="Unique",Jo="Unpack",Eu="UnsortedSegmentSum",Qo="ZerosLike",Nr="Step",ac="FromPixels",el="RotateWithOffset",ei="_FusedMatMul",ti="FusedConv2D",ni="FusedDepthwiseConv2D",tl=ym("kernelRegistry",()=>new Map),Cu=ym("gradRegistry",()=>new Map);function rc(e,t){let n=gm(e,t);return tl.get(n)}function xm(e){return Cu.get(e)}function nl(e){let t=tl.entries(),n=[];for(;;){let{done:a,value:r}=t.next();if(a)break;let[s,i]=r,[o]=s.split("_");o===e&&n.push(i)}return n}function ai(e){let{kernelName:t,backendName:n}=e,a=gm(t,n);tl.has(a)&&console.warn(`The kernel '${t}' for backend '${n}' is already registered`),tl.set(a,e)}function Cx(e){let{kernelName:t}=e;Cu.has(t)&&J().getBool("DEBUG")&&console.warn(`Overriding the gradient for '${t}'`),Cu.set(t,e)}function zI(e,t){let n=gm(e,t);if(!tl.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);tl.delete(n)}function _I(e){if(!Cu.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);Cu.delete(e)}function PI(e,t){nl(e).forEach(n=>{let a=Object.assign({},n,{backendName:t});ai(a)})}function gm(e,t){return`${t}_${e}`}var w={};Fe(w,{arraysEqual:()=>er,assert:()=>F,assertNonNegativeIntegerDimensions:()=>fm,assertNonNull:()=>rs,assertShapesMatch:()=>rn,bytesFromStringArray:()=>bx,bytesPerElement:()=>cm,checkConversionForErrors:()=>gx,clamp:()=>pu,computeStrides:()=>Ji,createScalarValue:()=>LI,createShuffledIndices:()=>kI,decodeString:()=>ic,distSquared:()=>xI,encodeString:()=>Mu,fetch:()=>WI,flatten:()=>ss,getArrayFromDType:()=>yx,getTypedArrayFromDType:()=>Ax,hasEncodingLoss:()=>NI,indexToLoc:()=>CI,inferDtype:()=>kp,inferFromImplicitShape:()=>SI,isBoolean:()=>vx,isFunction:()=>wr,isInt:()=>Vt,isNumber:()=>wx,isPromise:()=>mm,isScalarShape:()=>bI,isString:()=>vr,isTypedArray:()=>tn,isValidDtype:()=>xx,locToIndex:()=>EI,makeOnesTypedArray:()=>hm,makeZerosNestedTypedArray:()=>TI,makeZerosTypedArray:()=>Sp,nearestDivisor:()=>Ip,nearestLargerEven:()=>AI,now:()=>Ru,parseAxisParam:()=>sa,randUniform:()=>gI,repeatedTry:()=>II,rightPad:()=>cu,shuffle:()=>fx,shuffleCombo:()=>mI,sizeFromShape:()=>Tt,sizeToSquarishShape:()=>wI,squeezeShape:()=>mx,sum:()=>yI,tanh:()=>vI,toNestedArray:()=>Qi,toTypedArray:()=>sc});function LI(e,t){return t==="string"?Mu(e):sc([e],t)}function BI(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function sc(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=ss(e)),J().getBool("DEBUG")&&gx(e,t),BI(e,t))return e;if(t==null||t==="float32"||t==="complex64")return new Float32Array(e);if(t==="int32")return new Int32Array(e);if(t==="bool"){let n=new Uint8Array(e.length);for(let a=0;a{a=n()},s,i=Ru();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(r);else{r();for(let o of a)o.dataSync();s=Promise.resolve({kernelMs:Ru()-i})}if(J().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{VI(d,l.dtype,e)})}return{kernelName:e,outputs:a,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:n,timeMs:a,inputs:r,extraInfo:s}=e;n.forEach(i=>{Promise.all([i.data(),a,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],r,o[2])})})}};function VI(e,t,n){if(t!=="float32")return!1;for(let a=0;a0?m:""} `}}console.log(`%c${o} %c${i} %c${l}D ${u} %c${d} %c${p} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function HI(e,t,n){let a={},r={};for(let l=0;la[f.id]=!0),h=!0,r[d.id]=!0;break}if(h)break}}let s={};s[n.id]=!0;let i={};for(let l=e.length-1;l>=0;l--){let d=e[l],u=d.inputs;for(let p=0;p=0;r--){let s=t[r],i=[];if(s.outputs.forEach(l=>{let d=e[l.id];d!=null?i.push(d):i.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let o=s.gradient(i);for(let l in s.inputs){if(!(l in o))throw new Error(`Cannot backprop through input ${l}. Available gradients found: ${Object.keys(o)}.`);let d=n(()=>o[l]());if(d.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${l} must have 'float32' dtype, but has '${d.dtype}'`);let u=s.inputs[l];if(!er(d.shape,u.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${l}' has shape '${d.shape}', which does not match the shape of the input '${u.shape}'`);if(e[u.id]==null)e[u.id]=d;else{let p=e[u.id];e[u.id]=a(p,d),p.dispose()}}}}var Rx=20,Fu=3,bm=7;function XI(e,t,n,a){let r=Ji(t),s=qI(e,t,n,r),i=t.length,o=oc(e,t,n,r,s),l=["Tensor"];return a&&(l.push(` dtype: ${n}`),l.push(` rank: ${i}`),l.push(` shape: [${t}]`),l.push(" values:")),l.push(o.map(d=>" "+d).join(` `)),l.join(` -`)}function V9(e,t,n,r){let a=Nt(t),s=r[r.length-1],i=new Array(s).fill(0),o=t.length,l=n==="complex64"?$u(e):e;if(o>1)for(let c=0;cEx){let A=Mu*i,y=Array.from(e.slice(0,A)),g=Array.from(e.slice((o-Mu)*i,o*i));return n==="complex64"&&(y=$u(y),g=$u(g)),["["+y.map((x,v)=>Fu(x,a[v],n)).join(", ")+", ..., "+g.map((x,v)=>Fu(x,a[o-Mu+v],n)).join(", ")+"]"]}let f=n==="complex64"?$u(e):Array.from(e);return["["+f.map((A,y)=>Fu(A,a[y],n)).join(", ")+"]"]}let c=t.slice(1),u=r.slice(1),h=r[0]*i,d=[];if(o>Ex){for(let f=0;f1)for(let d=0;dRx){let A=Fu*i,y=Array.from(e.slice(0,A)),g=Array.from(e.slice((o-Fu)*i,o*i));return n==="complex64"&&(y=Du(y),g=Du(g)),["["+y.map((x,k)=>$u(x,r[k],n)).join(", ")+", ..., "+g.map((x,k)=>$u(x,r[o-Fu+k],n)).join(", ")+"]"]}let f=n==="complex64"?Du(e):Array.from(e);return["["+f.map((A,y)=>$u(A,r[y],n)).join(", ")+"]"]}let d=t.slice(1),u=a.slice(1),p=a[0]*i,c=[];if(o>Rx){for(let f=0;f`Length of values '${r}' does not match the size inferred by the shape '${this.size}'.`)}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||Ax(t,this.size),this.strides=Ji(e)}set(e,...t){t.length===0&&(t=[0]),M(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let r of e){if(r<0||r>=this.shape[t]){let a=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(a)}t++}let n=e[e.length-1];for(let r=0;rid(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=Fr().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>id(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();let e=await Fr().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(Fr().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return rl.print(this,e)}clone(){return this.throwIfDisposed(),rl.clone(this)}toString(e=!1){let t=this.dataSync();return j9(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),rl.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Fr().makeVariable(this,e,t,n)}};Object.defineProperty(Le,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function Z(){return yf("Tensor",()=>Le)}Z();var Du=class extends Le{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r);this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!na(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Fr().disposeTensor(this),this.dataId=e.dataId,Fr().incRef(this,null)}dispose(){Fr().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Du,Symbol.hasInstance,{value:e=>e instanceof Le&&e.assign!=null&&e.assign instanceof Function});var Ar={};Me(Ar,{assertTypesMatch:()=>Rx,getTensorsInContainer:()=>bf,isTensorInList:()=>X9,makeTypesMatch:()=>bt});var _f;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(_f||(_f={}));var vf;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(vf||(vf={}));var kf;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(kf||(kf={}));var If;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(If||(If={}));var Sf;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(Sf||(Sf={}));var K9={float32:If,int32:vf,bool:kf,complex64:Sf};function ir(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return K9[e][t]}function ld(e){return ir(e,"int32")}function bt(e,t){if(e.dtype===t.dtype)return[e,t];let n=ir(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Rx(e,t){M(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function X9(e,t){return t.some(n=>n.id===e.id)}function bf(e){let t=[],n=new Set;return Mx(e,t,n),t}function Mx(e,t,n){if(e==null)return;if(e instanceof Le){t.push(e);return}if(!Z9(e))return;let r=e;for(let a in r){let s=r[a];n.has(s)||(n.add(s),Mx(s,t,n))}}function Z9(e){return Array.isArray(e)||typeof e=="object"}function Nf(e){return e.kernelName!=null}var Fx=class{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},Ou=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Fx}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){nl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof cu)&&typeof n.then=="function"){let r=++this.pendingBackendInitId,a=n.then(s=>r(rthis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(r),()=>(r=t(),r instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r))}scopedRun(e,t,n){e();try{let r=n();return t(),r}catch(r){throw t(),r}}nextTensorId(){return Ou.nextTensorId++}nextVariableId(){return Ou.nextVariableId++}clone(e){let t=$.runKernel(vs,{x:e}),n={x:e},r=s=>({x:()=>{let i="float32",o={x:s},l={dtype:i};return $.runKernel(cs,o,l)}}),a=[];return this.addTapeNode(this.state.activeScope.name,n,[t],r,a,{}),t}runKernel(e,t,n){if(ad(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let r=this.backend.numDataIds(),a=0;n.forEach(o=>{a+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=r-t-a-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],r=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,l=Nf(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Nf(e)){let{kernelName:p,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let A=ad(p,this.backendName);M(A!=null,()=>`Cannot find registered kernel '${p}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=A.kernelFunc({inputs:m,attrs:f,backend:this.backend});let g=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(p,y,g);let x=g.map(v=>{if(v.rank!=null)return v;let{dataId:w,shape:b,dtype:k}=v;return this.makeTensorFromDataId(w,b,k)});if(r){let v=this.getTensorsForGradient(p,m,x);n=this.saveTensorsForBackwardMode(v)}return x}}else{let{forwardFunc:p}=e,m=f=>{!r||(n=f.map(A=>this.keep(this.clone(A))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>p(this.backend,m));let A=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,f,A),A}}let{inputs:c,attrs:u}=e,h=Nf(e)?null:e.backwardsFunc,d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(d=this.profiler.profileKernel(l,c,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs)}),r&&this.addTapeNode(l,c,t,h,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(p=>c[p]!=null?c[p].shape:null),outputShapes:t.map(p=>p.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let r=xf(e);if(r!=null){let a=r.inputsToSave||[],s=r.outputsToSave||[],i;r.saveAllInputs?(M(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(l=>t[l])):i=a.map(l=>t[l]);let o=n.filter((l,c)=>s[c]);return i.concat(o)}return[]}makeTensor(e,t,n,r){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let a=e;n==="string"&&va(e[0])&&(a=e.map(o=>Ru(o)));let s=r.write(a,t,n),i=new Le(t,n,s,this.nextTensorId());if(this.trackTensor(i,r),n==="string"){let o=this.state.tensorInfo.get(s),l=xx(a);this.state.numBytes+=l-o.bytes,o.bytes=l}return i}makeTensorFromDataId(e,t,n,r){n=n||"float32";let a=new Le(t,n,e,this.nextTensorId());return this.trackTensor(a,r),a}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),r!=null&&r!==e.dtype&&(e=e.cast(r));let a=new Du(e,t,n,this.nextTensorId());if(this.state.registeredVariables[a.name]!=null)throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*df(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Du||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;let t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){let n=e.size*df(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){let e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;let t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(r=>r.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let r of this.state.activeProfile.kernels)r.kernelTimeMs=await r.kernelTimeMs,r.extraInfo=await r.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,r,a,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},o=xf(e);o!=null&&(r=o.gradFunc),r!=null&&(i.gradient=l=>(l=l.map((c,u)=>{if(c==null){let h=n[u],d=Ih(h.size,h.dtype);return this.makeTensor(d,h.shape,h.dtype)}return c}),r(l.length>1?l:l[0],a,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=bf(e),n=new Set(t.map(a=>a.id));for(let a=0;a{!a.kept&&a.scopeId===r.id&&this.track(a)})}gradients(e,t,n,r=!1){if(M(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let a=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));M(a instanceof Le,()=>"The result y returned by f() must be a tensor.");let s=W9(this.state.activeTape,t,a);if(!r&&s.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{let i={};i[a.id]=n==null?Y9(a.shape):n,B9(i,s,l=>this.tidy(l),J9);let o=t.map(l=>i[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(let c of l.saved)c.dispose()}),this.state.activeTape=null),{value:a,grads:o}})}customGrad(e){return M(ka(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{M(t.every(i=>i instanceof Le),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,r={};t.forEach((i,o)=>{r[o]=i});let a=(i,o)=>(n=e(...t,o),M(n.value instanceof Le,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),M(ka(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let l=n.gradFunc(i,o),c=Array.isArray(l)?l:[l];M(c.length===t.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),M(c.every(h=>h instanceof Le),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let u={};return c.forEach((h,d)=>{u[d]=()=>h}),u};return this.runKernelFunc({forwardFunc:a,backwardsFunc:s,inputs:r})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Cu(),n=await this.backend.time(e);return n.wallMs=Cu()-t,n}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Fx;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};Ou.nextTensorId=0;Ou.nextVariableId=0;function Y9(e){let t=pf(Nt(e),"float32");return $.makeTensor(t,e,"float32")}function $x(){let e=Ix();if(e._tfengine==null){let t=new kx(e);e._tfengine=new Ou(t)}return T9(e._tfengine.ENV),H9(()=>e._tfengine),e._tfengine}var $=$x();function J9(e,t){let n={a:e,b:t};return $.runKernel(Ia,n)}var zu={};Me(zu,{isBrowser:()=>Dx,isMobile:()=>Q9});function eI(){return typeof navigator!="undefined"&&navigator!=null}function Q9(e){if(e||eI()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function Dx(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var yr=J();yr.registerFlag("DEBUG",()=>!1,e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});yr.registerFlag("IS_BROWSER",()=>Dx());yr.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");yr.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));yr.registerFlag("PROD",()=>!1);yr.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>yr.getBool("DEBUG"));yr.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);yr.registerFlag("IS_TEST",()=>!1);yr.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);yr.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function $r(e,t){let n=e;if(tn(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let r=[];for(;Array.isArray(n)||tn(n)&&t!=="string";)r.push(n.length),n=n[0];return Array.isArray(e)&&J().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Ox(e,r,[]),r}function Ox(e,t,n){if(n=n||[],!Array.isArray(e)&&!tn(e)){M(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}M(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),M(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let r=t.slice(1);for(let a=0;a=0&&(a=r),zx(r,a,t,n),e==null||!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=$r(e,a);!tn(e)&&!Array.isArray(e)&&(e=[e]);let i=a!=="string"?sd(e,a):ss(e,[],!0);return $.makeTensor(i,s,a)}function Pu(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((a,s)=>R(a,`${t}[${s}]`,n,r))}var Px="__op";function D(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Px;let a=(...s)=>{$.startScope(n);try{let i=r(...s);return mf(i)&&console.error("Cannot return a Promise inside of tidy."),$.endScope(i),i}catch(i){throw $.endScope(null),i}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}function tI(e,t){let n=R(e,"real","complex"),r=R(t,"imag","complex");an(n.shape,r.shape,`real and imag shapes, ${n.shape} and ${r.shape}, must match in call to tf.complex().`);let a={real:n,imag:r};return $.runKernel(Eh,a)}var Ea=D({complex_:tI});function Ca(e,t,n,r){if(r==null&&(r=vh(e)),r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(t!=null){ff(t);let a=Nt(t),s=Nt(n);M(a===s,()=>`Based on the provided shape, [${t}], the tensor should have ${a} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!tn(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=r!=="string"?sd(e,r):ss(e,[],!0),$.makeTensor(e,t,r)}function gr(e,t,n){let r=$r(e,n);return Ca(e,t,r,n)}var Tf={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},ud=4;async function rI(e,t){let n=[],r=[],a=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let d=await l.bytes(),p=d.reduce((A,y)=>A+y.length,0)+ud*d.length,m=new Uint8Array(p),f=0;for(let A=0;A{if(t+=s.byteLength,n.push(s.byteLength===s.buffer.byteLength?s:new s.constructor(s)),!(s instanceof Float32Array||s instanceof Int32Array||s instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${s.constructor.name}`)});let r=new Uint8Array(t),a=0;return n.forEach(s=>{r.set(new Uint8Array(s.buffer),a),a+=s.byteLength}),r.buffer}var Ef=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Wx(e){return Ef?Buffer.byteLength(e):new Blob([e]).size}function sI(e){if(Ef)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let r=0,a=t.length;r{t+=a.byteLength});let n=new Uint8Array(t),r=0;return e.forEach(a=>{n.set(new Uint8Array(a),r),r+=a.byteLength}),n.buffer}function Bx(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function Lu(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:Wx(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:Wx(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function oI(){let e=n=>{let r=n<<13,a=0;for(;(r&8388608)==0;)a-=8388608,r<<=1;return r&=~8388608,a+=947912704,r|a},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function lI(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function uI(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function aI(){let e=oI(),t=lI(),n=uI();return r=>{let a=new ArrayBuffer(4*r.length),s=new Uint32Array(a);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(a)}}var St=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return St.instance==null&&(St.instance=new St),St.instance}static registerSaveRouter(e){St.getInstance().saveRouters.push(e)}static registerLoadRouter(e){St.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return St.getHandlers(e,"save")}static getLoadHandlers(e,t){return St.getHandlers(e,"load",t)}static getHandlers(e,t,n){let r=[];return(t==="load"?St.getInstance().loadRouters:St.getInstance().saveRouters).forEach(a=>{let s=a(e,n);s!==null&&r.push(s)}),r}},cI=e=>St.registerSaveRouter(e),hI=e=>St.registerLoadRouter(e),dI=e=>St.getSaveHandlers(e),pI=(e,t)=>St.getLoadHandlers(e,t),Rf="tensorflowjs",Mf=1,ai="models_store",Ra="model_info_store";function Vx(){if(!J().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ff(e){let t=e.result;t.createObjectStore(ai,{keyPath:"modelPath"}),t.createObjectStore(Ra,{keyPath:"modelPath"})}var si=class{constructor(e){if(this.indexedDB=Vx(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise((n,r)=>{let a=this.indexedDB.open(Rf,Mf);a.onupgradeneeded=()=>Ff(a),a.onsuccess=()=>{let s=a.result;if(t==null){let i=s.transaction(ai,"readonly"),o=i.objectStore(ai).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),r(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=l=>(s.close(),r(o.error)),i.oncomplete=()=>s.close()}else{let i=Lu(t),o=s.transaction(Ra,"readwrite"),l=o.objectStore(Ra),c=l.put({modelPath:this.modelPath,modelArtifactsInfo:i}),u;c.onsuccess=()=>{u=s.transaction(ai,"readwrite");let h=u.objectStore(ai).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});h.onsuccess=()=>n({modelArtifactsInfo:i}),h.onerror=d=>{l=o.objectStore(Ra);let p=l.delete(this.modelPath);p.onsuccess=()=>(s.close(),r(h.error)),p.onerror=m=>(s.close(),r(h.error))}},c.onerror=h=>(s.close(),r(c.error)),o.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}}},a.onerror=s=>r(a.error)})}};si.URL_SCHEME="indexeddb://";var jx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(si.URL_SCHEME)?fI(e.slice(si.URL_SCHEME.length)):null;St.registerSaveRouter(jx);St.registerLoadRouter(jx);function fI(e){return new si(e)}function mI(e){return e.startsWith(si.URL_SCHEME)?e.slice(si.URL_SCHEME.length):e}var AI=class{constructor(){this.indexedDB=Vx()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(Rf,Mf);n.onupgradeneeded=()=>Ff(n),n.onsuccess=()=>{let r=n.result,a=r.transaction(Ra,"readonly"),s=a.objectStore(Ra).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(r.close(),t(s.error)),a.oncomplete=()=>r.close()},n.onerror=r=>t(n.error)})}async removeModel(e){return e=mI(e),new Promise((t,n)=>{let r=this.indexedDB.open(Rf,Mf);r.onupgradeneeded=()=>Ff(r),r.onsuccess=()=>{let a=r.result,s=a.transaction(Ra,"readwrite"),i=s.objectStore(Ra),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return a.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let c=i.delete(e),u=()=>{l=a.transaction(ai,"readwrite");let h=l.objectStore(ai).delete(e);h.onsuccess=()=>t(o.result.modelArtifactsInfo),h.onerror=d=>n(o.error)};c.onsuccess=u,c.onerror=h=>(u(),a.close(),n(o.error))}},o.onerror=c=>(a.close(),n(o.error)),s.oncomplete=()=>{l==null?a.close():l.oncomplete=()=>a.close()}},r.onerror=a=>n(r.error)})}},ra="/",al="tensorflowjs_models",Ux="info",yI="model_topology",gI="weight_specs",xI="weight_data",wI="model_metadata";function Hx(e){return{info:[al,e,Ux].join(ra),topology:[al,e,yI].join(ra),weightSpecs:[al,e,gI].join(ra),weightData:[al,e,xI].join(ra),modelMetadata:[al,e,wI].join(ra)}}function bI(e){let t=e.split(ra);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(ra)}function _I(e){return e.startsWith(ii.URL_SCHEME)?e.slice(ii.URL_SCHEME.length):e}var ii=class{constructor(e){if(!J().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Hx(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Lu(e);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,sI(e.weightData));let a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:r}}catch(a){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){let e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(r==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;let a=this.LS.getItem(this.keys.modelMetadata);if(a!=null){let i=JSON.parse(a);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=iI(s),t}};ii.URL_SCHEME="localstorage://";var Gx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ii.URL_SCHEME)?vI(e.slice(ii.URL_SCHEME.length)):null;St.registerSaveRouter(Gx);St.registerLoadRouter(Gx);function vI(e){return new ii(e)}var kI=class{constructor(){M(J().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),M(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=al+ra,n=ra+Ux;for(let r=0;r"scheme must not be undefined or null."),e.endsWith(sl)&&(e=e.slice(0,e.indexOf(sl))),M(e.length>0,()=>"scheme must not be an empty string.");let n=Gn.getInstance();M(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function cd(e){if(e.indexOf(sl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Gn.getSchemes().join(",")}`);return{scheme:e.split(sl)[0],path:e.split(sl)[1]}}async function qx(e,t,n=!1){M(e!==t,()=>`Old path and new path are the same: '${e}'`);let r=St.getLoadHandlers(e);M(r.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),M(r.length<2,()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${e}.`);let a=r[0],s=St.getSaveHandlers(t);M(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),M(s.length<2,()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${t}.`);let i=s[0],o=cd(e).scheme,l=cd(e).path,c=o===cd(e).scheme,u=await a.load();n&&c&&await Gn.getManager(o).removeModel(l);let h=await i.save(u);return n&&!c&&await Gn.getManager(o).removeModel(l),h.modelArtifactsInfo}async function II(){let e=Gn.getSchemes(),t={};for(let n of e){let r=await Gn.getManager(n).listModels();for(let a in r){let s=n+sl+a;t[s]=r[a]}}return t}async function SI(e){let t=cd(e);return Gn.getManager(t.scheme).removeModel(t.path)}async function NI(e,t){return qx(e,t,!1)}async function TI(e,t){return qx(e,t,!0)}var EI=class{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}};if(J().get("IS_BROWSER")){J().setPlatform("browser",new EI);try{Gn.registerManager(ii.URL_SCHEME,new kI)}catch(e){}try{Gn.registerManager(si.URL_SCHEME,new AI)}catch(e){}}var CI={importFetch:()=>zk()},$f,RI=class{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return J().global.fetch!=null?J().global.fetch(e,t):($f==null&&($f=CI.importFetch()),$f(e,t))}now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)}};J().get("IS_NODE")&&J().setPlatform("node",new RI);function We(e,t="float32",n){return t=t||"float32",ff(e),new $t(e,t,n)}function MI(e,t){let n=R(e,"x","cast");if(!gx(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let r={x:n},a={dtype:t};return $.runKernel(cs,r,a)}var Ae=D({cast_:MI});function FI(e){let t={x:R(e,"x","clone","string_or_numeric")};return $.runKernel(vs,t)}var Dr=D({clone_:FI});function Xx(e,t=!1){console.log(e.toString(t))}$x();var $I={buffer:We,cast:Ae,clone:Dr,print:Xx};G9($I);var bn={};Me(bn,{browserFiles:()=>DI,browserHTTPRequest:()=>zI,concatenateArrayBuffers:()=>Cf,copyModel:()=>NI,decodeWeights:()=>Lx,encodeWeights:()=>rI,fromMemory:()=>PI,getLoadHandlers:()=>pI,getModelArtifactsInfoForJSON:()=>Lu,getSaveHandlers:()=>dI,http:()=>Of,isHTTPScheme:()=>Df,listModels:()=>II,loadWeights:()=>OI,moveModel:()=>TI,registerLoadRouter:()=>hI,registerSaveRouter:()=>cI,removeModel:()=>SI,weightsLoaderFactory:()=>Kx,withSaveHandler:()=>LI});var WI="model",BI=".json",VI=".weights.bin";function Zx(e){return new Promise(t=>setTimeout(t)).then(e)}var il=class{constructor(e){if(!J().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(il.URL_SCHEME)&&(e=e.slice(il.URL_SCHEME.length)),(e==null||e.length===0)&&(e=WI),this.modelTopologyFileName=e+BI,this.weightDataFileName=e+VI}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer);let a=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=a,await Zx(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await Zx(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Lu(e)}}}};il.URL_SCHEME="downloads://";var jI=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,r)=>{let a=new FileReader;a.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){r(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let l=i.weightsManifest;if(l==null){r(new Error(`weightManifest field is missing from file ${e.name}`));return}let c;try{c=this.checkManifestAndWeightFiles(l,t)}catch(p){r(p);return}let u=[],h=[],d=[];l.forEach(p=>{p.paths.forEach(m=>{h.push(m),d.push(null)}),u.push(...p.weights)}),l.forEach(p=>{p.paths.forEach(m=>{let f=new FileReader;f.onload=A=>{let y=A.target.result,g=h.indexOf(m);if(d[g]=y,d.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:u,weightData:Cf(d),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=A=>r(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(c[m])})})},a.onerror=s=>r(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),a.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],r=t.map(s=>Bx(s.name)),a={};for(let s of e)s.paths.forEach(i=>{let o=Bx(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),r.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);a[i]=t[r.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return a}},HI=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(il.URL_SCHEME)?UI(e.slice(il.URL_SCHEME.length)):null;St.registerSaveRouter(HI);function UI(e="model"){return new il(e)}function DI(e){return new jI(e)}function Yx(e,t,n,r){i(e),n=n==null?0:n,r=r==null?1:r,o(n,r);let a=0,s=l=>(l.then(c=>{let u=n+ ++a/e.length*(r-n);return t(u),c}),l);function i(l){M(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,c){M(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),M(c>=0&&c<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${c}`),M(c>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${c}`)}return Promise.all(e.map(s))}async function Jx(e,t){t==null&&(t={});let n=t.fetchFunc==null?J().platform.fetch:t.fetchFunc,r=e.map(c=>n(c,t.requestInit,{isBinary:!0})),a=0,s=.5,i=(t.onProgress==null?await Promise.all(r):await Yx(r,t.onProgress,a,s)).map(c=>c.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await Yx(i,t.onProgress,o,l)}async function OI(e,t="",n,r){return Kx(a=>Jx(a,{requestInit:r}))(e,t,n)}function Kx(e){return async(t,n="",r)=>{let a=t.map(()=>!1),s={},i=r!=null?r.map(()=>!1):[],o=[];if(t.forEach((p,m)=>{let f=0;p.weights.forEach(A=>{let y="quantization"in A?A.quantization.dtype:A.dtype,g=Tf[y]*Nt(A.shape),x=()=>{a[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:A,groupOffset:f,sizeBytes:g})};r!=null?r.forEach((v,w)=>{v===A.name&&(x(),i[w]=!0)}):x(),o.push(A.name),f+=g})}),!i.every(p=>p)){let p=r.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${p.join(", ")}. -Manifest JSON has weights with names: ${o.join(", ")}.`)}let l=a.reduce((p,m,f)=>(m&&p.push(f),p),[]),c=[];l.forEach(p=>{t[p].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;c.push(f)})});let u=await e(c),h={},d=0;return l.forEach(p=>{let m=t[p].paths.length,f=0;for(let x=0;x{let v=A.slice(x.groupOffset,x.groupOffset+x.sizeBytes),w=Lx(v,[x.manifestEntry]);for(let b in w)h[b]=w[b]}),d+=m}),h}}var GI="application/octet-stream",qI="application/json",zf=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(M(typeof t.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=t.fetchFunc):this.fetch=J().platform.fetch,M(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&M(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(r)],{type:qI}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:GI}),"model.weights.bin");let a=await this.fetch(this.path,t);if(a.ok)return{modelArtifactsInfo:Lu(e),responses:[a]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${a.status}.`)}async load(){let e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(p){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,r=t.weightsManifest,a=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,l=t.userDefinedMetadata;if(n==null&&r==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let c,u;r!=null&&([c,u]=await this.loadWeights(r));let h={modelTopology:n,weightSpecs:c,weightData:u,generatedBy:a,convertedBy:s,format:i};o!=null&&(h.signature=o),l!=null&&(h.userDefinedMetadata=l);let d=t.modelInitializer;return d&&(h.modelInitializer=d),h}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=XI(t),a=this.weightPathPrefix||n,s=[];for(let c of e)s.push(...c.weights);let i=[],o=[];for(let c of e)for(let u of c.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(u)):i.push(a+u+r);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await Jx(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,Cf(l)]}};zf.URL_SCHEME_REGEX=/^https?:\/\//;function XI(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),r=e.substring(0,t),a=n>t?e.substring(n):"";return[r+"/",a]}function Df(e){return e.match(zf.URL_SCHEME_REGEX)!=null}var Qx=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(r=>Df(r)):n=Df(e),n)return Of(e,t)}return null};St.registerSaveRouter(Qx);St.registerLoadRouter(Qx);function Of(e,t){return new zf(e,t)}function zI(e,t){return Of(e,t)}var Pf=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},KI=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function PI(e,t,n,r){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new Pf(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pf({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pf({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r}))}function LI(e){return new KI(e)}var ew={};Me(ew,{confusionMatrix:()=>ZI});function YI(e,t,n=!1,r=!1){let a=R(e,"a","matMul"),s=R(t,"b","matMul");[a,s]=bt(a,s);let i={a,b:s},o={transposeA:n,transposeB:r};return $.runKernel(us,i,o)}var Be=D({matMul_:YI});function JI(e,t,n=1,r=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let a={indices:R(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:r};return $.runKernel($s,a,s)}var ol=D({oneHot_:JI});function QI(e,t){let n=R(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),M(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{M(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let r={x:n},a={perm:t};return $.runKernel(Qs,r,a)}var Ze=D({transpose_:QI});function eS(e,t,n){let r=R(e,"labels","confusionMatrix"),a=R(t,"predictions","confusionMatrix");M(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),M(r.rank===1,()=>`Expected the rank of labels to be 1, but got ${r.rank}`),M(a.rank===1,()=>`Expected the rank of predictions to be 1, but got ${a.rank}`),M(r.shape[0]===a.shape[0],()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`),M(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=ol(Ae(r,"int32"),n),i=ol(Ae(a,"int32"),n),o=Ze(s),l=Be(o,i);return Ae(l,"int32")}var ZI=D({confusionMatrix_:eS}),oi={};Me(oi,{fromPixels:()=>rS,fromPixelsAsync:()=>tS,toPixels:()=>nS});function hd(e,t,n){if(as(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let r=$r(e,n);if(r.length!==3&&r.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}var ll;function tw(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)r=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)a=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)o=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);if(a){let d=2;if(a&&e.readyState element.")}if(ad(rd,$.backendName)!=null){let d={pixels:e},p={numChannels:t};return $.runKernel(rd,d,p)}let[l,c]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height],u;i?u=e.getContext("2d").getImageData(0,0,l,c).data:r||n?u=e.data:(s||a||o)&&(ll==null&&(ll=document.createElement("canvas").getContext("2d")),ll.canvas.width=l,ll.canvas.height=c,ll.drawImage(e,0,0,l,c),u=ll.getImageData(0,0,l,c).data);let h;if(t===4)h=new Int32Array(u);else{let d=l*c;h=new Int32Array(d*t);for(let p=0;p4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(a*r*4);for(let c=0;c1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${p}.`)}else if(n.dtype==="int32"&&(p<0||p>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${p}.`);s===1?(u[0]=p*o,u[1]=p*o,u[2]=p*o):u[d]=p*o}let h=c*4;l[h+0]=Math.round(u[0]),l[h+1]=Math.round(u[1]),l[h+2]=Math.round(u[2]),l[h+3]=Math.round(u[3])}if(t!=null){t.width=a,t.height=r;let c=t.getContext("2d"),u=new ImageData(l,a,r);c.putImageData(u,0,0)}return n!==e&&n.dispose(),l}var rS=D({fromPixels_:tw}),Lf={};Me(Lf,{prepareAndValidate:()=>nw});function nw(e,t){let n=e.shape.length,r=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(Nt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let a=t.shape,s=a[a.length-1],i=1;for(let h=0;hh/c),1].slice(0,s);return[l,i,c,u]}var Wf={};Me(Wf,{calculateShapes:()=>rw,validateInput:()=>Vf,validateUpdateShape:()=>Bf});function Bf(e,t,n){let r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank1?t.shape[r-1]:1,s=n.length,i=1;for(let h=a;hlS,computeFlatOffset:()=>cS,computeOutShape:()=>aw,getNormalizedAxes:()=>iw,isSliceContinous:()=>uS,maskToAxes:()=>dd,parseSliceParams:()=>dw,sliceInfo:()=>hS,startForAxis:()=>cw,startIndicesWithElidedDims:()=>ow,stopForAxis:()=>hw,stopIndicesWithElidedDims:()=>lw,stridesForAxis:()=>uw,stridesWithElidedDims:()=>sw});function lS(e,t,n){let r=e.shape.length;M(r===t.length,()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`),M(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let a=0;a`Error in slice${r}D: begin[${a}] + size[${a}] (${t[a]+n[a]}) would overflow input.shape[${a}] (${e.shape[a]})`)}function dd(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function aw(e,t,n){let r=[];for(let a=0;a0){let p=t[0],m=n+1;u=ow(i,p,m,r,e),h=lw(o,p,m,a,e),d=sw(s,p,m,e)}else for(let p=0;p-1)s[o]=0;else{let l=pw(t,n,o),c=r[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=pw(t,n,o),c=r[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=r[a];return i<0&&(i+=l),i=hu(0,i,l-1),i}function hw(e,t,n,r,a,s){let i=t[a],o=n[a]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=r[a];return i<0&&(i+=l),o>0?i=hu(0,i,l):i=hu(-1,i,l-1),i}function uS(e,t,n){let r=n.length;for(let a=0;a1){r=a;break}for(let a=r+1;a0||n[a]!==e[a])return!1;return!0}function cS(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r{M(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(a).fill(-1):typeof n=="number"?s=[n,...new Array(a-1).fill(-1)]:n.lengthi>=0?i:(M(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-r[o])),[r,s]}function hS(e,t,n,r,a,s,i,o,l){let c=t.slice(),u=n.slice(),h=r;r==null&&(h=new Array(c.length));let d=dd(i);if(d.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&l!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let p=e.length-c.length,m=dd(o),f=e.slice();m.forEach(b=>{c[b]=0,u[b]=1,f.splice(b,0,1)});let{begin:A,end:y,strides:g}=iw(f,d,p,c,u,h,a,s,i);c=A,u=y,h=g;let x=dd(l);x.forEach(b=>{u[b]=c[b]+1,h[b]=1});let v=aw(c,u,h),w=v.filter((b,k)=>x.indexOf(k)===-1);return{nonStrided:h.every(b=>b===1),$begin:c,$end:u,$strides:h,size:v,newShape:f,outShape:w}}var re={};Me(re,{Serializable:()=>mw,SerializationMap:()=>li,registerClass:()=>Ma});var mw=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},li=class{constructor(){this.classNameMap={}}static getMap(){return li.instance==null&&(li.instance=new li),li.instance}static register(e){li.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function Ma(e){M(e.className!=null,()=>"Class being registered does not have the static className property defined."),M(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),M(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),li.register(e)}var Aw={};Me(Aw,{TEST_EPSILON_FLOAT16:()=>yw,encodeStrings:()=>gw,expectArrayBuffersEqual:()=>yS,expectArraysClose:()=>dS,expectArraysEqual:()=>fS,expectNumbersClose:()=>mS,expectPromiseToFail:()=>pS,expectValuesInRange:()=>AS,testEpsilon:()=>jf});var gS=.001,yw=.1;function dS(e,t,n){return n==null&&(n=jf()),Uf(e,t,(r,a)=>Hf(r,a,n))}function jf(){return $.backend.floatPrecision()===32?gS:yw}function Uf(e,t,n){let r=!0;if((tn(e)||tn(t))&&(r=!1),tn(e)&&tn(t)&&(r=!0),r){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=$r(e),o=$r(t);if(!na(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let a=tn(e)?e:ss(e),s=tn(t)?t:ss(t);if(a.length!==s.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${s.length}. -Actual: ${a}. -Expected: ${s}.`);for(let i=0;it.fail(),()=>t())}function fS(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return va(e)||va(e[0])||va(t)||va(t[0])?Uf(e,n,(r,a)=>r==a):Uf(e,t,(r,a)=>Hf(r,a,0))}function mS(e,t,n){if(n==null&&(n=jf()),!Hf(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Hf(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function AS(e,t,n){for(let r=0;rn)throw new Error(`Value out of range:${e[r]} low: ${t}, high: ${n}`)}function yS(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function gw(e){for(let t=0;tt.dispose())}function Vt(e){return $.keep(e)}function IS(e){return $.time(e)}function SS(e){return $.setBackend(e)}function NS(){return $.ready()}function TS(){return $.backendName}function ES(e){$.removeBackend(e)}function qf(e){return $.findBackend(e)}function CS(e){return $.findBackendFactory(e)}function ul(e,t,n=1){return $.registerBackend(e,t,n)}function xw(){return $.backend}function RS(e,t){J().setPlatform(e,t)}function MS(e,t){let n=R(e,"a","add"),r=R(t,"b","add");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Ia,a)}var se=D({add_:MS});function FS(e,t){let n=R(e,"a","floorDiv"),r=R(t,"b","floorDiv");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(ws,a)}var fd=D({floorDiv_:FS});function $S(e,t){let n=R(e,"a","div"),r=R(t,"b","div");if([n,r]=bt(n,r),n.dtype==="int32"&&r.dtype==="int32")return fd(n,r);let a={a:n,b:r},s={};return $.runKernel(ys,a,s)}var ge=D({div_:$S});function DS(e,t){let n=R(e,"a","mul"),r=R(t,"b","mul");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Fs,a)}var B=D({mul_:DS});function OS(e){let t=R(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return $.runKernel(Au,n)}else{let n={x:t};return $.runKernel(eo,n)}}var Dt=D({abs_:OS});function zS(e){let t={x:R(e,"x","acos")};return $.runKernel(to,t)}var Xf=D({acos_:zS});function PS(e){let t={x:R(e,"x","acosh")};return $.runKernel(no,t)}var Kf=D({acosh_:PS});function LS(e){M(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),M(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((a,s)=>R(a,`tensors${s}`,"addN")),n=t[0];t.forEach(a=>{if(a.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(a=>{if(!na(a.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let r=t;return $.runKernel(is,r)}var md=D({addN_:LS});function WS(e,t=null,n=!1){let r={x:R(e,"x","all","bool")},a={axis:t,keepDims:n};return $.runKernel(ro,r,a)}var Ad=D({all_:WS});function BS(e,t=null,n=!1){let r={x:R(e,"x","any","bool")},a={axis:t,keepDims:n};return $.runKernel(ao,r,a)}var Wu=D({any_:BS});function VS(e,t=0){let n={x:R(e,"x","argMax")},r={axis:t};return $.runKernel(os,n,r)}var Bu=D({argMax_:VS});function jS(e,t=0){let n={x:R(e,"x","argMin")},r={axis:t};return $.runKernel(pu,n,r)}var Zf=D({argMin_:jS});function US(e){let t={x:R(e,"x","asin")};return $.runKernel(so,t)}var Yf=D({asin_:US});function HS(e){let t={x:R(e,"x","asinh")};return $.runKernel(io,t)}var Jf=D({asinh_:HS});function GS(e){let t={x:R(e,"x","atan")};return $.runKernel(oo,t)}var Qf=D({atan_:GS});function qS(e,t){let n=R(e,"a","atan2"),r=R(t,"b","atan2");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(uo,a)}var em=D({atan2_:qS});function XS(e){let t={x:R(e,"x","atanh")};return $.runKernel(lo,t)}var tm=D({atanh_:XS});function KS(e,t,n,r,a="NHWC",s){let i=e[3],o=[...t,i],l=ww(a);return Vu(e,o,n,s,r,null,null,l)}function bw(e,t,n,r,a,s,i="channelsLast"){let[o,l]=yd(t),c;if(i==="channelsLast")c=[o,l,e[3],e[3]];else if(i==="channelsFirst")c=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Vu(e,c,n,r,a,s,!1,i)}function ZS(e,t,n,r,a,s,i="NDHWC"){let[o,l,c]=nm(t),u,h;if(i==="NDHWC")h="channelsLast",u=[o,l,c,e[4],e[4]];else if(i==="NCDHW")h="channelsFirst",u=[o,l,c,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return _w(e,u,n,r,a,!1,h,s)}function Vu(e,t,n,r,a,s,i=!1,o="channelsLast"){let[l,c,u,h]=[-1,-1,-1,-1];if(o==="channelsLast")[l,c,u,h]=e;else if(o==="channelsFirst")[l,h,c,u]=e;else throw new Error(`Unknown dataFormat ${o}`);let[d,p,,m]=t,[f,A]=yd(n),[y,g]=yd(r),x=cl(d,y),v=cl(p,g),{padInfo:w,outHeight:b,outWidth:k}=YS(a,c,u,f,A,x,v,s,o),N=i?m*h:m,C;return o==="channelsFirst"?C=[l,N,b,k]:o==="channelsLast"&&(C=[l,b,k,N]),{batchSize:l,dataFormat:o,inHeight:c,inWidth:u,inChannels:h,outHeight:b,outWidth:k,outChannels:N,padInfo:w,strideHeight:f,strideWidth:A,filterHeight:d,filterWidth:p,effectiveFilterHeight:x,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:g,inShape:e,outShape:C,filterShape:t}}function _w(e,t,n,r,a,s=!1,i="channelsLast",o){let[l,c,u,h,d]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,c,u,h,d]=e;else if(i==="channelsFirst")[l,d,c,u,h]=e;else throw new Error(`Unknown dataFormat ${i}`);let[p,m,f,,A]=t,[y,g,x]=nm(n),[v,w,b]=nm(r),k=cl(p,v),N=cl(m,w),C=cl(f,b),{padInfo:F,outDepth:O,outHeight:z,outWidth:V}=JS(a,c,u,h,y,g,x,k,N,C,o),j=s?A*d:A,U;return i==="channelsFirst"?U=[l,j,O,z,V]:i==="channelsLast"&&(U=[l,O,z,V,j]),{batchSize:l,dataFormat:i,inDepth:c,inHeight:u,inWidth:h,inChannels:d,outDepth:O,outHeight:z,outWidth:V,outChannels:j,padInfo:F,strideDepth:y,strideHeight:g,strideWidth:x,filterDepth:p,filterHeight:m,filterWidth:f,effectiveFilterDepth:k,effectiveFilterHeight:N,effectiveFilterWidth:C,dilationDepth:v,dilationHeight:w,dilationWidth:b,inShape:e,outShape:U,filterShape:t}}function QS(e,t,n,r,a){r==null&&(r=rm(e,t,n));let s=e[0],i=e[1],o=ui((s-t+2*r)/n+1,a),l=ui((i-t+2*r)/n+1,a);return[o,l]}function eN(e,t,n,r,a,s){a==null&&(a=rm(e,t,r));let i=e[0],o=e[1],l=e[2],c=ui((i-t+2*a)/r+1,s),u=ui((o-t+2*a)/r+1,s),h=ui((l-t+2*a)/r+1,s);return[c,u,h,n]}function rm(e,t,n,r=1){let a=cl(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function yd(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function nm(e){return typeof e=="number"?[e,e,e]:e}function cl(e,t){return t<=1?e:e+(e-1)*(t-1)}function YS(e,t,n,r,a,s,i,o,l){let c,u,h;if(typeof e=="number"){c={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let d=QS([t,n],s,r,e,o);u=d[0],h=d[1]}else if(e==="same"){u=Math.ceil(t/r),h=Math.ceil(n/a);let d=Math.max(0,(u-1)*r+s-t),p=Math.max(0,(h-1)*a+i-n),m=Math.floor(d/2),f=d-m,A=Math.floor(p/2),y=p-A;c={top:m,bottom:f,left:A,right:y,type:"SAME"}}else if(e==="valid")c={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-s+1)/r),h=Math.ceil((n-i+1)/a);else if(typeof e=="object"){let d=l==="channelsLast"?e[1][0]:e[2][0],p=l==="channelsLast"?e[1][1]:e[2][1],m=l==="channelsLast"?e[2][0]:e[3][0],f=l==="channelsLast"?e[2][1]:e[3][1];c={top:d,bottom:p,left:m,right:f,type:d===0&&p===0&&m===0&&f===0?"VALID":"EXPLICIT"},u=ui((t-s+d+p)/r+1,o),h=ui((n-i+m+f)/a+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:c,outHeight:u,outWidth:h}}function JS(e,t,n,r,a,s,i,o,l,c,u){let h,d,p,m;if(typeof e=="number"){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=eN([t,n,r,1],o,1,a,e,u);d=f[0],p=f[1],m=f[2]}else if(e==="same"){d=Math.ceil(t/a),p=Math.ceil(n/s),m=Math.ceil(r/i);let f=(d-1)*a+o-t,A=(p-1)*s+l-n,y=(m-1)*i+c-r,g=Math.floor(f/2),x=f-g,v=Math.floor(A/2),w=A-v,b=Math.floor(y/2),k=y-b;h={top:v,bottom:w,left:b,right:k,front:g,back:x,type:"SAME"}}else if(e==="valid")h={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},d=Math.ceil((t-o+1)/a),p=Math.ceil((n-l+1)/s),m=Math.ceil((r-c+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:h,outDepth:d,outHeight:p,outWidth:m}}function ui(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Fa(e){let[t,n,r]=yd(e);return t===1&&n===1&&r===1}function Or(e,t){return Fa(e)||Fa(t)}function ww(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function tN(e,t){let n={x:R(e,"x","reshape","string_or_numeric")},r={shape:t};return $.runKernel(Bo,n,r)}var H=D({reshape_:tN});function nN(e,t,n,r,a){let s=R(e,"x","avgPool","float32"),i=1;M(Or(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),M(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),a!=null&&M(Bt(r),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a},h=$.runKernel(ls,c,u);return h=Ae(h,s.dtype),l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var ju=D({avgPool_:nN});function rN(e,t,n,r,a,s="NDHWC"){let i=R(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),M(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),a!=null&&M(Bt(r),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},h=$.runKernel(fu,c,u);return h=Ae(h,o.dtype),l?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var am=D({avgPool3d_:rN});function aN(e,t=0){M(e.length>=1,()=>"Pass at least one tensor to concat");let n=Pu(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${s.dtype}. `)}),n.length===1)return Dr(n[0]);let r=n,a={axis:t};return $.runKernel(co,r,a)}var ot=D({concat_:aN});function sN(e){let t={x:R(e,"x","sigmoid")};return $.runKernel(Hs,t)}var _n=D({sigmoid_:sN});function iN(e,t,n){let r=R(e,"x","slice","string_or_numeric");if(r.rank===0)throw new Error("Slicing scalar is not possible");let a={x:r},s={begin:t,size:n};return $.runKernel(Ho,a,s)}var Re=D({slice_:iN});function oN(e){let t={x:R(e,"x","tanh")};return $.runKernel(Js,t)}var ci=D({tanh_:oN});function lN(e,t,n,r,a,s){let i=R(e,"forgetBias","basicLSTMCell"),o=R(t,"lstmKernel","basicLSTMCell"),l=R(n,"lstmBias","basicLSTMCell"),c=R(r,"data","basicLSTMCell"),u=R(a,"c","basicLSTMCell"),h=R(s,"h","basicLSTMCell"),d=ot([c,h],1),p=Be(d,o),m=se(p,l),f=m.shape[0],A=m.shape[1]/4,y=[f,A],g=Re(m,[0,0],y),x=Re(m,[0,A],y),v=Re(m,[0,A*2],y),w=Re(m,[0,A*3],y),b=se(B(_n(g),ci(x)),B(u,_n(se(i,v)))),k=B(ci(b),_n(w));return[b,k]}var uN=D({basicLSTMCell_:lN});function cN(e,t,n){let r=R(e,"x","batchToSpaceND"),a=t.reduce((o,l)=>o*l);M(r.rank>=1+t.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`),M(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),M(r.shape[0]%a==0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${a}`);let s={x:r},i={blockShape:t,crops:n};return $.runKernel(mu,s,i)}var Uu=D({batchToSpaceND_:cN});function hN(e){let t;return e.rank===0||e.rank===1?t=H(e,[1,1,1,e.size]):e.rank===2?t=H(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function dN(e,t,n,r,a,s){s==null&&(s=.001);let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;r!=null&&(u=R(r,"offset","batchNorm")),M(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),M(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),M(c==null||o.rank===c.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let h={x:hN(i),scale:c,offset:u,mean:o,variance:l},d={varianceEpsilon:s},p=$.runKernel(bs,h,d);return H(p,i.shape)}var hi=D({batchNorm_:dN});function pN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),M(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),M(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var vw=D({batchNorm2d_:pN});function fN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),M(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),M(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var kw=D({batchNorm3d_:fN});function mN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),M(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),M(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var Iw=D({batchNorm4d_:mN});function AN(e,t,n){let r=R(e,"x","bincount"),a=R(t,"weights","bincount");M(r.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),M(n>=0,()=>`size must be non-negative, but got ${n}.`),M(a.size===r.size||a.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`);let s={x:r,weights:a},i={size:n};return $.runKernel(Th,s,i)}var Sw=D({bincount_:AN});function yN(e,t){let n=R(e,"broadcastTo","x"),r=n.shape;if(t.some(l=>!(l>0)||l%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let l=n.shape.slice();for(;l.length=0;l--)if(a[l]===t[l])s[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(s.map((l,c)=>l>1?c:-1).filter(l=>l>=0).length===0)return Dr(n);let i={x:n},o={reps:s};return $.runKernel(Na,i,o)}var hl=D({broadcastTo_:yN});function gN(e){let t={x:R(e,"x","ceil")};return $.runKernel(hs,t)}var sm=D({ceil_:gN});function xN(e,t,n){let r=R(e,"x","clipByValue");M(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let a={x:r},s={clipValueMin:t,clipValueMax:n};return $.runKernel(Sa,a,s)}var vn=D({clipByValue_:xN});function wN(e){return ot(e,0)}var Nw=D({concat1d_:wN});function bN(e,t){return ot(e,t)}var dl=D({concat2d_:bN});function _N(e,t){return ot(e,t)}var Tw=D({concat3d_:_N});function vN(e,t){return ot(e,t)}var Ew=D({concat4d_:vN});function kN(e,t,n,r,a="NHWC",s=[1,1],i){let o=R(e,"x","conv2d"),l=R(t,"filter","conv2d"),c=o,u=!1;o.rank===3&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),M(c.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`),M(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),i!=null&&M(Bt(r),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let h=a==="NHWC"?c.shape[3]:c.shape[1];M(h===l.shape[2],()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`),M(Or(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let d={x:c,filter:l},p={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i},m=$.runKernel(ds,d,p);return u?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var sa=D({conv2d_:kN});function IN(e,t,n,r,a="NWC",s=1,i){let o=R(e,"x","conv1d"),l=R(t,"filter","conv1d"),c=o,u=!1;o.rank===2&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1]])),M(c.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`),M(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),i!=null&&M(Bt(r),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`),M(c.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`),M(Or(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),M(a==="NWC",()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`);let h=H(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=H(c,[c.shape[0],1,c.shape[1],c.shape[2]]),p=sa(d,h,[1,n],r,"NHWC",[1,s],i);return u?H(p,[p.shape[2],p.shape[3]]):H(p,[p.shape[0],p.shape[2],p.shape[3]])}var gd=D({conv1d_:IN});function SN(e,t,n,r,a,s="NHWC",i){M(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,c=!1;t.rank===3&&(c=!0,l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),M(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),M(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),M(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let u=s==="NHWC"?o[3]:o[1],h=s==="NHWC"?l.shape[3]:l.shape[1];M(u===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`),M(h===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`),i!=null&&M(Bt(a),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let d={dy:l,filter:n},p={strides:r,pad:a,dataFormat:s,dimRoundingMode:i,inputShape:o},m=$.runKernel(ps,d,p);return c?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var im=D({conv2DBackpropInput_:SN});function NN(e,t,n,r,a,s){let i=R(e,"x","conv2dTranspose"),o=R(t,"filter","conv2dTranspose");return im(n,i,o,r,a,"NHWC",s)}var xd=D({conv2dTranspose_:NN});function TN(e,t,n,r,a="NDHWC",s=[1,1,1]){let i=R(e,"x","conv3d"),o=R(t,"filter","conv3d"),l=i,c=!1;i.rank===4&&(c=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),M(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),M(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),M(Or(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),M(a==="NDHWC",()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`);let u={x:l,filter:o},h={strides:n,pad:r,dataFormat:a,dilations:s},d=$.runKernel(yu,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var om=D({conv3d_:TN});function EN(e,t,n,r,a){M(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let l=s[4],c=i.shape[4];M(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),M(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),M(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),M(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),M(c===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`);let u={dy:i,filter:n},h={pad:a,strides:r,inputShape:s},d=$.runKernel(Mh,u,h);return o?H(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var Cw=D({conv3DBackpropInput_:EN});function CN(e,t,n,r,a){let s=R(e,"x","conv3dTranspose"),i=R(t,"filter","conv3dTranspose");return Cw(n,s,i,r,a)}var Rw=D({conv3dTranspose_:CN});function RN(e){let t={x:R(e,"x","cos")};return $.runKernel(fs,t)}var Hu=D({cos_:RN});function MN(e){let t={x:R(e,"x","cosh")};return $.runKernel(ho,t)}var wd=D({cosh_:MN});function FN(e,t=0,n=!1,r=!1){let a={x:R(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:r};return $.runKernel(ms,a,s)}var bd=D({cumsum_:FN});function $N(e,t,n,r=!1){let a=R(e,"x","denseBincount"),s=R(t,"weights","denseBincount");M(a.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`),M(a.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`),M(n>=0,()=>`size must be non-negative, but got ${n}.`),M(s.size===a.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${s.shape}.`);let i={x:a,weights:s},o={size:n,binaryOutput:r};return $.runKernel(Fh,i,o)}var Mw=D({denseBincount_:$N});function DN(e,t,n="NHWC"){let r=R(e,"x","depthToSpace"),a=n==="NHWC"?r.shape[1]:r.shape[2],s=n==="NHWC"?r.shape[2]:r.shape[3],i=n==="NHWC"?r.shape[3]:r.shape[1];M(a*t>=0,()=>`Negative dimension size caused by overflow when multiplying - ${a} and ${t} for depthToSpace with input shape - ${r.shape}`),M(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying +`;return c[c.length-1]=" "+c[c.length-1]+"]"+(s?"":m),c}function Du(e){let t=[];for(let n=0;n`Length of values '${a}' does not match the size inferred by the shape '${this.size}'.`)}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||yx(t,this.size),this.strides=Ji(e)}set(e,...t){t.length===0&&(t=[0]),F(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let a of e){if(a<0||a>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let n=e[e.length-1];for(let a=0;aic(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=$a().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>ic(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();let e=await $a().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||($a().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return al.print(this,e)}clone(){return this.throwIfDisposed(),al.clone(this)}toString(e=!1){let t=this.dataSync();return XI(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),al.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),$a().makeVariable(this,e,t,n)}};Object.defineProperty(Le,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function Z(){return ym("Tensor",()=>Le)}Z();var Ou=class extends Le{constructor(e,t,n,a){super(e.shape,e.dtype,e.dataId,a);this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!er(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);$a().disposeTensor(this),this.dataId=e.dataId,$a().incRef(this,null)}dispose(){$a().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Ou,Symbol.hasInstance,{value:e=>e instanceof Le&&e.assign!=null&&e.assign instanceof Function});var Aa={};Fe(Aa,{assertTypesMatch:()=>Fx,getTensorsInContainer:()=>vm,isTensorInList:()=>QI,makeTypesMatch:()=>vt});var wm;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(wm||(wm={}));var km;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(km||(km={}));var Im;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(Im||(Im={}));var Sm;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(Sm||(Sm={}));var Nm;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(Nm||(Nm={}));var eS={float32:Sm,int32:km,bool:Im,complex64:Nm};function ia(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return eS[e][t]}function lc(e){return ia(e,"int32")}function vt(e,t){if(e.dtype===t.dtype)return[e,t];let n=ia(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Fx(e,t){F(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function QI(e,t){return t.some(n=>n.id===e.id)}function vm(e){let t=[],n=new Set;return $x(e,t,n),t}function $x(e,t,n){if(e==null)return;if(e instanceof Le){t.push(e);return}if(!tS(e))return;let a=e;for(let r in a){let s=a[r];n.has(s)||(n.add(s),$x(s,t,n))}}function tS(e){return Array.isArray(e)||typeof e=="object"}function Tm(e){return e.kernelName!=null}var Dx=class{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},zu=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Dx}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){nl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof du)&&typeof n.then=="function"){let a=++this.pendingBackendInitId,r=n.then(s=>a(athis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(a),()=>(a=t(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,t,n){e();try{let a=n();return t(),a}catch(a){throw t(),a}}nextTensorId(){return zu.nextTensorId++}nextVariableId(){return zu.nextVariableId++}clone(e){let t=D.runKernel(ks,{x:e}),n={x:e},a=s=>({x:()=>{let i="float32",o={x:s},l={dtype:i};return D.runKernel(ds,o,l)}}),r=[];return this.addTapeNode(this.state.activeScope.name,n,[t],a,r,{}),t}runKernel(e,t,n){if(rc(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let a=this.backend.numDataIds(),r=0;n.forEach(o=>{r+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=a-t-r-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],a=this.isTapeOn(),r=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,l=Tm(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Tm(e)){let{kernelName:h,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let A=rc(h,this.backendName);F(A!=null,()=>`Cannot find registered kernel '${h}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=A.kernelFunc({inputs:m,attrs:f,backend:this.backend});let g=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(h,y,g);let x=g.map(k=>{if(k.rank!=null)return k;let{dataId:b,shape:v,dtype:I}=k;return this.makeTensorFromDataId(b,v,I)});if(a){let k=this.getTensorsForGradient(h,m,x);n=this.saveTensorsForBackwardMode(k)}return x}}else{let{forwardFunc:h}=e,m=f=>{!a||(n=f.map(A=>this.keep(this.clone(A))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>h(this.backend,m));let A=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,f,A),A}}let{inputs:d,attrs:u}=e,p=Tm(e)?null:e.backwardsFunc,c;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(c=this.profiler.profileKernel(l,d,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(c),t=c.outputs)}),a&&this.addTapeNode(l,d,t,p,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map(h=>d[h]!=null?d[h].shape:null),outputShapes:t.map(h=>h.shape),kernelTimeMs:c.timeMs,extraInfo:c.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let a=xm(e);if(a!=null){let r=a.inputsToSave||[],s=a.outputsToSave||[],i;a.saveAllInputs?(F(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(l=>t[l])):i=r.map(l=>t[l]);let o=n.filter((l,d)=>s[d]);return i.concat(o)}return[]}makeTensor(e,t,n,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",a=a||this.backend;let r=e;n==="string"&&vr(e[0])&&(r=e.map(o=>Mu(o)));let s=a.write(r,t,n),i=new Le(t,n,s,this.nextTensorId());if(this.trackTensor(i,a),n==="string"){let o=this.state.tensorInfo.get(s),l=bx(r);this.state.numBytes+=l-o.bytes,o.bytes=l}return i}makeTensorFromDataId(e,t,n,a){n=n||"float32";let r=new Le(t,n,e,this.nextTensorId());return this.trackTensor(r,a),r}makeVariable(e,t=!0,n,a){n=n||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));let r=new Ou(e,t,n,this.nextTensorId());if(this.state.registeredVariables[r.name]!=null)throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*cm(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Ou||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;let t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){let n=e.size*cm(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){let e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;let t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,a,r,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=xm(e);o!=null&&(a=o.gradFunc),a!=null&&(i.gradient=l=>(l=l.map((d,u)=>{if(d==null){let p=n[u],c=Sp(p.size,p.dtype);return this.makeTensor(c,p.shape,p.dtype)}return d}),a(l.length>1?l:l[0],r,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=vm(e),n=new Set(t.map(r=>r.id));for(let r=0;r{!r.kept&&r.scopeId===a.id&&this.track(r)})}gradients(e,t,n,a=!1){if(F(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let r=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));F(r instanceof Le,()=>"The result y returned by f() must be a tensor.");let s=HI(this.state.activeTape,t,r);if(!a&&s.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{let i={};i[r.id]=n==null?nS(r.shape):n,GI(i,s,l=>this.tidy(l),aS);let o=t.map(l=>i[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(let d of l.saved)d.dispose()}),this.state.activeTape=null),{value:r,grads:o}})}customGrad(e){return F(wr(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{F(t.every(i=>i instanceof Le),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,a={};t.forEach((i,o)=>{a[o]=i});let r=(i,o)=>(n=e(...t,o),F(n.value instanceof Le,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),F(wr(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let l=n.gradFunc(i,o),d=Array.isArray(l)?l:[l];F(d.length===t.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),F(d.every(p=>p instanceof Le),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let u={};return d.forEach((p,c)=>{u[c]=()=>p}),u};return this.runKernelFunc({forwardFunc:r,backwardsFunc:s,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Ru(),n=await this.backend.time(e);return n.wallMs=Ru()-t,n}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Dx;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};zu.nextTensorId=0;zu.nextVariableId=0;function nS(e){let t=hm(Tt(e),"float32");return D.makeTensor(t,e,"float32")}function Ox(){let e=Nx();if(e._tfengine==null){let t=new Sx(e);e._tfengine=new zu(t)}return $I(e._tfengine.ENV),ZI(()=>e._tfengine),e._tfengine}var D=Ox();function aS(e,t){let n={a:e,b:t};return D.runKernel(kr,n)}var _u={};Fe(_u,{isBrowser:()=>zx,isMobile:()=>rS});function sS(){return typeof navigator!="undefined"&&navigator!=null}function rS(e){if(e||sS()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function zx(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var ya=J();ya.registerFlag("DEBUG",()=>!1,e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});ya.registerFlag("IS_BROWSER",()=>zx());ya.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");ya.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));ya.registerFlag("PROD",()=>!1);ya.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>ya.getBool("DEBUG"));ya.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);ya.registerFlag("IS_TEST",()=>!1);ya.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);ya.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function Da(e,t){let n=e;if(tn(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let a=[];for(;Array.isArray(n)||tn(n)&&t!=="string";)a.push(n.length),n=n[0];return Array.isArray(e)&&J().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&_x(e,a,[]),a}function _x(e,t,n){if(n=n||[],!Array.isArray(e)&&!tn(e)){F(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}F(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),F(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let a=t.slice(1);for(let r=0;r=0&&(r=a),Px(a,r,t,n),e==null||!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=Da(e,r);!tn(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?sc(e,r):ss(e,[],!0);return D.makeTensor(i,s,r)}function Pu(e,t,n,a="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>M(r,`${t}[${s}]`,n,a))}var Lx="__op";function O(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],a=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Lx;let r=(...s)=>{D.startScope(n);try{let i=a(...s);return mm(i)&&console.error("Cannot return a Promise inside of tidy."),D.endScope(i),i}catch(i){throw D.endScope(null),i}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}function iS(e,t){let n=M(e,"real","complex"),a=M(t,"imag","complex");rn(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, must match in call to tf.complex().`);let r={real:n,imag:a};return D.runKernel(Cp,r)}var Tr=O({complex_:iS});function Er(e,t,n,a){if(a==null&&(a=kp(e)),a==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(t!=null){fm(t);let r=Tt(t),s=Tt(n);F(r===s,()=>`Based on the provided shape, [${t}], the tensor should have ${r} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!tn(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=a!=="string"?sc(e,a):ss(e,[],!0),D.makeTensor(e,t,a)}function ga(e,t,n){let a=Da(e,n);return Er(e,t,a,n)}var Em={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},uc=4;async function lS(e,t){let n=[],a=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let c=await l.bytes(),h=c.reduce((A,y)=>A+y.length,0)+uc*c.length,m=new Uint8Array(h),f=0;for(let A=0;A{if(t+=s.byteLength,n.push(s.byteLength===s.buffer.byteLength?s:new s.constructor(s)),!(s instanceof Float32Array||s instanceof Int32Array||s instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${s.constructor.name}`)});let a=new Uint8Array(t),r=0;return n.forEach(s=>{a.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),a.buffer}var Cm=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Bx(e){return Cm?Buffer.byteLength(e):new Blob([e]).size}function dS(e){if(Cm)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let a=0,r=t.length;a{t+=r.byteLength});let n=new Uint8Array(t),a=0;return e.forEach(r=>{n.set(new Uint8Array(r),a),a+=r.byteLength}),n.buffer}function Vx(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function Lu(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:Bx(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:Bx(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function cS(){let e=n=>{let a=n<<13,r=0;for(;(a&8388608)==0;)r-=8388608,a<<=1;return a&=~8388608,r+=947912704,a|r},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function hS(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function fS(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function uS(){let e=cS(),t=hS(),n=fS();return a=>{let r=new ArrayBuffer(4*a.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(r)}}var Nt=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return Nt.instance==null&&(Nt.instance=new Nt),Nt.instance}static registerSaveRouter(e){Nt.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Nt.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Nt.getHandlers(e,"save")}static getLoadHandlers(e,t){return Nt.getHandlers(e,"load",t)}static getHandlers(e,t,n){let a=[];return(t==="load"?Nt.getInstance().loadRouters:Nt.getInstance().saveRouters).forEach(r=>{let s=r(e,n);s!==null&&a.push(s)}),a}},mS=e=>Nt.registerSaveRouter(e),AS=e=>Nt.registerLoadRouter(e),yS=e=>Nt.getSaveHandlers(e),gS=(e,t)=>Nt.getLoadHandlers(e,t),Mm="tensorflowjs",Fm=1,ri="models_store",Cr="model_info_store";function jx(){if(!J().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function $m(e){let t=e.result;t.createObjectStore(ri,{keyPath:"modelPath"}),t.createObjectStore(Cr,{keyPath:"modelPath"})}var si=class{constructor(e){if(this.indexedDB=jx(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise((n,a)=>{let r=this.indexedDB.open(Mm,Fm);r.onupgradeneeded=()=>$m(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(ri,"readonly"),o=i.objectStore(ri).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=l=>(s.close(),a(o.error)),i.oncomplete=()=>s.close()}else{let i=Lu(t),o=s.transaction(Cr,"readwrite"),l=o.objectStore(Cr),d=l.put({modelPath:this.modelPath,modelArtifactsInfo:i}),u;d.onsuccess=()=>{u=s.transaction(ri,"readwrite");let p=u.objectStore(ri).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});p.onsuccess=()=>n({modelArtifactsInfo:i}),p.onerror=c=>{l=o.objectStore(Cr);let h=l.delete(this.modelPath);h.onsuccess=()=>(s.close(),a(p.error)),h.onerror=m=>(s.close(),a(p.error))}},d.onerror=p=>(s.close(),a(d.error)),o.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}}},r.onerror=s=>a(r.error)})}};si.URL_SCHEME="indexeddb://";var Ux=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(si.URL_SCHEME)?xS(e.slice(si.URL_SCHEME.length)):null;Nt.registerSaveRouter(Ux);Nt.registerLoadRouter(Ux);function xS(e){return new si(e)}function bS(e){return e.startsWith(si.URL_SCHEME)?e.slice(si.URL_SCHEME.length):e}var vS=class{constructor(){this.indexedDB=jx()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(Mm,Fm);n.onupgradeneeded=()=>$m(n),n.onsuccess=()=>{let a=n.result,r=a.transaction(Cr,"readonly"),s=r.objectStore(Cr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(a.close(),t(s.error)),r.oncomplete=()=>a.close()},n.onerror=a=>t(n.error)})}async removeModel(e){return e=bS(e),new Promise((t,n)=>{let a=this.indexedDB.open(Mm,Fm);a.onupgradeneeded=()=>$m(a),a.onsuccess=()=>{let r=a.result,s=r.transaction(Cr,"readwrite"),i=s.objectStore(Cr),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let d=i.delete(e),u=()=>{l=r.transaction(ri,"readwrite");let p=l.objectStore(ri).delete(e);p.onsuccess=()=>t(o.result.modelArtifactsInfo),p.onerror=c=>n(o.error)};d.onsuccess=u,d.onerror=p=>(u(),r.close(),n(o.error))}},o.onerror=d=>(r.close(),n(o.error)),s.oncomplete=()=>{l==null?r.close():l.oncomplete=()=>r.close()}},a.onerror=r=>n(a.error)})}},tr="/",rl="tensorflowjs_models",Hx="info",wS="model_topology",kS="weight_specs",IS="weight_data",SS="model_metadata";function Gx(e){return{info:[rl,e,Hx].join(tr),topology:[rl,e,wS].join(tr),weightSpecs:[rl,e,kS].join(tr),weightData:[rl,e,IS].join(tr),modelMetadata:[rl,e,SS].join(tr)}}function NS(e){let t=e.split(tr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(tr)}function TS(e){return e.startsWith(ii.URL_SCHEME)?e.slice(ii.URL_SCHEME.length):e}var ii=class{constructor(e){if(!J().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Gx(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),a=Lu(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,dS(e.weightData));let r={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(r)),{modelArtifactsInfo:a}}catch(r){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){let e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=a;let r=this.LS.getItem(this.keys.modelMetadata);if(r!=null){let i=JSON.parse(r);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=pS(s),t}};ii.URL_SCHEME="localstorage://";var qx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ii.URL_SCHEME)?ES(e.slice(ii.URL_SCHEME.length)):null;Nt.registerSaveRouter(qx);Nt.registerLoadRouter(qx);function ES(e){return new ii(e)}var CS=class{constructor(){F(J().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),F(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=rl+tr,n=tr+Hx;for(let a=0;a"scheme must not be undefined or null."),e.endsWith(sl)&&(e=e.slice(0,e.indexOf(sl))),F(e.length>0,()=>"scheme must not be an empty string.");let n=Gn.getInstance();F(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function dc(e){if(e.indexOf(sl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Gn.getSchemes().join(",")}`);return{scheme:e.split(sl)[0],path:e.split(sl)[1]}}async function Xx(e,t,n=!1){F(e!==t,()=>`Old path and new path are the same: '${e}'`);let a=Nt.getLoadHandlers(e);F(a.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),F(a.length<2,()=>`Copying failed because more than one (${a.length}) load handlers for source URL ${e}.`);let r=a[0],s=Nt.getSaveHandlers(t);F(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),F(s.length<2,()=>`Copying failed because more than one (${a.length}) save handlers for destination URL ${t}.`);let i=s[0],o=dc(e).scheme,l=dc(e).path,d=o===dc(e).scheme,u=await r.load();n&&d&&await Gn.getManager(o).removeModel(l);let p=await i.save(u);return n&&!d&&await Gn.getManager(o).removeModel(l),p.modelArtifactsInfo}async function RS(){let e=Gn.getSchemes(),t={};for(let n of e){let a=await Gn.getManager(n).listModels();for(let r in a){let s=n+sl+r;t[s]=a[r]}}return t}async function MS(e){let t=dc(e);return Gn.getManager(t.scheme).removeModel(t.path)}async function FS(e,t){return Xx(e,t,!1)}async function $S(e,t){return Xx(e,t,!0)}var DS=class{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}};if(J().get("IS_BROWSER")){J().setPlatform("browser",new DS);try{Gn.registerManager(ii.URL_SCHEME,new CS)}catch(e){}try{Gn.registerManager(si.URL_SCHEME,new vS)}catch(e){}}var OS={importFetch:()=>V9()},Dm,zS=class{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return J().global.fetch!=null?J().global.fetch(e,t):(Dm==null&&(Dm=OS.importFetch()),Dm(e,t))}now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)}};J().get("IS_NODE")&&J().setPlatform("node",new zS);function We(e,t="float32",n){return t=t||"float32",fm(e),new Dt(e,t,n)}function _S(e,t){let n=M(e,"x","cast");if(!xx(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let a={x:n},r={dtype:t};return D.runKernel(ds,a,r)}var Ae=O({cast_:_S});function PS(e){let t={x:M(e,"x","clone","string_or_numeric")};return D.runKernel(ks,t)}var Oa=O({clone_:PS});function Kx(e,t=!1){console.log(e.toString(t))}Ox();var LS={buffer:We,cast:Ae,clone:Oa,print:Kx};YI(LS);var vn={};Fe(vn,{browserFiles:()=>WS,browserHTTPRequest:()=>VS,concatenateArrayBuffers:()=>Rm,copyModel:()=>FS,decodeWeights:()=>Wx,encodeWeights:()=>lS,fromMemory:()=>jS,getLoadHandlers:()=>gS,getModelArtifactsInfoForJSON:()=>Lu,getSaveHandlers:()=>yS,http:()=>zm,isHTTPScheme:()=>Om,listModels:()=>RS,loadWeights:()=>BS,moveModel:()=>$S,registerLoadRouter:()=>AS,registerSaveRouter:()=>mS,removeModel:()=>MS,weightsLoaderFactory:()=>Zx,withSaveHandler:()=>US});var HS="model",GS=".json",qS=".weights.bin";function Yx(e){return new Promise(t=>setTimeout(t)).then(e)}var il=class{constructor(e){if(!J().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(il.URL_SCHEME)&&(e=e.slice(il.URL_SCHEME.length)),(e==null||e.length===0)&&(e=HS),this.modelTopologyFileName=e+GS,this.weightDataFileName=e+qS}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer);let r=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=r,await Yx(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await Yx(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Lu(e)}}}};il.URL_SCHEME="downloads://";var XS=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,a)=>{let r=new FileReader;r.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){a(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let l=i.weightsManifest;if(l==null){a(new Error(`weightManifest field is missing from file ${e.name}`));return}let d;try{d=this.checkManifestAndWeightFiles(l,t)}catch(h){a(h);return}let u=[],p=[],c=[];l.forEach(h=>{h.paths.forEach(m=>{p.push(m),c.push(null)}),u.push(...h.weights)}),l.forEach(h=>{h.paths.forEach(m=>{let f=new FileReader;f.onload=A=>{let y=A.target.result,g=p.indexOf(m);if(c[g]=y,c.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:u,weightData:Rm(c),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=A=>a(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(d[m])})})},r.onerror=s=>a(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],a=t.map(s=>Vx(s.name)),r={};for(let s of e)s.paths.forEach(i=>{let o=Vx(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),a.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);r[i]=t[a.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return r}},ZS=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(il.URL_SCHEME)?KS(e.slice(il.URL_SCHEME.length)):null;Nt.registerSaveRouter(ZS);function KS(e="model"){return new il(e)}function WS(e){return new XS(e)}function Jx(e,t,n,a){i(e),n=n==null?0:n,a=a==null?1:a,o(n,a);let r=0,s=l=>(l.then(d=>{let u=n+ ++r/e.length*(a-n);return t(u),d}),l);function i(l){F(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,d){F(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),F(d>=0&&d<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${d}`),F(d>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${d}`)}return Promise.all(e.map(s))}async function Qx(e,t){t==null&&(t={});let n=t.fetchFunc==null?J().platform.fetch:t.fetchFunc,a=e.map(d=>n(d,t.requestInit,{isBinary:!0})),r=0,s=.5,i=(t.onProgress==null?await Promise.all(a):await Jx(a,t.onProgress,r,s)).map(d=>d.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await Jx(i,t.onProgress,o,l)}async function BS(e,t="",n,a){return Zx(r=>Qx(r,{requestInit:a}))(e,t,n)}function Zx(e){return async(t,n="",a)=>{let r=t.map(()=>!1),s={},i=a!=null?a.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(A=>{let y="quantization"in A?A.quantization.dtype:A.dtype,g=Em[y]*Tt(A.shape),x=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:A,groupOffset:f,sizeBytes:g})};a!=null?a.forEach((k,b)=>{k===A.name&&(x(),i[b]=!0)}):x(),o.push(A.name),f+=g})}),!i.every(h=>h)){let h=a.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${h.join(", ")}. +Manifest JSON has weights with names: ${o.join(", ")}.`)}let l=r.reduce((h,m,f)=>(m&&h.push(f),h),[]),d=[];l.forEach(h=>{t[h].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;d.push(f)})});let u=await e(d),p={},c=0;return l.forEach(h=>{let m=t[h].paths.length,f=0;for(let x=0;x{let k=A.slice(x.groupOffset,x.groupOffset+x.sizeBytes),b=Wx(k,[x.manifestEntry]);for(let v in b)p[v]=b[v]}),c+=m}),p}}var YS="application/octet-stream",JS="application/json",_m=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(F(typeof t.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=t.fetchFunc):this.fetch=J().platform.fetch,F(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&F(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(a)],{type:JS}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:YS}),"model.weights.bin");let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:Lu(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){let e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(h){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,a=t.weightsManifest,r=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,l=t.userDefinedMetadata;if(n==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let d,u;a!=null&&([d,u]=await this.loadWeights(a));let p={modelTopology:n,weightSpecs:d,weightData:u,generatedBy:r,convertedBy:s,format:i};o!=null&&(p.signature=o),l!=null&&(p.userDefinedMetadata=l);let c=t.modelInitializer;return c&&(p.modelInitializer=c),p}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,a]=QS(t),r=this.weightPathPrefix||n,s=[];for(let d of e)s.push(...d.weights);let i=[],o=[];for(let d of e)for(let u of d.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(u)):i.push(r+u+a);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await Qx(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,Rm(l)]}};_m.URL_SCHEME_REGEX=/^https?:\/\//;function QS(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),a=e.substring(0,t),r=n>t?e.substring(n):"";return[a+"/",r]}function Om(e){return e.match(_m.URL_SCHEME_REGEX)!=null}var eb=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(a=>Om(a)):n=Om(e),n)return zm(e,t)}return null};Nt.registerSaveRouter(eb);Nt.registerLoadRouter(eb);function zm(e,t){return new _m(e,t)}function VS(e,t){return zm(e,t)}var Pm=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},eN=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function jS(e,t,n,a){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new Pm(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pm({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pm({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:a}))}function US(e){return new eN(e)}var tb={};Fe(tb,{confusionMatrix:()=>tN});function nN(e,t,n=!1,a=!1){let r=M(e,"a","matMul"),s=M(t,"b","matMul");[r,s]=vt(r,s);let i={a:r,b:s},o={transposeA:n,transposeB:a};return D.runKernel(us,i,o)}var Be=O({matMul_:nN});function aN(e,t,n=1,a=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let r={indices:M(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:a};return D.runKernel(Ds,r,s)}var ol=O({oneHot_:aN});function rN(e,t){let n=M(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),F(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{F(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let a={x:n},r={perm:t};return D.runKernel(Qs,a,r)}var Ze=O({transpose_:rN});function sN(e,t,n){let a=M(e,"labels","confusionMatrix"),r=M(t,"predictions","confusionMatrix");F(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),F(a.rank===1,()=>`Expected the rank of labels to be 1, but got ${a.rank}`),F(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),F(a.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${a.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),F(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=ol(Ae(a,"int32"),n),i=ol(Ae(r,"int32"),n),o=Ze(s),l=Be(o,i);return Ae(l,"int32")}var tN=O({confusionMatrix_:sN}),oi={};Fe(oi,{fromPixels:()=>lN,fromPixelsAsync:()=>iN,toPixels:()=>oN});function pc(e,t,n){if(rs(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let a=Da(e,n);if(a.length!==3&&a.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}var ll;function nb(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,a=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)a=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)r=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)o=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);if(r){let c=2;if(r&&e.readyState element.")}if(rc(ac,D.backendName)!=null){let c={pixels:e},h={numChannels:t};return D.runKernel(ac,c,h)}let[l,d]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],u;i?u=e.getContext("2d").getImageData(0,0,l,d).data:a||n?u=e.data:(s||r||o)&&(ll==null&&(ll=document.createElement("canvas").getContext("2d")),ll.canvas.width=l,ll.canvas.height=d,ll.drawImage(e,0,0,l,d),u=ll.getImageData(0,0,l,d).data);let p;if(t===4)p=new Int32Array(u);else{let c=l*d;p=new Int32Array(c*t);for(let h=0;h4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(r*a*4);for(let d=0;d1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(n.dtype==="int32"&&(h<0||h>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${h}.`);s===1?(u[0]=h*o,u[1]=h*o,u[2]=h*o):u[c]=h*o}let p=d*4;l[p+0]=Math.round(u[0]),l[p+1]=Math.round(u[1]),l[p+2]=Math.round(u[2]),l[p+3]=Math.round(u[3])}if(t!=null){t.width=r,t.height=a;let d=t.getContext("2d"),u=new ImageData(l,r,a);d.putImageData(u,0,0)}return n!==e&&n.dispose(),l}var lN=O({fromPixels_:nb}),Lm={};Fe(Lm,{prepareAndValidate:()=>ab});function ab(e,t){let n=e.shape.length,a=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(a<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${a}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[a-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[a-1]} vs. ${n}`);if(Tt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let r=t.shape,s=r[r.length-1],i=1;for(let p=0;pp/d),1].slice(0,s);return[l,i,d,u]}var Wm={};Fe(Wm,{calculateShapes:()=>rb,validateInput:()=>Vm,validateUpdateShape:()=>Bm});function Bm(e,t,n){let a=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${a}, and batchDim: ${r}.`;if(n.rank1?t.shape[a-1]:1,s=n.length,i=1;for(let p=r;phN,computeFlatOffset:()=>mN,computeOutShape:()=>sb,getNormalizedAxes:()=>ob,isSliceContinous:()=>fN,maskToAxes:()=>cc,parseSliceParams:()=>hb,sliceInfo:()=>AN,startForAxis:()=>pb,startIndicesWithElidedDims:()=>lb,stopForAxis:()=>cb,stopIndicesWithElidedDims:()=>ub,stridesForAxis:()=>db,stridesWithElidedDims:()=>ib});function hN(e,t,n){let a=e.shape.length;F(a===t.length,()=>`Error in slice${a}D: Length of begin ${t} must match the rank of the array (${a}).`),F(a===n.length,()=>`Error in slice${a}D: Length of size ${n} must match the rank of the array (${a}).`);for(let r=0;r`Error in slice${a}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function cc(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function sb(e,t,n){let a=[];for(let r=0;r0){let h=t[0],m=n+1;u=lb(i,h,m,a,e),p=ub(o,h,m,r,e),c=ib(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let l=fb(t,n,o),d=a[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=fb(t,n,o),d=a[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),i=pu(0,i,l-1),i}function cb(e,t,n,a,r,s){let i=t[r],o=n[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),o>0?i=pu(0,i,l):i=pu(-1,i,l-1),i}function fN(e,t,n){let a=n.length;for(let r=0;r1){a=r;break}for(let r=a+1;r0||n[r]!==e[r])return!1;return!0}function mN(e,t){let n=e.length>0?e[e.length-1]:1;for(let a=0;a{F(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(r).fill(-1):typeof n=="number"?s=[n,...new Array(r-1).fill(-1)]:n.lengthi>=0?i:(F(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-a[o])),[a,s]}function AN(e,t,n,a,r,s,i,o,l){let d=t.slice(),u=n.slice(),p=a;a==null&&(p=new Array(d.length));let c=cc(i);if(c.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&l!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let h=e.length-d.length,m=cc(o),f=e.slice();m.forEach(v=>{d[v]=0,u[v]=1,f.splice(v,0,1)});let{begin:A,end:y,strides:g}=ob(f,c,h,d,u,p,r,s,i);d=A,u=y,p=g;let x=cc(l);x.forEach(v=>{u[v]=d[v]+1,p[v]=1});let k=sb(d,u,p),b=k.filter((v,I)=>x.indexOf(I)===-1);return{nonStrided:p.every(v=>v===1),$begin:d,$end:u,$strides:p,size:k,newShape:f,outShape:b}}var ae={};Fe(ae,{Serializable:()=>Ab,SerializationMap:()=>li,registerClass:()=>Rr});var Ab=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},li=class{constructor(){this.classNameMap={}}static getMap(){return li.instance==null&&(li.instance=new li),li.instance}static register(e){li.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function Rr(e){F(e.className!=null,()=>"Class being registered does not have the static className property defined."),F(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),F(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),li.register(e)}var yb={};Fe(yb,{TEST_EPSILON_FLOAT16:()=>gb,encodeStrings:()=>xb,expectArrayBuffersEqual:()=>wN,expectArraysClose:()=>yN,expectArraysEqual:()=>xN,expectNumbersClose:()=>bN,expectPromiseToFail:()=>gN,expectValuesInRange:()=>vN,testEpsilon:()=>jm});var kN=.001,gb=.1;function yN(e,t,n){return n==null&&(n=jm()),Um(e,t,(a,r)=>Hm(a,r,n))}function jm(){return D.backend.floatPrecision()===32?kN:gb}function Um(e,t,n){let a=!0;if((tn(e)||tn(t))&&(a=!1),tn(e)&&tn(t)&&(a=!0),a){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=Da(e),o=Da(t);if(!er(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=tn(e)?e:ss(e),s=tn(t)?t:ss(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}. +Actual: ${r}. +Expected: ${s}.`);for(let i=0;it.fail(),()=>t())}function xN(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return vr(e)||vr(e[0])||vr(t)||vr(t[0])?Um(e,n,(a,r)=>a==r):Um(e,t,(a,r)=>Hm(a,r,0))}function bN(e,t,n){if(n==null&&(n=jm()),!Hm(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Hm(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function vN(e,t,n){for(let a=0;an)throw new Error(`Value out of range:${e[a]} low: ${t}, high: ${n}`)}function wN(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function xb(e){for(let t=0;tt.dispose())}function jt(e){return D.keep(e)}function RN(e){return D.time(e)}function MN(e){return D.setBackend(e)}function FN(){return D.ready()}function $N(){return D.backendName}function DN(e){D.removeBackend(e)}function qm(e){return D.findBackend(e)}function ON(e){return D.findBackendFactory(e)}function ul(e,t,n=1){return D.registerBackend(e,t,n)}function bb(){return D.backend}function zN(e,t){J().setPlatform(e,t)}function _N(e,t){let n=M(e,"a","add"),a=M(t,"b","add");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(kr,r)}var se=O({add_:_N});function PN(e,t){let n=M(e,"a","floorDiv"),a=M(t,"b","floorDiv");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(bs,r)}var fc=O({floorDiv_:PN});function LN(e,t){let n=M(e,"a","div"),a=M(t,"b","div");if([n,a]=vt(n,a),n.dtype==="int32"&&a.dtype==="int32")return fc(n,a);let r={a:n,b:a},s={};return D.runKernel(ys,r,s)}var ge=O({div_:LN});function WN(e,t){let n=M(e,"a","mul"),a=M(t,"b","mul");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel($s,r)}var B=O({mul_:WN});function BN(e){let t=M(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return D.runKernel(Au,n)}else{let n={x:t};return D.runKernel(eo,n)}}var Ot=O({abs_:BN});function VN(e){let t={x:M(e,"x","acos")};return D.runKernel(to,t)}var Xm=O({acos_:VN});function jN(e){let t={x:M(e,"x","acosh")};return D.runKernel(no,t)}var Km=O({acosh_:jN});function UN(e){F(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),F(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((r,s)=>M(r,`tensors${s}`,"addN")),n=t[0];t.forEach(r=>{if(r.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!er(r.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let a=t;return D.runKernel(is,a)}var mc=O({addN_:UN});function HN(e,t=null,n=!1){let a={x:M(e,"x","all","bool")},r={axis:t,keepDims:n};return D.runKernel(ao,a,r)}var Ac=O({all_:HN});function GN(e,t=null,n=!1){let a={x:M(e,"x","any","bool")},r={axis:t,keepDims:n};return D.runKernel(ro,a,r)}var Wu=O({any_:GN});function qN(e,t=0){let n={x:M(e,"x","argMax")},a={axis:t};return D.runKernel(os,n,a)}var Bu=O({argMax_:qN});function XN(e,t=0){let n={x:M(e,"x","argMin")},a={axis:t};return D.runKernel(hu,n,a)}var Zm=O({argMin_:XN});function KN(e){let t={x:M(e,"x","asin")};return D.runKernel(so,t)}var Ym=O({asin_:KN});function ZN(e){let t={x:M(e,"x","asinh")};return D.runKernel(io,t)}var Jm=O({asinh_:ZN});function YN(e){let t={x:M(e,"x","atan")};return D.runKernel(oo,t)}var Qm=O({atan_:YN});function JN(e,t){let n=M(e,"a","atan2"),a=M(t,"b","atan2");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(uo,r)}var eA=O({atan2_:JN});function QN(e){let t={x:M(e,"x","atanh")};return D.runKernel(lo,t)}var tA=O({atanh_:QN});function eT(e,t,n,a,r="NHWC",s){let i=e[3],o=[...t,i],l=vb(r);return Vu(e,o,n,s,a,null,null,l)}function wb(e,t,n,a,r,s,i="channelsLast"){let[o,l]=yc(t),d;if(i==="channelsLast")d=[o,l,e[3],e[3]];else if(i==="channelsFirst")d=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Vu(e,d,n,a,r,s,!1,i)}function tT(e,t,n,a,r,s,i="NDHWC"){let[o,l,d]=nA(t),u,p;if(i==="NDHWC")p="channelsLast",u=[o,l,d,e[4],e[4]];else if(i==="NCDHW")p="channelsFirst",u=[o,l,d,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return kb(e,u,n,a,r,!1,p,s)}function Vu(e,t,n,a,r,s,i=!1,o="channelsLast"){let[l,d,u,p]=[-1,-1,-1,-1];if(o==="channelsLast")[l,d,u,p]=e;else if(o==="channelsFirst")[l,p,d,u]=e;else throw new Error(`Unknown dataFormat ${o}`);let[c,h,,m]=t,[f,A]=yc(n),[y,g]=yc(a),x=dl(c,y),k=dl(h,g),{padInfo:b,outHeight:v,outWidth:I}=nT(r,d,u,f,A,x,k,s,o),T=i?m*p:m,R;return o==="channelsFirst"?R=[l,T,v,I]:o==="channelsLast"&&(R=[l,v,I,T]),{batchSize:l,dataFormat:o,inHeight:d,inWidth:u,inChannels:p,outHeight:v,outWidth:I,outChannels:T,padInfo:b,strideHeight:f,strideWidth:A,filterHeight:c,filterWidth:h,effectiveFilterHeight:x,effectiveFilterWidth:k,dilationHeight:y,dilationWidth:g,inShape:e,outShape:R,filterShape:t}}function kb(e,t,n,a,r,s=!1,i="channelsLast",o){let[l,d,u,p,c]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,d,u,p,c]=e;else if(i==="channelsFirst")[l,c,d,u,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,A]=t,[y,g,x]=nA(n),[k,b,v]=nA(a),I=dl(h,k),T=dl(m,b),R=dl(f,v),{padInfo:$,outDepth:z,outHeight:_,outWidth:V}=aT(r,d,u,p,y,g,x,I,T,R,o),j=s?A*c:A,U;return i==="channelsFirst"?U=[l,j,z,_,V]:i==="channelsLast"&&(U=[l,z,_,V,j]),{batchSize:l,dataFormat:i,inDepth:d,inHeight:u,inWidth:p,inChannels:c,outDepth:z,outHeight:_,outWidth:V,outChannels:j,padInfo:$,strideDepth:y,strideHeight:g,strideWidth:x,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:I,effectiveFilterHeight:T,effectiveFilterWidth:R,dilationDepth:k,dilationHeight:b,dilationWidth:v,inShape:e,outShape:U,filterShape:t}}function rT(e,t,n,a,r){a==null&&(a=aA(e,t,n));let s=e[0],i=e[1],o=ui((s-t+2*a)/n+1,r),l=ui((i-t+2*a)/n+1,r);return[o,l]}function sT(e,t,n,a,r,s){r==null&&(r=aA(e,t,a));let i=e[0],o=e[1],l=e[2],d=ui((i-t+2*r)/a+1,s),u=ui((o-t+2*r)/a+1,s),p=ui((l-t+2*r)/a+1,s);return[d,u,p,n]}function aA(e,t,n,a=1){let r=dl(t,a);return Math.floor((e[0]*(n-1)-n+r)/2)}function yc(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function nA(e){return typeof e=="number"?[e,e,e]:e}function dl(e,t){return t<=1?e:e+(e-1)*(t-1)}function nT(e,t,n,a,r,s,i,o,l){let d,u,p;if(typeof e=="number"){d={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let c=rT([t,n],s,a,e,o);u=c[0],p=c[1]}else if(e==="same"){u=Math.ceil(t/a),p=Math.ceil(n/r);let c=Math.max(0,(u-1)*a+s-t),h=Math.max(0,(p-1)*r+i-n),m=Math.floor(c/2),f=c-m,A=Math.floor(h/2),y=h-A;d={top:m,bottom:f,left:A,right:y,type:"SAME"}}else if(e==="valid")d={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-s+1)/a),p=Math.ceil((n-i+1)/r);else if(typeof e=="object"){let c=l==="channelsLast"?e[1][0]:e[2][0],h=l==="channelsLast"?e[1][1]:e[2][1],m=l==="channelsLast"?e[2][0]:e[3][0],f=l==="channelsLast"?e[2][1]:e[3][1];d={top:c,bottom:h,left:m,right:f,type:c===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},u=ui((t-s+c+h)/a+1,o),p=ui((n-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:d,outHeight:u,outWidth:p}}function aT(e,t,n,a,r,s,i,o,l,d,u){let p,c,h,m;if(typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=sT([t,n,a,1],o,1,r,e,u);c=f[0],h=f[1],m=f[2]}else if(e==="same"){c=Math.ceil(t/r),h=Math.ceil(n/s),m=Math.ceil(a/i);let f=(c-1)*r+o-t,A=(h-1)*s+l-n,y=(m-1)*i+d-a,g=Math.floor(f/2),x=f-g,k=Math.floor(A/2),b=A-k,v=Math.floor(y/2),I=y-v;p={top:k,bottom:b,left:v,right:I,front:g,back:x,type:"SAME"}}else if(e==="valid")p={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},c=Math.ceil((t-o+1)/r),h=Math.ceil((n-l+1)/s),m=Math.ceil((a-d+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:h,outWidth:m}}function ui(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Mr(e){let[t,n,a]=yc(e);return t===1&&n===1&&a===1}function za(e,t){return Mr(e)||Mr(t)}function vb(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function iT(e,t){let n={x:M(e,"x","reshape","string_or_numeric")},a={shape:t};return D.runKernel(Bo,n,a)}var H=O({reshape_:iT});function oT(e,t,n,a,r){let s=M(e,"x","avgPool","float32"),i=1;F(za(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),F(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),r!=null&&F(Vt(a),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=D.runKernel(ls,d,u);return p=Ae(p,s.dtype),l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var ju=O({avgPool_:oT});function lT(e,t,n,a,r,s="NDHWC"){let i=M(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),F(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&F(Vt(a),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=D.runKernel(fu,d,u);return p=Ae(p,o.dtype),l?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var rA=O({avgPool3d_:lT});function uT(e,t=0){F(e.length>=1,()=>"Pass at least one tensor to concat");let n=Pu(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${s.dtype}. `)}),n.length===1)return Oa(n[0]);let a=n,r={axis:t};return D.runKernel(po,a,r)}var ot=O({concat_:uT});function dT(e){let t={x:M(e,"x","sigmoid")};return D.runKernel(Hs,t)}var wn=O({sigmoid_:dT});function pT(e,t,n){let a=M(e,"x","slice","string_or_numeric");if(a.rank===0)throw new Error("Slicing scalar is not possible");let r={x:a},s={begin:t,size:n};return D.runKernel(Ho,r,s)}var Me=O({slice_:pT});function cT(e){let t={x:M(e,"x","tanh")};return D.runKernel(Js,t)}var di=O({tanh_:cT});function hT(e,t,n,a,r,s){let i=M(e,"forgetBias","basicLSTMCell"),o=M(t,"lstmKernel","basicLSTMCell"),l=M(n,"lstmBias","basicLSTMCell"),d=M(a,"data","basicLSTMCell"),u=M(r,"c","basicLSTMCell"),p=M(s,"h","basicLSTMCell"),c=ot([d,p],1),h=Be(c,o),m=se(h,l),f=m.shape[0],A=m.shape[1]/4,y=[f,A],g=Me(m,[0,0],y),x=Me(m,[0,A],y),k=Me(m,[0,A*2],y),b=Me(m,[0,A*3],y),v=se(B(wn(g),di(x)),B(u,wn(se(i,k)))),I=B(di(v),wn(b));return[v,I]}var fT=O({basicLSTMCell_:hT});function mT(e,t,n){let a=M(e,"x","batchToSpaceND"),r=t.reduce((o,l)=>o*l);F(a.rank>=1+t.length,()=>`input rank is ${a.rank} but should be > than blockShape.length ${t.length}`),F(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),F(a.shape[0]%r==0,()=>`input tensor batch is ${a.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:a},i={blockShape:t,crops:n};return D.runKernel(mu,s,i)}var Uu=O({batchToSpaceND_:mT});function AT(e){let t;return e.rank===0||e.rank===1?t=H(e,[1,1,1,e.size]):e.rank===2?t=H(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function yT(e,t,n,a,r,s){s==null&&(s=.001);let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;a!=null&&(u=M(a,"offset","batchNorm")),F(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),F(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),F(d==null||o.rank===d.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let p={x:AT(i),scale:d,offset:u,mean:o,variance:l},c={varianceEpsilon:s},h=D.runKernel(vs,p,c);return H(h,i.shape)}var pi=O({batchNorm_:yT});function gT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),F(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),F(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===2||d.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Ib=O({batchNorm2d_:gT});function xT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),F(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),F(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===3||d.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Sb=O({batchNorm3d_:xT});function bT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),F(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),F(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===4||d.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Nb=O({batchNorm4d_:bT});function vT(e,t,n){let a=M(e,"x","bincount"),r=M(t,"weights","bincount");F(a.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${a.dtype}`),F(n>=0,()=>`size must be non-negative, but got ${n}.`),F(r.size===a.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${a.shape}, weights shape: ${r.shape}.`);let s={x:a,weights:r},i={size:n};return D.runKernel(Ep,s,i)}var Tb=O({bincount_:vT});function wT(e,t){let n=M(e,"broadcastTo","x"),a=n.shape;if(t.some(l=>!(l>0)||l%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let l=n.shape.slice();for(;l.length=0;l--)if(r[l]===t[l])s[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${t}].`);if(s.map((l,d)=>l>1?d:-1).filter(l=>l>=0).length===0)return Oa(n);let i={x:n},o={reps:s};return D.runKernel(Sr,i,o)}var pl=O({broadcastTo_:wT});function kT(e){let t={x:M(e,"x","ceil")};return D.runKernel(ps,t)}var sA=O({ceil_:kT});function IT(e,t,n){let a=M(e,"x","clipByValue");F(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let r={x:a},s={clipValueMin:t,clipValueMax:n};return D.runKernel(Ir,r,s)}var kn=O({clipByValue_:IT});function ST(e){return ot(e,0)}var Eb=O({concat1d_:ST});function NT(e,t){return ot(e,t)}var cl=O({concat2d_:NT});function TT(e,t){return ot(e,t)}var Cb=O({concat3d_:TT});function ET(e,t){return ot(e,t)}var Rb=O({concat4d_:ET});function CT(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","conv2d"),l=M(t,"filter","conv2d"),d=o,u=!1;o.rank===3&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(d.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${d.rank}.`),F(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),i!=null&&F(Vt(a),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p=r==="NHWC"?d.shape[3]:d.shape[1];F(p===l.shape[2],()=>`Error in conv2d: depth of input (${p}) must match input depth for filter ${l.shape[2]}.`),F(za(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let c={x:d,filter:l},h={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},m=D.runKernel(cs,c,h);return u?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var ar=O({conv2d_:CT});function RT(e,t,n,a,r="NWC",s=1,i){let o=M(e,"x","conv1d"),l=M(t,"filter","conv1d"),d=o,u=!1;o.rank===2&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1]])),F(d.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${d.rank}.`),F(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),i!=null&&F(Vt(a),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),F(d.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${d.shape[2]}) must match input depth for filter ${l.shape[1]}.`),F(za(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),F(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let p=H(l,[1,l.shape[0],l.shape[1],l.shape[2]]),c=H(d,[d.shape[0],1,d.shape[1],d.shape[2]]),h=ar(c,p,[1,n],a,"NHWC",[1,s],i);return u?H(h,[h.shape[2],h.shape[3]]):H(h,[h.shape[0],h.shape[2],h.shape[3]])}var gc=O({conv1d_:RT});function MT(e,t,n,a,r,s="NHWC",i){F(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,d=!1;t.rank===3&&(d=!0,l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),F(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),F(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),F(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let u=s==="NHWC"?o[3]:o[1],p=s==="NHWC"?l.shape[3]:l.shape[1];F(u===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`),F(p===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${p}) must match output depth for filter ${n.shape[3]}.`),i!=null&&F(Vt(r),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let c={dy:l,filter:n},h={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=D.runKernel(hs,c,h);return d?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var iA=O({conv2DBackpropInput_:MT});function FT(e,t,n,a,r,s){let i=M(e,"x","conv2dTranspose"),o=M(t,"filter","conv2dTranspose");return iA(n,i,o,a,r,"NHWC",s)}var xc=O({conv2dTranspose_:FT});function $T(e,t,n,a,r="NDHWC",s=[1,1,1]){let i=M(e,"x","conv3d"),o=M(t,"filter","conv3d"),l=i,d=!1;i.rank===4&&(d=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),F(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),F(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),F(za(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),F(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`);let u={x:l,filter:o},p={strides:n,pad:a,dataFormat:r,dilations:s},c=D.runKernel(yu,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var oA=O({conv3d_:$T});function DT(e,t,n,a,r){F(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let l=s[4],d=i.shape[4];F(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),F(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),F(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),F(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),F(d===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[4]}.`);let u={dy:i,filter:n},p={pad:r,strides:a,inputShape:s},c=D.runKernel(Fp,u,p);return o?H(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var Mb=O({conv3DBackpropInput_:DT});function OT(e,t,n,a,r){let s=M(e,"x","conv3dTranspose"),i=M(t,"filter","conv3dTranspose");return Mb(n,s,i,a,r)}var Fb=O({conv3dTranspose_:OT});function zT(e){let t={x:M(e,"x","cos")};return D.runKernel(fs,t)}var Hu=O({cos_:zT});function _T(e){let t={x:M(e,"x","cosh")};return D.runKernel(co,t)}var bc=O({cosh_:_T});function PT(e,t=0,n=!1,a=!1){let r={x:M(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:a};return D.runKernel(ms,r,s)}var vc=O({cumsum_:PT});function LT(e,t,n,a=!1){let r=M(e,"x","denseBincount"),s=M(t,"weights","denseBincount");F(r.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),F(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),F(n>=0,()=>`size must be non-negative, but got ${n}.`),F(s.size===r.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${s.shape}.`);let i={x:r,weights:s},o={size:n,binaryOutput:a};return D.runKernel($p,i,o)}var $b=O({denseBincount_:LT});function WT(e,t,n="NHWC"){let a=M(e,"x","depthToSpace"),r=n==="NHWC"?a.shape[1]:a.shape[2],s=n==="NHWC"?a.shape[2]:a.shape[3],i=n==="NHWC"?a.shape[3]:a.shape[1];F(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying + ${r} and ${t} for depthToSpace with input shape + ${a.shape}`),F(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${s} and ${t} for depthToSpace with input shape - ${r.shape}`),M(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${r.shape}`);let o={x:r},l={blockSize:t,dataFormat:n};return $.runKernel(fo,o,l)}var lm=D({depthToSpace_:DN});function ON(e,t,n,r,a="NHWC",s=[1,1],i){let o=R(e,"x","depthwiseConv2d"),l=R(t,"filter","depthwiseConv2d"),c=o,u=!1;o.rank===3&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),M(c.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`),M(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),M(c.shape[3]===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),i!=null&&M(Bt(r),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let h={x:c,filter:l},d={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i},p=$.runKernel(As,h,d);return u?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var pl=D({depthwiseConv2d_:ON});function zN(e){let t={x:R(e,"x","diag")};return $.runKernel(Oh,t)}var PN=D({diag_:zN});function LN(e,t,n,r,a=[1,1],s="NHWC"){let i=R(e,"x","dilation2d"),o=R(t,"filter","dilation2d");M(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),M(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),M(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,c=!1;i.rank===3&&(l=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),c=!0);let u={x:l,filter:o},h={strides:n,pad:r,dilations:a},d=$.runKernel(gu,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var um=D({dilation2d_:LN});function WN(e,t){let n=e.length,r=[];for(let a=0;a1&&i===1&&r.unshift(s)}return r}function Ot(e,t){let n=[];for(let r=0;r1)&&n.unshift(s)}return n}function dt(e,t){let n=[],r=Math.max(e.length,t.length);for(let a=0;a`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`);let a=n.rank===1?n.size:n.shape[1],s=r.rank===1?r.size:r.shape[0];if(M(a===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`),n.rank===1&&r.rank===1){let i=H(n,[1,-1]),o=H(r,[-1,1]),l=Be(i,o);return H(l,[])}else if(n.rank===1&&r.rank===2){let i=H(n,[1,-1]),o=H(r,[r.shape[0],r.shape[1]]),l=Be(i,o);return H(l,[l.size])}else if(n.rank===2&&r.rank===1){let i=H(r,[-1,1]),o=Be(n,i);return H(o,[o.size])}else{let i=H(r,[r.shape[0],r.shape[1]]);return Be(n,i)}}var Fw=D({dot_:HN});function GN(e,...t){let n=t.map((a,s)=>R(a,`tensors${s}`,"einsum")),r={equation:e};return $.runKernel(Lh,n,r)}var $w=D({einsum_:GN});function qN(e){let t={x:R(e,"x","elu")};return $.runKernel(mo,t)}var fl=D({elu_:qN});function XN(e){let t=R(e,"x","erf");M(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ae(t,"float32"));let n={x:t};return $.runKernel(Ao,n)}var hm=D({erf_:XN});function KN(e){let t={x:R(e,"x","exp")};return $.runKernel(gs,t)}var qn=D({exp_:KN});function ZN(e,t=0){let n=R(e,"x","expandDims","string_or_numeric");M(t<=n.rank,()=>"Axis must be <= rank of the tensor");let r={input:n},a={dim:t};return $.runKernel(go,r,a)}var on=D({expandDims_:ZN});function YN(e){let t={x:R(e,"x","expm1")};return $.runKernel(xo,t)}var dm=D({expm1_:YN});function JN(e,t){let n=R(e,"x","tile","string_or_numeric");M(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let r={x:n},a={reps:t};return $.runKernel(Na,r,a)}var Da=D({tile_:JN});function QN(e,t,n,r="float32"){t==null&&(t=e);let a=We([e,t],r),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${s.rank}.`),M(Bt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=H(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},c={depthRadius:t,bias:n,alpha:r,beta:a},u=$.runKernel(_u,l,c);return o?H(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var mm=D({localResponseNormalization_:hT});function dT(e){let t={x:R(e,"x","log")};return $.runKernel(Is,t)}var Mn=D({log_:dT});function pT(e){let t={x:R(e,"x","log1p")};return $.runKernel(Eo,t)}var kd=D({log1p_:pT});function fT(e){return M(ka(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let r=R(t,"x","tf.grad","string_or_numeric"),a=n!=null?R(n,"dy","tf.grad"):null;return $.tidy(()=>{let{value:s,grads:i}=$.gradients(()=>e(r),[r],a);return a!=null&&an(s.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Id(i),i[0]})}}function mT(e){return M(ka(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{M(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let r=Pu(t,"args","tf.grads","string_or_numeric"),a=n!=null?R(n,"dy","tf.grads"):null;return $.tidy(()=>{let{value:s,grads:i}=$.gradients(()=>e(...r),r,a);return a!=null&&an(s.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Id(i),i})}}function AT(e){return M(ka(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{M(t instanceof Le,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),M(n==null||n instanceof Le,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:r,value:a}=$.gradients(()=>e(t),[t],n);return Id(r),{grad:r[0],value:a}}}function yT(e){return M(ka(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{M(Array.isArray(t)&&t.every(a=>a instanceof Le),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),M(n==null||n instanceof Le,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let r=$.gradients(()=>e(...t),t,n);return n!=null&&an(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Id(r.grads),r}}function Pw(e,t){M(ka(e),()=>"The f passed in variableGrads(f) must be a function"),M(t==null||Array.isArray(t)&&t.every(c=>c instanceof Du),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let c in $.registeredVariables)t.push($.registeredVariables[c])}let r=n?t.filter(c=>!c.trainable):null,a=t.length;t=t.filter(c=>c.trainable),M(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`);let s=!0,{value:i,grads:o}=$.gradients(e,t,null,s);M(o.some(c=>c!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),M(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let l={};return t.forEach((c,u)=>{o[u]!=null&&(l[c.name]=o[u])}),r!=null&&r.forEach(c=>l[c.name]=null),{value:i,grads:l}}function zr(e){return $.customGrad(e)}function Id(e){if(e.filter(t=>t==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that - the f you passed encloses all operations that lead from x to y.`)}function gT(e){let t={x:R(e,"x","neg")};return $.runKernel(Mo,t)}var _t=D({neg_:gT});function xT(e){let t={x:R(e,"x","softplus")};return $.runKernel(Xo,t)}var fi=D({softplus_:xT});function wT(e){let t=R(e,"x","logSigmoid");return zr(n=>({value:_t(fi(_t(n))),gradFunc:r=>B(r,_n(_t(n)))}))(t)}var Lw=D({logSigmoid_:wT});function bT(e,t=null,n=!1){let r={x:R(e,"x","max")},a={reductionIndices:t,keepDims:n};return $.runKernel(Ss,r,a)}var Xn=D({max_:bT});function _T(e,t){let n=R(e,"a","sub"),r=R(t,"b","sub");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Zs,a)}var ye=D({sub_:_T});function vT(e,t=null,n=!1){let r=R(e,"x","sum");r.dtype==="bool"&&(r=Ae(r,"int32"));let a={x:r},s={axis:t,keepDims:n};return $.runKernel(qs,a,s)}var Ne=D({sum_:vT});function kT(e,t=-1){let n=R(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return zr((r,a)=>{let s=!0,i=Xn(r,t,!0),o=ye(r,i),l=ye(Ae(o,"float32"),Mn(Ne(qn(o),t,s)));return a([l]),{value:l,gradFunc:(c,u)=>{let[h]=u,d=!0,p=qn(h);return ye(c,B(Ne(c,t,d),p))}}})(n)}var Sd=D({logSoftmax_:kT});function Am(e,t){for(let n=0;ne[s]);return[n,a]}function mi(e,t){let n=t.map(r=>1);return Ww(e,n,t)}function IT(e,t,n){M(Am(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function Vw(e,t){if(Am(e,t))return null;let n=[];for(let r=0;rn.push(r)),n}function ym(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function ST(e,t){let n=[];for(let r=t-e;r`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),M(Or(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),a!=null&&M(Bt(r),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a},h=$.runKernel(Ts,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var Ku=D({maxPool_:MT});function FT(e,t=[1,1,1],n,r,a,s="NDHWC"){let i=R(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),M(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),a!=null&&M(Bt(r),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},h=$.runKernel(vu,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var xm=D({maxPool3d_:FT});function $T(e,t,n,r,a=!1){let s={x:R(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:r,includeBatchInIndex:a},o=$.runKernel(Xh,s,i);return{result:o[0],indexes:o[1]}}var Uw=D({maxPoolWithArgmax_:$T});function DT(e,t){let n=R(e,"a","maximum"),r=R(t,"b","maximum");[n,r]=bt(n,r),n.dtype==="bool"&&(n=Ae(n,"int32"),r=Ae(r,"int32")),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Ns,a)}var Pr=D({maximum_:DT});function OT(e,t=null,n=!1){let r={x:R(e,"x","mean")},a={axis:t,keepDims:n};return $.runKernel(Es,r,a)}var vt=D({mean_:OT});function Et(e,t="float32"){if(t==="complex64"){let r=Et(e,"float32"),a=Et(e,"float32");return Ea(r,a)}let n=Ih(Nt(e),t);return $.makeTensor(n,e,t)}function Fn(e,t="float32"){if(t==="complex64"){let r=Fn(e,"float32"),a=Et(e,"float32");return Ea(r,a)}let n=pf(Nt(e),t);return $.makeTensor(n,e,t)}function zT(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let r=R(e,"x","meshgrid",e instanceof Le?e.dtype:"float32");if(t===void 0)return[r];let a=R(t,"y","meshgrid",t instanceof Le?t.dtype:"float32"),s=Nt(r.shape),i=Nt(a.shape);return n==="xy"?(r=H(r,[1,-1]),a=H(a,[-1,1]),[Be(Fn([i,1],r.dtype),r),Be(a,Fn([1,s],a.dtype))]):(r=H(r,[-1,1]),a=H(a,[1,-1]),[Be(r,Fn([1,i],r.dtype)),Be(Fn([s,1],a.dtype),a)])}function PT(e,t=null,n=!1){let r={x:R(e,"x","min")},a={axis:t,keepDims:n};return $.runKernel(Cs,r,a)}var Al=D({min_:PT});function LT(e,t){let n=R(e,"a","minimum"),r=R(t,"b","minimum");[n,r]=bt(n,r),n.dtype==="bool"&&(n=Ae(n,"int32"),r=Ae(r,"int32")),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Rs,a)}var yl=D({minimum_:LT});function WT(e,t,n){M(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let r=R(e,"x","mirrorPad");if(r.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");M(t.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`);let a=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),M(t[o][0]>=0&&t[o][0]<=r.shape[o]-a&&t[o][1]>=0&&t[o][1]<=r.shape[o]-a,()=>`Padding in dimension ${o} cannot be greater than or equal to ${r.shape[o]-a} or less than 0 for input of shape ${r.shape}`);let s={paddings:t,mode:n},i={x:r};return $.runKernel(Ms,i,s)}var wm=D({mirrorPad_:WT});function BT(e,t){let n=R(e,"a","mod"),r=R(t,"b","mod");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Ro,a)}var bm=D({mod_:BT});function VT(e){let t=R(e,"x","square"),n={};return $.runKernel("Square",{x:t},n)}var st=D({square_:VT});function jT(e,t=null,n=!1){e=R(e,"x","moments");let r=sr(t,e.shape),a=vt(e,r,n),s=a.shape;n||(s=mi(a.shape,r));let i=st(ye(Ae(e,"float32"),H(a,s))),o=vt(i,r,n);return{mean:a,variance:o}}var Td=D({moments_:jT});function UT(e,t,n,r){let a=R(t,"data","multiRNNCell"),s=Pu(n,"c","multiRNNCell"),i=Pu(r,"h","multiRNNCell"),o=a,l=[];for(let h=0;h2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?H(a,[1,-1]):a},l={numSamples:t,seed:n,normalized:r},c=$.runKernel(Kh,o,l);return i===1?H(c,[c.size]):c}var Hw=D({multinomial_:GT});function qT(e,t){let n=R(e,"a","notEqual"),r=R(t,"b","notEqual");[n,r]=bt(n,r),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Fo,a)}var Ai=D({notEqual_:qT});function XT(e){let t={x:R(e,"x","onesLike")};return $.runKernel(zo,t)}var $n=D({onesLike_:XT});function KT(e,t){let n=R(e,"v1","outerProduct"),r=R(t,"v2","outerProduct");M(n.rank===1&&r.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`);let a=H(n,[-1,1]),s=H(r,[1,-1]);return Be(a,s)}var ZT=D({outerProduct_:KT});function YT(e,t,n=0){let r=R(e,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let a={paddings:t,constantValue:n},s={x:r};return $.runKernel(Ds,s,a)}var ia=D({pad_:YT});function JT(e,t,n=0){return M(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),ia(e,[t],n)}var QT=D({pad1d_:JT});function eE(e,t,n=0){return M(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var tE=D({pad2d_:eE});function nE(e,t,n=0){return M(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var rE=D({pad3d_:nE});function aE(e,t,n=0){return M(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var sE=D({pad4d_:aE});function iE(e,t,n){let r=R(e,"x","spaceToBatchND");M(r.rank>=1+t.length,()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`),M(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),M(r.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+n[l-1][0]+n[l-1][1])%t[l-1]==0:i,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let a={x:r},s={blockShape:t,paddings:n};return $.runKernel(Su,a,s)}var Zu=D({spaceToBatchND_:iE});function uE(e,t,n,r,a,s){a==null&&(a=[1,1]),s==null&&(s=1),r===0&&(r="valid");let i=R(e,"x","maxPool"),o=i,l=!1;i.rank===3&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]])),M(Or(s,a),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`);let c=bw(o.shape,t,s,a,r),u=[c.dilationHeight,c.dilationWidth],h;r==="same"?h=lE([c.filterHeight,c.filterWidth],u):h=[[0,0],[0,0]];let d=u[0]===1&&u[1]===1,[p,m]=oE([c.inHeight,c.inWidth],u,h),f=d?r:"valid",A=d?o:Zu(o,u,p),y=(n==="avg"?()=>ju(A,t,s,f):()=>Ku(A,t,s,f))(),g=d?y:Uu(y,u,m);return l?H(g,[g.shape[1],g.shape[2],g.shape[3]]):g}function oE(e,t,n){let r=n.map(u=>u[0]),a=n.map(u=>u[1]),s=e.concat(r,a),i=t.map((u,h)=>(u-s[h]%u)%u),o=a.map((u,h)=>u+i[h]),l=t.map((u,h)=>[r[h],o[h]]),c=t.map((u,h)=>[0,i[h]]);return[l,c]}function lE(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),r=n.map(s=>Math.floor(s/2)),a=n.map((s,i)=>s-r[i]);return n.map((s,i)=>[r[i],a[i]])}var Gw=D({pool_:uE});function cE(e,t){let n=R(e,"base","pow"),r=R(t,"exp","pow");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Os,a)}var oa=D({pow_:cE});function hE(e,t){let n=R(e,"x","prelu"),r=R(t,"alpha","prelu"),a={x:n,alpha:r};return $.runKernel(zs,a)}var Yu=D({prelu_:hE});function dE(e,t=null,n=!1){let r=R(e,"x","prod");r.dtype==="bool"&&(r=Ae(r,"int32"));let a={x:r},s={axis:t,keepDims:n};return $.runKernel(Lo,a,s)}var Ed=D({prod_:dE});function pE(e,t,n){let r=Nt(e),a=null;if(n==null||n==="float32")a=new Float32Array(r);else if(n==="int32")a=new Int32Array(r);else if(n==="bool")a=new Uint8Array(r);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*r*i,t=this.mean+this.stdDev*a*i,(!this.truncated||this.isValidTruncated(e))&&(n=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}},mE=class{constructor(e,t,n,r){this.alpha=e,this.beta=1/t,this.dtype=n;let a=r||Math.random();this.randu=_m.alea(a.toString()),this.randn=new vm(0,1,n,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,r,a,s;for(;;){do r=this.randn.nextValue(),s=1+this.c*r;while(s<=0);if(s*=s*s,e=r*r,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),a=this.randu(),athis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,r==null&&(r=Math.random()),typeof r=="number"&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=_m.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function yE(e,t,n=1,r="float32",a){if(n==null&&(n=1),r==null&&(r="float32"),r!=="float32"&&r!=="int32")throw new Error(`Unsupported data type ${r}`);let s=new mE(t,n,r,a),i=We(e,r);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),Dn(t,0)}var NE=D({reverse1d_:SE});function TE(e,t){let n=R(e,"x","reverse");return M(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),Dn(n,t)}var EE=D({reverse2d_:TE});function CE(e,t){let n=R(e,"x","reverse");return M(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),Dn(n,t)}var RE=D({reverse3d_:CE});function ME(e,t){let n=R(e,"x","reverse");return M(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),Dn(n,t)}var FE=D({reverse4d_:ME});function $E(e){let t={x:R(e,"x","round")};return $.runKernel(Vs,t)}var Im=D({round_:$E});function DE(e){let t={x:R(e,"x","rsqrt")};return $.runKernel(js,t)}var Md=D({rsqrt_:DE});function ke(e,t){if((tn(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&tn(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Ca(e,[],[],t)}function OE(e){let t={x:R(e,"x","selu")};return $.runKernel(Uo,t)}var Fd=D({selu_:OE});function zE(e,t,n,r,a,s=[1,1],i="NHWC"){let o=R(e,"x","separableConv2d"),l=R(t,"depthwiseFilter","separableConv2d"),c=R(n,"pointwiseFilter","separableConv2d"),u=o,h=!1;if(o.rank===3&&(h=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");M(u.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`),M(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),M(c.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),M(c.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`),M(c.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`);let d=l.shape[2],p=l.shape[3];M(c.shape[2]===d*p,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${c.shape[2]}.`);let m=pl(u,l,r,a,i,s),f=sa(m,c,1,"valid",i);return h?H(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var Sm=D({separableConv2d_:zE});async function PE(e,t){let n=R(e,"x","setdiff1d"),r=R(t,"y","setdiff1d");M(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),M(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),M(r.rank===1,()=>`y should be 1D tensor, but got y (${r.shape}).`);let a=await n.data(),s=await r.data(),i=new Set(s),o=0;for(let u=0;u`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),Re(r,[t],[n])}var Od=D({slice1d_:VE});function jE(e,t,n){let r=R(e,"x","slice2d");return M(r.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var Tm=D({slice2d_:jE});function UE(e,t,n){let r=R(e,"x","slice3d");return M(r.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var zd=D({slice3d_:UE});function HE(e,t,n){let r=R(e,"x","slice4d");return M(r.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var Qu=D({slice4d_:HE});function GE(e,t=-1){let n=R(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let r={logits:n},a={dim:t};return $.runKernel(Xs,r,a)}var ec=D({softmax_:GE});function qE(e){M(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return $.runKernel(Bh,t)}var tc=D({fft_:qE});function XE(e){M(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return $.runKernel(Vh,t)}var xl=D({ifft_:XE});function KE(e){let t=e.shape[e.shape.length-1],n=e.size/t,r;if(t<=2){let a=H(e,[n,t]);r=xl(a)}else{let a=[n,2*(t-1)],s=H(Ju(e),[n,t]),i=H(_d(e),[n,t]),o=Dn(Re(s,[0,1],[n,t-2]),1),l=B(Dn(Re(i,[0,1],[n,t-2]),1),ke(-1)),c=ot([s,o],1),u=ot([i,l],1),h=H(Ea(c,u),[a[0],a[1]]);r=xl(h)}if(r=Ju(r),e.rank===3&&e.shape[0]!==0){let a=r,s=e.shape[0];r=H(r,[s,r.shape[0]/s,r.shape[1]]),a.dispose()}return r}var Pd=D({irfft_:KE});function ZE(e,t,n=0){let r={x:R(e,"x","split")},a={numOrSizeSplits:t,axis:n};return $.runKernel(Ko,r,a)}var ln=D({split_:ZE});function YE(e,t){M(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],r=e.size/n,a;if(t!=null&&t0),f=e.shape.map(A=>A);f[e.shape.length-1]=t,a=Re(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,a=ot([e,Et(m)],e.shape.length-1),n=t}else a=e;let s=Ue(a),i=H(Ea(a,s),[r,n]),o=tc(i),l=Math.floor(n/2)+1,c=Ju(o),u=_d(o),h=ln(c,[l,n-l],c.shape.length-1),d=ln(u,[l,n-l],u.shape.length-1),p=a.shape.slice();return p[a.shape.length-1]=l,H(Ea(h[0],d[0]),p)}var nc=D({rfft_:YE});function JE(e){let t={x:R(e,"x","sqrt")};return $.runKernel(Gs,t)}var Jt=D({sqrt_:JE});function QE(e,t){let n=R(e,"a","squaredDifference"),r=R(t,"b","squaredDifference");[n,r]=bt(n,r),dt(n.shape,r.shape);let a={a:n,b:r},s={};return $.runKernel(Ks,a,s)}var Ld=D({squaredDifference_:QE});function eC(e,t){let n=R(e,"x","squeeze");return H(n,fx(n.shape,t).newShape)}var za=D({squeeze_:eC});function tC(e,t=0){let n=Pu(e,"tensors","stack","string_or_numeric");M(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&M(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let r=n,a={axis:t};return $.runKernel(Po,r,a)}var On=D({stack_:tC});function nC(e,t=0){let n={x:R(e,"x","step")},r={alpha:t};return $.runKernel(Ta,n,r)}var wl=D({step_:nC});function rC(e,t,n,r,a=0,s=0,i=0,o=0,l=0){let c={x:R(e,"x","stridedSlice")},u={begin:t,end:n,strides:r,beginMask:a,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return $.runKernel(Zo,c,u)}var Em=D({stridedSlice_:rC});function aC(e){let t={x:R(e,"x","tan")};return $.runKernel(Ys,t)}var Cm=D({tan_:aC});function nn(e,t){as(e);let n=$r(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ca(e,null,n,t)}function Kn(e,t,n){if(as(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let r=$r(e,n);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ca(e,t,r,n)}function sC(e,t,n){if(as(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let r=$r(e,n);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}function iC(e,t,n){if(as(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let r=$r(e,n);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}function oC(e,t,n){if(as(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let r=$r(e,n);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,Ca(e,t,r,n)}function lC(e,t=1,n=!0){let r=R(e,"x","topk");if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let a=r.shape[r.shape.length-1];if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);let s={x:r},i={k:t,sorted:n},[o,l]=$.runKernel(Yo,s,i);return{values:o,indices:l}}var Rm=D({topk_:lC});function uC(e,t=0,n=1,r,a){if(r!=null&&r==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new vm(t,n,r,!0,a),i=We(e,r);for(let o=0;o0,()=>"The input tensor must be at least 1D");let r={x:n},a={axis:t},[s,i]=$.runKernel(nd,r,a);return{values:s,indices:i}}var Bd=D({unique_:cC});function hC(e,t,n){let r=R(e,"x","unsortedSegmentSum"),a=R(t,"segmentIds","unsortedSegmentSum","int32");M(Bt(n),()=>"numSegments must be of dtype int");let s={x:r,segmentIds:a},i={numSegments:n};return $.runKernel(Tu,s,i)}var Mm=D({unsortedSegmentSum_:hC});function dC(e,t=0){let n=R(e,"x","unstack","string_or_numeric");M(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let r={value:n},a={axis:t};return $.runKernel(Jo,r,a)}var ur=D({unstack_:dC});function Kw(e,t=!0,n,r){return $.makeVariable(e,t,n,r)}function Zw(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),an(o.slice(s,s+i),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let f=s;f"Shape mismatch in v and x");let l=ke(1),c=ye(l,o),u=B(ye(i,s),c);if(a){M(r!=null,()=>"When using zeroDebias: true, step is required.");let h=R(r,"step","movingAverage");u=ge(u,ye(l,oa(o,h)))}return se(s,u)}var gC=D({movingAverage_:yC});function xC(e,t,n){let r=R(e,"indices","scatterND","int32"),a=R(t,"updates","scatterND");Vf(a,r,n);let s={indices:r,updates:a},i={shape:n};return $.runKernel(Vo,s,i)}var Jw=D({scatterND_:xC});function wC(e,t,n,r){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let a=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function bC(e,t,n,r=0){let a=R(e,"sparseIndices","sparseToDense","int32"),s=R(t,"sparseValues","sparseToDense"),i=R(r,"defaultValue","sparseToDense",s.dtype);wC(a,s,n,i);let o={sparseIndices:a,sparseValues:s,defaultValue:i},l={outputShape:n};return $.runKernel(ed,o,l)}var $m=D({sparseToDense_:bC});function _C(e,t){let n=R(t,"indices","gatherND","int32"),r={params:R(e,"x","gatherND"),indices:n};return $.runKernel(_o,r)}var Qw=D({gatherND_:_C});function vC(e,t){if(t==null)return e.shape.slice();if(na(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let r=0;r`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`),M(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Le?a.clone():a;let s=vC(a,n),i=1-t,o=ge(ml(se(gl(s,0,1,"float32",r),i)),i);return B(a,o)}var eb=D({dropout_:kC});function tb(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function Dm(e,t,n){let r=1-e%2,a=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`),M(r.rank-1===a.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`),an(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=r.shape[r.shape.length-1];M(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await r.data(),o=await a.data(),[l,c]=[i.length/s,s],u=mx("bool",l);for(let h=0;hA.value-f.value),u[h]=0;for(let f=0;fNC,depthwiseConv2d:()=>TC,matMul:()=>EC});function CC(e,t,n,r,a,s="NHWC",i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]])),M(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),M(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),M(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let c=s==="NHWC"?o.shape[3]:o.shape[1],u=s==="NHWC"?l.shape[3]:l.shape[1];M(c===n[2],()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`),M(u===n[3],()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`),i!=null&&M(Bt(a),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let h={x:o,dy:l},d={strides:r,pad:a,dataFormat:s,dimRoundingMode:i,filterShape:n};return $.runKernel(Ch,h,d)}var Om=D({conv2DBackpropFilter_:CC});function jd(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,wl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Ud(e,t){let n=t,r=Ot(e.shape,t.shape);return r.length>0&&(n=Ne(n,r)),H(n,e.shape)}function Hd(e,t,n,r){if(t==="linear")return e;if(t==="relu")return Lr(e);if(t==="elu")return fl(e);if(t==="relu6")return Rd(e);if(t==="prelu")return Yu(e,n);if(t==="leakyrelu")return qu(e,r);if(t==="sigmoid")return _n(e);throw new Error(`Unknown fused activation ${t}.`)}var Gd=(e,t)=>!(e>0)||t==="linear";function RC({x:e,filter:t,strides:n,pad:r,dataFormat:a="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(l=l||"linear",Gd($.state.gradientDepth,l)===!1){let w=sa(e,t,n,r,a,s,i);return o!=null&&(w=se(w,o)),Hd(w,l,c,u)}let h=R(e,"x","conv2d"),d=R(t,"filter","conv2d"),p=h,m=!1;h.rank===3&&(m=!0,p=H(h,[1,h.shape[0],h.shape[1],h.shape[2]])),M(p.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`),M(d.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`),i!=null&&M(Bt(r),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`),M(p.shape[3]===d.shape[2],()=>`Error in conv2d: depth of input (${p.shape[3]}) must match input depth for filter ${d.shape[2]}.`),M(Or(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),M(a==="NHWC",()=>`Error in conv2d: got dataFormat of ${a} but only NHWC is currently supported.`);let f=Vu(p.shape,d.shape,n,s,r,i),A;o!=null&&(A=R(o,"bias","fused conv2d"),[A]=bt(A,h),dt(f.outShape,A.shape));let y;c!=null&&(y=R(c,"prelu weights","fused conv2d"));let g=(w,b)=>{let[k,N,C,F]=b,O=jd(w,C,l);M(Fa(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let z=im(N.shape,O,k,n,r),V=Om(N,O,k.shape,n,r),j=[z,V];if(F!=null){let U=Ud(F,O);j.push(U)}return j},x={x:p,filter:d,bias:A,preluActivationWeights:y},v={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?zr((w,b,k)=>{let N=$.runKernel(ti,x,v);return k([b,w,N]),m&&(N=H(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:g}})(p,d):zr((w,b,k,N)=>{let C=$.runKernel(ti,x,v);return N([b,w,C,k]),m&&(C=H(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:g}})(p,d,A)}var NC=D({fusedConv2d_:RC});function MC(e,t,n,r,a,s=[1,1],i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c={x:o,dy:l},u={strides:r,pad:a,dimRoundingMode:i,dilations:s,filterShape:n};return $.runKernel($h,c,u)}var nb=D({depthwiseConv2dNativeBackpropFilter_:MC});function FC(e,t,n,r,a,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c={dy:o,filter:n},u={strides:r,pad:a,dimRoundingMode:i,dilations:s,inputShape:e},h=$.runKernel(Dh,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var rb=D({depthwiseConv2dNativeBackpropInput_:FC});function $C({x:e,filter:t,strides:n,pad:r,dataFormat:a="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(Gd($.state.gradientDepth,l)===!1){let w=pl(e,t,n,r,a,s,i);return o!=null&&(w=se(w,o)),Hd(w,l,c,u)}let h=R(e,"x","depthwiseConv2d"),d=R(t,"filter","depthwiseConv2d"),p=h,m=!1;h.rank===3&&(m=!0,p=H(h,[1,h.shape[0],h.shape[1],h.shape[2]])),M(p.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`),M(d.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`),M(p.shape[3]===d.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),s==null&&(s=[1,1]),M(Or(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&M(Bt(r),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${r}.`);let f=Vu(p.shape,d.shape,n,s,r,i,!0),A;o!=null&&(A=R(o,"bias","fused conv2d"),[A]=bt(A,h),dt(f.outShape,A.shape));let y;c!=null&&(y=R(c,"prelu weights","fused depthwiseConv2d"));let g=(w,b)=>{M(Fa(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[k,N,C,F]=b,O=jd(w,C,l),z=rb(N.shape,O,k,n,r,s,i),V=nb(N,O,k.shape,n,r,s,i);if(F!=null){let j=Ud(A,O);return[z,V,j]}return[z,V]},x={x:p,filter:d,bias:A,preluActivationWeights:y},v={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?zr((w,b,k)=>{let N=$.runKernel(ni,x,v);return k([b,w,N]),m&&(N=H(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:g}})(p,d):zr((w,b,k,N)=>{let C=$.runKernel(ni,x,v);return N([b,w,C,k]),m&&(C=H(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:g}})(p,d,A)}var TC=D({fusedDepthwiseConv2d_:$C});function DC({a:e,b:t,transposeA:n=!1,transposeB:r=!1,bias:a,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(Gd($.state.gradientDepth,s)===!1){let F=Be(e,t,n,r);return a!=null&&(F=se(F,a)),Hd(F,s,i,o)}let l=R(e,"a","fused matMul"),c=R(t,"b","fused matMul");[l,c]=bt(l,c);let u=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=r?c.shape[c.rank-1]:c.shape[c.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=r?c.shape[c.rank-2]:c.shape[c.rank-1],m=l.shape.slice(0,-2),f=c.shape.slice(0,-2),A=Nt(m),y=Nt(f);M(l.rank>=2&&c.rank>=2&&l.rank===c.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${l.rank} and ${c.rank}.`),M(na(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${l.shape} and ${c.shape} must match.`),M(u===h,()=>`Error in fused matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${l.shape} and ${c.shape} and transposeA=${n} and transposeB=${r} must match.`);let g=l.shape.slice(0,-2).concat([d,p]),x=n?H(l,[A,u,d]):H(l,[A,d,u]),v=r?H(c,[y,p,h]):H(c,[y,h,p]),w;a!=null&&(w=R(a,"bias","fused matMul"),[w]=bt(w,l),dt(g,w.shape));let b;i!=null&&(b=R(i,"prelu weights","fused matMul"));let k=(F,O)=>{let[z,V,j,U]=O,X=jd(H(F,j.shape),j,s),G,ee;if(!n&&!r?(G=Be(X,V,!1,!0),ee=Be(z,X,!0,!1)):!n&&r?(G=Be(X,V,!1,!1),ee=Be(X,z,!0,!1)):n&&!r?(G=Be(V,X,!1,!0),ee=Be(z,X,!1,!1)):(G=Be(V,X,!0,!0),ee=Be(X,z,!0,!0)),a!=null){let Y=Ud(U,X);return[G,ee,Y]}else return[G,ee]},N={a:x,b:v,bias:w,preluActivationWeights:b},C={transposeA:n,transposeB:r,activation:s,leakyreluAlpha:o};return a==null?zr((F,O,z)=>{let V=$.runKernel(ei,N,C);return z([F,O,V]),{value:H(V,g),gradFunc:k}})(x,v):zr((F,O,z,V)=>{let j=$.runKernel(ei,N,C);return V([F,O,j,z]),{value:H(j,g),gradFunc:k}})(x,v,w)}var EC=D({fusedMatMul_:DC});function OC(e){return Dm(e,.54,.46)}var zC=D({hammingWindow_:OC});function PC(e){return Dm(e,.5,.5)}var ab=D({hannWindow_:PC});function LC(e,t,n,r=!1,a=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Re(e,s,t)),s+=n;if(r)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),M(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${o.shape}.`),M(l.rank===1&&l.shape[0]===c,()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${o.shape}.`),M(r.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),M(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),M(a==="bilinear"||a==="nearest",()=>`method must be bilinear or nearest, but was ${a}`);let u={image:i,boxes:o,boxInd:l},h={method:a,extrapolationValue:s,cropSize:r};return $.runKernel(po,u,h)}var jC=D({cropAndResize_:VC});function UC(e){let t=R(e,"image","flipLeftRight","float32");M(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return $.runKernel(wo,n,{})}var HC=D({flipLeftRight_:UC});function GC(e,t,n=0,r=.5){let a=R(e,"image","rotateWithOffset","float32");M(a.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`);let s={image:a},i={radians:t,fillValue:n,center:r};return $.runKernel(el,s,i)}var qC=D({rotateWithOffset_:GC});function bl(e,t,n,r,a,s){r==null&&(r=.5),a==null&&(a=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),M(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),M(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),M(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),M(t.rank===1,()=>"scores must be a 1D tensor"),M(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),M(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s}}function XC(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppression"),i=R(t,"scores","nonMaxSuppression"),o=bl(s,i,n,r,a);n=o.maxOutputSize,r=o.iouThreshold,a=o.scoreThreshold;let l={maxOutputSize:n,iouThreshold:r,scoreThreshold:a};return $.runKernel($o,{boxes:s,scores:i},l)}var KC=D({nonMaxSuppression_:XC});function YC(e,t,n){let r=ZC(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function ZC(e,t,n){return QC(e,t,n||JC)}function JC(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?r=s+1:(a=s,i=!o)}return i?r:-r-1}function ib(e,t,n,r,a){return zm(e,t,n,r,a,0)}function ob(e,t,n,r,a,s){return zm(e,t,n,r,a,0,!1,s,!0)}function lb(e,t,n,r,a,s){return zm(e,t,n,r,a,s,!0)}function zm(e,t,n,r,a,s,i=!1,o=!1,l=!1){let c=[];for(let A=0;Aa&&c.push({score:t[A],boxIndex:A,suppressBeginIndex:0});c.sort(ub);let u=s>0?-.5/s:0,h=[],d=[];for(;h.length0;){let A=c.pop(),{score:y,boxIndex:g,suppressBeginIndex:x}=A;if(y=x;--w){let b=eR(e,g,h[w]);if(b>=r){v=!0;break}if(A.score=A.score*tR(r,u,b),A.score<=a)break}A.suppressBeginIndex=h.length,v||(A.score===y?(h.push(g),d.push(A.score)):A.score>a&&YC(c,A,ub))}let p=h.length,m=n-p;o&&m>0&&(h.push(...new Array(m).fill(0)),d.push(...new Array(m).fill(0)));let f={selectedIndices:h};return i&&(f.selectedScores=d),l&&(f.validOutputs=p),f}function eR(e,t,n){let r=e.subarray(t*4,t*4+4),a=e.subarray(n*4,n*4+4),s=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),o=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),c=Math.min(a[0],a[2]),u=Math.min(a[1],a[3]),h=Math.max(a[0],a[2]),d=Math.max(a[1],a[3]),p=(o-s)*(l-i),m=(h-c)*(d-u);if(p<=0||m<=0)return 0;let f=Math.max(s,c),A=Math.max(i,u),y=Math.min(o,h),g=Math.min(l,d),x=Math.max(y-f,0)*Math.max(g-A,0);return x/(p+m-x)}function tR(e,t,n){let r=Math.exp(t*n*n);return n<=e?r:0}function ub(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function nR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppressionAsync"),i=R(t,"scores","nonMaxSuppressionAsync"),o=bl(s,i,n,r,a);n=o.maxOutputSize,r=o.iouThreshold,a=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),c=l[0],u=l[1],{selectedIndices:h}=ib(c,u,n,r,a);return s!==e&&s.dispose(),i!==t&&i.dispose(),nn(h,"int32")}var rR=nR;function aR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=bl(i,o,n,r,a,s);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,s=l.softNmsSigma;let c={boxes:i,scores:o},u={maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s},h=$.runKernel(Oo,c,u);return{selectedIndices:h[0],selectedScores:h[1]}}var sR=D({nonMaxSuppressionWithScore_:aR});async function iR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=bl(i,o,n,r,a,s);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,s=l.softNmsSigma;let c=await Promise.all([i.data(),o.data()]),u=c[0],h=c[1],{selectedIndices:d,selectedScores:p}=lb(u,h,n,r,a,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(d,"int32"),selectedScores:nn(p)}}var oR=iR;function lR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=bl(i,o,n,r,a,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,d={boxes:i,scores:o},p={maxOutputSize:c,iouThreshold:u,scoreThreshold:h,padToMaxOutputSize:s},m=$.runKernel(Do,d,p);return{selectedIndices:m[0],validOutputs:m[1]}}var uR=D({nonMaxSuppressionPadded_:lR});async function cR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=bl(i,o,n,r,a,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=ob(d,p,c,u,h,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(m,"int32"),validOutputs:ke(f,"int32")}}var hR=cR;function dR(e,t,n=!1,r=!1){let a=R(e,"images","resizeBilinear");M(a.rank===3||a.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`),M(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),M(r===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=a,i=!1;a.rank===3&&(i=!0,s=H(a,[1,a.shape[0],a.shape[1],a.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:r,size:t},c=$.runKernel(Ls,o,l);return i?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var cb=D({resizeBilinear_:dR});function pR(e,t,n=!1,r=!1){let a=R(e,"images","resizeNearestNeighbor");M(a.rank===3||a.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`),M(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),M(a.dtype==="float32"||a.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),M(r===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=a,i=!1;a.rank===3&&(i=!0,s=H(a,[1,a.shape[0],a.shape[1],a.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:r,size:t},c=$.runKernel(Iu,o,l);return i?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var hb=D({resizeNearestNeighbor_:pR});function fR(e,t,n="nearest",r="constant",a=0,s){let i=R(e,"image","transform","float32"),o=R(t,"transforms","transform","float32");M(i.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${i.rank}.`),M(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),M(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},c={interpolation:n,fillMode:r,fillValue:a,outputShape:s};return $.runKernel(td,l,c)}var mR=D({transform_:fR});function AR(e,t,n){M(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),M(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let r=R(e,"a","bandPart");M(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);let a=r.shape,[s,i]=r.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=H(Cd(0,s,1,"int32"),[-1,1]),l=Cd(0,i,1,"int32"),c=ye(o,l),u=lr(pi(c,ke(+t,"int32")),Oa(c,ke(-n,"int32"))),h=Et([s,i],r.dtype);return H(On(ur(H(r,[-1,s,i])).map(d=>kn(u,d,h))),a)}var yR=D({bandPart_:AR});function gR(e){let t;if(Array.isArray(e)){t=!1,M(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let a=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${a})`)}else t=!0,e=ln(e,e.shape[0],0).map(a=>za(a,[0]));M(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],r=e;for(let a=0;a{let s=r[a];if(a>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return db(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((l,c)=>l*c),r=ur(H(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],s=[];r.forEach(l=>{let[c,u]=db(l,t);a.push(c),s.push(u)});let i=H(On(a,0),e.shape),o=H(On(s,0),e.shape);return[i,o]}}function db(e,t=!1){return $.tidy(()=>{M(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],r=e.shape[1],a=pm(n),s=Dr(e),i=Kn([[1]],[1,1]),o=Dr(i),l=n>=r?r:n;for(let c=0;c{let p=Re(s,[c,c],[n-c,1]),m=Vd(p),f=Re(s,[c,c],[1,1]),A=kn(or(f,0),Kn([[-1]]),Kn([[1]])),y=ye(f,B(A,m)),g=ge(p,y);g.shape[0]===1?o=Dr(i):o=ot([i,Re(g,[1,0],[g.shape[0]-1,g.shape[1]])],0);let x=_t(ge(Be(A,y),m)),v=Re(s,[c,0],[n-c,r]),w=B(x,o),b=Ze(o);if(c===0)s=ye(v,Be(w,Be(b,v)));else{let C=ye(v,Be(w,Be(b,v)));s=ot([Re(s,[0,0],[c,r]),C],0)}let k=Ze(w),N=Re(a,[0,c],[n,a.shape[1]-c]);if(c===0)a=ye(N,Be(Be(N,o),k));else{let C=ye(N,Be(Be(N,o),k));a=ot([Re(a,[0,0],[n,c]),C],1)}return[o,s,a]}),Te([u,h,d])}return!t&&n>r&&(a=Re(a,[0,0],[n,r]),s=Re(s,[0,0],[r,r])),[a,s]})}var bR=D({qr_:wR}),un;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(un||(un={}));function _R(e,t,n=un.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"losses","computeWeightedLoss"),a=null;t!=null&&(a=R(t,"weights","computeWeightedLoss"));let s=a==null?r:B(r,a);if(n===un.NONE)return s;if(n===un.SUM)return Ne(s);if(n===un.MEAN){if(a==null)return vt(s);{let i=r.size/a.size,o=ge(Ne(s),Ne(a));return i>1?ge(o,ke(i)):o}}if(n===un.SUM_BY_NONZERO_WEIGHTS){if(a==null)return ge(Ne(s),ke(r.size));{let i=B(a,Fn(r.shape)),o=Ae(Ne(Ai(i,ke(0))),"float32");return ge(Ne(s),o)}}throw Error(`Unknown reduction: ${n}`)}var la=D({computeWeightedLoss_:_R});function vR(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","absoluteDifference"),s=R(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=R(n,"weights","absoluteDifference")),an(a.shape,s.shape,"Error in absoluteDifference: ");let o=Dt(ye(a,s));return la(o,i,r)}var kR=D({absoluteDifference_:vR});function IR(e,t,n,r,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","cosineDistance"),i=R(t,"predictions","cosineDistance"),o=null;r!=null&&(o=R(r,"weights","cosineDistance")),an(s.shape,i.shape,"Error in cosineDistance: ");let l=ke(1),c=ye(l,Ne(B(s,i),n,!0));return la(c,o,a)}var SR=D({cosineDistance_:IR});function NR(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","hingeLoss"),s=R(t,"predictions","hingeLoss"),i=null;n!=null&&(i=R(n,"weights","hingeLoss")),an(a.shape,s.shape,"Error in hingeLoss: ");let o=ke(1);a=ye(B(ke(2),a),o);let l=Lr(ye(o,B(a,s)));return la(l,i,r)}var TR=D({hingeLoss_:NR});function ER(e,t,n,r=1,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","huberLoss"),i=R(t,"predictions","huberLoss"),o=null;n!=null&&(o=R(n,"weights","huberLoss")),an(s.shape,i.shape,"Error in huberLoss: ");let l=ke(r),c=Dt(ye(i,s)),u=yl(c,l),h=ye(c,u),d=se(B(ke(.5),st(u)),B(l,h));return la(d,o,a)}var CR=D({huberLoss_:ER});function RR(e,t,n,r=1e-7,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","logLoss"),i=R(t,"predictions","logLoss"),o=null;n!=null&&(o=R(n,"weights","logLoss")),an(s.shape,i.shape,"Error in logLoss: ");let l=ke(1),c=ke(r),u=_t(B(s,Mn(se(i,c)))),h=B(ye(l,s),Mn(se(ye(l,i),c))),d=ye(u,h);return la(d,o,a)}var MR=D({logLoss_:RR});function FR(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","meanSquaredError"),s=R(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=R(n,"weights","meanSquaredError")),an(a.shape,s.shape,"Error in meanSquaredError: ");let o=Ld(a,s);return la(o,i,r)}var $R=D({meanSquaredError_:FR});function DR(e,t){let n=R(e,"labels","sigmoidCrossEntropyWithLogits"),r=R(t,"logits","sigmoidCrossEntropyWithLogits");an(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");let a=Lr(r),s=B(r,n),i=kd(qn(_t(Dt(r))));return se(ye(a,s),i)}function OR(e,t,n,r=0,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"multiClassLabels","sigmoidCrossEntropy"),i=R(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=R(n,"weights","sigmoidCrossEntropy")),an(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),r>0){let c=ke(r),u=ke(1),h=ke(.5);s=se(B(s,ye(u,c)),B(h,c))}let l=DR(s,i);return la(l,o,a)}var zR=D({sigmoidCrossEntropy_:OR});function PR(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return zr((r,a,s)=>{let i=gm(a,[n],!0),o=ye(Ae(a,"float32"),i);s([r,o]);let l=_t(B(o,r));return{value:Ne(l,[n]),gradFunc:(c,u)=>{let[h,d]=u,p=mi(c.shape,[n]);return[B(H(c,p),ye(Ae(h,"float32"),qn(d))),B(H(c,p),ye(qn(d),Ae(h,"float32")))]}}})(e,t)}function LR(e,t,n,r=0,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"onehotLabels","softmaxCrossEntropy"),i=R(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=R(n,"weights","softmaxCrossEntropy")),an(s.shape,i.shape,"Error in softmaxCrossEntropy: "),r>0){let c=ke(r),u=ke(1),h=ke(s.shape[1]);s=se(B(s,ye(u,c)),ge(c,h))}let l=PR(s,i);return la(l,o,a)}var WR=D({softmaxCrossEntropy_:LR});function BR(e,t,n){let r=R(e,"inputIndices","sparseReshape"),a=R(t,"inputShape","sparseReshape"),s=R(n,"newShape","sparseReshape");if(r.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${r.shape}`);if(a.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:r,inputShape:a,newShape:s},o=$.runKernel(Qh,i);return{outputIndices:o[0],outputShape:o[1]}}var VR=D({sparseReshape_:BR}),jR={fft:tc,ifft:xl,rfft:nc,irfft:Pd},UR={hammingWindow:zC,hannWindow:ab,frame:sb,stft:BC},Ye={flipLeftRight:HC,resizeNearestNeighbor:hb,resizeBilinear:cb,rotateWithOffset:qC,cropAndResize:jC,nonMaxSuppression:KC,nonMaxSuppressionAsync:rR,nonMaxSuppressionWithScore:sR,nonMaxSuppressionWithScoreAsync:oR,nonMaxSuppressionPadded:uR,nonMaxSuppressionPaddedAsync:hR,transform:mR},pb={bandPart:yR,gramSchmidt:xR,qr:bR},HR={absoluteDifference:kR,computeWeightedLoss:la,cosineDistance:SR,hingeLoss:TR,huberLoss:CR,logLoss:MR,meanSquaredError:$R,sigmoidCrossEntropy:zR,softmaxCrossEntropy:WR},fb={sparseReshape:VR},ua=class extends mw{minimize(e,t=!1,n){let{value:r,grads:a}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:a[i.name]}));this.applyGradients(s)}else this.applyGradients(a);return Te(a),t?r:(r.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Pw(e,t)}dispose(){this.iterations_!=null&&Te(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:ke(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}};Object.defineProperty(ua,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var qd=class extends ua{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:L(()=>Ue(r).variable(a))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;L(()=>{let l=se(B(i,this.rho),B(st(s),1-this.rho)),c=B(ge(Jt(se(o,this.epsilon)),Jt(se(i,this.epsilon))),s),u=se(B(o,this.rho),B(st(c),1-this.rho));i.assign(l),o.assign(u);let h=se(B(c,-this.learningRate),r);r.assign(h)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Te(this.accumulatedGrads.map(e=>e.variable)),Te(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};qd.className="Adadelta";Ma(qd);var Xd=class extends ua{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:L(()=>Gu(r.shape,this.initialAccumulatorValue).variable(i))}}let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let s=this.accumulatedGrads[n].variable;L(()=>{let i=se(s,st(a));s.assign(i);let o=se(B(ge(a,Jt(se(i,$.backend.epsilon()))),-this.learningRate),r);r.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Te(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};Xd.className="Adagrad";Ma(Xd);var Kd=class extends ua{constructor(e,t,n,r=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],L(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(n).variable()}),r==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),r=ye(1,this.accBeta2);t.forEach((a,s)=>{let i=$.registeredVariables[a],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${a}/m`,variable:L(()=>Ue(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${a}/v`,variable:L(()=>Ue(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[a];if(l==null)return;let c=this.accumulatedFirstMoment[s].variable,u=this.accumulatedSecondMoment[s].variable,h=se(B(c,this.beta1),B(l,1-this.beta1)),d=se(B(u,this.beta2),B(st(l),1-this.beta2)),p=ge(h,n),m=ge(d,r);c.assign(h),u.assign(d);let f=se(B(ge(p,se(Jt(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Te(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Te(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e),L(()=>{this.accBeta1.assign(oa(this.beta1,this.iterations_+1)),this.accBeta2.assign(oa(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}};Kd.className="Adam";Ma(Kd);var Zd=class extends ua{constructor(e,t,n,r=null,a=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],L(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),r==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),r=ge(-this.learningRate,se(B(this.iteration,this.decay),1));t.forEach((a,s)=>{let i=$.registeredVariables[a],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${a}/m`,variable:Ue(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${a}/v`,variable:Ue(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[a];if(l==null)return;let c=this.accumulatedFirstMoment[s].variable,u=this.accumulatedWeightedInfNorm[s].variable,h=se(B(c,this.beta1),B(l,1-this.beta1)),d=B(u,this.beta2),p=Dt(l),m=Pr(d,p);c.assign(h),u.assign(m);let f=se(B(ge(r,n),ge(h,se(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(se(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Te(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Te(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}};Zd.className="Adamax";Ma(Zd);var rc=class extends ua{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let a=$.registeredVariables[t];L(()=>{let s=se(B(this.c,r),a);a.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Vt(ke(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}};rc.className="SGD";Ma(rc);var Yd=class extends rc{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(r).variable(i))}}let a=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&L(()=>{let i,o=se(B(this.m,a),s);this.useNesterov?i=se(B(this.c,se(s,B(o,this.m))),r):i=se(B(this.c,o),r),a.assign(o),r.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Te(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}};Yd.className="Momentum";Ma(Yd);var Jd=class extends ua{constructor(e,t=.9,n=0,r=null,a=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,r==null&&(this.epsilon=$.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:L(()=>Ue(r).variable(a))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;L(()=>{let l=se(B(i,this.decay),B(st(s),1-this.decay));if(this.centered){let c=this.accumulatedMeanGrads[n].variable,u=se(B(c,this.decay),B(s,1-this.decay)),h=ge(B(s,this.learningRate),Jt(ye(l,se(st(u),this.epsilon)))),d=se(B(o,this.momentum),h);i.assign(l),c.assign(u),o.assign(d);let p=ye(r,d);r.assign(p)}else{let c=se(B(i,this.decay),B(st(s),1-this.decay)),u=se(B(o,this.momentum),ge(B(s,this.learningRate),Jt(se(c,this.epsilon))));i.assign(c),o.assign(u);let h=ye(r,u);r.assign(h)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Te(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Te(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Te(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}};Jd.className="RMSProp";Ma(Jd);var yi=class{static sgd(e){return new rc(e)}static momentum(e,t,n=!1){return new Yd(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,a=!1){return new Jd(e,t,n,r,a)}static adam(e=.001,t=.9,n=.999,r=null){return new Kd(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new qd(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,a=0){return new Zd(e,t,n,r,a)}static adagrad(e,t=.1){return new Xd(e,t)}},gi={sgd:yi.sgd,momentum:yi.momentum,adadelta:yi.adadelta,adagrad:yi.adagrad,rmsprop:yi.rmsprop,adamax:yi.adamax,adam:yi.adam},GR=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Qd(){return new Promise(e=>GR(()=>e()))}var E={};Me(E,{ERF_A1:()=>rM,ERF_A2:()=>aM,ERF_A3:()=>sM,ERF_A4:()=>iM,ERF_A5:()=>oM,ERF_P:()=>nM,PARALLELIZE_THRESHOLD:()=>Pm,SELU_SCALE:()=>Ab,SELU_SCALEALPHA:()=>mb,applyActivation:()=>Hd,assertAndGetBroadcastShape:()=>dt,assertAxesAreInnerMostDims:()=>IT,assertParamsConsistent:()=>qR,assignToTypedArray:()=>mM,axesAreInnerMostDims:()=>Am,calculateShapes:()=>rw,checkEinsumDimSizes:()=>wM,combineLocations:()=>Ww,complexWithEvenIndex:()=>dM,complexWithOddIndex:()=>pM,computeConv2DInfo:()=>Vu,computeConv3DInfo:()=>_w,computeDefaultPad:()=>rm,computeDilation2DInfo:()=>KS,computeOptimalWindowSize:()=>KR,computeOutAndReduceShapes:()=>Bw,computeOutShape:()=>XR,computePool2DInfo:()=>bw,computePool3DInfo:()=>ZS,convertConv2DDataFormat:()=>ww,decodeEinsumEquation:()=>gM,eitherStridesOrDilationsAreOne:()=>Or,expandShapeToKeepDim:()=>mi,exponent:()=>yM,exponents:()=>AM,fromStringArrayToUint8:()=>IM,fromUint8ToStringArray:()=>kM,getAxesPermutation:()=>Vw,getBroadcastDims:()=>WN,getComplexWithIndex:()=>fM,getEinsumComputePath:()=>bM,getEinsumPermutation:()=>xM,getFusedBiasGradient:()=>Ud,getFusedDyActivation:()=>jd,getImageCenter:()=>ZR,getInnerMostAxes:()=>ST,getPermuted:()=>JR,getReductionAxes:()=>Ot,getReshaped:()=>YR,getReshapedPermuted:()=>QR,getSliceBeginCoords:()=>eM,getSliceSize:()=>tM,getUndoAxesPermutation:()=>ym,isIdentityPermutation:()=>_M,log:()=>uM,mergeRealAndImagArrays:()=>cM,prepareAndValidate:()=>nw,prepareSplitSize:()=>vM,segment_util:()=>yb,shouldFuse:()=>Gd,slice_util:()=>sn,splitRealAndImagArrays:()=>hM,tupleValuesAreOne:()=>Fa,upcastType:()=>ir,validateInput:()=>Vf,validateUpdateShape:()=>Bf,warn:()=>lM});function qR(e,t){let n=e[0].length;e.forEach((a,s)=>{M(a.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),M(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let r=e[0];e.forEach((a,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${a}) does not match the shape of the rest (${r}) along the non-concatenated axis ${s}.`)})}function XR(e,t){let n=e[0].slice();for(let r=1;r=t*2+1||i%2==1?s.push(i):a.push(i);r.push(...a),r.push(0),r.push(...s)}return r}function QR(e,t,n,r=!0){let a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(let s=1;s/g,gb=",",xb="...";function gM(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(SM,"").length)/Lm.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${Lm}").`);let[r,a]=e.split(Lm);M(r.indexOf(xb)===-1,()=>`The ellipsis notation ("${xb}") is not supported yet.`);let s=r.split(gb),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let d=0;dm.indexOf(p)!==-1))throw new Error(`Output subscripts contain the label ${p} not present in the input subscripts.`);o.indexOf(p)===-1&&o.push(p)}for(let d=0;da!==-1),{permutationIndices:n,expandDims:r}}function wM(e,t,n){let r=new Array(e);for(let a=0;a`Expected dimension ${r[t[a][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function bM(e,t){let n=e,r=[],a=0;e.length===0&&n.push(-1),a=e.length+1;for(let i=0;it===n)}function NM(e,t){let n=[];for(let r=0;r"Number of splits must evenly divide the axis."),r=new Array(t).fill(e.shape[n]/t);else{let a=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);M(a<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,l)=>l>0?o+l:o);t[s]=e.shape[n]-i}M(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),r=t}return r}var yb={};Me(yb,{collectGatherOpShapeInfo:()=>CM,computeOutShape:()=>EM,segOpComputeOptimalWindowSize:()=>TM});function TM(e,t){let n=!1,r;for(e<=Pm?(r=e,n=!0):r=kh(e,Math.floor(Math.sqrt(e)));!n;)r>t||r===e?n=!0:r=kh(e,r+1);return r}function EM(e,t,n){let r=[],a=e.length;for(let s=0;sa))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) ( - ${s}).`);if(nid(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function IM(e){return e.map(t=>Ru(t))}var Wr={};Me(Wr,{nonMaxSuppressionV3Impl:()=>ib,nonMaxSuppressionV4Impl:()=>ob,nonMaxSuppressionV5Impl:()=>lb,whereImpl:()=>Zw});function be(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&_.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var RM=Wr.whereImpl,ep=class extends cu{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new _h(this,aa())}nextDataId(){return ep.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,J().get("IS_NODE")&&E.warn(` + ${a.shape}`),F(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${a.shape}`);let o={x:a},l={blockSize:t,dataFormat:n};return D.runKernel(fo,o,l)}var lA=O({depthToSpace_:WT});function BT(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","depthwiseConv2d"),l=M(t,"filter","depthwiseConv2d"),d=o,u=!1;o.rank===3&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(d.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),F(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),F(d.shape[3]===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),i!=null&&F(Vt(a),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p={x:d,filter:l},c={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},h=D.runKernel(As,p,c);return u?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var hl=O({depthwiseConv2d_:BT});function VT(e){let t={x:M(e,"x","diag")};return D.runKernel(zp,t)}var jT=O({diag_:VT});function UT(e,t,n,a,r=[1,1],s="NHWC"){let i=M(e,"x","dilation2d"),o=M(t,"filter","dilation2d");F(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),F(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),F(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,d=!1;i.rank===3&&(l=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),d=!0);let u={x:l,filter:o},p={strides:n,pad:a,dilations:r},c=D.runKernel(gu,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var uA=O({dilation2d_:UT});function HT(e,t){let n=e.length,a=[];for(let r=0;r1&&i===1&&a.unshift(s)}return a}function zt(e,t){let n=[];for(let a=0;a1)&&n.unshift(s)}return n}function ct(e,t){let n=[],a=Math.max(e.length,t.length);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${a.rank}.`);let r=n.rank===1?n.size:n.shape[1],s=a.rank===1?a.size:a.shape[0];if(F(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),n.rank===1&&a.rank===1){let i=H(n,[1,-1]),o=H(a,[-1,1]),l=Be(i,o);return H(l,[])}else if(n.rank===1&&a.rank===2){let i=H(n,[1,-1]),o=H(a,[a.shape[0],a.shape[1]]),l=Be(i,o);return H(l,[l.size])}else if(n.rank===2&&a.rank===1){let i=H(a,[-1,1]),o=Be(n,i);return H(o,[o.size])}else{let i=H(a,[a.shape[0],a.shape[1]]);return Be(n,i)}}var Db=O({dot_:ZT});function YT(e,...t){let n=t.map((r,s)=>M(r,`tensors${s}`,"einsum")),a={equation:e};return D.runKernel(Lp,n,a)}var Ob=O({einsum_:YT});function JT(e){let t={x:M(e,"x","elu")};return D.runKernel(mo,t)}var fl=O({elu_:JT});function QT(e){let t=M(e,"x","erf");F(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ae(t,"float32"));let n={x:t};return D.runKernel(Ao,n)}var pA=O({erf_:QT});function eE(e){let t={x:M(e,"x","exp")};return D.runKernel(gs,t)}var qn=O({exp_:eE});function tE(e,t=0){let n=M(e,"x","expandDims","string_or_numeric");F(t<=n.rank,()=>"Axis must be <= rank of the tensor");let a={input:n},r={dim:t};return D.runKernel(go,a,r)}var on=O({expandDims_:tE});function nE(e){let t={x:M(e,"x","expm1")};return D.runKernel(xo,t)}var cA=O({expm1_:nE});function aE(e,t){let n=M(e,"x","tile","string_or_numeric");F(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let a={x:n},r={reps:t};return D.runKernel(Sr,a,r)}var $r=O({tile_:aE});function rE(e,t,n,a="float32"){t==null&&(t=e);let r=We([e,t],a),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${s.rank}.`),F(Vt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=H(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},d={depthRadius:t,bias:n,alpha:a,beta:r},u=D.runKernel(wu,l,d);return o?H(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var mA=O({localResponseNormalization_:AE});function yE(e){let t={x:M(e,"x","log")};return D.runKernel(Ss,t)}var Fn=O({log_:yE});function gE(e){let t={x:M(e,"x","log1p")};return D.runKernel(Co,t)}var Ic=O({log1p_:gE});function xE(e){return F(wr(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let a=M(t,"x","tf.grad","string_or_numeric"),r=n!=null?M(n,"dy","tf.grad"):null;return D.tidy(()=>{let{value:s,grads:i}=D.gradients(()=>e(a),[a],r);return r!=null&&rn(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Sc(i),i[0]})}}function bE(e){return F(wr(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{F(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let a=Pu(t,"args","tf.grads","string_or_numeric"),r=n!=null?M(n,"dy","tf.grads"):null;return D.tidy(()=>{let{value:s,grads:i}=D.gradients(()=>e(...a),a,r);return r!=null&&rn(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Sc(i),i})}}function vE(e){return F(wr(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{F(t instanceof Le,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),F(n==null||n instanceof Le,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:a,value:r}=D.gradients(()=>e(t),[t],n);return Sc(a),{grad:a[0],value:r}}}function wE(e){return F(wr(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{F(Array.isArray(t)&&t.every(r=>r instanceof Le),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),F(n==null||n instanceof Le,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let a=D.gradients(()=>e(...t),t,n);return n!=null&&rn(a.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Sc(a.grads),a}}function Lb(e,t){F(wr(e),()=>"The f passed in variableGrads(f) must be a function"),F(t==null||Array.isArray(t)&&t.every(d=>d instanceof Ou),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let d in D.registeredVariables)t.push(D.registeredVariables[d])}let a=n?t.filter(d=>!d.trainable):null,r=t.length;t=t.filter(d=>d.trainable),F(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`);let s=!0,{value:i,grads:o}=D.gradients(e,t,null,s);F(o.some(d=>d!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),F(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let l={};return t.forEach((d,u)=>{o[u]!=null&&(l[d.name]=o[u])}),a!=null&&a.forEach(d=>l[d.name]=null),{value:i,grads:l}}function _a(e){return D.customGrad(e)}function Sc(e){if(e.filter(t=>t==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that + the f you passed encloses all operations that lead from x to y.`)}function kE(e){let t={x:M(e,"x","neg")};return D.runKernel(Fo,t)}var wt=O({neg_:kE});function IE(e){let t={x:M(e,"x","softplus")};return D.runKernel(Xo,t)}var fi=O({softplus_:IE});function SE(e){let t=M(e,"x","logSigmoid");return _a(n=>({value:wt(fi(wt(n))),gradFunc:a=>B(a,wn(wt(n)))}))(t)}var Wb=O({logSigmoid_:SE});function NE(e,t=null,n=!1){let a={x:M(e,"x","max")},r={reductionIndices:t,keepDims:n};return D.runKernel(Ns,a,r)}var Xn=O({max_:NE});function TE(e,t){let n=M(e,"a","sub"),a=M(t,"b","sub");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(Zs,r)}var ye=O({sub_:TE});function EE(e,t=null,n=!1){let a=M(e,"x","sum");a.dtype==="bool"&&(a=Ae(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return D.runKernel(qs,r,s)}var Te=O({sum_:EE});function CE(e,t=-1){let n=M(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return _a((a,r)=>{let s=!0,i=Xn(a,t,!0),o=ye(a,i),l=ye(Ae(o,"float32"),Fn(Te(qn(o),t,s)));return r([l]),{value:l,gradFunc:(d,u)=>{let[p]=u,c=!0,h=qn(p);return ye(d,B(Te(d,t,c),h))}}})(n)}var Nc=O({logSoftmax_:CE});function AA(e,t){for(let n=0;ne[s]);return[n,r]}function mi(e,t){let n=t.map(a=>1);return Bb(e,n,t)}function RE(e,t,n){F(AA(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function jb(e,t){if(AA(e,t))return null;let n=[];for(let a=0;an.push(a)),n}function yA(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function ME(e,t){let n=[];for(let a=t-e;a`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),F(za(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),r!=null&&F(Vt(a),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=D.runKernel(Es,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var Ku=O({maxPool_:_E});function PE(e,t=[1,1,1],n,a,r,s="NDHWC"){let i=M(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),F(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&F(Vt(a),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=D.runKernel(ku,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var xA=O({maxPool3d_:PE});function LE(e,t,n,a,r=!1){let s={x:M(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:a,includeBatchInIndex:r},o=D.runKernel(Xp,s,i);return{result:o[0],indexes:o[1]}}var Hb=O({maxPoolWithArgmax_:LE});function WE(e,t){let n=M(e,"a","maximum"),a=M(t,"b","maximum");[n,a]=vt(n,a),n.dtype==="bool"&&(n=Ae(n,"int32"),a=Ae(a,"int32")),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel(Ts,r)}var Pa=O({maximum_:WE});function BE(e,t=null,n=!1){let a={x:M(e,"x","mean")},r={axis:t,keepDims:n};return D.runKernel(Cs,a,r)}var kt=O({mean_:BE});function Ct(e,t="float32"){if(t==="complex64"){let a=Ct(e,"float32"),r=Ct(e,"float32");return Tr(a,r)}let n=Sp(Tt(e),t);return D.makeTensor(n,e,t)}function $n(e,t="float32"){if(t==="complex64"){let a=$n(e,"float32"),r=Ct(e,"float32");return Tr(a,r)}let n=hm(Tt(e),t);return D.makeTensor(n,e,t)}function VE(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let a=M(e,"x","meshgrid",e instanceof Le?e.dtype:"float32");if(t===void 0)return[a];let r=M(t,"y","meshgrid",t instanceof Le?t.dtype:"float32"),s=Tt(a.shape),i=Tt(r.shape);return n==="xy"?(a=H(a,[1,-1]),r=H(r,[-1,1]),[Be($n([i,1],a.dtype),a),Be(r,$n([1,s],r.dtype))]):(a=H(a,[-1,1]),r=H(r,[1,-1]),[Be(a,$n([1,i],a.dtype)),Be($n([s,1],r.dtype),r)])}function jE(e,t=null,n=!1){let a={x:M(e,"x","min")},r={axis:t,keepDims:n};return D.runKernel(Rs,a,r)}var Al=O({min_:jE});function UE(e,t){let n=M(e,"a","minimum"),a=M(t,"b","minimum");[n,a]=vt(n,a),n.dtype==="bool"&&(n=Ae(n,"int32"),a=Ae(a,"int32")),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel(Ms,r)}var yl=O({minimum_:UE});function HE(e,t,n){F(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let a=M(e,"x","mirrorPad");if(a.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");F(t.length===a.rank,()=>`Padding doesn't match input. Must be ${a.rank}. Got ${t.length}.`);let r=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),F(t[o][0]>=0&&t[o][0]<=a.shape[o]-r&&t[o][1]>=0&&t[o][1]<=a.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${a.shape[o]-r} or less than 0 for input of shape ${a.shape}`);let s={paddings:t,mode:n},i={x:a};return D.runKernel(Fs,i,s)}var bA=O({mirrorPad_:HE});function GE(e,t){let n=M(e,"a","mod"),a=M(t,"b","mod");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(Mo,r)}var vA=O({mod_:GE});function qE(e){let t=M(e,"x","square"),n={};return D.runKernel("Square",{x:t},n)}var st=O({square_:qE});function XE(e,t=null,n=!1){e=M(e,"x","moments");let a=sa(t,e.shape),r=kt(e,a,n),s=r.shape;n||(s=mi(r.shape,a));let i=st(ye(Ae(e,"float32"),H(r,s))),o=kt(i,a,n);return{mean:r,variance:o}}var Ec=O({moments_:XE});function KE(e,t,n,a){let r=M(t,"data","multiRNNCell"),s=Pu(n,"c","multiRNNCell"),i=Pu(a,"h","multiRNNCell"),o=r,l=[];for(let p=0;p2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?H(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:a},d=D.runKernel(Kp,o,l);return i===1?H(d,[d.size]):d}var Gb=O({multinomial_:YE});function JE(e,t){let n=M(e,"a","notEqual"),a=M(t,"b","notEqual");[n,a]=vt(n,a),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel($o,r)}var Ai=O({notEqual_:JE});function QE(e){let t={x:M(e,"x","onesLike")};return D.runKernel(_o,t)}var Dn=O({onesLike_:QE});function eC(e,t){let n=M(e,"v1","outerProduct"),a=M(t,"v2","outerProduct");F(n.rank===1&&a.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${a.rank}.`);let r=H(n,[-1,1]),s=H(a,[1,-1]);return Be(r,s)}var tC=O({outerProduct_:eC});function nC(e,t,n=0){let a=M(e,"x","pad");if(a.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:n},s={x:a};return D.runKernel(Os,s,r)}var rr=O({pad_:nC});function aC(e,t,n=0){return F(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),rr(e,[t],n)}var rC=O({pad1d_:aC});function sC(e,t,n=0){return F(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var iC=O({pad2d_:sC});function oC(e,t,n=0){return F(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var lC=O({pad3d_:oC});function uC(e,t,n=0){return F(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var dC=O({pad4d_:uC});function pC(e,t,n){let a=M(e,"x","spaceToBatchND");F(a.rank>=1+t.length,()=>`input rank ${a.rank} should be > than [blockShape] ${t.length}`),F(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),F(a.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+n[l-1][0]+n[l-1][1])%t[l-1]==0:i,!0),()=>`input spatial dimensions ${a.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:a},s={blockShape:t,paddings:n};return D.runKernel(Nu,r,s)}var Zu=O({spaceToBatchND_:pC});function fC(e,t,n,a,r,s){r==null&&(r=[1,1]),s==null&&(s=1),a===0&&(a="valid");let i=M(e,"x","maxPool"),o=i,l=!1;i.rank===3&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]])),F(za(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let d=wb(o.shape,t,s,r,a),u=[d.dilationHeight,d.dilationWidth],p;a==="same"?p=hC([d.filterHeight,d.filterWidth],u):p=[[0,0],[0,0]];let c=u[0]===1&&u[1]===1,[h,m]=cC([d.inHeight,d.inWidth],u,p),f=c?a:"valid",A=c?o:Zu(o,u,h),y=(n==="avg"?()=>ju(A,t,s,f):()=>Ku(A,t,s,f))(),g=c?y:Uu(y,u,m);return l?H(g,[g.shape[1],g.shape[2],g.shape[3]]):g}function cC(e,t,n){let a=n.map(u=>u[0]),r=n.map(u=>u[1]),s=e.concat(a,r),i=t.map((u,p)=>(u-s[p]%u)%u),o=r.map((u,p)=>u+i[p]),l=t.map((u,p)=>[a[p],o[p]]),d=t.map((u,p)=>[0,i[p]]);return[l,d]}function hC(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),a=n.map(s=>Math.floor(s/2)),r=n.map((s,i)=>s-a[i]);return n.map((s,i)=>[a[i],r[i]])}var qb=O({pool_:fC});function mC(e,t){let n=M(e,"base","pow"),a=M(t,"exp","pow");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(zs,r)}var sr=O({pow_:mC});function AC(e,t){let n=M(e,"x","prelu"),a=M(t,"alpha","prelu"),r={x:n,alpha:a};return D.runKernel(_s,r)}var Yu=O({prelu_:AC});function yC(e,t=null,n=!1){let a=M(e,"x","prod");a.dtype==="bool"&&(a=Ae(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return D.runKernel(Lo,r,s)}var Cc=O({prod_:yC});function gC(e,t,n){let a=Tt(e),r=null;if(n==null||n==="float32")r=new Float32Array(a);else if(n==="int32")r=new Int32Array(a);else if(n==="bool")r=new Uint8Array(a);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*a*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(n=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}},bC=class{constructor(e,t,n,a){this.alpha=e,this.beta=1/t,this.dtype=n;let r=a||Math.random();this.randu=wA.alea(r.toString()),this.randn=new kA(0,1,n,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,a,r,s;for(;;){do a=this.randn.nextValue(),s=1+this.c*a;while(s<=0);if(s*=s*s,e=a*a,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),r=this.randu(),rthis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=wA.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function wC(e,t,n=1,a="float32",r){if(n==null&&(n=1),a==null&&(a="float32"),a!=="float32"&&a!=="int32")throw new Error(`Unsupported data type ${a}`);let s=new bC(t,n,a,r),i=We(e,a);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),On(t,0)}var FC=O({reverse1d_:MC});function $C(e,t){let n=M(e,"x","reverse");return F(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),On(n,t)}var DC=O({reverse2d_:$C});function OC(e,t){let n=M(e,"x","reverse");return F(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),On(n,t)}var zC=O({reverse3d_:OC});function _C(e,t){let n=M(e,"x","reverse");return F(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),On(n,t)}var PC=O({reverse4d_:_C});function LC(e){let t={x:M(e,"x","round")};return D.runKernel(Vs,t)}var SA=O({round_:LC});function WC(e){let t={x:M(e,"x","rsqrt")};return D.runKernel(js,t)}var Fc=O({rsqrt_:WC});function Ie(e,t){if((tn(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&tn(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Er(e,[],[],t)}function BC(e){let t={x:M(e,"x","selu")};return D.runKernel(Uo,t)}var $c=O({selu_:BC});function VC(e,t,n,a,r,s=[1,1],i="NHWC"){let o=M(e,"x","separableConv2d"),l=M(t,"depthwiseFilter","separableConv2d"),d=M(n,"pointwiseFilter","separableConv2d"),u=o,p=!1;if(o.rank===3&&(p=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");F(u.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`),F(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),F(d.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),F(d.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${d.shape[0]}.`),F(d.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${d.shape[1]}.`);let c=l.shape[2],h=l.shape[3];F(d.shape[2]===c*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${c*h}, but got ${d.shape[2]}.`);let m=hl(u,l,a,r,i,s),f=ar(m,d,1,"valid",i);return p?H(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var NA=O({separableConv2d_:VC});async function jC(e,t){let n=M(e,"x","setdiff1d"),a=M(t,"y","setdiff1d");F(n.dtype===a.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${a.dtype}).`),F(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),F(a.rank===1,()=>`y should be 1D tensor, but got y (${a.shape}).`);let r=await n.data(),s=await a.data(),i=new Set(s),o=0;for(let u=0;u`slice1d expects a rank-1 tensor, but got a rank-${a.rank} tensor`),Me(a,[t],[n])}var zc=O({slice1d_:qC});function XC(e,t,n){let a=M(e,"x","slice2d");return F(a.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var EA=O({slice2d_:XC});function KC(e,t,n){let a=M(e,"x","slice3d");return F(a.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var _c=O({slice3d_:KC});function ZC(e,t,n){let a=M(e,"x","slice4d");return F(a.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var Qu=O({slice4d_:ZC});function YC(e,t=-1){let n=M(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let a={logits:n},r={dim:t};return D.runKernel(Xs,a,r)}var ed=O({softmax_:YC});function JC(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return D.runKernel(Bp,t)}var td=O({fft_:JC});function QC(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return D.runKernel(Vp,t)}var xl=O({ifft_:QC});function eR(e){let t=e.shape[e.shape.length-1],n=e.size/t,a;if(t<=2){let r=H(e,[n,t]);a=xl(r)}else{let r=[n,2*(t-1)],s=H(Ju(e),[n,t]),i=H(wc(e),[n,t]),o=On(Me(s,[0,1],[n,t-2]),1),l=B(On(Me(i,[0,1],[n,t-2]),1),Ie(-1)),d=ot([s,o],1),u=ot([i,l],1),p=H(Tr(d,u),[r[0],r[1]]);a=xl(p)}if(a=Ju(a),e.rank===3&&e.shape[0]!==0){let r=a,s=e.shape[0];a=H(a,[s,a.shape[0]/s,a.shape[1]]),r.dispose()}return a}var Pc=O({irfft_:eR});function tR(e,t,n=0){let a={x:M(e,"x","split")},r={numOrSizeSplits:t,axis:n};return D.runKernel(Ko,a,r)}var ln=O({split_:tR});function nR(e,t){F(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],a=e.size/n,r;if(t!=null&&t0),f=e.shape.map(A=>A);f[e.shape.length-1]=t,r=Me(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,r=ot([e,Ct(m)],e.shape.length-1),n=t}else r=e;let s=Ue(r),i=H(Tr(r,s),[a,n]),o=td(i),l=Math.floor(n/2)+1,d=Ju(o),u=wc(o),p=ln(d,[l,n-l],d.shape.length-1),c=ln(u,[l,n-l],u.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=l,H(Tr(p[0],c[0]),h)}var nd=O({rfft_:nR});function aR(e){let t={x:M(e,"x","sqrt")};return D.runKernel(Gs,t)}var Jt=O({sqrt_:aR});function rR(e,t){let n=M(e,"a","squaredDifference"),a=M(t,"b","squaredDifference");[n,a]=vt(n,a),ct(n.shape,a.shape);let r={a:n,b:a},s={};return D.runKernel(Ks,r,s)}var Lc=O({squaredDifference_:rR});function sR(e,t){let n=M(e,"x","squeeze");return H(n,mx(n.shape,t).newShape)}var Or=O({squeeze_:sR});function iR(e,t=0){let n=Pu(e,"tensors","stack","string_or_numeric");F(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&F(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let a=n,r={axis:t};return D.runKernel(Po,a,r)}var zn=O({stack_:iR});function oR(e,t=0){let n={x:M(e,"x","step")},a={alpha:t};return D.runKernel(Nr,n,a)}var bl=O({step_:oR});function lR(e,t,n,a,r=0,s=0,i=0,o=0,l=0){let d={x:M(e,"x","stridedSlice")},u={begin:t,end:n,strides:a,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return D.runKernel(Zo,d,u)}var CA=O({stridedSlice_:lR});function uR(e){let t={x:M(e,"x","tan")};return D.runKernel(Ys,t)}var RA=O({tan_:uR});function nn(e,t){rs(e);let n=Da(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Er(e,null,n,t)}function Kn(e,t,n){if(rs(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let a=Da(e,n);if(a.length!==2&&a.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Er(e,t,a,n)}function dR(e,t,n){if(rs(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let a=Da(e,n);if(a.length!==4&&a.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}function pR(e,t,n){if(rs(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let a=Da(e,n);if(a.length!==5&&a.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}function cR(e,t,n){if(rs(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let a=Da(e,n);if(a.length!==6&&a.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||a,Er(e,t,a,n)}function hR(e,t=1,n=!0){let a=M(e,"x","topk");if(a.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let r=a.shape[a.shape.length-1];if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:a},i={k:t,sorted:n},[o,l]=D.runKernel(Yo,s,i);return{values:o,indices:l}}var MA=O({topk_:hR});function fR(e,t=0,n=1,a,r){if(a!=null&&a==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new kA(t,n,a,!0,r),i=We(e,a);for(let o=0;o0,()=>"The input tensor must be at least 1D");let a={x:n},r={axis:t},[s,i]=D.runKernel(nc,a,r);return{values:s,indices:i}}var Bc=O({unique_:mR});function AR(e,t,n){let a=M(e,"x","unsortedSegmentSum"),r=M(t,"segmentIds","unsortedSegmentSum","int32");F(Vt(n),()=>"numSegments must be of dtype int");let s={x:a,segmentIds:r},i={numSegments:n};return D.runKernel(Eu,s,i)}var FA=O({unsortedSegmentSum_:AR});function yR(e,t=0){let n=M(e,"x","unstack","string_or_numeric");F(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let a={value:n},r={axis:t};return D.runKernel(Jo,a,r)}var ua=O({unstack_:yR});function Zb(e,t=!0,n,a){return D.makeVariable(e,t,n,a)}function Yb(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),rn(o.slice(s,s+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let f=s;f"Shape mismatch in v and x");let l=Ie(1),d=ye(l,o),u=B(ye(i,s),d);if(r){F(a!=null,()=>"When using zeroDebias: true, step is required.");let p=M(a,"step","movingAverage");u=ge(u,ye(l,sr(o,p)))}return se(s,u)}var kR=O({movingAverage_:wR});function IR(e,t,n){let a=M(e,"indices","scatterND","int32"),r=M(t,"updates","scatterND");Vm(r,a,n);let s={indices:a,updates:r},i={shape:n};return D.runKernel(Vo,s,i)}var Qb=O({scatterND_:IR});function SR(e,t,n,a){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let r=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==a.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function NR(e,t,n,a=0){let r=M(e,"sparseIndices","sparseToDense","int32"),s=M(t,"sparseValues","sparseToDense"),i=M(a,"defaultValue","sparseToDense",s.dtype);SR(r,s,n,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},l={outputShape:n};return D.runKernel(ec,o,l)}var DA=O({sparseToDense_:NR});function TR(e,t){let n=M(t,"indices","gatherND","int32"),a={params:M(e,"x","gatherND"),indices:n};return D.runKernel(wo,a)}var e3=O({gatherND_:TR});function ER(e,t){if(t==null)return e.shape.slice();if(er(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let a=0;a`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`),F(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Le?r.clone():r;let s=ER(r,n),i=1-t,o=ge(ml(se(gl(s,0,1,"float32",a),i)),i);return B(r,o)}var t3=O({dropout_:CR});function n3(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function OA(e,t,n){let a=1-e%2,r=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${a.rank}`),F(a.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${a.rank} and targets rank ${r.rank}`),rn(a.shape.slice(0,a.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=a.shape[a.shape.length-1];F(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await a.data(),o=await r.data(),[l,d]=[i.length/s,s],u=Ax("bool",l);for(let p=0;pA.value-f.value),u[p]=0;for(let f=0;fFR,depthwiseConv2d:()=>$R,matMul:()=>DR});function OR(e,t,n,a,r,s="NHWC",i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]])),F(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),F(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),F(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let d=s==="NHWC"?o.shape[3]:o.shape[1],u=s==="NHWC"?l.shape[3]:l.shape[1];F(d===n[2],()=>`Error in conv2dDerFilter: depth of input ${d}) must match input depth in filter (${n[2]}.`),F(u===n[3],()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`),i!=null&&F(Vt(r),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let p={x:o,dy:l},c={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:n};return D.runKernel(Rp,p,c)}var zA=O({conv2DBackpropFilter_:OR});function jc(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,bl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Uc(e,t){let n=t,a=zt(e.shape,t.shape);return a.length>0&&(n=Te(n,a)),H(n,e.shape)}function Hc(e,t,n,a){if(t==="linear")return e;if(t==="relu")return La(e);if(t==="elu")return fl(e);if(t==="relu6")return Mc(e);if(t==="prelu")return Yu(e,n);if(t==="leakyrelu")return qu(e,a);if(t==="sigmoid")return wn(e);throw new Error(`Unknown fused activation ${t}.`)}var Gc=(e,t)=>!(e>0)||t==="linear";function zR({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:d,leakyreluAlpha:u}){if(l=l||"linear",Gc(D.state.gradientDepth,l)===!1){let b=ar(e,t,n,a,r,s,i);return o!=null&&(b=se(b,o)),Hc(b,l,d,u)}let p=M(e,"x","conv2d"),c=M(t,"filter","conv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=H(p,[1,p.shape[0],p.shape[1],p.shape[2]])),F(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),F(c.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${c.rank}.`),i!=null&&F(Vt(a),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),F(h.shape[3]===c.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${c.shape[2]}.`),F(za(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),F(r==="NHWC",()=>`Error in conv2d: got dataFormat of ${r} but only NHWC is currently supported.`);let f=Vu(h.shape,c.shape,n,s,a,i),A;o!=null&&(A=M(o,"bias","fused conv2d"),[A]=vt(A,p),ct(f.outShape,A.shape));let y;d!=null&&(y=M(d,"prelu weights","fused conv2d"));let g=(b,v)=>{let[I,T,R,$]=v,z=jc(b,R,l);F(Mr(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let _=iA(T.shape,z,I,n,a),V=zA(T,z,I.shape,n,a),j=[_,V];if($!=null){let U=Uc($,z);j.push(U)}return j},x={x:h,filter:c,bias:A,preluActivationWeights:y},k={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?_a((b,v,I)=>{let T=D.runKernel(ti,x,k);return I([v,b,T]),m&&(T=H(T,[T.shape[1],T.shape[2],T.shape[3]])),{value:T,gradFunc:g}})(h,c):_a((b,v,I,T)=>{let R=D.runKernel(ti,x,k);return T([v,b,R,I]),m&&(R=H(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:g}})(h,c,A)}var FR=O({fusedConv2d_:zR});function _R(e,t,n,a,r,s=[1,1],i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={x:o,dy:l},u={strides:a,pad:r,dimRoundingMode:i,dilations:s,filterShape:n};return D.runKernel(Dp,d,u)}var a3=O({depthwiseConv2dNativeBackpropFilter_:_R});function PR(e,t,n,a,r,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={dy:o,filter:n},u={strides:a,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},p=D.runKernel(Op,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var r3=O({depthwiseConv2dNativeBackpropInput_:PR});function LR({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:d,leakyreluAlpha:u}){if(Gc(D.state.gradientDepth,l)===!1){let b=hl(e,t,n,a,r,s,i);return o!=null&&(b=se(b,o)),Hc(b,l,d,u)}let p=M(e,"x","depthwiseConv2d"),c=M(t,"filter","depthwiseConv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=H(p,[1,p.shape[0],p.shape[1],p.shape[2]])),F(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),F(c.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${c.rank}.`),F(h.shape[3]===c.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),s==null&&(s=[1,1]),F(za(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&F(Vt(a),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${a}.`);let f=Vu(h.shape,c.shape,n,s,a,i,!0),A;o!=null&&(A=M(o,"bias","fused conv2d"),[A]=vt(A,p),ct(f.outShape,A.shape));let y;d!=null&&(y=M(d,"prelu weights","fused depthwiseConv2d"));let g=(b,v)=>{F(Mr(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[I,T,R,$]=v,z=jc(b,R,l),_=r3(T.shape,z,I,n,a,s,i),V=a3(T,z,I.shape,n,a,s,i);if($!=null){let j=Uc(A,z);return[_,V,j]}return[_,V]},x={x:h,filter:c,bias:A,preluActivationWeights:y},k={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?_a((b,v,I)=>{let T=D.runKernel(ni,x,k);return I([v,b,T]),m&&(T=H(T,[T.shape[1],T.shape[2],T.shape[3]])),{value:T,gradFunc:g}})(h,c):_a((b,v,I,T)=>{let R=D.runKernel(ni,x,k);return T([v,b,R,I]),m&&(R=H(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:g}})(h,c,A)}var $R=O({fusedDepthwiseConv2d_:LR});function WR({a:e,b:t,transposeA:n=!1,transposeB:a=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(Gc(D.state.gradientDepth,s)===!1){let $=Be(e,t,n,a);return r!=null&&($=se($,r)),Hc($,s,i,o)}let l=M(e,"a","fused matMul"),d=M(t,"b","fused matMul");[l,d]=vt(l,d);let u=n?l.shape[l.rank-2]:l.shape[l.rank-1],p=a?d.shape[d.rank-1]:d.shape[d.rank-2],c=n?l.shape[l.rank-1]:l.shape[l.rank-2],h=a?d.shape[d.rank-2]:d.shape[d.rank-1],m=l.shape.slice(0,-2),f=d.shape.slice(0,-2),A=Tt(m),y=Tt(f);F(l.rank>=2&&d.rank>=2&&l.rank===d.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${l.rank} and ${d.rank}.`),F(er(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${l.shape} and ${d.shape} must match.`),F(u===p,()=>`Error in fused matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${l.shape} and ${d.shape} and transposeA=${n} and transposeB=${a} must match.`);let g=l.shape.slice(0,-2).concat([c,h]),x=n?H(l,[A,u,c]):H(l,[A,c,u]),k=a?H(d,[y,h,p]):H(d,[y,p,h]),b;r!=null&&(b=M(r,"bias","fused matMul"),[b]=vt(b,l),ct(g,b.shape));let v;i!=null&&(v=M(i,"prelu weights","fused matMul"));let I=($,z)=>{let[_,V,j,U]=z,X=jc(H($,j.shape),j,s),G,ee;if(!n&&!a?(G=Be(X,V,!1,!0),ee=Be(_,X,!0,!1)):!n&&a?(G=Be(X,V,!1,!1),ee=Be(X,_,!0,!1)):n&&!a?(G=Be(V,X,!1,!0),ee=Be(_,X,!1,!1)):(G=Be(V,X,!0,!0),ee=Be(X,_,!0,!0)),r!=null){let Y=Uc(U,X);return[G,ee,Y]}else return[G,ee]},T={a:x,b:k,bias:b,preluActivationWeights:v},R={transposeA:n,transposeB:a,activation:s,leakyreluAlpha:o};return r==null?_a(($,z,_)=>{let V=D.runKernel(ei,T,R);return _([$,z,V]),{value:H(V,g),gradFunc:I}})(x,k):_a(($,z,_,V)=>{let j=D.runKernel(ei,T,R);return V([$,z,j,_]),{value:H(j,g),gradFunc:I}})(x,k,b)}var DR=O({fusedMatMul_:WR});function BR(e){return OA(e,.54,.46)}var VR=O({hammingWindow_:BR});function jR(e){return OA(e,.5,.5)}var s3=O({hannWindow_:jR});function UR(e,t,n,a=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Me(e,s,t)),s+=n;if(a)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),F(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${d},4] but had shape ${o.shape}.`),F(l.rank===1&&l.shape[0]===d,()=>`Error in cropAndResize: boxInd must be have size [${d}] but had shape ${o.shape}.`),F(a.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${a.length}.`),F(a[0]>=1&&a[1]>=1,()=>`cropSize must be atleast [1,1], but was ${a}`),F(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let u={image:i,boxes:o,boxInd:l},p={method:r,extrapolationValue:s,cropSize:a};return D.runKernel(ho,u,p)}var XR=O({cropAndResize_:qR});function KR(e){let t=M(e,"image","flipLeftRight","float32");F(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return D.runKernel(bo,n,{})}var ZR=O({flipLeftRight_:KR});function YR(e,t,n=0,a=.5){let r=M(e,"image","rotateWithOffset","float32");F(r.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);let s={image:r},i={radians:t,fillValue:n,center:a};return D.runKernel(el,s,i)}var JR=O({rotateWithOffset_:YR});function vl(e,t,n,a,r,s){a==null&&(a=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),F(0<=a&&a<=1,()=>`iouThreshold must be in [0, 1], but was '${a}'`),F(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),F(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),F(t.rank===1,()=>"scores must be a 1D tensor"),F(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),F(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s}}function QR(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppression"),i=M(t,"scores","nonMaxSuppression"),o=vl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l={maxOutputSize:n,iouThreshold:a,scoreThreshold:r};return D.runKernel(Do,{boxes:s,scores:i},l)}var eM=O({nonMaxSuppression_:QR});function nM(e,t,n){let a=tM(e,t,n),r=a<0?-(a+1):a;e.splice(r,0,t)}function tM(e,t,n){return rM(e,t,n||aM)}function aM(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?a=s+1:(r=s,i=!o)}return i?a:-a-1}function o3(e,t,n,a,r){return _A(e,t,n,a,r,0)}function l3(e,t,n,a,r,s){return _A(e,t,n,a,r,0,!1,s,!0)}function u3(e,t,n,a,r,s){return _A(e,t,n,a,r,s,!0)}function _A(e,t,n,a,r,s,i=!1,o=!1,l=!1){let d=[];for(let A=0;Ar&&d.push({score:t[A],boxIndex:A,suppressBeginIndex:0});d.sort(d3);let u=s>0?-.5/s:0,p=[],c=[];for(;p.length0;){let A=d.pop(),{score:y,boxIndex:g,suppressBeginIndex:x}=A;if(y=x;--b){let v=sM(e,g,p[b]);if(v>=a){k=!0;break}if(A.score=A.score*iM(a,u,v),A.score<=r)break}A.suppressBeginIndex=p.length,k||(A.score===y?(p.push(g),c.push(A.score)):A.score>r&&nM(d,A,d3))}let h=p.length,m=n-h;o&&m>0&&(p.push(...new Array(m).fill(0)),c.push(...new Array(m).fill(0)));let f={selectedIndices:p};return i&&(f.selectedScores=c),l&&(f.validOutputs=h),f}function sM(e,t,n){let a=e.subarray(t*4,t*4+4),r=e.subarray(n*4,n*4+4),s=Math.min(a[0],a[2]),i=Math.min(a[1],a[3]),o=Math.max(a[0],a[2]),l=Math.max(a[1],a[3]),d=Math.min(r[0],r[2]),u=Math.min(r[1],r[3]),p=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),h=(o-s)*(l-i),m=(p-d)*(c-u);if(h<=0||m<=0)return 0;let f=Math.max(s,d),A=Math.max(i,u),y=Math.min(o,p),g=Math.min(l,c),x=Math.max(y-f,0)*Math.max(g-A,0);return x/(h+m-x)}function iM(e,t,n){let a=Math.exp(t*n*n);return n<=e?a:0}function d3(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function oM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppressionAsync"),i=M(t,"scores","nonMaxSuppressionAsync"),o=vl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),d=l[0],u=l[1],{selectedIndices:p}=o3(d,u,n,a,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),nn(p,"int32")}var lM=oM;function uM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=vl(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let d={boxes:i,scores:o},u={maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s},p=D.runKernel(zo,d,u);return{selectedIndices:p[0],selectedScores:p[1]}}var dM=O({nonMaxSuppressionWithScore_:uM});async function pM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=vl(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let d=await Promise.all([i.data(),o.data()]),u=d[0],p=d[1],{selectedIndices:c,selectedScores:h}=u3(u,p,n,a,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(c,"int32"),selectedScores:nn(h)}}var cM=pM;function hM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=vl(i,o,n,a,r,null),d=l.maxOutputSize,u=l.iouThreshold,p=l.scoreThreshold,c={boxes:i,scores:o},h={maxOutputSize:d,iouThreshold:u,scoreThreshold:p,padToMaxOutputSize:s},m=D.runKernel(Oo,c,h);return{selectedIndices:m[0],validOutputs:m[1]}}var fM=O({nonMaxSuppressionPadded_:hM});async function mM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=vl(i,o,n,a,r,null),d=l.maxOutputSize,u=l.iouThreshold,p=l.scoreThreshold,[c,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=l3(c,h,d,u,p,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(m,"int32"),validOutputs:Ie(f,"int32")}}var AM=mM;function yM(e,t,n=!1,a=!1){let r=M(e,"images","resizeBilinear");F(r.rank===3||r.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`),F(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),F(a===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=H(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},d=D.runKernel(Ls,o,l);return i?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var p3=O({resizeBilinear_:yM});function gM(e,t,n=!1,a=!1){let r=M(e,"images","resizeNearestNeighbor");F(r.rank===3||r.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`),F(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),F(r.dtype==="float32"||r.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),F(a===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=H(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},d=D.runKernel(Su,o,l);return i?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var c3=O({resizeNearestNeighbor_:gM});function xM(e,t,n="nearest",a="constant",r=0,s){let i=M(e,"image","transform","float32"),o=M(t,"transforms","transform","float32");F(i.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${i.rank}.`),F(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),F(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},d={interpolation:n,fillMode:a,fillValue:r,outputShape:s};return D.runKernel(tc,l,d)}var bM=O({transform_:xM});function vM(e,t,n){F(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),F(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let a=M(e,"a","bandPart");F(a.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${a.rank}.`);let r=a.shape,[s,i]=a.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=H(Rc(0,s,1,"int32"),[-1,1]),l=Rc(0,i,1,"int32"),d=ye(o,l),u=la(hi(d,Ie(+t,"int32")),Dr(d,Ie(-n,"int32"))),p=Ct([s,i],a.dtype);return H(zn(ua(H(a,[-1,s,i])).map(c=>In(u,c,p))),r)}var wM=O({bandPart_:vM});function kM(e){let t;if(Array.isArray(e)){t=!1,F(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let r=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${r})`)}else t=!0,e=ln(e,e.shape[0],0).map(r=>Or(r,[0]));F(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],a=e;for(let r=0;r{let s=a[r];if(r>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return h3(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((l,d)=>l*d),a=ua(H(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];a.forEach(l=>{let[d,u]=h3(l,t);r.push(d),s.push(u)});let i=H(zn(r,0),e.shape),o=H(zn(s,0),e.shape);return[i,o]}}function h3(e,t=!1){return D.tidy(()=>{F(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],a=e.shape[1],r=hA(n),s=Oa(e),i=Kn([[1]],[1,1]),o=Oa(i),l=n>=a?a:n;for(let d=0;d{let h=Me(s,[d,d],[n-d,1]),m=Vc(h),f=Me(s,[d,d],[1,1]),A=In(oa(f,0),Kn([[-1]]),Kn([[1]])),y=ye(f,B(A,m)),g=ge(h,y);g.shape[0]===1?o=Oa(i):o=ot([i,Me(g,[1,0],[g.shape[0]-1,g.shape[1]])],0);let x=wt(ge(Be(A,y),m)),k=Me(s,[d,0],[n-d,a]),b=B(x,o),v=Ze(o);if(d===0)s=ye(k,Be(b,Be(v,k)));else{let R=ye(k,Be(b,Be(v,k)));s=ot([Me(s,[0,0],[d,a]),R],0)}let I=Ze(b),T=Me(r,[0,d],[n,r.shape[1]-d]);if(d===0)r=ye(T,Be(Be(T,o),I));else{let R=ye(T,Be(Be(T,o),I));r=ot([Me(r,[0,0],[n,d]),R],1)}return[o,s,r]}),Ee([u,p,c])}return!t&&n>a&&(r=Me(r,[0,0],[n,a]),s=Me(s,[0,0],[a,a])),[r,s]})}var NM=O({qr_:SM}),un;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(un||(un={}));function TM(e,t,n=un.SUM_BY_NONZERO_WEIGHTS){let a=M(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=M(t,"weights","computeWeightedLoss"));let s=r==null?a:B(a,r);if(n===un.NONE)return s;if(n===un.SUM)return Te(s);if(n===un.MEAN){if(r==null)return kt(s);{let i=a.size/r.size,o=ge(Te(s),Te(r));return i>1?ge(o,Ie(i)):o}}if(n===un.SUM_BY_NONZERO_WEIGHTS){if(r==null)return ge(Te(s),Ie(a.size));{let i=B(r,$n(a.shape)),o=Ae(Te(Ai(i,Ie(0))),"float32");return ge(Te(s),o)}}throw Error(`Unknown reduction: ${n}`)}var ir=O({computeWeightedLoss_:TM});function EM(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","absoluteDifference"),s=M(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=M(n,"weights","absoluteDifference")),rn(r.shape,s.shape,"Error in absoluteDifference: ");let o=Ot(ye(r,s));return ir(o,i,a)}var CM=O({absoluteDifference_:EM});function RM(e,t,n,a,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","cosineDistance"),i=M(t,"predictions","cosineDistance"),o=null;a!=null&&(o=M(a,"weights","cosineDistance")),rn(s.shape,i.shape,"Error in cosineDistance: ");let l=Ie(1),d=ye(l,Te(B(s,i),n,!0));return ir(d,o,r)}var MM=O({cosineDistance_:RM});function FM(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","hingeLoss"),s=M(t,"predictions","hingeLoss"),i=null;n!=null&&(i=M(n,"weights","hingeLoss")),rn(r.shape,s.shape,"Error in hingeLoss: ");let o=Ie(1);r=ye(B(Ie(2),r),o);let l=La(ye(o,B(r,s)));return ir(l,i,a)}var $M=O({hingeLoss_:FM});function DM(e,t,n,a=1,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","huberLoss"),i=M(t,"predictions","huberLoss"),o=null;n!=null&&(o=M(n,"weights","huberLoss")),rn(s.shape,i.shape,"Error in huberLoss: ");let l=Ie(a),d=Ot(ye(i,s)),u=yl(d,l),p=ye(d,u),c=se(B(Ie(.5),st(u)),B(l,p));return ir(c,o,r)}var OM=O({huberLoss_:DM});function zM(e,t,n,a=1e-7,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","logLoss"),i=M(t,"predictions","logLoss"),o=null;n!=null&&(o=M(n,"weights","logLoss")),rn(s.shape,i.shape,"Error in logLoss: ");let l=Ie(1),d=Ie(a),u=wt(B(s,Fn(se(i,d)))),p=B(ye(l,s),Fn(se(ye(l,i),d))),c=ye(u,p);return ir(c,o,r)}var _M=O({logLoss_:zM});function PM(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","meanSquaredError"),s=M(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=M(n,"weights","meanSquaredError")),rn(r.shape,s.shape,"Error in meanSquaredError: ");let o=Lc(r,s);return ir(o,i,a)}var LM=O({meanSquaredError_:PM});function WM(e,t){let n=M(e,"labels","sigmoidCrossEntropyWithLogits"),a=M(t,"logits","sigmoidCrossEntropyWithLogits");rn(n.shape,a.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=La(a),s=B(a,n),i=Ic(qn(wt(Ot(a))));return se(ye(r,s),i)}function BM(e,t,n,a=0,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"multiClassLabels","sigmoidCrossEntropy"),i=M(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","sigmoidCrossEntropy")),rn(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),a>0){let d=Ie(a),u=Ie(1),p=Ie(.5);s=se(B(s,ye(u,d)),B(p,d))}let l=WM(s,i);return ir(l,o,r)}var VM=O({sigmoidCrossEntropy_:BM});function jM(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return _a((a,r,s)=>{let i=gA(r,[n],!0),o=ye(Ae(r,"float32"),i);s([a,o]);let l=wt(B(o,a));return{value:Te(l,[n]),gradFunc:(d,u)=>{let[p,c]=u,h=mi(d.shape,[n]);return[B(H(d,h),ye(Ae(p,"float32"),qn(c))),B(H(d,h),ye(qn(c),Ae(p,"float32")))]}}})(e,t)}function UM(e,t,n,a=0,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"onehotLabels","softmaxCrossEntropy"),i=M(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","softmaxCrossEntropy")),rn(s.shape,i.shape,"Error in softmaxCrossEntropy: "),a>0){let d=Ie(a),u=Ie(1),p=Ie(s.shape[1]);s=se(B(s,ye(u,d)),ge(d,p))}let l=jM(s,i);return ir(l,o,r)}var HM=O({softmaxCrossEntropy_:UM});function GM(e,t,n){let a=M(e,"inputIndices","sparseReshape"),r=M(t,"inputShape","sparseReshape"),s=M(n,"newShape","sparseReshape");if(a.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape + ${a.shape}`);if(r.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:a,inputShape:r,newShape:s},o=D.runKernel(Qp,i);return{outputIndices:o[0],outputShape:o[1]}}var qM=O({sparseReshape_:GM}),XM={fft:td,ifft:xl,rfft:nd,irfft:Pc},KM={hammingWindow:VR,hannWindow:s3,frame:i3,stft:GR},Ye={flipLeftRight:ZR,resizeNearestNeighbor:c3,resizeBilinear:p3,rotateWithOffset:JR,cropAndResize:XR,nonMaxSuppression:eM,nonMaxSuppressionAsync:lM,nonMaxSuppressionWithScore:dM,nonMaxSuppressionWithScoreAsync:cM,nonMaxSuppressionPadded:fM,nonMaxSuppressionPaddedAsync:AM,transform:bM},f3={bandPart:wM,gramSchmidt:IM,qr:NM},ZM={absoluteDifference:CM,computeWeightedLoss:ir,cosineDistance:MM,hingeLoss:$M,huberLoss:OM,logLoss:_M,meanSquaredError:LM,sigmoidCrossEntropy:VM,softmaxCrossEntropy:HM},m3={sparseReshape:qM},or=class extends Ab{minimize(e,t=!1,n){let{value:a,grads:r}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return Ee(r),t?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Lb(e,t)}dispose(){this.iterations_!=null&&Ee(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:Ie(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}};Object.defineProperty(or,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var qc=class extends or{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t],r=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:L(()=>Ue(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;L(()=>{let l=se(B(i,this.rho),B(st(s),1-this.rho)),d=B(ge(Jt(se(o,this.epsilon)),Jt(se(i,this.epsilon))),s),u=se(B(o,this.rho),B(st(d),1-this.rho));i.assign(l),o.assign(u);let p=se(B(d,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Ee(this.accumulatedGrads.map(e=>e.variable)),Ee(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};qc.className="Adadelta";Rr(qc);var Xc=class extends or{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:L(()=>Gu(a.shape,this.initialAccumulatorValue).variable(i))}}let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[n].variable;L(()=>{let i=se(s,st(r));s.assign(i);let o=se(B(ge(r,Jt(se(i,D.backend.epsilon()))),-this.learningRate),a);a.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Ee(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};Xc.className="Adagrad";Rr(Xc);var Kc=class extends or{constructor(e,t,n,a=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],L(()=>{this.accBeta1=Ie(t).variable(),this.accBeta2=Ie(n).variable()}),a==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),a=ye(1,this.accBeta2);t.forEach((r,s)=>{let i=D.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:L(()=>Ue(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:L(()=>Ue(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let d=this.accumulatedFirstMoment[s].variable,u=this.accumulatedSecondMoment[s].variable,p=se(B(d,this.beta1),B(l,1-this.beta1)),c=se(B(u,this.beta2),B(st(l),1-this.beta2)),h=ge(p,n),m=ge(c,a);d.assign(p),u.assign(c);let f=se(B(ge(h,se(Jt(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Ee(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Ee(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e),L(()=>{this.accBeta1.assign(sr(this.beta1,this.iterations_+1)),this.accBeta2.assign(sr(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}};Kc.className="Adam";Rr(Kc);var Zc=class extends or{constructor(e,t,n,a=null,r=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],L(()=>{this.iteration=Ie(0).variable(),this.accBeta1=Ie(t).variable()}),a==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),a=ge(-this.learningRate,se(B(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=D.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Ue(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:Ue(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let d=this.accumulatedFirstMoment[s].variable,u=this.accumulatedWeightedInfNorm[s].variable,p=se(B(d,this.beta1),B(l,1-this.beta1)),c=B(u,this.beta2),h=Ot(l),m=Pa(c,h);d.assign(p),u.assign(m);let f=se(B(ge(a,n),ge(p,se(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(se(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Ee(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Ee(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}};Zc.className="Adamax";Rr(Zc);var ad=class extends or{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let r=D.registeredVariables[t];L(()=>{let s=se(B(this.c,a),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=jt(Ie(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}};ad.className="SGD";Rr(ad);var Yc=class extends ad{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=Ie(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(a).variable(i))}}let r=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&L(()=>{let i,o=se(B(this.m,r),s);this.useNesterov?i=se(B(this.c,se(s,B(o,this.m))),a):i=se(B(this.c,o),a),r.assign(o),a.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Ee(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}};Yc.className="Momentum";Rr(Yc);var Jc=class extends or{constructor(e,t=.9,n=0,a=null,r=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,a==null&&(this.epsilon=D.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t],r=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:L(()=>Ue(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;L(()=>{let l=se(B(i,this.decay),B(st(s),1-this.decay));if(this.centered){let d=this.accumulatedMeanGrads[n].variable,u=se(B(d,this.decay),B(s,1-this.decay)),p=ge(B(s,this.learningRate),Jt(ye(l,se(st(u),this.epsilon)))),c=se(B(o,this.momentum),p);i.assign(l),d.assign(u),o.assign(c);let h=ye(a,c);a.assign(h)}else{let d=se(B(i,this.decay),B(st(s),1-this.decay)),u=se(B(o,this.momentum),ge(B(s,this.learningRate),Jt(se(d,this.epsilon))));i.assign(d),o.assign(u);let p=ye(a,u);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Ee(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Ee(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Ee(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}};Jc.className="RMSProp";Rr(Jc);var yi=class{static sgd(e){return new ad(e)}static momentum(e,t,n=!1){return new Yc(e,t,n)}static rmsprop(e,t=.9,n=0,a=null,r=!1){return new Jc(e,t,n,a,r)}static adam(e=.001,t=.9,n=.999,a=null){return new Kc(e,t,n,a)}static adadelta(e=.001,t=.95,n=null){return new qc(e,t,n)}static adamax(e=.002,t=.9,n=.999,a=null,r=0){return new Zc(e,t,n,a,r)}static adagrad(e,t=.1){return new Xc(e,t)}},gi={sgd:yi.sgd,momentum:yi.momentum,adadelta:yi.adadelta,adagrad:yi.adagrad,rmsprop:yi.rmsprop,adamax:yi.adamax,adam:yi.adam},YM=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Qc(){return new Promise(e=>YM(()=>e()))}var C={};Fe(C,{ERF_A1:()=>lF,ERF_A2:()=>uF,ERF_A3:()=>dF,ERF_A4:()=>pF,ERF_A5:()=>cF,ERF_P:()=>oF,PARALLELIZE_THRESHOLD:()=>PA,SELU_SCALE:()=>y3,SELU_SCALEALPHA:()=>A3,applyActivation:()=>Hc,assertAndGetBroadcastShape:()=>ct,assertAxesAreInnerMostDims:()=>RE,assertParamsConsistent:()=>JM,assignToTypedArray:()=>bF,axesAreInnerMostDims:()=>AA,calculateShapes:()=>rb,checkEinsumDimSizes:()=>SF,combineLocations:()=>Bb,complexWithEvenIndex:()=>yF,complexWithOddIndex:()=>gF,computeConv2DInfo:()=>Vu,computeConv3DInfo:()=>kb,computeDefaultPad:()=>aA,computeDilation2DInfo:()=>eT,computeOptimalWindowSize:()=>eF,computeOutAndReduceShapes:()=>Vb,computeOutShape:()=>QM,computePool2DInfo:()=>wb,computePool3DInfo:()=>tT,convertConv2DDataFormat:()=>vb,decodeEinsumEquation:()=>kF,eitherStridesOrDilationsAreOne:()=>za,expandShapeToKeepDim:()=>mi,exponent:()=>wF,exponents:()=>vF,fromStringArrayToUint8:()=>RF,fromUint8ToStringArray:()=>CF,getAxesPermutation:()=>jb,getBroadcastDims:()=>HT,getComplexWithIndex:()=>xF,getEinsumComputePath:()=>NF,getEinsumPermutation:()=>IF,getFusedBiasGradient:()=>Uc,getFusedDyActivation:()=>jc,getImageCenter:()=>tF,getInnerMostAxes:()=>ME,getPermuted:()=>aF,getReductionAxes:()=>zt,getReshaped:()=>nF,getReshapedPermuted:()=>rF,getSliceBeginCoords:()=>sF,getSliceSize:()=>iF,getUndoAxesPermutation:()=>yA,isIdentityPermutation:()=>TF,log:()=>fF,mergeRealAndImagArrays:()=>mF,prepareAndValidate:()=>ab,prepareSplitSize:()=>EF,segment_util:()=>g3,shouldFuse:()=>Gc,slice_util:()=>sn,splitRealAndImagArrays:()=>AF,tupleValuesAreOne:()=>Mr,upcastType:()=>ia,validateInput:()=>Vm,validateUpdateShape:()=>Bm,warn:()=>hF});function JM(e,t){let n=e[0].length;e.forEach((r,s)=>{F(r.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),F(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let a=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${a}) along the non-concatenated axis ${s}.`)})}function QM(e,t){let n=e[0].slice();for(let a=1;a=t*2+1||i%2==1?s.push(i):r.push(i);a.push(...r),a.push(0),a.push(...s)}return a}function rF(e,t,n,a=!0){let r=[];a?r.push(e[0]/n):r.push(e[0]*n);for(let s=1;s/g,x3=",",b3="...";function kF(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(MF,"").length)/LA.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${LA}").`);let[a,r]=e.split(LA);F(a.indexOf(b3)===-1,()=>`The ellipsis notation ("${b3}") is not supported yet.`);let s=a.split(x3),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let c=0;cm.indexOf(h)!==-1))throw new Error(`Output subscripts contain the label ${h} not present in the input subscripts.`);o.indexOf(h)===-1&&o.push(h)}for(let c=0;cr!==-1),{permutationIndices:n,expandDims:a}}function SF(e,t,n){let a=new Array(e);for(let r=0;r`Expected dimension ${a[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function NF(e,t){let n=e,a=[],r=0;e.length===0&&n.push(-1),r=e.length+1;for(let i=0;it===n)}function FF(e,t){let n=[];for(let a=0;a"Number of splits must evenly divide the axis."),a=new Array(t).fill(e.shape[n]/t);else{let r=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);F(r<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,l)=>l>0?o+l:o);t[s]=e.shape[n]-i}F(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),a=t}return a}var g3={};Fe(g3,{collectGatherOpShapeInfo:()=>OF,computeOutShape:()=>DF,segOpComputeOptimalWindowSize:()=>$F});function $F(e,t){let n=!1,a;for(e<=PA?(a=e,n=!0):a=Ip(e,Math.floor(Math.sqrt(e)));!n;)a>t||a===e?n=!0:a=Ip(e,a+1);return a}function DF(e,t,n){let a=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${a}`);if(a<0&&(a+=r),a>s)throw new Error(`batchDims (${a}) must be less than rank(x) ( + ${s}).`);if(nic(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function RF(e){return e.map(t=>Mu(t))}var Wa={};Fe(Wa,{nonMaxSuppressionV3Impl:()=>o3,nonMaxSuppressionV4Impl:()=>l3,nonMaxSuppressionV5Impl:()=>u3,whereImpl:()=>Yb});function ve(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&w.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var zF=Wa.whereImpl,eh=class extends du{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new wp(this,nr())}nextDataId(){return eh.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,J().get("IS_NODE")&&C.warn(` ============================ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details. -============================`));let r={id:this.nextDataId()};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}makeTensorInfo(e,t,n){let r;if(t==="string"&&n!=null&&n.length>0&&_.isString(n[0])){let a=n.map(s=>_.encodeString(s));r=this.write(a,e,t)}else r=this.write(n,e,t);return{dataId:r,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,r,a){this.data.set(e,{values:t,dtype:r,refCount:a})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let r=this.readSync(n.real.dataId),a=this.readSync(n.imag.dataId);return E.mergeRealAndImagArrays(r,a)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(r=>_.decodeString(r))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}makeOutput(e,t,n){let r=this.write(e,t,n);return aa().makeTensorFromDataId(r,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=_.now();return e(),{kernelMs:_.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){be([e],"where");let t=this.readSync(e.dataId);return RM(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};ep.nextDataId=0;var Wm={};Me(Wm,{addImpl:()=>bb,bincountImpl:()=>Bm,bincountReduceImpl:()=>_b,ceilImpl:()=>vb,concatImpl:()=>Vm,expImpl:()=>kb,expm1Impl:()=>Ib,floorImpl:()=>Sb,gatherV2Impl:()=>Nb,greaterImpl:()=>Tb,lessImpl:()=>Eb,linSpaceImpl:()=>Cb,logImpl:()=>Rb,maxImpl:()=>Mb,maximumImpl:()=>Fb,minimumImpl:()=>$b,multiplyImpl:()=>jm,negImpl:()=>Db,notEqualImpl:()=>Ob,prodImpl:()=>zb,rangeImpl:()=>Hm,rsqrtImpl:()=>Pb,simpleAbsImpl:()=>wb,sliceImpl:()=>tp,sparseReshapeImpl:()=>Lb,squaredDifferenceImpl:()=>Wb,stridedSliceImpl:()=>Bb,subImpl:()=>Vb,tileImpl:()=>jb,topKImpl:()=>Ub,transposeImpl:()=>Um,uniqueImpl:()=>Hb});function wb(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;be(t,"abs");let r=new Float32Array(_.sizeFromShape(t.shape)),a=n.data.get(t.dataId).values;return r=wb(a),n.makeOutput(r,t.shape,"float32")},FM={kernelName:eo,backendName:"cpu",kernelFunc:MM};function Ct(e){return(t,n,r,a,s)=>{let i=E.assertAndGetBroadcastShape(t,n),o=i.length,l=_.computeStrides(i),c=_.sizeFromShape(i),u=_.getTypedArrayFromDType(s,c),h=t.length,d=n.length,p=_.computeStrides(t),m=_.computeStrides(n),f=E.getBroadcastDims(t,i),A=E.getBroadcastDims(n,i);if(f.length+A.length===0)for(let y=0;yx[k]=0);let v=_.locToIndex(x,h,p),w=g.slice(-d);A.forEach(k=>w[k]=0);let b=_.locToIndex(w,d,m);u[y]=e(r[v],a[b])}return[u,i]}}function zn(e){let{inputs:t,backend:n}=e,{real:r,imag:a}=t,s=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,o=n.makeTensorInfo(r.shape,"complex64"),l=n.data.get(o.dataId);return l.complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",s),imag:n.makeTensorInfo(a.shape,"float32",i)},o}var $M={kernelName:Eh,backendName:"cpu",kernelFunc:zn};function np(e,t,n="float32"){if(n==="complex64"){let a=np(e,t,"float32"),s=np(e,t,"float32");return zn({inputs:{real:a,imag:s},backend:e})}let r=_.makeZerosTypedArray(_.sizeFromShape(t),n);return e.makeTensorInfo(t,n,r)}function Br(e){let{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var DM={kernelName:vs,backendName:"cpu",kernelFunc:Br};function xi(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.data.get(r.dataId).complexTensorInfos.real,s=n.data.get(a.dataId).values;return n.makeTensorInfo(a.shape,a.dtype,s)}var OM={kernelName:Zh,backendName:"cpu",kernelFunc:xi};function La(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dtype:s}=r;if(s==="complex64"){if(a.dtype==="complex64")return Br({inputs:{x:a},backend:n});let i=np(n,a.shape,a.dtype),o=La({inputs:{x:a},backend:n,attrs:{dtype:"float32"}}),l=zn({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}if(a.dtype==="complex64"){let i=xi({inputs:{input:a},backend:n}),o=La({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!_.hasEncodingLoss(a.dtype,s)){let i=Br({inputs:{x:a},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(a.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(a.shape,"int32",o)}if(s==="bool"){let i=n.data.get(a.dataId).values,o=_.toTypedArray([0],a.dtype),[l,c]=Ct((u,h)=>u!==h?1:0)(a.shape,[],i,o,"bool");return n.makeTensorInfo(c,"bool",l)}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${s}`)}var zM={kernelName:cs,backendName:"cpu",kernelFunc:La};function jt(e,t,n,r){return n==null?({inputs:a,backend:s})=>{let{a:i,b:o}=a,l=s;be([i,o],e);let c=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,h=r||i.dtype,[d,p]=t(i.shape,o.shape,c,u,h);return l.makeTensorInfo(p,h,d)}:({inputs:a,backend:s})=>{let{a:i,b:o}=a,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let c=La({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),u=l.data.get(c.dataId),h=u.complexTensorInfos.real,d=u.complexTensorInfos.imag,p=l.data.get(h.dataId).values,m=l.data.get(d.dataId).values,f=La({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),A=l.data.get(f.dataId),y=A.complexTensorInfos.real,g=A.complexTensorInfos.imag,x=l.data.get(y.dataId).values,v=l.data.get(g.dataId).values,[w,b,k]=n(i.shape,o.shape,p,m,x,v),N=l.makeTensorInfo(k,"float32",w),C=l.makeTensorInfo(k,"float32",b),F=zn({inputs:{real:N,imag:C},backend:l});return l.disposeIntermediateTensorInfo(c),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(N),l.disposeIntermediateTensorInfo(C),F}else{let c=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,h=r||i.dtype,[d,p]=t(i.shape,o.shape,c,u,h);return l.makeTensorInfo(p,h,d)}}}function Gm(e){return(t,n,r,a,s,i)=>{let o=E.assertAndGetBroadcastShape(t,n),l=_.sizeFromShape(o),c=o.length,u=_.computeStrides(o),h=_.getTypedArrayFromDType("float32",l),d=_.getTypedArrayFromDType("float32",l),p=E.getBroadcastDims(t,o),m=E.getBroadcastDims(n,o),f=E.mergeRealAndImagArrays(r,a),A=E.mergeRealAndImagArrays(s,i),y=t.length,g=_.computeStrides(t),x=n.length,v=_.computeStrides(n);if(p.length+m.length===0)for(let w=0;wk[z]=0);let N=_.locToIndex(k,y,g),C=b.slice(-x);m.forEach(z=>C[z]=0);let F=_.locToIndex(C,x,v),O=e(f[N*2],f[N*2+1],A[F*2],A[F*2+1]);h[w]=O.real,d[w]=O.imag}return[h,d,o]}}var bb=Ct((e,t)=>e+t),PM=Gm((e,t,n,r)=>({real:e+n,imag:t+r})),ac=jt(Ia,bb,PM),LM={kernelName:Ia,backendName:"cpu",kernelFunc:ac};function Bm(e,t,n,r,a){let s=_.sizeFromShape(r),i=_.makeZerosTypedArray(a,n);for(let o=0;o=a||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function _b(e,t,n,r=!1){let a=e.shape[0],s=e.shape[1],i=We([a,n],t.dtype);for(let o=0;o=n||(r?i.set(1,o,c):t.size>0?i.set(i.get(o,c)+t.get(o,l),o,c):i.set(i.get(o,c)+1,o,c))}return i}function _l(e){return(t,n,r)=>{let a=_.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=r;if(be(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,c=_.sizeFromShape(i.shape),u=n||i.dtype,h=_.getArrayFromDType(u,c);for(let d=0;d{let{x:i}=r;if(be(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,c=n||i.dtype,u=t(l,c,a);return o.makeTensorInfo(i.shape,c,u)}}var vb=_l(e=>Math.ceil(e)),WM=vl(hs,vb),BM={kernelName:hs,backendName:"cpu",kernelFunc:WM};function Vm(e,t,n,r){let a=_.getArrayFromDType(n,_.sizeFromShape(t));if(r&&n!=="string"){let s=0;e.forEach(i=>{let o=_.sizeFromShape(i.shape);a.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?E.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let c=0;cMath.exp(e)),Gb=vl(gs,kb),VM={kernelName:gs,backendName:"cpu",kernelFunc:Gb},Ib=_l(e=>Math.expm1(e)),jM=vl(xo,Ib),UM={kernelName:xo,backendName:"cpu",kernelFunc:jM},Sb=_l(e=>Math.floor(e)),HM=vl(xs,Sb),GM={kernelName:xs,backendName:"cpu",kernelFunc:HM};function Nb(e,t,n){let r=We(n,e.dtype);for(let a=0;ae>t?1:0),qM=jt(vo,Tb,null,"bool"),XM={kernelName:vo,backendName:"cpu",kernelFunc:qM},Eb=Ct((e,t)=>eMath.log(e)),YM=vl(Is,Rb),JM={kernelName:Is,backendName:"cpu",kernelFunc:YM};function Mb(e,t,n,r){let a=_.getTypedArrayFromDType(r,_.sizeFromShape(n));for(let s=0;so&&(o=c)}a[s]=o}return a}var Fb=Ct((e,t)=>Math.max(e,t)),QM=jt(Ns,Fb),eF={kernelName:Ns,backendName:"cpu",kernelFunc:QM},$b=Ct((e,t)=>Math.min(e,t)),tF=jt(Rs,$b),nF={kernelName:Rs,backendName:"cpu",kernelFunc:tF},jm=Ct((e,t)=>e*t),rF=Gm((e,t,n,r)=>({real:e*n-t*r,imag:e*r+t*n})),rp=jt(Fs,jm,rF),aF={kernelName:Fs,backendName:"cpu",kernelFunc:rp};function Db(e,t,n){let r=_.createScalarValue(-1,n);return jm([],t,r,e,n)}function sF(e){let{inputs:t,backend:n}=e,{x:r}=t;be(r,"neg");let a=n.data.get(r.dataId).values,[s,i]=Db(a,r.shape,r.dtype);return n.makeTensorInfo(i,r.dtype,s)}var iF={kernelName:Mo,backendName:"cpu",kernelFunc:sF},Ob=Ct((e,t)=>e!==t?1:0),oF=jt(Fo,Ob,null,"bool"),lF={kernelName:Fo,backendName:"cpu",kernelFunc:oF};function Um(e,t,n,r,a){let s=t.length,i=_.sizeFromShape(t),o=_.computeStrides(t),l=_.computeStrides(a),c=_.getTypedArrayFromDType(n,_.sizeFromShape(a));for(let u=0;un.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(y,A,m)}var hF={kernelName:Lo,backendName:"cpu",kernelFunc:cF};function Hm(e,t,n,r){let a=e===t,s=e1;if(a||s||i)return _.makeZerosTypedArray(0,r);let o=Math.abs(Math.ceil((t-e)/n)),l=_.makeZerosTypedArray(o,r);t1/Math.sqrt(e)),dF=vl(js,Pb),pF={kernelName:js,backendName:"cpu",kernelFunc:dF};function tp(e,t,n,r,a){let s=sn.isSliceContinous(r,t,n),i=_.sizeFromShape(n),o=_.computeStrides(r);if(s){let h=sn.computeFlatOffset(t,o);return a==="string"?e.slice(h,h+i):e.subarray(h,h+i)}let l=a==="string"?E.fromUint8ToStringArray(e):e,c=We(r,a,l),u=We(n,a);for(let h=0;hm+t[f]);u.set(c.get(...p),...d)}return a==="string"?E.fromStringArrayToUint8(u.values):u.values}function wi(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,size:i}=r;be(a,"slice");let[o,l]=sn.parseSliceParams(a,s,i);sn.assertParamsValid(a,o,l);let c=n.data.get(a.dataId).values,u=tp(c,o,l,a.shape,a.dtype);return n.makeTensorInfo(l,a.dtype,u)}var fF={kernelName:Ho,backendName:"cpu",kernelFunc:wi};function Lb(e,t,n,r,a){let s=_.sizeFromShape(r),i=t[0],o=a.length,l=[],c=1,u=-1;for(let A=0;A0){p[d-1]=1;for(let A=d-2;A>=0;--A)p[A]=p[A+1]*r[A+1]}let m=[];if(o>0){m[o-1]=1;for(let A=o-2;A>=0;--A)m[A]=m[A+1]*l[A+1]}let f=_.getArrayFromDType(n,i*o);for(let A=0;A{let n=e-t;return n*n}),mF=jt(Ks,Wb),AF={kernelName:Ks,backendName:"cpu",kernelFunc:mF};function Bb(e,t,n,r){let a=We(e,t.dtype);for(let s=0;se-t),yF=Gm((e,t,n,r)=>({real:e-n,imag:t-r})),qm=jt(Zs,Vb,yF),gF={kernelName:Zs,backendName:"cpu",kernelFunc:qm};function jb(e,t){let n=new Array(e.rank);for(let a=0;ax.value-g.value);let f=h*r,A=l.subarray(f,f+r),y=c.subarray(f,f+r);for(let g=0;g{for(let A=0;Anew ep,1);var Xb=nt(mo,e=>e>=0?e:Math.exp(e)-1),xF={kernelName:mo,backendName:"cpu",kernelFunc:Xb};function Kb(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{alpha:s}=r;be([a],"leakyRelu");let i=_.sizeFromShape(a.shape),o=n.data.get(a.dataId).values,l=_.getTypedArrayFromDType("float32",i);for(let c=0;ce<0?t*e:e);function Zb(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t;be([r,a],"prelu");let s=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,[o,l]=bF(r.shape,a.shape,s,i,r.dtype);return n.makeTensorInfo(l,r.dtype,o)}var _F={kernelName:zs,backendName:"cpu",kernelFunc:Zb},Yb=nt(Ps,e=>Math.max(0,e)),vF={kernelName:Ps,backendName:"cpu",kernelFunc:Yb},Jb=nt(Ws,e=>Math.min(Math.max(0,e),6)),kF={kernelName:Ws,backendName:"cpu",kernelFunc:Jb},Qb=nt(Hs,e=>1/(1+Math.exp(-e))),IF={kernelName:Hs,backendName:"cpu",kernelFunc:Qb};function Xm(e,t,n,r,a){if(n==="linear")return Br({inputs:{x:t},backend:e});if(n==="relu")return Yb({inputs:{x:t},backend:e});if(n==="elu")return Xb({inputs:{x:t},backend:e});if(n==="relu6")return Jb({inputs:{x:t},backend:e});if(n==="prelu")return Zb({inputs:{x:t,alpha:r},backend:e});if(n==="leakyrelu")return Kb({inputs:{x:t},backend:e,attrs:{alpha:a}});if(n==="sigmoid")return Qb({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function pt(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{shape:s}=r,i=_.sizeFromShape(a.shape),o=_.inferFromImplicitShape(s,i),l=_.sizeFromShape(o);_.assert(i===l,()=>`The new shape (${o}) has ${l} elements and the old shape (${a.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(a.dataId);let c=n.data.get(a.dataId);if(c.complexTensorInfos!=null){let u=c.complexTensorInfos.real,h=c.complexTensorInfos.imag;u.shape=o,h.shape=o}return{dataId:a.dataId,shape:o,dtype:a.dtype}}var SF={kernelName:Bo,backendName:"cpu",kernelFunc:pt};function e_(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;be([a,s],"matMul");let l=a.shape.length,c=s.shape.length,u=i?a.shape[l-2]:a.shape[l-1],h=o?s.shape[c-1]:s.shape[c-2],d=i?a.shape[l-1]:a.shape[l-2],p=o?s.shape[c-2]:s.shape[c-1],m=a.shape.slice(0,-2),f=s.shape.slice(0,-2),A=_.sizeFromShape(m),y=_.sizeFromShape(f),g=A===y||A===1||y===1;_.assert(l>=2&&c>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?a.shape.slice(0,-2):s.shape.slice(0,-2)).concat([d,p]);_.assert(u===h,()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${a.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[A,u,d]:[A,d,u],w=o?[y,p,h]:[y,h,p],b=pt({inputs:{x:a},backend:n,attrs:{shape:v}}),k=pt({inputs:{x:s},backend:n,attrs:{shape:w}}),N=i?b.shape[1]:b.shape[2],C=i?b.shape[2]:b.shape[1],F=o?k.shape[1]:k.shape[2],O=Math.max(A,y),z=n.data.get(b.dataId).values,V=n.data.get(k.dataId).values,j=_.computeStrides(b.shape),U=_.computeStrides(k.shape),[X,G,ee]=i?[j[0],1,j[1]]:[j[0],j[1],1],[Y,ae,te]=o?[1,U[1],U[0]]:[U[1],1,U[0]],ie=C*F,Q=We([O,C,F],b.dtype),ce=Q.values,oe=n.blockSize;for(let me=0;meMath.acos(e)),RF={kernelName:to,backendName:"cpu",kernelFunc:CF},MF=nt(no,e=>Math.acosh(e)),FF={kernelName:no,backendName:"cpu",kernelFunc:MF};function $F(e){let{inputs:t,backend:n}=e,r=t;be(t,"addN");let a=r.map(o=>n.data.get(o.dataId).values),s=We(r[0].shape,r[0].dtype),i=s.values;for(let o=0;og&&(g=w,x=v)}p[A]=x}return c.forEach(A=>n.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",p)}var BF={kernelName:os,backendName:"cpu",kernelFunc:WF};function VF(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r;be(a,"argMin");let i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=Zn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],E.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[u,h]=E.computeOutAndReduceShapes(l.shape,i),d=_.sizeFromShape(u),p=_.makeZerosTypedArray(d,"int32"),m=_.sizeFromShape(h),f=n.data.get(l.dataId).values;for(let A=0;An.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",p)}var jF={kernelName:pu,backendName:"cpu",kernelFunc:VF},UF=nt(so,e=>Math.asin(e)),HF={kernelName:so,backendName:"cpu",kernelFunc:UF},GF=nt(io,e=>Math.asinh(e)),qF={kernelName:io,backendName:"cpu",kernelFunc:GF},XF=nt(oo,e=>Math.atan(e)),KF={kernelName:oo,backendName:"cpu",kernelFunc:XF},ZF=Ct((e,t)=>Math.atan2(e,t)),YF=jt(uo,ZF),JF={kernelName:uo,backendName:"cpu",kernelFunc:YF},QF=nt(lo,e=>Math.atanh(e)),e$={kernelName:lo,backendName:"cpu",kernelFunc:QF};function Km(e,t,n,r,a,s){let i=a.strideHeight,o=a.strideWidth,l=a.dilationHeight,c=a.dilationWidth,u=a.effectiveFilterHeight,h=a.effectiveFilterWidth,d=a.padInfo.top,p=a.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=We(a.outShape,n),A=f.values,y=a.outShape[1]*a.outShape[2]*a.outShape[3],g=a.outShape[2]*a.outShape[3],x=a.outShape[3];for(let v=0;vG?G=oe:s==="avg"&&(ee+=oe,Y++)}if(isNaN(G))break}let ae=z+V*x+k;A[ae]=s==="avg"?ee/Y:G}}}return f}function t_(e,t,n,r,a=!1,s=!1){let i=We(r.outShape,"int32"),o=r.strideHeight,l=r.strideWidth,c=r.dilationHeight,u=r.dilationWidth,h=r.effectiveFilterHeight,d=r.effectiveFilterWidth,p=r.padInfo.top,m=r.padInfo.left,f=We(t,n,e);for(let A=0;AF&&(F=X,a?O=s?((A*r.inHeight+z)*r.inWidth+j)*r.inChannels+y:(z*r.inWidth+j)*r.inChannels+y:O=V*d+U)}}i.set(O,A,g,b,y)}}return i}function n_(e,t,n,r,a,s){let i=a.strideDepth,o=a.strideHeight,l=a.strideWidth,c=a.dilationDepth,u=a.dilationHeight,h=a.dilationWidth,d=a.effectiveFilterDepth,p=a.effectiveFilterHeight,m=a.effectiveFilterWidth,f=a.padInfo.front,A=a.padInfo.top,y=a.padInfo.left,g=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=We(a.outShape,n),v=x.values,w=a.outShape[1]*a.outShape[2]*a.outShape[3]*a.outShape[4],b=a.outShape[2]*a.outShape[3]*a.outShape[4],k=a.outShape[3]*a.outShape[4],N=a.outShape[4];for(let C=0;Cve?ve=Ve:s==="avg"&&(Ie+=Ve,Fe++),isNaN(ve))break}if(isNaN(ve))break}if(isNaN(ve))break}let Oe=de+z;v[Oe]=s==="avg"?Ie/Fe:ve}}}}return x}function t$(e,t){let n=We(t.outShape,"int32"),r=t.strideDepth,a=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=V&&(V=te,j=X*u*h+ee*u+ae)}}}n.set(j,f,y,w,C,A)}}}return n}function n$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t;be(a,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=r,c=1;_.assert(E.eitherStridesOrDilationsAreOne(i,c),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l),h;if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))h=Br({inputs:{x:a},backend:n});else{let d=n.data.get(a.dataId).values,p=_.computeStrides(a.shape),m=Km(d,a.shape,a.dtype,p,u,"avg");h=n.makeTensorInfo(u.outShape,a.dtype,m.values)}return h}var r$={kernelName:ls,backendName:"cpu",kernelFunc:n$};function a$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r;be(a,"avgPool3d");let u=E.computePool3DInfo(a.shape,s,i,1,o,l,c),h=n.data.get(a.dataId).values,d=n_(h,a.shape,a.dtype,_.computeStrides(a.shape),u,"avg");return n.makeTensorInfo(d.shape,"float32",d.values)}var s$={kernelName:fu,backendName:"cpu",kernelFunc:a$};function i$(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=r;be([a,s],"avgPool3DGrad");let u=E.computePool3DInfo(s.shape,i,o,1,l,c),h=u.strideDepth,d=u.strideHeight,p=u.strideWidth,m=u.filterDepth,f=u.filterHeight,A=u.filterWidth,y=u.dilationDepth,g=u.dilationHeight,x=u.dilationWidth,v=u.effectiveFilterDepth,w=u.effectiveFilterHeight,b=u.effectiveFilterWidth,k=v-1-u.padInfo.front,N=b-1-u.padInfo.left,C=w-1-u.padInfo.top,F=We(s.shape,"float32"),O=1/(m*f*A),z=n.bufferSync(a);for(let V=0;V=u.outDepth||Math.floor(Q)!==Q))for(let ce=0;ce=u.outHeight||Math.floor(oe)!==oe))for(let me=0;me=u.outWidth||Math.floor(de)!==de||(te+=z.get(V,Q,oe,de,j))}}}F.set(te*O,V,U,X,G,j)}return n.makeTensorInfo(F.shape,F.dtype,F.values)}var o$={kernelName:Nh,backendName:"cpu",kernelFunc:i$};function l$(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s;be([a,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:c}=r,u=E.computePool2DInfo(i.shape,o,l,1,c),h=u.strideHeight,d=u.strideWidth,p=u.filterHeight,m=u.filterWidth,f=u.dilationHeight,A=u.dilationWidth,y=u.effectiveFilterHeight,g=u.effectiveFilterWidth,x=g-1-u.padInfo.left,v=y-1-u.padInfo.top,w=We(i.shape,"float32"),b=1/(p*m),k=n.data.get(a.dataId).values,N=We(a.shape,"float32",k);for(let C=0;C=u.outHeight||Math.floor(G)!==G))for(let ee=0;ee=u.outWidth||Math.floor(Y)!==Y||(U+=N.get(C,G,Y,F))}}w.set(U*b,C,O,z,F)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}var u$={kernelName:Sh,backendName:"cpu",kernelFunc:l$};function c$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,scale:s,offset:i,mean:o,variance:l}=t;_.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),_.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),_.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),be([a,o,l,s,i],"batchNorm");let{varianceEpsilon:c}=r;c==null&&(c=.001);let u=n.data.get(a.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(u.length),A=m.length,y=p.length,g=d.length,x=h.length,v=0,w=0,b=0,k=0;for(let N=0;N=A&&(v=0),w>=x&&(w=0),b>=y&&(b=0),k>=g&&(k=0);return n.makeTensorInfo(a.shape,a.dtype,f)}var h$={kernelName:bs,backendName:"cpu",kernelFunc:c$};function d$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,crops:i}=r;be([a],"batchToSpaceND");let o=s.reduce((y,g)=>y*g),l=E.getReshaped(a.shape,s,o),c=E.getPermuted(l.length,s.length),u=E.getReshapedPermuted(a.shape,s,o),h=E.getSliceBeginCoords(i,s.length),d=E.getSliceSize(u,i,s.length),p=pt({inputs:{x:a},backend:n,attrs:{shape:l}}),m=Zn({inputs:{x:p},backend:n,attrs:{perm:c}}),f=pt({inputs:{x:m},backend:n,attrs:{shape:u}}),A=wi({inputs:{x:f},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var p$={kernelName:mu,backendName:"cpu",kernelFunc:d$};function f$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i}=r,o=n.data.get(a.dataId).values,l=n.data.get(s.dataId).values,c=Bm(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,c)}var m$={kernelName:Th,backendName:"cpu",kernelFunc:f$},A$=nt(Sa,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,r=new Float32Array(_.sizeFromShape(t.shape)),a=n.data.get(t.dataId),s=a.complexTensorInfos.real,i=a.complexTensorInfos.imag,o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values;for(let c=0;cf.shape),s);if(_.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>_.sizeFromShape(f.shape)>0);if(o.length===1)return Br({inputs:{x:o[0]},backend:n});let l=o.map(f=>f.shape);if(E.assertParamsConsistent(l,s),o[0].dtype==="complex64"){let f=o.map(v=>xi({inputs:{input:v},backend:n})),A=o.map(v=>kl({inputs:{input:v},backend:n})),y=Il({inputs:f,backend:n,attrs:{axis:s}}),g=Il({inputs:A,backend:n,attrs:{axis:s}}),x=zn({inputs:{real:y,imag:g},backend:n});return f.forEach(v=>n.disposeIntermediateTensorInfo(v)),A.forEach(v=>n.disposeIntermediateTensorInfo(v)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(g),x}let c=o.map(f=>{let A=_.sizeFromShape(f.shape.slice(s));return pt({inputs:{x:f},backend:n,attrs:{shape:[-1,A]}})}),u=c.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=E.computeOutShape(c.map(f=>f.shape),1);let h=c[0].shape[0]===1,d=Vm(u,i,t[0].dtype,h),p=E.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(p,t[0].dtype,d);return c.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var b$={kernelName:co,backendName:"cpu",kernelFunc:Il};function r_(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=r;be([a,s],"conv2d");let h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,s.shape,i,c,o,u,!1,h),p=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,A=d.dilationWidth,y=d.padInfo.left,g=d.padInfo.top,x=d.dataFormat==="channelsLast",v=new $t(d.outShape,a.dtype),w=_.computeStrides(a.shape),b=_.computeStrides(s.shape),k=w[0],N=x?w[1]:w[2],C=x?w[2]:1,F=x?1:w[1],O=v.strides[0],z=x?v.strides[1]:v.strides[2],V=x?v.strides[2]:1,j=x?1:v.strides[1],U=n.data.get(a.dataId).values,X=n.data.get(s.dataId).values,G=v.values;for(let ee=0;ee=d.inHeight)continue;let me=ce*b[0],de=Y+oe*N;for(let ve=0;ve=d.inWidth)continue;let Qe=me+Oe*b[1],et=de+$e*C,at=Qe;for(let Xe=0;Xe=c.inDepth)continue;let ee=X*C[0],Y=O+G*N[1];for(let ae=0;ae=c.inHeight)continue;let oe=ee+Q*C[1],me=Y+ce*N[2];for(let de=0;de=c.inWidth)continue;let $e=oe+Fe*C[2],Qe=me+Oe*c.inChannels,et=$e;for(let at=0;atMath.cos(e)),$$={kernelName:fs,backendName:"cpu",kernelFunc:F$},D$=nt(ho,e=>Math.cosh(e)),O$={kernelName:ho,backendName:"cpu",kernelFunc:D$};function z$(e){let{inputs:t,backend:n,attrs:r}=e,{image:a,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:c}=r,[u,h,d,p]=a.shape,m=s.shape[0],[f,A]=o,y=We([m,f,A,p],"float32"),g=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,v=n.data.get(a.dataId).values,w=_.computeStrides(a.shape),b=_.computeStrides(y.shape);for(let k=0;k=u)continue;let j=f>1?(O-C)*(h-1)/(f-1):0,U=A>1?(z-F)*(d-1)/(A-1):0;for(let X=0;X1?C*(h-1)+X*j:.5*(C+O)*(h-1);if(G<0||G>h-1){for(let ee=0;ee1?F*(d-1)+te*U:.5*(F+z)*(d-1);if(ie<0||ie>d-1){for(let me=0;me1?F*(d-1)+ee*U:.5*(F+z)*(d-1);if(Y<0||Y>d-1){for(let ie=0;iey+m-g-1:(y,g)=>y+g;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=a.shape[1],c=a.shape[2],u=a.shape[3],h=l*s,d=c*s,p=u/(s*s),m=n.data.get(a.dataId).values,f=new Float32Array(o*h*d*p),A=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let p=E.computeConv2DInfo(a.shape,s.shape,i,d,o,c,!0),{filterHeight:m,filterWidth:f,dilationHeight:A,dilationWidth:y,padInfo:g}=p,x=g.left,v=g.top,w=p.outChannels/p.inChannels,b=new $t(p.outShape,a.dtype),k=n.data.get(a.dataId).values,N=n.data.get(s.dataId).values,C=b.values;for(let F=0;F=p.inHeight)continue;let ee=X*h[0],Y=O+G*u[1];for(let ae=0;ae=p.inWidth)continue;let oe=ee+Q*h[1],me=Y+ce*p.inChannels,de=te,ve=oe;for(let Ie=0;Ie{let{x:r,filter:a}=e,{strides:s,pad:i,dilations:o}=n,l=t,c=l.data.get(r.dataId).values,u=r.shape.length,h=l.data.get(a.dataId).values,d=a.shape.length,{batchSize:p,inHeight:m,inWidth:f,inChannels:A,outHeight:y,outWidth:g,padInfo:x,strideHeight:v,strideWidth:w,filterHeight:b,filterWidth:k,dilationHeight:N,dilationWidth:C,outShape:F}=E.computeDilation2DInfo(r.shape,a.shape,s,i,"NHWC",o),O=_.sizeFromShape(F),z=F.length,V=_.getArrayFromDType(r.dtype,O);for(let j=0;j=0&&Q=0&&oeae&&(ae=ve)}}}let te=_.locToIndex([j,U,G,Y],z,_.computeStrides(F));V[te]=ae}}}return{dataId:l.write(_.toTypedArray(V,r.dtype),F,r.dtype),shape:F,dtype:r.dtype}}},Q$={kernelName:Ph,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,c=t,u=_.toNestedArray(r.shape,c.data.get(r.dataId).values),h=_.toNestedArray(a.shape,c.data.get(a.dataId).values),{batchSize:d,inHeight:p,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:v,filterHeight:w,filterWidth:b,dilationHeight:k,dilationWidth:N,outShape:C}=E.computeDilation2DInfo(r.shape,a.shape,i,o,"NHWC",l);_.assert(s.rank===C.length,()=>`Error in ${Ph}, dy must have the same rank as output ${C.length}, but got ${s.rank}`);let F=_.toNestedArray(C,c.data.get(s.dataId).values),O=_.makeZerosNestedTypedArray(a.shape,a.dtype);for(let z=0;z=0&&ie=0&&ceee&&(ee=oe,Y=te,ae=Q)}}}O[Y][ae][G]+=F[z][V][U][G]}}}return{dataId:c.write(_.toTypedArray(O,r.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},eD={kernelName:zh,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,c=t,u=_.toNestedArray(r.shape,c.data.get(r.dataId).values),h=_.toNestedArray(a.shape,c.data.get(a.dataId).values),{batchSize:d,inHeight:p,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:v,filterHeight:w,filterWidth:b,dilationHeight:k,dilationWidth:N,outShape:C}=E.computeDilation2DInfo(r.shape,a.shape,i,o,"NHWC",l);_.assert(s.rank===C.length,()=>`Error in ${zh}, dy must have the same rank as output ${C.length}, but got ${s.rank}`);let F=_.toNestedArray(C,c.data.get(s.dataId).values),O=_.makeZerosNestedTypedArray(r.shape,r.dtype);for(let z=0;z=0&&ie=0&&ceee&&(ee=oe,Y=ie,ae=ce)}}}O[z][Y][ae][G]+=F[z][V][U][G]}}}return{dataId:c.write(_.toTypedArray(O,r.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}};function sc(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r;be(a,"sum");let o;a.dtype==="bool"?o=La({inputs:{x:a},backend:n,attrs:{dtype:"int32"}}):o=Br({inputs:{x:a},backend:n});let l=o.shape.length,c=_.parseAxisParam(s,o.shape),u=E.getAxesPermutation(c,l),h=c,d=o;u!=null&&(d=Zn({inputs:{x:o},backend:n,attrs:{perm:u}}),h=E.getInnerMostAxes(h.length,l)),E.assertAxesAreInnerMostDims("sum",h,d.shape.length);let[p,m]=E.computeOutAndReduceShapes(d.shape,h),f=E.upcastType(d.dtype,"int32"),A=np(n,p,f),y=_.sizeFromShape(m),g=n.data.get(A.dataId).values,x=n.data.get(d.dataId).values;for(let v=0;v=0&&(d=sc({inputs:{x:d},backend:n,attrs:{axis:c[f]-(i.length-p),keepDims:!1}}),m.push(d)),p--)}for(let f of m)f!==d&&n.disposeIntermediateTensorInfo(f);return d}var rD={kernelName:Lh,backendName:"cpu",kernelFunc:nD};function aD(e){let{inputs:t,backend:n}=e,{dy:r,y:a}=t;be([r,a],"eluGrad");let s=new Float32Array(_.sizeFromShape(a.shape)),i=n.data.get(a.dataId).values,o=n.data.get(r.dataId).values;for(let l=0;l=1?s[l]=o[l]:s[l]=o[l]*(c+1)}return n.makeTensorInfo(a.shape,"float32",s)}var sD={kernelName:Wh,backendName:"cpu",kernelFunc:aD},iD=Ct((e,t)=>e===t?1:0),s_=jt(yo,iD,null,"bool"),oD={kernelName:yo,backendName:"cpu",kernelFunc:s_},lD=E.ERF_P,uD=E.ERF_A1,cD=E.ERF_A2,hD=E.ERF_A3,dD=E.ERF_A4,pD=E.ERF_A5,fD=nt(Ao,e=>{let t=Math.sign(e),n=Math.abs(e),r=1/(1+lD*n);return t*(1-((((pD*r+dD)*r+hD)*r+cD)*r+uD)*r*Math.exp(-n*n))}),mD={kernelName:Ao,backendName:"cpu",kernelFunc:fD};function ap(e){let{inputs:t,backend:n,attrs:r}=e,{input:a}=t,{dim:s}=r,i=a.shape.length,o=a.shape.slice(),l=s;return s<0&&(_.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),pt({inputs:{x:a},backend:n,attrs:{shape:o}})}var AD={kernelName:go,backendName:"cpu",kernelFunc:ap},yD=Ct((e,t)=>e/t),Zm=jt(ys,yD),Ym={kernelName:ys,backendName:"cpu",kernelFunc:Zm};function i_(e,t,n){let r=e.shape,a=r[0],s=r[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,c=[a,s],u=_.sizeFromShape(c),h=_.getTypedArrayFromDType("float32",u),d=_.getTypedArrayFromDType("float32",u);for(let A=0;A{let{image:r}=e,a=n,s=_.getTypedArrayFromDType(r.dtype,_.sizeFromShape(r.shape)),[i,o,l,c]=r.shape,u=a.data.get(r.dataId).values;for(let h=0;h=0&&xMath.floor(e/t)),ND=jt(ws,SD,null,"int32"),TD={kernelName:ws,backendName:"cpu",kernelFunc:ND};function ED(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=r_({inputs:{x:a,filter:s},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(i){let A=f;f=ac({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(p){let A=f;f=Xm(n,f,p,o,m),n.disposeIntermediateTensorInfo(A)}return f}var CD={kernelName:ti,backendName:"cpu",kernelFunc:ED};function RD(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=a_({inputs:{x:a,filter:s},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(i){let A=f;f=ac({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(p){let A=f;f=Xm(n,f,p,o,m),n.disposeIntermediateTensorInfo(A)}return f}var MD={kernelName:ni,backendName:"cpu",kernelFunc:RD};function FD(e){let{inputs:t,backend:n}=e,{params:r,indices:a}=t,s=_.sizeFromShape(r.shape),i=a.shape,o=i[i.length-1],[l,c,u,h]=E.prepareAndValidate(r,a);if(c===0)return n.makeTensorInfo(l,r.dtype,[]);let d=We([c,u],r.dtype),p=n.data.get(a.dataId).values,m=n.data.get(r.dataId).values;for(let f=0;f=s/u)throw new Error(`Invalid indices: ${A} does not index into ${r.shape}`);for(let g=0;ge>=t?1:0),PD=jt(_s,zD,null,"bool"),LD={kernelName:_s,backendName:"cpu",kernelFunc:PD};function WD(e){let{inputs:t,backend:n}=e,{input:r}=t,a=_.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],i=a/s,o=pt({inputs:{x:r},backend:n,attrs:{shape:[i,s]}}),l=i_(o,!0,n),c=pt({inputs:{x:l},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),c}var BD={kernelName:Vh,backendName:"cpu",kernelFunc:WD},VD=nt(ko,e=>Number.isFinite(e)?1:0,"bool"),jD={kernelName:ko,backendName:"cpu",kernelFunc:VD},UD=nt(Io,e=>Math.abs(e)===Infinity?1:0,"bool"),HD={kernelName:Io,backendName:"cpu",kernelFunc:UD},GD=nt(So,e=>Number.isNaN(e)?1:0,"bool"),qD={kernelName:So,backendName:"cpu",kernelFunc:GD},XD=Ct((e,t)=>e<=t?1:0),KD=jt(To,XD,null,"bool"),ZD={kernelName:To,backendName:"cpu",kernelFunc:KD};function YD(e){let{backend:t,attrs:n}=e,{start:r,stop:a,num:s}=n,i=Cb(r,a,s);return t.makeTensorInfo([i.length],"float32",i)}var JD={kernelName:Uh,backendName:"cpu",kernelFunc:YD},QD=nt(Eo,e=>Math.log1p(e)),eO={kernelName:Eo,backendName:"cpu",kernelFunc:QD},tO=Ct((e,t)=>e&&t),nO=jt(Co,tO,null,"bool"),rO={kernelName:Co,backendName:"cpu",kernelFunc:nO},aO=nt(wu,e=>e?0:1,"bool"),sO={kernelName:wu,backendName:"cpu",kernelFunc:aO},iO=Ct((e,t)=>e||t),oO=jt(bu,iO,null,"bool"),lO={kernelName:bu,backendName:"cpu",kernelFunc:oO};function uO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=r;be(a,"LRN");let c=a.shape[3],u=c-1,h=n.data.get(a.dataId).values,d=_.sizeFromShape(a.shape),p=new Float32Array(d);function m(f){let A=f%c,y=f-A+Math.max(0,A-s),g=f-A+Math.min(A+s,u),x=0;for(;y<=g;y++){let v=h[y];x+=v*v}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l),h;if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))h=Br({inputs:{x:a},backend:n});else{let d=n.data.get(a.dataId).values,p=_.computeStrides(a.shape),m=Km(d,a.shape,a.dtype,p,u,"max");h=n.makeTensorInfo(u.outShape,a.dtype,m.values)}return h}var mO={kernelName:Ts,backendName:"cpu",kernelFunc:fO};function AO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r;be(a,"maxPool3d");let u=E.computePool3DInfo(a.shape,s,i,1,o,l,c),h=n.data.get(a.dataId).values,d=n_(h,a.shape,a.dtype,_.computeStrides(a.shape),u,"max");return n.makeTensorInfo(d.shape,"float32",d.values)}var yO={kernelName:vu,backendName:"cpu",kernelFunc:AO};function gO(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=r;be([a,s],"maxPool3DGrad");let u=E.computePool3DInfo(s.shape,i,o,1,l,c),h=n.bufferSync(s),d=t$(h,u),p=u.strideDepth,m=u.strideHeight,f=u.strideWidth,A=u.dilationDepth,y=u.dilationHeight,g=u.dilationWidth,x=u.effectiveFilterDepth,v=u.effectiveFilterHeight,w=u.effectiveFilterWidth,b=x-1-u.padInfo.front,k=w-1-u.padInfo.left,N=v-1-u.padInfo.top,C=We(s.shape,"float32"),F=n.bufferSync(a);for(let O=0;O=u.outDepth||Math.floor(te)!==te))for(let ie=0;ie=u.outHeight||Math.floor(Q)!==Q))for(let ce=0;ce=u.outWidth||Math.floor(oe)!==oe)continue;let me=x*v*w-1-d.get(O,te,Q,oe,z),de=ae*v*w+ie*w+ce,ve=me===de?1:0;ve!==0&&(Y+=F.get(O,te,Q,oe,z)*ve)}}}C.set(Y,O,V,j,U,z)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}var xO={kernelName:qh,backendName:"cpu",kernelFunc:gO};function wO(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s,output:i}=t,o=s;be([s,i],"maxPoolGrad");let{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=r,d=E.computePool2DInfo(o.shape,l,c,1,u,h),p=n.data.get(o.dataId).values,m=We(d.outShape,o.dtype,t_(p,o.shape,o.dtype,d).values),f=d.strideHeight,A=d.strideWidth,y=d.dilationHeight,g=d.dilationWidth,x=d.effectiveFilterHeight,v=d.effectiveFilterWidth,w=v-1-d.padInfo.left,b=x-1-d.padInfo.top,k=We(o.shape,"float32"),N=n.data.get(a.dataId).values,C=We(a.shape,"float32",N);for(let F=0;F=d.outHeight||Math.floor(ee)!==ee))for(let Y=0;Y=d.outWidth||Math.floor(ae)!==ae)continue;let te=x*v-1-m.get(F,ee,ae,O),ie=G*v+Y,Q=te===ie?1:0;Q!==0&&(X+=C.get(F,ee,ae,O)*Q)}}k.set(X,F,z,V,O)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}var bO={kernelName:Gh,backendName:"cpu",kernelFunc:wO};function _O(e,t,n,r,a){let s=_.computeStrides(t),i=Km(e,t,n,s,a,"max"),o=t_(e,t,n,a,!0,r);return[i.values,o.values]}var vO={kernelName:Xh,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{filterSize:a,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;be(r,"MaxPoolWithArgmax");let c=l.data.get(r.dataId).values,u=E.computePool2DInfo(r.shape,a,s,[1,1],i),[h,d]=_O(c,r.shape,r.dtype,o,u),p=l.write(h,u.outShape,r.dtype),m=l.write(d,u.outShape,r.dtype);return[{dataId:p,shape:u.outShape,dtype:r.dtype},{dataId:m,shape:u.outShape,dtype:"int32"}]}};function kO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=_.parseAxisParam(s,a.shape),l=E.computeOutAndReduceShapes(a.shape,o)[1],c=_.sizeFromShape(l),u=[],h=n.makeTensorInfo([],"float32",new Float32Array([c]));u.push(h);let d=La({inputs:{x:a},backend:n,attrs:{dtype:"float32"}});u.push(d);let p=Zm({inputs:{a:d,b:h},backend:n});u.push(p);let m=sc({inputs:{x:p},backend:n,attrs:{axis:s,keepDims:i}});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var IO={kernelName:Es,backendName:"cpu",kernelFunc:kO};function SO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r;be(a,"min");let o=_.parseAxisParam(s,a.shape),l=o,c=E.getAxesPermutation(l,a.shape.length),u=a;c!=null&&(u=Zn({inputs:{x:a},backend:n,attrs:{perm:c}}),l=E.getInnerMostAxes(l.length,a.shape.length)),E.assertAxesAreInnerMostDims("min",l,u.shape.length);let[h,d]=E.computeOutAndReduceShapes(u.shape,l),p=_.sizeFromShape(d),m=_.makeZerosTypedArray(_.sizeFromShape(h),u.dtype),f=n.data.get(u.dataId).values;for(let y=0;yg[0]+a.shape[x]+g[1]),l=s.map(g=>g[0]),c=s.map((g,x)=>g[0]+a.shape[x]),u=i==="reflect"?0:1,h=n.data.get(a.dataId).values,d=a.shape.length,p=_.computeStrides(a.shape),m=_.sizeFromShape(o),f=o.length,A=_.computeStrides(o),y=_.getTypedArrayFromDType(a.dtype,m);for(let g=0;g=c[w]&&(x[w]=(c[w]-1)*2-x[w]+u);x=x.map((w,b)=>w-l[b]);let v=_.locToIndex(x,d,p);y[g]=h[v]}return{dataId:n.write(y,o,a.dtype),shape:o,dtype:a.dtype}}var EO={kernelName:Ms,backendName:"cpu",kernelFunc:TO},CO=Ct((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),RO=jt(Ro,CO),MO={kernelName:Ro,backendName:"cpu",kernelFunc:RO},FO=Yi(Og());function l_(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{dim:s}=r,i=a.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let l=_.parseAxisParam([o],a.shape),c=o_({inputs:{x:a},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=E.expandShapeToKeepDim(c.shape,l),h=pt({inputs:{x:c},backend:n,attrs:{shape:u}}),d=qm({inputs:{a,b:h},backend:n}),p=Gb({inputs:{x:d},backend:n}),m=sc({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),f=pt({inputs:{x:m},backend:n,attrs:{shape:u}}),A=Zm({inputs:{a:p,b:f},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var $O={kernelName:Xs,backendName:"cpu",kernelFunc:l_};function DO(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{numSamples:s,seed:i,normalized:o}=r;be(a,"multinomial");let l=o?a:l_({inputs:{logits:a},backend:n,attrs:{dim:-1}}),c=l.shape[0],u=l.shape[1],h=n.data.get(l.dataId).values,d=[c,s],p=_.makeZerosTypedArray(_.sizeFromShape(d),"int32");for(let m=0;m=0&&u[h]{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=ap({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=Il({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),c}var ZO={kernelName:Po,backendName:"cpu",kernelFunc:c_};function YO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{paddings:s,constantValue:i}=r;be(a,"pad");let o=s.map((y,g)=>y[0]+a.shape[g]+y[1]),l=s.map(y=>y[0]),c=n.data.get(a.dataId).values,u=_.sizeFromShape(a.shape),h=a.shape.length,d=_.computeStrides(a.shape),p=_.sizeFromShape(o),m=o.length,f=_.computeStrides(o),A=_.getTypedArrayFromDType(a.dtype,p);i!==0&&A.fill(i);for(let y=0;yv+l[w]),x=_.locToIndex(g,m,f);A[x]=c[y]}return{dataId:n.write(A,o,a.dtype),shape:o,dtype:a.dtype}}var h_={kernelName:Ds,backendName:"cpu",kernelFunc:YO},JO=Ct((e,t)=>Math.pow(e,t)),QO=jt(Os,JO),ez={kernelName:Os,backendName:"cpu",kernelFunc:QO};function tz(e){let{backend:t,attrs:n}=e,{start:r,stop:a,dtype:s,step:i}=n,o=Hm(r,a,i,s);return t.makeTensorInfo([o.length],s,o)}var nz={kernelName:ku,backendName:"cpu",kernelFunc:tz},rz=nt(Wo,e=>1/e),az={kernelName:Wo,backendName:"cpu",kernelFunc:rz};function sz(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r;be(a,"resizeBilinear");let l=_.computeStrides(a.shape),[c,u]=o,[h,d,p,m]=a.shape,f=n.data.get(a.dataId).values,A=new Float32Array(_.sizeFromShape([h,c,u,m])),y=[s&&c>1?d-1:d,s&&u>1?p-1:p],g=[s&&c>1?c-1:c,s&&u>1?u-1:u],x=0,v=y[0]/g[0],w=y[1]/g[1];for(let b=0;b1?c-1:c,i&&p>1?u-1:u],A=[i&&d>1?d-1:d,i&&p>1?p-1:p],y=f[0]/A[0],g=f[1]/A[1],x=n.data.get(s.dataId).values,v=0;for(let w=0;w1?d-1:d,s&&u>1?p-1:p],g=[s&&c>1?c-1:c,s&&u>1?u-1:u],x=y[0]/g[0],v=y[1]/g[1],w=0;for(let b=0;b1?u-1:u,i&&m>1?h-1:h],g=[i&&p>1?p-1:p,i&&m>1?m-1:m],x=y[0]/g[0],v=y[1]/g[1],w=1/x,b=1/v,k=Math.ceil(w)*2+2,N=Math.ceil(b)*2+2;for(let C=0;C=p)continue;let Q=F+ie*l[1],ce=ie*x,oe=Math.min(u-1,i?Math.round(ce):Math.floor(ce));if(O===oe)for(let me=0;me=m)continue;let ve=Q+de*l[2],Ie=de*v,Fe=Math.min(h-1,i?Math.round(Ie):Math.floor(Ie));U===Fe&&(ae+=A[ve+Y])}}f[X+Y]=ae}}}}return n.makeTensorInfo(a.shape,a.dtype,f)}var dz={kernelName:Yh,backendName:"cpu",kernelFunc:hz};function pz(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r;be(a,"reverse");let i=a.shape.length,o=_.parseAxisParam(s,a.shape);if(i===0)return Br({inputs:{x:a},backend:n});let l=new $t(a.shape,a.dtype),c=n.bufferSync(a);for(let u=0;ud[p]=a.shape[p]-1-d[p]),l.set(c.get(...d),...h)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}var fz={kernelName:Bs,backendName:"cpu",kernelFunc:pz},mz={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:r}=e,{radians:a,fillValue:s,center:i}=t,o=n,l=_.getTypedArrayFromDType(r.dtype,_.sizeFromShape(r.shape)),[c,u,h,d]=r.shape,[p,m]=E.getImageCenter(i,u,h),f=255,A=Math.sin(a),y=Math.cos(a),g=o.data.get(r.dataId).values;for(let x=0;x=0&&V=0&&j{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),yz={kernelName:Vs,backendName:"cpu",kernelFunc:Az};function d_(e,t,n,r,a,s,i,o,l,c){let u=[r/a,a],h=e.values,d=t.values;if(r===0)return We(n,t.dtype);let p=We(u,t.dtype);p.values.fill(l);for(let m=0;m=r/a)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||a.shape.length===1?1:_.sizeFromShape(a.shape.slice(1));for(let m=0;me>=0?vz*e:_z*(Math.exp(e)-1)),Iz={kernelName:Uo,backendName:"cpu",kernelFunc:kz},Sz=nt(qo,e=>e<0?-1:e>0?1:0),Nz={kernelName:qo,backendName:"cpu",kernelFunc:Sz},Tz=nt(Us,e=>Math.sin(e)),Ez={kernelName:Us,backendName:"cpu",kernelFunc:Tz},Cz=nt(Go,e=>Math.sinh(e)),Rz={kernelName:Go,backendName:"cpu",kernelFunc:Cz},Mz=11920928955078125e-23,p_=Math.log(Mz)+2,Fz=nt(Xo,e=>{let t=e>-p_,n=e{let d=[...u];d[o]=h;let p=wi({inputs:{x:a},backend:n,attrs:{begin:c,size:d}});return c[o]+=h,p})}var Vz={kernelName:Ko,backendName:"cpu",kernelFunc:Bz},jz=nt(Gs,e=>Math.sqrt(e)),Uz={kernelName:Gs,backendName:"cpu",kernelFunc:jz},Hz={kernelName:Nu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,r=t;be(n,"square");let a=r.data.get(n.dataId).values,s=new Float32Array(a.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),qz={kernelName:Ta,backendName:"cpu",kernelFunc:Gz};function Xz(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r;be(a,"stridedSlice");let{nonStrided:p,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(a.shape,s,i,o,l,c,u,h,d),x=pt({inputs:{x:a},backend:n,attrs:{shape:y}}),v;if(p){let b=wi({inputs:{x},backend:n,attrs:{begin:m,size:A}});v=pt({inputs:{x:b},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(b)}else if(g.some(b=>b===0))v=n.makeTensorInfo(g,a.dtype,[]);else{let b=n.bufferSync(x),k=Bb(g,b,f,m);v=n.makeTensorInfo(k.shape,k.dtype,k.values)}let w=pt({inputs:{x:v},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),w}var Kz={kernelName:Zo,backendName:"cpu",kernelFunc:Xz},Zz=nt(Ys,e=>Math.tan(e)),Yz={kernelName:Ys,backendName:"cpu",kernelFunc:Zz},Jz=nt(Js,e=>Math.tanh(e)),Qz={kernelName:Js,backendName:"cpu",kernelFunc:Jz};function eP(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{reps:s}=r;be(a,"tile");let i=jb(n.bufferSync(a),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var tP={kernelName:Na,backendName:"cpu",kernelFunc:eP};function nP(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{k:s,sorted:i}=r;be(a,"topk");let o=n.data.get(a.dataId).values,[l,c]=Ub(o,a.shape,a.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}var rP={kernelName:Yo,backendName:"cpu",kernelFunc:nP};function iP(e){let{inputs:t,attrs:n,backend:r}=e,{image:a,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:c}=n,[u,h,d,p]=a.shape,[m,f]=c!=null?c:[h,d],A=[u,m,f,p],y=_.computeStrides(a.shape),g=y[0],x=y[1],v=y[2],w=_.getTypedArrayFromDType(a.dtype,_.sizeFromShape(A));w.fill(l);let b=r.data.get(a.dataId).values,k=r.data.get(s.dataId).values;for(let N=0;Nt-1)if(t<=1)n=0;else{let r=2*t;n-=r*Math.trunc(n/r),n>=t&&(n=r-n-1)}return _.clamp(0,n,t-1)}function uP(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let r=t-1;n+=t*(Math.trunc(-n/r)+1)}else if(n>t-1)if(t<=1)n=0;else{let r=t-1;n-=t*Math.trunc(n/r)}return _.clamp(0,n,t-1)}function cP(e,t){return e}function hP(e,t){return _.clamp(0,e,t-1)}function ic(e,t,n,r,a,s,i,o,l,c,u){let h=i*r+o*a+l*s+c;return 0<=o&&on.disposeIntermediateTensorInfo(m)),p}var yP={kernelName:Tu,backendName:"cpu",kernelFunc:AP},gP=[EF,FM,RF,FF,LM,DF,zF,LF,BF,jF,HF,qF,KF,JF,e$,r$,s$,o$,u$,NF,h$,p$,m$,zM,BM,y$,$M,x$,b$,k$,S$,_$,C$,M$,T$,$$,O$,P$,W$,V$,U$,H$,q$,K$,Y$,J$,eD,Q$,Ym,rD,xF,sD,oD,mD,VM,AD,UM,_D,kD,ID,GM,TD,CD,MD,$D,OD,XM,LD,DM,BD,w$,jD,HD,qD,wF,ZM,ZD,JD,JM,eO,rO,sO,lO,cO,dO,eF,mO,yO,xO,bO,vO,pO,IO,NO,nF,EO,MO,OO,aF,iF,LO,VO,HO,lF,qO,KO,ZO,h_,ez,_F,hF,nz,OM,az,vF,kF,SF,iz,lz,cz,dz,fz,mz,yz,pF,xz,bz,Iz,IF,Nz,Ez,Rz,fF,$O,$z,Oz,Pz,Wz,Vz,Uz,Hz,AF,qz,Kz,gF,tD,Yz,Qz,tP,rP,uF,oP,pP,mP,yP,XO];for(let e of gP)ri(e);var m_={};Me(m_,{assertNotComplex:()=>Sl,bindCanvasToFramebuffer:()=>bP,bindColorTextureToFramebuffer:()=>op,bindTextureToProgramUniformSampler:()=>C_,bindTextureUnit:()=>N_,bindVertexBufferToProgramAttribute:()=>eA,callAndCheck:()=>xe,canBeRepresented:()=>A_,createFragmentShader:()=>x_,createFramebuffer:()=>S_,createProgram:()=>w_,createStaticIndexBuffer:()=>v_,createStaticVertexBuffer:()=>__,createTexture:()=>k_,createVertexShader:()=>g_,getBatchDim:()=>bi,getExtensionOrThrow:()=>oc,getFramebufferErrorMessage:()=>R_,getMaxTexturesInShader:()=>$_,getNumChannels:()=>xP,getProgramUniformLocation:()=>E_,getProgramUniformLocationOrThrow:()=>T_,getRowsCols:()=>_i,getShapeAs3D:()=>lp,getTextureShapeFromLogicalShape:()=>M_,getWebGLDisjointQueryTimerVersion:()=>D_,getWebGLErrorMessage:()=>y_,getWebGLMaxTextureSize:()=>F_,hasExtension:()=>Yn,isCapableOfRenderingToFloatTexture:()=>O_,isDownloadFloatTextureEnabled:()=>z_,isReshapeFree:()=>uc,isWebGLFenceEnabled:()=>P_,isWebGLVersionEnabled:()=>nA,linkProgram:()=>b_,resetMaxTextureSize:()=>_P,resetMaxTexturesInShader:()=>vP,unbindColorTextureFromFramebuffer:()=>tA,unbindTextureUnit:()=>wP,validateFramebuffer:()=>lc,validateProgram:()=>ip,validateTextureSize:()=>I_});var vi={},rA={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function up(e,t){vi[e]=t}function Vr(e){if(!(e in vi)){let n=kP(e);if(n!==null)vi[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=vi[e];return t.isContextLost()?(delete vi[e],Vr(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),vi[e])}function IP(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function kP(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=IP(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete vi[e]},!1),e===1?t.getContext("webgl",rA)||t.getContext("experimental-webgl",rA):t.getContext("webgl2",rA)}var cc;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(cc||(cc={}));var Jn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(Jn||(Jn={}));var Qt;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Qt||(Qt={}));function hc(e,t){return[t,e]}function SP(e,t){return e*t}function dc(e){let t=_.sizeFromShape(e),n=Math.ceil(t/4);return _.sizeToSquarishShape(n)}function Nl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function NP(e,t){let[n,r]=Nl(e,t);return n*r*4}function aA(e,t){let n=e,r,a,s,i,o,l,c,u,h,d;return J().getNumber("WEBGL_VERSION")===2?(r=n.R32F,a=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,c=4,u=1,h=n.HALF_FLOAT,d=n.FLOAT):(r=e.RGBA,a=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,c=4,u=4,h=t!=null?t.HALF_FLOAT_OES:null,d=e.FLOAT),l=e.RGBA,{internalFormatFloat:r,internalFormatHalfFloat:a,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:h,textureTypeFloat:d}}function xe(e,t){let n=t();return J().getBool("DEBUG")&&TP(e),n}function TP(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+y_(e,t))}var EP=596e-10,CP=65504;function A_(e){return!!(J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||EPe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function g_(e,t){let n=ca(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function x_(e,t){let n=ca(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw RP(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var MP=/ERROR: [0-9]+:([0-9]+):/g;function RP(e,t){let n=MP.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let r=+n[1],a=e.split(` -`),s=a.length.toString().length+2,i=a.map((h,d)=>_.rightPad((d+1).toString(),s)+h),o=0;for(let h=0;h0&&w.isString(n[0])){let r=n.map(s=>w.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return{dataId:a,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,a,r){this.data.set(e,{values:t,dtype:a,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let a=this.readSync(n.real.dataId),r=this.readSync(n.imag.dataId);return C.mergeRealAndImagArrays(a,r)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>w.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}makeOutput(e,t,n){let a=this.write(e,t,n);return nr().makeTensorFromDataId(a,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=w.now();return e(),{kernelMs:w.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){ve([e],"where");let t=this.readSync(e.dataId);return zF(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};eh.nextDataId=0;var WA={};Fe(WA,{addImpl:()=>w3,bincountImpl:()=>BA,bincountReduceImpl:()=>k3,ceilImpl:()=>I3,concatImpl:()=>VA,expImpl:()=>S3,expm1Impl:()=>N3,floorImpl:()=>T3,gatherV2Impl:()=>E3,greaterImpl:()=>C3,lessImpl:()=>R3,linSpaceImpl:()=>M3,logImpl:()=>F3,maxImpl:()=>$3,maximumImpl:()=>D3,minimumImpl:()=>O3,multiplyImpl:()=>jA,negImpl:()=>z3,notEqualImpl:()=>_3,prodImpl:()=>P3,rangeImpl:()=>HA,rsqrtImpl:()=>L3,simpleAbsImpl:()=>v3,sliceImpl:()=>th,sparseReshapeImpl:()=>W3,squaredDifferenceImpl:()=>B3,stridedSliceImpl:()=>V3,subImpl:()=>j3,tileImpl:()=>U3,topKImpl:()=>H3,transposeImpl:()=>UA,uniqueImpl:()=>G3});function v3(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;ve(t,"abs");let a=new Float32Array(w.sizeFromShape(t.shape)),r=n.data.get(t.dataId).values;return a=v3(r),n.makeOutput(a,t.shape,"float32")},PF={kernelName:eo,backendName:"cpu",kernelFunc:_F};function Rt(e){return(t,n,a,r,s)=>{let i=C.assertAndGetBroadcastShape(t,n),o=i.length,l=w.computeStrides(i),d=w.sizeFromShape(i),u=w.getTypedArrayFromDType(s,d),p=t.length,c=n.length,h=w.computeStrides(t),m=w.computeStrides(n),f=C.getBroadcastDims(t,i),A=C.getBroadcastDims(n,i);if(f.length+A.length===0)for(let y=0;yx[I]=0);let k=w.locToIndex(x,p,h),b=g.slice(-c);A.forEach(I=>b[I]=0);let v=w.locToIndex(b,c,m);u[y]=e(a[k],r[v])}return[u,i]}}function _n(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(a.shape,"complex64"),l=n.data.get(o.dataId);return l.complexTensorInfos={real:n.makeTensorInfo(a.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",i)},o}var LF={kernelName:Cp,backendName:"cpu",kernelFunc:_n};function nh(e,t,n="float32"){if(n==="complex64"){let r=nh(e,t,"float32"),s=nh(e,t,"float32");return _n({inputs:{real:r,imag:s},backend:e})}let a=w.makeZerosTypedArray(w.sizeFromShape(t),n);return e.makeTensorInfo(t,n,a)}function Ba(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var WF={kernelName:ks,backendName:"cpu",kernelFunc:Ba};function xi(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.data.get(a.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}var BF={kernelName:Zp,backendName:"cpu",kernelFunc:xi};function _r(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Ba({inputs:{x:r},backend:n});let i=nh(n,r.shape,r.dtype),o=_r({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=_n({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=xi({inputs:{input:r},backend:n}),o=_r({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!w.hasEncodingLoss(r.dtype,s)){let i=Ba({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(r.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(r.shape,"int32",o)}if(s==="bool"){let i=n.data.get(r.dataId).values,o=w.toTypedArray([0],r.dtype),[l,d]=Rt((u,p)=>u!==p?1:0)(r.shape,[],i,o,"bool");return n.makeTensorInfo(d,"bool",l)}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var VF={kernelName:ds,backendName:"cpu",kernelFunc:_r};function Ut(e,t,n,a){return n==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;ve([i,o],e);let d=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,d,u,p);return l.makeTensorInfo(h,p,c)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let d=_r({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),u=l.data.get(d.dataId),p=u.complexTensorInfos.real,c=u.complexTensorInfos.imag,h=l.data.get(p.dataId).values,m=l.data.get(c.dataId).values,f=_r({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),A=l.data.get(f.dataId),y=A.complexTensorInfos.real,g=A.complexTensorInfos.imag,x=l.data.get(y.dataId).values,k=l.data.get(g.dataId).values,[b,v,I]=n(i.shape,o.shape,h,m,x,k),T=l.makeTensorInfo(I,"float32",b),R=l.makeTensorInfo(I,"float32",v),$=_n({inputs:{real:T,imag:R},backend:l});return l.disposeIntermediateTensorInfo(d),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(T),l.disposeIntermediateTensorInfo(R),$}else{let d=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,d,u,p);return l.makeTensorInfo(h,p,c)}}}function GA(e){return(t,n,a,r,s,i)=>{let o=C.assertAndGetBroadcastShape(t,n),l=w.sizeFromShape(o),d=o.length,u=w.computeStrides(o),p=w.getTypedArrayFromDType("float32",l),c=w.getTypedArrayFromDType("float32",l),h=C.getBroadcastDims(t,o),m=C.getBroadcastDims(n,o),f=C.mergeRealAndImagArrays(a,r),A=C.mergeRealAndImagArrays(s,i),y=t.length,g=w.computeStrides(t),x=n.length,k=w.computeStrides(n);if(h.length+m.length===0)for(let b=0;bI[_]=0);let T=w.locToIndex(I,y,g),R=v.slice(-x);m.forEach(_=>R[_]=0);let $=w.locToIndex(R,x,k),z=e(f[T*2],f[T*2+1],A[$*2],A[$*2+1]);p[b]=z.real,c[b]=z.imag}return[p,c,o]}}var w3=Rt((e,t)=>e+t),jF=GA((e,t,n,a)=>({real:e+n,imag:t+a})),rd=Ut(kr,w3,jF),UF={kernelName:kr,backendName:"cpu",kernelFunc:rd};function BA(e,t,n,a,r){let s=w.sizeFromShape(a),i=w.makeZerosTypedArray(r,n);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function k3(e,t,n,a=!1){let r=e.shape[0],s=e.shape[1],i=We([r,n],t.dtype);for(let o=0;o=n||(a?i.set(1,o,d):t.size>0?i.set(i.get(o,d)+t.get(o,l),o,d):i.set(i.get(o,d)+1,o,d))}return i}function wl(e){return(t,n,a)=>{let r=w.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=a;if(ve(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,d=w.sizeFromShape(i.shape),u=n||i.dtype,p=w.getArrayFromDType(u,d);for(let c=0;c{let{x:i}=a;if(ve(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,d=n||i.dtype,u=t(l,d,r);return o.makeTensorInfo(i.shape,d,u)}}var I3=wl(e=>Math.ceil(e)),HF=kl(ps,I3),GF={kernelName:ps,backendName:"cpu",kernelFunc:HF};function VA(e,t,n,a){let r=w.getArrayFromDType(n,w.sizeFromShape(t));if(a&&n!=="string"){let s=0;e.forEach(i=>{let o=w.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?C.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let d=0;dMath.exp(e)),q3=kl(gs,S3),qF={kernelName:gs,backendName:"cpu",kernelFunc:q3},N3=wl(e=>Math.expm1(e)),XF=kl(xo,N3),KF={kernelName:xo,backendName:"cpu",kernelFunc:XF},T3=wl(e=>Math.floor(e)),ZF=kl(xs,T3),YF={kernelName:xs,backendName:"cpu",kernelFunc:ZF};function E3(e,t,n){let a=We(n,e.dtype);for(let r=0;re>t?1:0),JF=Ut(ko,C3,null,"bool"),QF={kernelName:ko,backendName:"cpu",kernelFunc:JF},R3=Rt((e,t)=>eMath.log(e)),n$=kl(Ss,F3),a$={kernelName:Ss,backendName:"cpu",kernelFunc:n$};function $3(e,t,n,a){let r=w.getTypedArrayFromDType(a,w.sizeFromShape(n));for(let s=0;so&&(o=d)}r[s]=o}return r}var D3=Rt((e,t)=>Math.max(e,t)),r$=Ut(Ts,D3),s$={kernelName:Ts,backendName:"cpu",kernelFunc:r$},O3=Rt((e,t)=>Math.min(e,t)),i$=Ut(Ms,O3),o$={kernelName:Ms,backendName:"cpu",kernelFunc:i$},jA=Rt((e,t)=>e*t),l$=GA((e,t,n,a)=>({real:e*n-t*a,imag:e*a+t*n})),ah=Ut($s,jA,l$),u$={kernelName:$s,backendName:"cpu",kernelFunc:ah};function z3(e,t,n){let a=w.createScalarValue(-1,n);return jA([],t,a,e,n)}function d$(e){let{inputs:t,backend:n}=e,{x:a}=t;ve(a,"neg");let r=n.data.get(a.dataId).values,[s,i]=z3(r,a.shape,a.dtype);return n.makeTensorInfo(i,a.dtype,s)}var p$={kernelName:Fo,backendName:"cpu",kernelFunc:d$},_3=Rt((e,t)=>e!==t?1:0),c$=Ut($o,_3,null,"bool"),h$={kernelName:$o,backendName:"cpu",kernelFunc:c$};function UA(e,t,n,a,r){let s=t.length,i=w.sizeFromShape(t),o=w.computeStrides(t),l=w.computeStrides(r),d=w.getTypedArrayFromDType(n,w.sizeFromShape(r));for(let u=0;un.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(y,A,m)}var A$={kernelName:Lo,backendName:"cpu",kernelFunc:m$};function HA(e,t,n,a){let r=e===t,s=e1;if(r||s||i)return w.makeZerosTypedArray(0,a);let o=Math.abs(Math.ceil((t-e)/n)),l=w.makeZerosTypedArray(o,a);t1/Math.sqrt(e)),y$=kl(js,L3),g$={kernelName:js,backendName:"cpu",kernelFunc:y$};function th(e,t,n,a,r){let s=sn.isSliceContinous(a,t,n),i=w.sizeFromShape(n),o=w.computeStrides(a);if(s){let p=sn.computeFlatOffset(t,o);return r==="string"?e.slice(p,p+i):e.subarray(p,p+i)}let l=r==="string"?C.fromUint8ToStringArray(e):e,d=We(a,r,l),u=We(n,r);for(let p=0;pm+t[f]);u.set(d.get(...h),...c)}return r==="string"?C.fromStringArrayToUint8(u.values):u.values}function bi(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a;ve(r,"slice");let[o,l]=sn.parseSliceParams(r,s,i);sn.assertParamsValid(r,o,l);let d=n.data.get(r.dataId).values,u=th(d,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}var x$={kernelName:Ho,backendName:"cpu",kernelFunc:bi};function W3(e,t,n,a,r){let s=w.sizeFromShape(a),i=t[0],o=r.length,l=[],d=1,u=-1;for(let A=0;A0){h[c-1]=1;for(let A=c-2;A>=0;--A)h[A]=h[A+1]*a[A+1]}let m=[];if(o>0){m[o-1]=1;for(let A=o-2;A>=0;--A)m[A]=m[A+1]*l[A+1]}let f=w.getArrayFromDType(n,i*o);for(let A=0;A{let n=e-t;return n*n}),b$=Ut(Ks,B3),v$={kernelName:Ks,backendName:"cpu",kernelFunc:b$};function V3(e,t,n,a){let r=We(e,t.dtype);for(let s=0;se-t),w$=GA((e,t,n,a)=>({real:e-n,imag:t-a})),qA=Ut(Zs,j3,w$),k$={kernelName:Zs,backendName:"cpu",kernelFunc:qA};function U3(e,t){let n=new Array(e.rank);for(let r=0;rx.value-g.value);let f=p*a,A=l.subarray(f,f+a),y=d.subarray(f,f+a);for(let g=0;g{for(let A=0;Anew eh,1);var K3=nt(mo,e=>e>=0?e:Math.exp(e)-1),I$={kernelName:mo,backendName:"cpu",kernelFunc:K3};function Z3(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a;ve([r],"leakyRelu");let i=w.sizeFromShape(r.shape),o=n.data.get(r.dataId).values,l=w.getTypedArrayFromDType("float32",i);for(let d=0;de<0?t*e:e);function Y3(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t;ve([a,r],"prelu");let s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,[o,l]=N$(a.shape,r.shape,s,i,a.dtype);return n.makeTensorInfo(l,a.dtype,o)}var T$={kernelName:_s,backendName:"cpu",kernelFunc:Y3},J3=nt(Ps,e=>Math.max(0,e)),E$={kernelName:Ps,backendName:"cpu",kernelFunc:J3},Q3=nt(Ws,e=>Math.min(Math.max(0,e),6)),C$={kernelName:Ws,backendName:"cpu",kernelFunc:Q3},e7=nt(Hs,e=>1/(1+Math.exp(-e))),R$={kernelName:Hs,backendName:"cpu",kernelFunc:e7};function XA(e,t,n,a,r){if(n==="linear")return Ba({inputs:{x:t},backend:e});if(n==="relu")return J3({inputs:{x:t},backend:e});if(n==="elu")return K3({inputs:{x:t},backend:e});if(n==="relu6")return Q3({inputs:{x:t},backend:e});if(n==="prelu")return Y3({inputs:{x:t,alpha:a},backend:e});if(n==="leakyrelu")return Z3({inputs:{x:t},backend:e,attrs:{alpha:r}});if(n==="sigmoid")return e7({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function ht(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=w.sizeFromShape(r.shape),o=w.inferFromImplicitShape(s,i),l=w.sizeFromShape(o);w.assert(i===l,()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);let d=n.data.get(r.dataId);if(d.complexTensorInfos!=null){let u=d.complexTensorInfos.real,p=d.complexTensorInfos.imag;u.shape=o,p.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var M$={kernelName:Bo,backendName:"cpu",kernelFunc:ht};function t7(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;ve([r,s],"matMul");let l=r.shape.length,d=s.shape.length,u=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[d-1]:s.shape[d-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[d-2]:s.shape[d-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),A=w.sizeFromShape(m),y=w.sizeFromShape(f),g=A===y||A===1||y===1;w.assert(l>=2&&d>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);w.assert(u===p,()=>`Error in matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let k=i?[A,u,c]:[A,c,u],b=o?[y,h,p]:[y,p,h],v=ht({inputs:{x:r},backend:n,attrs:{shape:k}}),I=ht({inputs:{x:s},backend:n,attrs:{shape:b}}),T=i?v.shape[1]:v.shape[2],R=i?v.shape[2]:v.shape[1],$=o?I.shape[1]:I.shape[2],z=Math.max(A,y),_=n.data.get(v.dataId).values,V=n.data.get(I.dataId).values,j=w.computeStrides(v.shape),U=w.computeStrides(I.shape),[X,G,ee]=i?[j[0],1,j[1]]:[j[0],j[1],1],[Y,re,te]=o?[1,U[1],U[0]]:[U[1],1,U[0]],ie=R*$,Q=We([z,R,$],v.dtype),de=Q.values,oe=n.blockSize;for(let me=0;meMath.acos(e)),z$={kernelName:to,backendName:"cpu",kernelFunc:O$},_$=nt(no,e=>Math.acosh(e)),P$={kernelName:no,backendName:"cpu",kernelFunc:_$};function L$(e){let{inputs:t,backend:n}=e,a=t;ve(t,"addN");let r=a.map(o=>n.data.get(o.dataId).values),s=We(a[0].shape,a[0].dtype),i=s.values;for(let o=0;og&&(g=b,x=k)}h[A]=x}return d.forEach(A=>n.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",h)}var G$={kernelName:os,backendName:"cpu",kernelFunc:H$};function q$(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a;ve(r,"argMin");let i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=Zn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],C.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[u,p]=C.computeOutAndReduceShapes(l.shape,i),c=w.sizeFromShape(u),h=w.makeZerosTypedArray(c,"int32"),m=w.sizeFromShape(p),f=n.data.get(l.dataId).values;for(let A=0;An.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",h)}var X$={kernelName:hu,backendName:"cpu",kernelFunc:q$},K$=nt(so,e=>Math.asin(e)),Z$={kernelName:so,backendName:"cpu",kernelFunc:K$},Y$=nt(io,e=>Math.asinh(e)),J$={kernelName:io,backendName:"cpu",kernelFunc:Y$},Q$=nt(oo,e=>Math.atan(e)),eD={kernelName:oo,backendName:"cpu",kernelFunc:Q$},tD=Rt((e,t)=>Math.atan2(e,t)),nD=Ut(uo,tD),aD={kernelName:uo,backendName:"cpu",kernelFunc:nD},rD=nt(lo,e=>Math.atanh(e)),sD={kernelName:lo,backendName:"cpu",kernelFunc:rD};function KA(e,t,n,a,r,s){let i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,d=r.dilationWidth,u=r.effectiveFilterHeight,p=r.effectiveFilterWidth,c=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=We(r.outShape,n),A=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],g=r.outShape[2]*r.outShape[3],x=r.outShape[3];for(let k=0;kG?G=oe:s==="avg"&&(ee+=oe,Y++)}if(isNaN(G))break}let re=_+V*x+I;A[re]=s==="avg"?ee/Y:G}}}return f}function n7(e,t,n,a,r=!1,s=!1){let i=We(a.outShape,"int32"),o=a.strideHeight,l=a.strideWidth,d=a.dilationHeight,u=a.dilationWidth,p=a.effectiveFilterHeight,c=a.effectiveFilterWidth,h=a.padInfo.top,m=a.padInfo.left,f=We(t,n,e);for(let A=0;A$&&($=X,r?z=s?((A*a.inHeight+_)*a.inWidth+j)*a.inChannels+y:(_*a.inWidth+j)*a.inChannels+y:z=V*c+U)}}i.set(z,A,g,v,y)}}return i}function a7(e,t,n,a,r,s){let i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,d=r.dilationDepth,u=r.dilationHeight,p=r.dilationWidth,c=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,A=r.padInfo.top,y=r.padInfo.left,g=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=We(r.outShape,n),k=x.values,b=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],v=r.outShape[2]*r.outShape[3]*r.outShape[4],I=r.outShape[3]*r.outShape[4],T=r.outShape[4];for(let R=0;Rke?ke=Ve:s==="avg"&&(Se+=Ve,$e++),isNaN(ke))break}if(isNaN(ke))break}if(isNaN(ke))break}let ze=ce+_;k[ze]=s==="avg"?Se/$e:ke}}}}return x}function iD(e,t){let n=We(t.outShape,"int32"),a=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,d=t.effectiveFilterDepth,u=t.effectiveFilterHeight,p=t.effectiveFilterWidth,c=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=V&&(V=te,j=X*u*p+ee*u+re)}}}n.set(j,f,y,b,R,A)}}}return n}function oD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;ve(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l),p;if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))p=Ba({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=w.computeStrides(r.shape),m=KA(c,r.shape,r.dtype,h,u,"avg");p=n.makeTensorInfo(u.outShape,r.dtype,m.values)}return p}var lD={kernelName:ls,backendName:"cpu",kernelFunc:oD};function uD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a;ve(r,"avgPool3d");let u=C.computePool3DInfo(r.shape,s,i,1,o,l,d),p=n.data.get(r.dataId).values,c=a7(p,r.shape,r.dtype,w.computeStrides(r.shape),u,"avg");return n.makeTensorInfo(c.shape,"float32",c.values)}var dD={kernelName:fu,backendName:"cpu",kernelFunc:uD};function pD(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=a;ve([r,s],"avgPool3DGrad");let u=C.computePool3DInfo(s.shape,i,o,1,l,d),p=u.strideDepth,c=u.strideHeight,h=u.strideWidth,m=u.filterDepth,f=u.filterHeight,A=u.filterWidth,y=u.dilationDepth,g=u.dilationHeight,x=u.dilationWidth,k=u.effectiveFilterDepth,b=u.effectiveFilterHeight,v=u.effectiveFilterWidth,I=k-1-u.padInfo.front,T=v-1-u.padInfo.left,R=b-1-u.padInfo.top,$=We(s.shape,"float32"),z=1/(m*f*A),_=n.bufferSync(r);for(let V=0;V=u.outDepth||Math.floor(Q)!==Q))for(let de=0;de=u.outHeight||Math.floor(oe)!==oe))for(let me=0;me=u.outWidth||Math.floor(ce)!==ce||(te+=_.get(V,Q,oe,ce,j))}}}$.set(te*z,V,U,X,G,j)}return n.makeTensorInfo($.shape,$.dtype,$.values)}var cD={kernelName:Tp,backendName:"cpu",kernelFunc:pD};function hD(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;ve([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:d}=a,u=C.computePool2DInfo(i.shape,o,l,1,d),p=u.strideHeight,c=u.strideWidth,h=u.filterHeight,m=u.filterWidth,f=u.dilationHeight,A=u.dilationWidth,y=u.effectiveFilterHeight,g=u.effectiveFilterWidth,x=g-1-u.padInfo.left,k=y-1-u.padInfo.top,b=We(i.shape,"float32"),v=1/(h*m),I=n.data.get(r.dataId).values,T=We(r.shape,"float32",I);for(let R=0;R=u.outHeight||Math.floor(G)!==G))for(let ee=0;ee=u.outWidth||Math.floor(Y)!==Y||(U+=T.get(R,G,Y,$))}}b.set(U*v,R,z,_,$)}return n.makeTensorInfo(b.shape,b.dtype,b.values)}var fD={kernelName:Np,backendName:"cpu",kernelFunc:hD};function mD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,scale:s,offset:i,mean:o,variance:l}=t;w.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),w.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),w.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),ve([r,o,l,s,i],"batchNorm");let{varianceEpsilon:d}=a;d==null&&(d=.001);let u=n.data.get(r.dataId).values,p=n.data.get(o.dataId).values,c=n.data.get(l.dataId).values,h=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(u.length),A=m.length,y=h.length,g=c.length,x=p.length,k=0,b=0,v=0,I=0;for(let T=0;T=A&&(k=0),b>=x&&(b=0),v>=y&&(v=0),I>=g&&(I=0);return n.makeTensorInfo(r.shape,r.dtype,f)}var AD={kernelName:vs,backendName:"cpu",kernelFunc:mD};function yD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;ve([r],"batchToSpaceND");let o=s.reduce((y,g)=>y*g),l=C.getReshaped(r.shape,s,o),d=C.getPermuted(l.length,s.length),u=C.getReshapedPermuted(r.shape,s,o),p=C.getSliceBeginCoords(i,s.length),c=C.getSliceSize(u,i,s.length),h=ht({inputs:{x:r},backend:n,attrs:{shape:l}}),m=Zn({inputs:{x:h},backend:n,attrs:{perm:d}}),f=ht({inputs:{x:m},backend:n,attrs:{shape:u}}),A=bi({inputs:{x:f},backend:n,attrs:{begin:p,size:c}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var gD={kernelName:mu,backendName:"cpu",kernelFunc:yD};function xD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,d=BA(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}var bD={kernelName:Ep,backendName:"cpu",kernelFunc:xD},vD=nt(Ir,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,a=new Float32Array(w.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values;for(let d=0;df.shape),s);if(w.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>w.sizeFromShape(f.shape)>0);if(o.length===1)return Ba({inputs:{x:o[0]},backend:n});let l=o.map(f=>f.shape);if(C.assertParamsConsistent(l,s),o[0].dtype==="complex64"){let f=o.map(k=>xi({inputs:{input:k},backend:n})),A=o.map(k=>Il({inputs:{input:k},backend:n})),y=Sl({inputs:f,backend:n,attrs:{axis:s}}),g=Sl({inputs:A,backend:n,attrs:{axis:s}}),x=_n({inputs:{real:y,imag:g},backend:n});return f.forEach(k=>n.disposeIntermediateTensorInfo(k)),A.forEach(k=>n.disposeIntermediateTensorInfo(k)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(g),x}let d=o.map(f=>{let A=w.sizeFromShape(f.shape.slice(s));return ht({inputs:{x:f},backend:n,attrs:{shape:[-1,A]}})}),u=d.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=C.computeOutShape(d.map(f=>f.shape),1);let p=d[0].shape[0]===1,c=VA(u,i,t[0].dtype,p),h=C.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(h,t[0].dtype,c);return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var ND={kernelName:po,backendName:"cpu",kernelFunc:Sl};function r7(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:d,dimRoundingMode:u}=a;ve([r,s],"conv2d");let p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!1,p),h=c.filterHeight,m=c.filterWidth,f=c.dilationHeight,A=c.dilationWidth,y=c.padInfo.left,g=c.padInfo.top,x=c.dataFormat==="channelsLast",k=new Dt(c.outShape,r.dtype),b=w.computeStrides(r.shape),v=w.computeStrides(s.shape),I=b[0],T=x?b[1]:b[2],R=x?b[2]:1,$=x?1:b[1],z=k.strides[0],_=x?k.strides[1]:k.strides[2],V=x?k.strides[2]:1,j=x?1:k.strides[1],U=n.data.get(r.dataId).values,X=n.data.get(s.dataId).values,G=k.values;for(let ee=0;ee=c.inHeight)continue;let me=de*v[0],ce=Y+oe*T;for(let ke=0;ke=c.inWidth)continue;let Qe=me+ze*v[1],et=ce+De*R,rt=Qe;for(let Xe=0;Xe=d.inDepth)continue;let ee=X*R[0],Y=z+G*T[1];for(let re=0;re=d.inHeight)continue;let oe=ee+Q*R[1],me=Y+de*T[2];for(let ce=0;ce=d.inWidth)continue;let De=oe+$e*R[2],Qe=me+ze*d.inChannels,et=De;for(let rt=0;rtMath.cos(e)),LD={kernelName:fs,backendName:"cpu",kernelFunc:PD},WD=nt(co,e=>Math.cosh(e)),BD={kernelName:co,backendName:"cpu",kernelFunc:WD};function VD(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:d}=a,[u,p,c,h]=r.shape,m=s.shape[0],[f,A]=o,y=We([m,f,A,h],"float32"),g=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,k=n.data.get(r.dataId).values,b=w.computeStrides(r.shape),v=w.computeStrides(y.shape);for(let I=0;I=u)continue;let j=f>1?(z-R)*(p-1)/(f-1):0,U=A>1?(_-$)*(c-1)/(A-1):0;for(let X=0;X1?R*(p-1)+X*j:.5*(R+z)*(p-1);if(G<0||G>p-1){for(let ee=0;ee1?$*(c-1)+te*U:.5*($+_)*(c-1);if(ie<0||ie>c-1){for(let me=0;me1?$*(c-1)+ee*U:.5*($+_)*(c-1);if(Y<0||Y>c-1){for(let ie=0;iey+m-g-1:(y,g)=>y+g;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=r.shape[1],d=r.shape[2],u=r.shape[3],p=l*s,c=d*s,h=u/(s*s),m=n.data.get(r.dataId).values,f=new Float32Array(o*p*c*h),A=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let h=C.computeConv2DInfo(r.shape,s.shape,i,c,o,d,!0),{filterHeight:m,filterWidth:f,dilationHeight:A,dilationWidth:y,padInfo:g}=h,x=g.left,k=g.top,b=h.outChannels/h.inChannels,v=new Dt(h.outShape,r.dtype),I=n.data.get(r.dataId).values,T=n.data.get(s.dataId).values,R=v.values;for(let $=0;$=h.inHeight)continue;let ee=X*p[0],Y=z+G*u[1];for(let re=0;re=h.inWidth)continue;let oe=ee+Q*p[1],me=Y+de*h.inChannels,ce=te,ke=oe;for(let Se=0;Se{let{x:a,filter:r}=e,{strides:s,pad:i,dilations:o}=n,l=t,d=l.data.get(a.dataId).values,u=a.shape.length,p=l.data.get(r.dataId).values,c=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:A,outHeight:y,outWidth:g,padInfo:x,strideHeight:k,strideWidth:b,filterHeight:v,filterWidth:I,dilationHeight:T,dilationWidth:R,outShape:$}=C.computeDilation2DInfo(a.shape,r.shape,s,i,"NHWC",o),z=w.sizeFromShape($),_=$.length,V=w.getArrayFromDType(a.dtype,z);for(let j=0;j=0&&Q=0&&oere&&(re=ke)}}}let te=w.locToIndex([j,U,G,Y],_,w.computeStrides($));V[te]=re}}}return{dataId:l.write(w.toTypedArray(V,a.dtype),$,a.dtype),shape:$,dtype:a.dtype}}},rO={kernelName:Pp,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,d=t,u=w.toNestedArray(a.shape,d.data.get(a.dataId).values),p=w.toNestedArray(r.shape,d.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:k,filterHeight:b,filterWidth:v,dilationHeight:I,dilationWidth:T,outShape:R}=C.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);w.assert(s.rank===R.length,()=>`Error in ${Pp}, dy must have the same rank as output ${R.length}, but got ${s.rank}`);let $=w.toNestedArray(R,d.data.get(s.dataId).values),z=w.makeZerosNestedTypedArray(r.shape,r.dtype);for(let _=0;_=0&&ie=0&&deee&&(ee=oe,Y=te,re=Q)}}}z[Y][re][G]+=$[_][V][U][G]}}}return{dataId:d.write(w.toTypedArray(z,a.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},sO={kernelName:_p,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,d=t,u=w.toNestedArray(a.shape,d.data.get(a.dataId).values),p=w.toNestedArray(r.shape,d.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:k,filterHeight:b,filterWidth:v,dilationHeight:I,dilationWidth:T,outShape:R}=C.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);w.assert(s.rank===R.length,()=>`Error in ${_p}, dy must have the same rank as output ${R.length}, but got ${s.rank}`);let $=w.toNestedArray(R,d.data.get(s.dataId).values),z=w.makeZerosNestedTypedArray(a.shape,a.dtype);for(let _=0;_=0&&ie=0&&deee&&(ee=oe,Y=ie,re=de)}}}z[_][Y][re][G]+=$[_][V][U][G]}}}return{dataId:d.write(w.toTypedArray(z,a.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}};function sd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;ve(r,"sum");let o;r.dtype==="bool"?o=_r({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):o=Ba({inputs:{x:r},backend:n});let l=o.shape.length,d=w.parseAxisParam(s,o.shape),u=C.getAxesPermutation(d,l),p=d,c=o;u!=null&&(c=Zn({inputs:{x:o},backend:n,attrs:{perm:u}}),p=C.getInnerMostAxes(p.length,l)),C.assertAxesAreInnerMostDims("sum",p,c.shape.length);let[h,m]=C.computeOutAndReduceShapes(c.shape,p),f=C.upcastType(c.dtype,"int32"),A=nh(n,h,f),y=w.sizeFromShape(m),g=n.data.get(A.dataId).values,x=n.data.get(c.dataId).values;for(let k=0;k=0&&(c=sd({inputs:{x:c},backend:n,attrs:{axis:d[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var lO={kernelName:Lp,backendName:"cpu",kernelFunc:oO};function uO(e){let{inputs:t,backend:n}=e,{dy:a,y:r}=t;ve([a,r],"eluGrad");let s=new Float32Array(w.sizeFromShape(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values;for(let l=0;l=1?s[l]=o[l]:s[l]=o[l]*(d+1)}return n.makeTensorInfo(r.shape,"float32",s)}var dO={kernelName:Wp,backendName:"cpu",kernelFunc:uO},pO=Rt((e,t)=>e===t?1:0),i7=Ut(yo,pO,null,"bool"),cO={kernelName:yo,backendName:"cpu",kernelFunc:i7},hO=C.ERF_P,fO=C.ERF_A1,mO=C.ERF_A2,AO=C.ERF_A3,yO=C.ERF_A4,gO=C.ERF_A5,xO=nt(Ao,e=>{let t=Math.sign(e),n=Math.abs(e),a=1/(1+hO*n);return t*(1-((((gO*a+yO)*a+AO)*a+mO)*a+fO)*a*Math.exp(-n*n))}),bO={kernelName:Ao,backendName:"cpu",kernelFunc:xO};function rh(e){let{inputs:t,backend:n,attrs:a}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(w.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),ht({inputs:{x:r},backend:n,attrs:{shape:o}})}var vO={kernelName:go,backendName:"cpu",kernelFunc:rh},wO=Rt((e,t)=>e/t),ZA=Ut(ys,wO),YA={kernelName:ys,backendName:"cpu",kernelFunc:ZA};function o7(e,t,n){let a=e.shape,r=a[0],s=a[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,d=[r,s],u=w.sizeFromShape(d),p=w.getTypedArrayFromDType("float32",u),c=w.getTypedArrayFromDType("float32",u);for(let A=0;A{let{image:a}=e,r=n,s=w.getTypedArrayFromDType(a.dtype,w.sizeFromShape(a.shape)),[i,o,l,d]=a.shape,u=r.data.get(a.dataId).values;for(let p=0;p=0&&xMath.floor(e/t)),FO=Ut(bs,MO,null,"int32"),$O={kernelName:bs,backendName:"cpu",kernelFunc:FO};function DO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=r7({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c}});if(i){let A=f;f=rd({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(h){let A=f;f=XA(n,f,h,o,m),n.disposeIntermediateTensorInfo(A)}return f}var OO={kernelName:ti,backendName:"cpu",kernelFunc:DO};function zO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=s7({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c}});if(i){let A=f;f=rd({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(h){let A=f;f=XA(n,f,h,o,m),n.disposeIntermediateTensorInfo(A)}return f}var _O={kernelName:ni,backendName:"cpu",kernelFunc:zO};function PO(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=w.sizeFromShape(a.shape),i=r.shape,o=i[i.length-1],[l,d,u,p]=C.prepareAndValidate(a,r);if(d===0)return n.makeTensorInfo(l,a.dtype,[]);let c=We([d,u],a.dtype),h=n.data.get(r.dataId).values,m=n.data.get(a.dataId).values;for(let f=0;f=s/u)throw new Error(`Invalid indices: ${A} does not index into ${a.shape}`);for(let g=0;ge>=t?1:0),jO=Ut(ws,VO,null,"bool"),UO={kernelName:ws,backendName:"cpu",kernelFunc:jO};function HO(e){let{inputs:t,backend:n}=e,{input:a}=t,r=w.sizeFromShape(a.shape),s=a.shape[a.shape.length-1],i=r/s,o=ht({inputs:{x:a},backend:n,attrs:{shape:[i,s]}}),l=o7(o,!0,n),d=ht({inputs:{x:l},backend:n,attrs:{shape:a.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),d}var GO={kernelName:Vp,backendName:"cpu",kernelFunc:HO},qO=nt(Io,e=>Number.isFinite(e)?1:0,"bool"),XO={kernelName:Io,backendName:"cpu",kernelFunc:qO},KO=nt(So,e=>Math.abs(e)===Infinity?1:0,"bool"),ZO={kernelName:So,backendName:"cpu",kernelFunc:KO},YO=nt(No,e=>Number.isNaN(e)?1:0,"bool"),JO={kernelName:No,backendName:"cpu",kernelFunc:YO},QO=Rt((e,t)=>e<=t?1:0),ez=Ut(Eo,QO,null,"bool"),tz={kernelName:Eo,backendName:"cpu",kernelFunc:ez};function nz(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=M3(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var az={kernelName:Up,backendName:"cpu",kernelFunc:nz},rz=nt(Co,e=>Math.log1p(e)),sz={kernelName:Co,backendName:"cpu",kernelFunc:rz},iz=Rt((e,t)=>e&&t),oz=Ut(Ro,iz,null,"bool"),lz={kernelName:Ro,backendName:"cpu",kernelFunc:oz},uz=nt(bu,e=>e?0:1,"bool"),dz={kernelName:bu,backendName:"cpu",kernelFunc:uz},pz=Rt((e,t)=>e||t),cz=Ut(vu,pz,null,"bool"),hz={kernelName:vu,backendName:"cpu",kernelFunc:cz};function fz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a;ve(r,"LRN");let d=r.shape[3],u=d-1,p=n.data.get(r.dataId).values,c=w.sizeFromShape(r.shape),h=new Float32Array(c);function m(f){let A=f%d,y=f-A+Math.max(0,A-s),g=f-A+Math.min(A+s,u),x=0;for(;y<=g;y++){let k=p[y];x+=k*k}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l),p;if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))p=Ba({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=w.computeStrides(r.shape),m=KA(c,r.shape,r.dtype,h,u,"max");p=n.makeTensorInfo(u.outShape,r.dtype,m.values)}return p}var bz={kernelName:Es,backendName:"cpu",kernelFunc:xz};function vz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a;ve(r,"maxPool3d");let u=C.computePool3DInfo(r.shape,s,i,1,o,l,d),p=n.data.get(r.dataId).values,c=a7(p,r.shape,r.dtype,w.computeStrides(r.shape),u,"max");return n.makeTensorInfo(c.shape,"float32",c.values)}var wz={kernelName:ku,backendName:"cpu",kernelFunc:vz};function kz(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=a;ve([r,s],"maxPool3DGrad");let u=C.computePool3DInfo(s.shape,i,o,1,l,d),p=n.bufferSync(s),c=iD(p,u),h=u.strideDepth,m=u.strideHeight,f=u.strideWidth,A=u.dilationDepth,y=u.dilationHeight,g=u.dilationWidth,x=u.effectiveFilterDepth,k=u.effectiveFilterHeight,b=u.effectiveFilterWidth,v=x-1-u.padInfo.front,I=b-1-u.padInfo.left,T=k-1-u.padInfo.top,R=We(s.shape,"float32"),$=n.bufferSync(r);for(let z=0;z=u.outDepth||Math.floor(te)!==te))for(let ie=0;ie=u.outHeight||Math.floor(Q)!==Q))for(let de=0;de=u.outWidth||Math.floor(oe)!==oe)continue;let me=x*k*b-1-c.get(z,te,Q,oe,_),ce=re*k*b+ie*b+de,ke=me===ce?1:0;ke!==0&&(Y+=$.get(z,te,Q,oe,_)*ke)}}}R.set(Y,z,V,j,U,_)}return n.makeTensorInfo(R.shape,R.dtype,R.values)}var Iz={kernelName:qp,backendName:"cpu",kernelFunc:kz};function Sz(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s,output:i}=t,o=s;ve([s,i],"maxPoolGrad");let{filterSize:l,strides:d,pad:u,dimRoundingMode:p}=a,c=C.computePool2DInfo(o.shape,l,d,1,u,p),h=n.data.get(o.dataId).values,m=We(c.outShape,o.dtype,n7(h,o.shape,o.dtype,c).values),f=c.strideHeight,A=c.strideWidth,y=c.dilationHeight,g=c.dilationWidth,x=c.effectiveFilterHeight,k=c.effectiveFilterWidth,b=k-1-c.padInfo.left,v=x-1-c.padInfo.top,I=We(o.shape,"float32"),T=n.data.get(r.dataId).values,R=We(r.shape,"float32",T);for(let $=0;$=c.outHeight||Math.floor(ee)!==ee))for(let Y=0;Y=c.outWidth||Math.floor(re)!==re)continue;let te=x*k-1-m.get($,ee,re,z),ie=G*k+Y,Q=te===ie?1:0;Q!==0&&(X+=R.get($,ee,re,z)*Q)}}I.set(X,$,_,V,z)}return n.makeTensorInfo(I.shape,I.dtype,I.values)}var Nz={kernelName:Gp,backendName:"cpu",kernelFunc:Sz};function Tz(e,t,n,a,r){let s=w.computeStrides(t),i=KA(e,t,n,s,r,"max"),o=n7(e,t,n,r,!0,a);return[i.values,o.values]}var Ez={kernelName:Xp,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;ve(a,"MaxPoolWithArgmax");let d=l.data.get(a.dataId).values,u=C.computePool2DInfo(a.shape,r,s,[1,1],i),[p,c]=Tz(d,a.shape,a.dtype,o,u),h=l.write(p,u.outShape,a.dtype),m=l.write(c,u.outShape,a.dtype);return[{dataId:h,shape:u.outShape,dtype:a.dtype},{dataId:m,shape:u.outShape,dtype:"int32"}]}};function Cz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=w.parseAxisParam(s,r.shape),l=C.computeOutAndReduceShapes(r.shape,o)[1],d=w.sizeFromShape(l),u=[],p=n.makeTensorInfo([],"float32",new Float32Array([d]));u.push(p);let c=_r({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(c);let h=ZA({inputs:{a:c,b:p},backend:n});u.push(h);let m=sd({inputs:{x:h},backend:n,attrs:{axis:s,keepDims:i}});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var Rz={kernelName:Cs,backendName:"cpu",kernelFunc:Cz};function Mz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;ve(r,"min");let o=w.parseAxisParam(s,r.shape),l=o,d=C.getAxesPermutation(l,r.shape.length),u=r;d!=null&&(u=Zn({inputs:{x:r},backend:n,attrs:{perm:d}}),l=C.getInnerMostAxes(l.length,r.shape.length)),C.assertAxesAreInnerMostDims("min",l,u.shape.length);let[p,c]=C.computeOutAndReduceShapes(u.shape,l),h=w.sizeFromShape(c),m=w.makeZerosTypedArray(w.sizeFromShape(p),u.dtype),f=n.data.get(u.dataId).values;for(let y=0;yg[0]+r.shape[x]+g[1]),l=s.map(g=>g[0]),d=s.map((g,x)=>g[0]+r.shape[x]),u=i==="reflect"?0:1,p=n.data.get(r.dataId).values,c=r.shape.length,h=w.computeStrides(r.shape),m=w.sizeFromShape(o),f=o.length,A=w.computeStrides(o),y=w.getTypedArrayFromDType(r.dtype,m);for(let g=0;g=d[b]&&(x[b]=(d[b]-1)*2-x[b]+u);x=x.map((b,v)=>b-l[v]);let k=w.locToIndex(x,c,h);y[g]=p[k]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var Dz={kernelName:Fs,backendName:"cpu",kernelFunc:$z},Oz=Rt((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),zz=Ut(Mo,Oz),_z={kernelName:Mo,backendName:"cpu",kernelFunc:zz},Pz=Yi(_g());function u7(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=r.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let l=w.parseAxisParam([o],r.shape),d=l7({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=C.expandShapeToKeepDim(d.shape,l),p=ht({inputs:{x:d},backend:n,attrs:{shape:u}}),c=qA({inputs:{a:r,b:p},backend:n}),h=q3({inputs:{x:c},backend:n}),m=sd({inputs:{x:h},backend:n,attrs:{axis:l,keepDims:!1}}),f=ht({inputs:{x:m},backend:n,attrs:{shape:u}}),A=ZA({inputs:{a:h,b:f},backend:n});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var Lz={kernelName:Xs,backendName:"cpu",kernelFunc:u7};function Wz(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a;ve(r,"multinomial");let l=o?r:u7({inputs:{logits:r},backend:n,attrs:{dim:-1}}),d=l.shape[0],u=l.shape[1],p=n.data.get(l.dataId).values,c=[d,s],h=w.makeZerosTypedArray(w.sizeFromShape(c),"int32");for(let m=0;m=0&&u[p]{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=rh({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=Sl({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),d}var t_={kernelName:Po,backendName:"cpu",kernelFunc:p7};function n_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a;ve(r,"pad");let o=s.map((y,g)=>y[0]+r.shape[g]+y[1]),l=s.map(y=>y[0]),d=n.data.get(r.dataId).values,u=w.sizeFromShape(r.shape),p=r.shape.length,c=w.computeStrides(r.shape),h=w.sizeFromShape(o),m=o.length,f=w.computeStrides(o),A=w.getTypedArrayFromDType(r.dtype,h);i!==0&&A.fill(i);for(let y=0;yk+l[b]),x=w.locToIndex(g,m,f);A[x]=d[y]}return{dataId:n.write(A,o,r.dtype),shape:o,dtype:r.dtype}}var c7={kernelName:Os,backendName:"cpu",kernelFunc:n_},a_=Rt((e,t)=>Math.pow(e,t)),r_=Ut(zs,a_),s_={kernelName:zs,backendName:"cpu",kernelFunc:r_};function i_(e){let{backend:t,attrs:n}=e,{start:a,stop:r,dtype:s,step:i}=n,o=HA(a,r,i,s);return t.makeTensorInfo([o.length],s,o)}var o_={kernelName:Iu,backendName:"cpu",kernelFunc:i_},l_=nt(Wo,e=>1/e),u_={kernelName:Wo,backendName:"cpu",kernelFunc:l_};function d_(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a;ve(r,"resizeBilinear");let l=w.computeStrides(r.shape),[d,u]=o,[p,c,h,m]=r.shape,f=n.data.get(r.dataId).values,A=new Float32Array(w.sizeFromShape([p,d,u,m])),y=[s&&d>1?c-1:c,s&&u>1?h-1:h],g=[s&&d>1?d-1:d,s&&u>1?u-1:u],x=0,k=y[0]/g[0],b=y[1]/g[1];for(let v=0;v1?d-1:d,i&&h>1?u-1:u],A=[i&&c>1?c-1:c,i&&h>1?h-1:h],y=f[0]/A[0],g=f[1]/A[1],x=n.data.get(s.dataId).values,k=0;for(let b=0;b1?c-1:c,s&&u>1?h-1:h],g=[s&&d>1?d-1:d,s&&u>1?u-1:u],x=y[0]/g[0],k=y[1]/g[1],b=0;for(let v=0;v1?u-1:u,i&&m>1?p-1:p],g=[i&&h>1?h-1:h,i&&m>1?m-1:m],x=y[0]/g[0],k=y[1]/g[1],b=1/x,v=1/k,I=Math.ceil(b)*2+2,T=Math.ceil(v)*2+2;for(let R=0;R=h)continue;let Q=$+ie*l[1],de=ie*x,oe=Math.min(u-1,i?Math.round(de):Math.floor(de));if(z===oe)for(let me=0;me=m)continue;let ke=Q+ce*l[2],Se=ce*k,$e=Math.min(p-1,i?Math.round(Se):Math.floor(Se));U===$e&&(re+=A[ke+Y])}}f[X+Y]=re}}}}return n.makeTensorInfo(r.shape,r.dtype,f)}var y_={kernelName:Yp,backendName:"cpu",kernelFunc:A_};function g_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a;ve(r,"reverse");let i=r.shape.length,o=w.parseAxisParam(s,r.shape);if(i===0)return Ba({inputs:{x:r},backend:n});let l=new Dt(r.shape,r.dtype),d=n.bufferSync(r);for(let u=0;uc[h]=r.shape[h]-1-c[h]),l.set(d.get(...c),...p)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}var x_={kernelName:Bs,backendName:"cpu",kernelFunc:g_},b_={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=w.getTypedArrayFromDType(a.dtype,w.sizeFromShape(a.shape)),[d,u,p,c]=a.shape,[h,m]=C.getImageCenter(i,u,p),f=255,A=Math.sin(r),y=Math.cos(r),g=o.data.get(a.dataId).values;for(let x=0;x=0&&V=0&&j{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),w_={kernelName:Vs,backendName:"cpu",kernelFunc:v_};function h7(e,t,n,a,r,s,i,o,l,d){let u=[a/r,r],p=e.values,c=t.values;if(a===0)return We(n,t.dtype);let h=We(u,t.dtype);h.values.fill(l);for(let m=0;m=a/r)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||r.shape.length===1?1:w.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?E_*e:T_*(Math.exp(e)-1)),R_={kernelName:Uo,backendName:"cpu",kernelFunc:C_},M_=nt(qo,e=>e<0?-1:e>0?1:0),F_={kernelName:qo,backendName:"cpu",kernelFunc:M_},$_=nt(Us,e=>Math.sin(e)),D_={kernelName:Us,backendName:"cpu",kernelFunc:$_},O_=nt(Go,e=>Math.sinh(e)),z_={kernelName:Go,backendName:"cpu",kernelFunc:O_},__=11920928955078125e-23,f7=Math.log(__)+2,P_=nt(Xo,e=>{let t=e>-f7,n=e{let c=[...u];c[o]=p;let h=bi({inputs:{x:r},backend:n,attrs:{begin:d,size:c}});return d[o]+=p,h})}var q_={kernelName:Ko,backendName:"cpu",kernelFunc:G_},X_=nt(Gs,e=>Math.sqrt(e)),K_={kernelName:Gs,backendName:"cpu",kernelFunc:X_},Z_={kernelName:Tu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,a=t;ve(n,"square");let r=a.data.get(n.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),J_={kernelName:Nr,backendName:"cpu",kernelFunc:Y_};function Q_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a;ve(r,"stridedSlice");let{nonStrided:h,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(r.shape,s,i,o,l,d,u,p,c),x=ht({inputs:{x:r},backend:n,attrs:{shape:y}}),k;if(h){let v=bi({inputs:{x},backend:n,attrs:{begin:m,size:A}});k=ht({inputs:{x:v},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(v)}else if(g.some(v=>v===0))k=n.makeTensorInfo(g,r.dtype,[]);else{let v=n.bufferSync(x),I=V3(g,v,f,m);k=n.makeTensorInfo(I.shape,I.dtype,I.values)}let b=ht({inputs:{x:k},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(k),b}var eP={kernelName:Zo,backendName:"cpu",kernelFunc:Q_},tP=nt(Ys,e=>Math.tan(e)),nP={kernelName:Ys,backendName:"cpu",kernelFunc:tP},aP=nt(Js,e=>Math.tanh(e)),rP={kernelName:Js,backendName:"cpu",kernelFunc:aP};function sP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reps:s}=a;ve(r,"tile");let i=U3(n.bufferSync(r),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var iP={kernelName:Sr,backendName:"cpu",kernelFunc:sP};function oP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a;ve(r,"topk");let o=n.data.get(r.dataId).values,[l,d]=H3(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(d.shape,d.dtype,d.values)]}var lP={kernelName:Yo,backendName:"cpu",kernelFunc:oP};function pP(e){let{inputs:t,attrs:n,backend:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:d}=n,[u,p,c,h]=r.shape,[m,f]=d!=null?d:[p,c],A=[u,m,f,h],y=w.computeStrides(r.shape),g=y[0],x=y[1],k=y[2],b=w.getTypedArrayFromDType(r.dtype,w.sizeFromShape(A));b.fill(l);let v=a.data.get(r.dataId).values,I=a.data.get(s.dataId).values;for(let T=0;Tt-1)if(t<=1)n=0;else{let a=2*t;n-=a*Math.trunc(n/a),n>=t&&(n=a-n-1)}return w.clamp(0,n,t-1)}function fP(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let a=t-1;n+=t*(Math.trunc(-n/a)+1)}else if(n>t-1)if(t<=1)n=0;else{let a=t-1;n-=t*Math.trunc(n/a)}return w.clamp(0,n,t-1)}function mP(e,t){return e}function AP(e,t){return w.clamp(0,e,t-1)}function id(e,t,n,a,r,s,i,o,l,d,u){let p=i*a+o*r+l*s+d;return 0<=o&&on.disposeIntermediateTensorInfo(m)),h}var wP={kernelName:Eu,backendName:"cpu",kernelFunc:vP},kP=[D$,PF,z$,P$,UF,W$,V$,U$,G$,X$,Z$,J$,eD,aD,sD,lD,dD,cD,fD,F$,AD,gD,bD,VF,GF,wD,LF,ID,ND,CD,MD,TD,OD,_D,$D,LD,BD,jD,HD,qD,KD,ZD,JD,eO,nO,aO,sO,rO,YA,lO,I$,dO,cO,bO,qF,vO,KF,TO,CO,RO,YF,$O,OO,_O,LO,BO,QF,UO,WF,GO,SD,XO,ZO,JO,S$,t$,tz,az,a$,sz,lz,dz,hz,mz,yz,s$,bz,wz,Iz,Nz,Ez,gz,Rz,Fz,o$,Dz,_z,Bz,u$,p$,Uz,qz,Zz,h$,Jz,e_,t_,c7,s_,T$,A$,o_,BF,u_,E$,C$,M$,p_,h_,m_,y_,x_,b_,w_,g$,I_,N_,R_,R$,F_,D_,z_,x$,Lz,L_,B_,j_,H_,q_,K_,Z_,v$,J_,eP,k$,iO,nP,rP,iP,lP,f$,cP,gP,bP,wP,Qz];for(let e of kP)ai(e);var A7={};Fe(A7,{assertNotComplex:()=>Nl,bindCanvasToFramebuffer:()=>NP,bindColorTextureToFramebuffer:()=>oh,bindTextureToProgramUniformSampler:()=>M7,bindTextureUnit:()=>E7,bindVertexBufferToProgramAttribute:()=>e1,callAndCheck:()=>xe,canBeRepresented:()=>y7,createFragmentShader:()=>b7,createFramebuffer:()=>T7,createProgram:()=>v7,createStaticIndexBuffer:()=>I7,createStaticVertexBuffer:()=>k7,createTexture:()=>S7,createVertexShader:()=>x7,getBatchDim:()=>vi,getExtensionOrThrow:()=>od,getFramebufferErrorMessage:()=>F7,getMaxTexturesInShader:()=>O7,getNumChannels:()=>IP,getProgramUniformLocation:()=>R7,getProgramUniformLocationOrThrow:()=>C7,getRowsCols:()=>wi,getShapeAs3D:()=>lh,getTextureShapeFromLogicalShape:()=>$7,getWebGLDisjointQueryTimerVersion:()=>z7,getWebGLErrorMessage:()=>g7,getWebGLMaxTextureSize:()=>D7,hasExtension:()=>Yn,isCapableOfRenderingToFloatTexture:()=>_7,isDownloadFloatTextureEnabled:()=>P7,isReshapeFree:()=>ud,isWebGLFenceEnabled:()=>L7,isWebGLVersionEnabled:()=>n1,linkProgram:()=>w7,resetMaxTextureSize:()=>TP,resetMaxTexturesInShader:()=>EP,unbindColorTextureFromFramebuffer:()=>t1,unbindTextureUnit:()=>SP,validateFramebuffer:()=>ld,validateProgram:()=>ih,validateTextureSize:()=>N7});var ki={},a1={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function uh(e,t){ki[e]=t}function Va(e){if(!(e in ki)){let n=CP(e);if(n!==null)ki[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=ki[e];return t.isContextLost()?(delete ki[e],Va(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),ki[e])}function RP(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function CP(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=RP(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete ki[e]},!1),e===1?t.getContext("webgl",a1)||t.getContext("experimental-webgl",a1):t.getContext("webgl2",a1)}var dd;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(dd||(dd={}));var Jn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(Jn||(Jn={}));var Qt;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Qt||(Qt={}));function pd(e,t){return[t,e]}function MP(e,t){return e*t}function cd(e){let t=w.sizeFromShape(e),n=Math.ceil(t/4);return w.sizeToSquarishShape(n)}function Tl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function FP(e,t){let[n,a]=Tl(e,t);return n*a*4}function r1(e,t){let n=e,a,r,s,i,o,l,d,u,p,c;return J().getNumber("WEBGL_VERSION")===2?(a=n.R32F,r=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,d=4,u=1,p=n.HALF_FLOAT,c=n.FLOAT):(a=e.RGBA,r=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,d=4,u=4,p=t!=null?t.HALF_FLOAT_OES:null,c=e.FLOAT),l=e.RGBA,{internalFormatFloat:a,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:d,defaultNumChannels:u,textureTypeHalfFloat:p,textureTypeFloat:c}}function xe(e,t){let n=t();return J().getBool("DEBUG")&&$P(e),n}function $P(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+g7(e,t))}var DP=596e-10,OP=65504;function y7(e){return!!(J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||DPe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function x7(e,t){let n=lr(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function b7(e,t){let n=lr(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw zP(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var _P=/ERROR: [0-9]+:([0-9]+):/g;function zP(e,t){let n=_P.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let a=+n[1],r=e.split(` +`),s=r.length.toString().length+2,i=r.map((p,c)=>w.rightPad((c+1).toString(),s)+p),o=0;for(let p=0;pe.createProgram(),"Unable to create WebGLProgram.")}function b_(e,t){if(xe(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function ip(e,t){if(xe(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function __(e,t){let n=ca(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function v_(e,t){let n=ca(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function xP(){return J().getNumber("WEBGL_VERSION")===2?1:4}function k_(e){return ca(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function I_(e,t){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let r=`[${e}x${t}]`;throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n){let r=`[${e}x${t}]`,a=`[${n}x${n}]`;throw new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU "+a+".")}}function S_(e){return ca(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function eA(e,t,n,r,a,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,r)),xe(e,()=>e.vertexAttribPointer(o,a,e.FLOAT,!1,s,i)),xe(e,()=>e.enableVertexAttribArray(o)),!0)}function N_(e,t,n){L_(e,n),xe(e,()=>e.activeTexture(e.TEXTURE0+n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function wP(e,t){L_(e,t),xe(e,()=>e.activeTexture(e.TEXTURE0+t)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function T_(e,t,n){return ca(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function E_(e,t,n){return e.getUniformLocation(t,n)}function C_(e,t,n,r){xe(e,()=>N_(e,t,r)),xe(e,()=>e.uniform1i(n,r))}function bP(e){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),xe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function op(e,t,n){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function tA(e,t){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function lc(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+R_(e,t))}function R_(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function ca(e,t,n){let r=xe(e,()=>t());if(r==null)throw new Error(n);return r}function L_(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(rn){let a=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${a}.`)}}function bi(e,t=2){return _.sizeFromShape(e.slice(0,e.length-t))}function _i(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function lp(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[bi(e),..._i(e)]),t}function M_(e,t=!1){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((a,s)=>s>=e.length-2?_.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=_.squeezeShape(e).newShape);let r=_.sizeFromShape(e);if(e.length<=1&&r<=n)return[1,r];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let a=bi(e),s=2,i=2;return e.length&&([s,i]=_i(e)),r=a*(s/2)*(i/2),_.sizeToSquarishShape(r).map(o=>o*2)}return _.sizeToSquarishShape(r)}function cp(e){return e%2==0}function uc(e,t){if(e=e.slice(-2),t=t.slice(-2),_.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r||cp(n)&&cp(r)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&cp(e[0])&&cp(t[0])}var hp,dp;function F_(e){if(hp==null){let t=Vr(e);hp=t.getParameter(t.MAX_TEXTURE_SIZE)}return hp}function _P(){hp=null}function vP(){dp=null}function $_(e){if(dp==null){let t=Vr(e);dp=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,dp)}function D_(e){if(e===0)return 0;let t,n=Vr(e);return Yn(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:Yn(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function Yn(e,t){return e.getExtension(t)!=null}function nA(e){try{if(Vr(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function O_(e){if(e===0)return!1;let t=Vr(e);if(e===1){if(!Yn(t,"OES_texture_float"))return!1}else if(!Yn(t,"EXT_color_buffer_float"))return!1;return sA(t)}function z_(e){if(e===0)return!1;let t=Vr(e);if(e===1){if(!Yn(t,"OES_texture_float")||!Yn(t,"WEBGL_color_buffer_float"))return!1}else{if(Yn(t,"EXT_color_buffer_float"))return sA(t);let n="EXT_color_buffer_half_float";if(Yn(t,n)){let r=t.getExtension(n);return FP(t,r)}return!1}return sA(t)}function sA(e){let t=aA(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=1,a=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,r,a,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function FP(e,t){let n=aA(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);let a=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,a,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(i),o}function P_(e){return e!==2?!1:Vr(e).fenceSync!=null}function Sl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&_.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Ce=J();Ce.registerFlag("HAS_WEBGL",()=>Ce.getNumber("WEBGL_VERSION")>0);Ce.registerFlag("WEBGL_VERSION",()=>nA(2)?2:nA(1)?1:0);Ce.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Ce.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Ce.get("WEBGL_VERSION")===2);Ce.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Ce.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Ce.registerFlag("WEBGL_PACK",()=>Ce.getBool("HAS_WEBGL"));Ce.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_CLIP",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_REDUCE",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_LAZILY_UNPACK",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_CONV_IM2COL",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>F_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>$_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Ce.getNumber("WEBGL_VERSION");return e===0?0:D_(e)});Ce.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Ce.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!zu.isMobile());Ce.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>O_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Ce.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Ce.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Ce.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>z_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_FENCE_API_ENABLED",()=>P_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Ce.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Ce.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Ce.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>zu.isMobile()&&Ce.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});function cn(){let e,t,n,r,a,s,i,o,l,c;return J().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",r="in",a="texture",s="outputColor",i="out vec4 outputColor;",o=` +`)[0]),console.log(`%c ${w.rightPad(d[0],o)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(u.join(` +`))}function v7(e){return lr(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}function w7(e,t){if(xe(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function ih(e,t){if(xe(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function k7(e,t){let n=lr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function I7(e,t){let n=lr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function IP(){return J().getNumber("WEBGL_VERSION")===2?1:4}function S7(e){return lr(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function N7(e,t){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let a=`[${e}x${t}]`;throw new Error("Requested texture size "+a+" is invalid.")}if(e>n||t>n){let a=`[${e}x${t}]`,r=`[${n}x${n}]`;throw new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU "+r+".")}}function T7(e){return lr(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function e1(e,t,n,a,r,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),xe(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),xe(e,()=>e.enableVertexAttribArray(o)),!0)}function E7(e,t,n){W7(e,n),xe(e,()=>e.activeTexture(e.TEXTURE0+n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function SP(e,t){W7(e,t),xe(e,()=>e.activeTexture(e.TEXTURE0+t)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function C7(e,t,n){return lr(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function R7(e,t,n){return e.getUniformLocation(t,n)}function M7(e,t,n,a){xe(e,()=>E7(e,t,a)),xe(e,()=>e.uniform1i(n,a))}function NP(e){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),xe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function oh(e,t,n){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function t1(e,t){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function ld(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+F7(e,t))}function F7(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function lr(e,t,n){let a=xe(e,()=>t());if(a==null)throw new Error(n);return a}function W7(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,a=t+e.TEXTURE0;if(an){let r=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${r}.`)}}function vi(e,t=2){return w.sizeFromShape(e.slice(0,e.length-t))}function wi(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function lh(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[vi(e),...wi(e)]),t}function $7(e,t=!1){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((r,s)=>s>=e.length-2?w.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=w.squeezeShape(e).newShape);let a=w.sizeFromShape(e);if(e.length<=1&&a<=n)return[1,a];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let r=vi(e),s=2,i=2;return e.length&&([s,i]=wi(e)),a=r*(s/2)*(i/2),w.sizeToSquarishShape(a).map(o=>o*2)}return w.sizeToSquarishShape(a)}function dh(e){return e%2==0}function ud(e,t){if(e=e.slice(-2),t=t.slice(-2),w.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],a=t.slice(-1)[0];if(n===a||dh(n)&&dh(a)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&dh(e[0])&&dh(t[0])}var ph,ch;function D7(e){if(ph==null){let t=Va(e);ph=t.getParameter(t.MAX_TEXTURE_SIZE)}return ph}function TP(){ph=null}function EP(){ch=null}function O7(e){if(ch==null){let t=Va(e);ch=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ch)}function z7(e){if(e===0)return 0;let t,n=Va(e);return Yn(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:Yn(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function Yn(e,t){return e.getExtension(t)!=null}function n1(e){try{if(Va(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function _7(e){if(e===0)return!1;let t=Va(e);if(e===1){if(!Yn(t,"OES_texture_float"))return!1}else if(!Yn(t,"EXT_color_buffer_float"))return!1;return s1(t)}function P7(e){if(e===0)return!1;let t=Va(e);if(e===1){if(!Yn(t,"OES_texture_float")||!Yn(t,"WEBGL_color_buffer_float"))return!1}else{if(Yn(t,"EXT_color_buffer_float"))return s1(t);let n="EXT_color_buffer_half_float";if(Yn(t,n)){let a=t.getExtension(n);return PP(t,a)}return!1}return s1(t)}function s1(e){let t=r1(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let a=1,r=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,a,r,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function PP(e,t){let n=r1(e,t),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);let r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(i),o}function L7(e){return e!==2?!1:Va(e).fenceSync!=null}function Nl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&w.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Re=J();Re.registerFlag("HAS_WEBGL",()=>Re.getNumber("WEBGL_VERSION")>0);Re.registerFlag("WEBGL_VERSION",()=>n1(2)?2:n1(1)?1:0);Re.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Re.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Re.get("WEBGL_VERSION")===2);Re.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Re.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Re.registerFlag("WEBGL_PACK",()=>Re.getBool("HAS_WEBGL"));Re.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_CLIP",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_REDUCE",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_LAZILY_UNPACK",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_CONV_IM2COL",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>D7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>O7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Re.getNumber("WEBGL_VERSION");return e===0?0:z7(e)});Re.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Re.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!_u.isMobile());Re.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>_7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Re.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Re.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Re.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>P7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_FENCE_API_ENABLED",()=>L7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Re.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Re.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Re.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>_u.isMobile()&&Re.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});function dn(){let e,t,n,a,r,s,i,o,l,d;return J().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",a="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=` bool isnan_custom(float val) { return (val > 0.0 || val < 0.0) ? false : val != 0.0; } @@ -44,7 +44,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee } #define isnan(value) isnan_custom(value) - `,l="",c=` + `,l="",d=` #define round(value) newRound(value) int newRound(float value) { return int(floor(value + 0.5)); @@ -53,7 +53,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ivec4 newRound(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `):(e="",t="attribute",n="varying",r="varying",a="texture2D",s="gl_FragColor",i="",o=` + `):(e="",t="attribute",n="varying",a="varying",r="texture2D",s="gl_FragColor",i="",o=` #define isnan(value) isnan_custom(value) bool isnan_custom(float val) { return (val > 0. || val < 1. || val == 0.) ? false : true; @@ -70,7 +70,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee bvec4 isinf(vec4 val) { return equal(abs(val), vec4(INFINITY)); } - `,c=` + `,d=` int round(float value) { return int(floor(value + 0.5)); } @@ -78,11 +78,11 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:a,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:c}}function ki(e,t,n="index"){let r=_.computeStrides(t);return r.map((a,s)=>{let i=`int ${e[s]} = ${n} / ${a}`,o=s===r.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${a}`:`index -= ${e[s]} * ${a}`;return`${i}; ${o};`}).join("")}function iA(e){let t=_.computeStrides(e).map(n=>n.toString());return` + `),{version:e,attribute:t,varyingVs:n,varyingFs:a,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:d}}function Ii(e,t,n="index"){let a=w.computeStrides(t);return a.map((r,s)=>{let i=`int ${e[s]} = ${n} / ${r}`,o=s===a.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function i1(e){let t=w.computeStrides(e).map(n=>n.toString());return` int getFlatIndex(ivec3 coords) { return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; } -`}var W_=` +`}var B7=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -121,9 +121,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return c / 255.0; } -`,$P=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=cc.DENSE;let t=dc(e),n=cn();this.outputShape=e,this.userCode=` +`,LP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=dd.DENSE;let t=cd(e),n=dn();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } @@ -142,9 +142,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},DP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=cc.DENSE;let t=dc(e),n=cn();this.outputShape=e,this.userCode=` + `}},WP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=dd.DENSE;let t=cd(e),n=dn();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } @@ -163,23 +163,23 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},OP=class{constructor(e){this.variableNames=["A"],this.outTexUsage=Jn.DOWNLOAD;let t=cn();this.outputShape=e,this.userCode=` - ${W_} + `}},BP=class{constructor(e){this.variableNames=["A"],this.outTexUsage=Jn.DOWNLOAD;let t=dn();this.outputShape=e,this.userCode=` + ${B7} void main() { float x = getAAtOutCoords(); ${t.output} = encode_float(x); } - `}},zP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Jn.DOWNLOAD;let t=cn();this.outputShape=e,this.userCode=` - ${W_} + `}},VP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Jn.DOWNLOAD;let t=dn();this.outputShape=e,this.userCode=` + ${B7} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); ${t.output} = encode_float(x); } - `}},PP=class{constructor(e,t,n=!1){this.variableNames=["A"];let r=cn(),[a,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` - ${iA(e)} + `}},jP=class{constructor(e,t,n=!1){this.variableNames=["A"];let a=dn(),[r,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` + ${i1(e)} void main() { ivec3 coords = getOutputCoords(); @@ -191,8 +191,8 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee int r = flatIndex / ${s}; int c = imod(flatIndex, ${s}); - vec2 uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${a}.0); - vec4 values = ${r.texture2D}(A, uv); + vec2 uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${r}.0); + vec4 values = ${a.texture2D}(A, uv); float result; @@ -206,12 +206,12 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee result = values[3]; } - ${r.output} = vec4(${i}, 0., 0., 0.); + ${a.output} = vec4(${i}, 0., 0., 0.); } - `}},LP=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let r=cn(),[a,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let l=0;l<=1;l++)for(let c=0;c<=1;c++){let u=l*2+c;i+=` + `}},UP=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let a=dn(),[r,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let l=0;l<=1;l++)for(let d=0;d<=1;d++){let u=l*2+d;i+=` localCoords = coords; - if(localCoords[2] + ${c} < ${e[2]}) { - localCoords[2] += ${c}; + if(localCoords[2] + ${d} < ${e[2]}) { + localCoords[2] += ${d}; if(localCoords[1] + ${l} < ${e[1]}) { localCoords[1] += ${l}; @@ -222,8 +222,8 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee r = flatIndex / ${s}; c = imod(flatIndex, ${s}); - uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${a}.0); - values = ${r.texture2D}(A, uv); + uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${r}.0); + values = ${a.texture2D}(A, uv); if(offset == 0) { result[${u}] = values[0]; @@ -237,7 +237,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee } } `}this.userCode=` - ${iA(e)} + ${i1(e)} void main() { ivec3 coords = getOutputCoords(); @@ -250,9 +250,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${i} - ${r.output} = ${o}; + ${a.output} = ${o}; } - `}},B_={};Me(B_,{bindVertexProgramAttributeStreams:()=>Z_,createBufferFromOutputTexture:()=>Q_,createFloat16MatrixTexture:()=>G_,createFloat16PackedMatrixTexture:()=>K_,createFloat32MatrixTexture:()=>H_,createIndexBuffer:()=>U_,createPackedMatrixTexture:()=>X_,createUnsignedBytesMatrixTexture:()=>q_,createVertexBuffer:()=>j_,createVertexShader:()=>V_,downloadByteEncodedFloatMatrixFromOutputTexture:()=>t3,downloadFloat32MatrixFromBuffer:()=>e3,downloadMatrixFromPackedOutputTexture:()=>r3,downloadPackedMatrixFromBuffer:()=>n3,getInternalFormatForFloat16MatrixTexture:()=>lA,getInternalFormatForFloat16PackedMatrixTexture:()=>hA,getInternalFormatForFloat32MatrixTexture:()=>oA,getInternalFormatForPackedMatrixTexture:()=>cA,getInternalFormatForUnsignedBytesMatrixTexture:()=>uA,uploadDenseMatrixToTexture:()=>Y_,uploadPixelDataToTexture:()=>J_});function V_(e){let t=cn(),n=`${t.version} + `}},V7={};Fe(V7,{bindVertexProgramAttributeStreams:()=>Y7,createBufferFromOutputTexture:()=>ev,createFloat16MatrixTexture:()=>q7,createFloat16PackedMatrixTexture:()=>Z7,createFloat32MatrixTexture:()=>G7,createIndexBuffer:()=>H7,createPackedMatrixTexture:()=>K7,createUnsignedBytesMatrixTexture:()=>X7,createVertexBuffer:()=>U7,createVertexShader:()=>j7,downloadByteEncodedFloatMatrixFromOutputTexture:()=>nv,downloadFloat32MatrixFromBuffer:()=>tv,downloadMatrixFromPackedOutputTexture:()=>rv,downloadPackedMatrixFromBuffer:()=>av,getInternalFormatForFloat16MatrixTexture:()=>l1,getInternalFormatForFloat16PackedMatrixTexture:()=>p1,getInternalFormatForFloat32MatrixTexture:()=>o1,getInternalFormatForPackedMatrixTexture:()=>d1,getInternalFormatForUnsignedBytesMatrixTexture:()=>u1,uploadDenseMatrixToTexture:()=>J7,uploadPixelDataToTexture:()=>Q7});function j7(e){let t=dn(),n=`${t.version} precision highp float; ${t.attribute} vec3 clipSpacePos; ${t.attribute} vec2 uv; @@ -261,22 +261,22 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; - }`;return g_(e,n)}function j_(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return __(e,t)}function U_(e){let t=new Uint16Array([0,1,2,2,1,3]);return v_(e,t)}function pc(e,t,n,r,a,s){I_(t,n);let i=k_(e),o=e.TEXTURE_2D;return xe(e,()=>e.bindTexture(o,i)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),xe(e,()=>e.texImage2D(o,0,r,t,n,0,a,s,null)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function oA(e){return e.internalFormatFloat}function H_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,oA(r),r.textureFormatFloat,e.FLOAT)}function lA(e){return e.internalFormatHalfFloat}function G_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,lA(r),r.textureFormatFloat,r.textureTypeHalfFloat)}function uA(e){return e.downloadTextureFormat}function q_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,uA(r),e.RGBA,e.UNSIGNED_BYTE)}function cA(e){return e.internalFormatPackedFloat}function X_(e,t,n,r){let[a,s]=Nl(t,n);return pc(e,a,s,cA(r),e.RGBA,e.FLOAT)}function hA(e){return e.internalFormatPackedHalfFloat}function K_(e,t,n,r){let[a,s]=Nl(t,n);return pc(e,a,s,hA(r),e.RGBA,r.textureTypeHalfFloat)}function Z_(e,t,n){let r=0,a=3*4,s=3*4+2*4;return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),eA(e,t,"clipSpacePos",n,3,s,r)&&eA(e,t,"uv",n,2,s,a)}function Y_(e,t,n,r,a,s){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;a instanceof Uint8Array?(i=new Uint8Array(n*r*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*r*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(a),xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,r,0,e.RGBA,o,i)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function J_(e,t,n){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Q_(e,t,n,r){let a=e.createBuffer();xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,a));let s=4*4*t*n;return xe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),a}function e3(e,t,n){let r=e,a=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,a),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),a}function t3(e,t,n,r){let[a,s]=hc(t,n),i=4,o=new Uint8Array(SP(t*n,i));return xe(e,()=>e.readPixels(0,0,a,s,r.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function n3(e,t,n,r,a,s,i,o){let l=e,c=new Float32Array(NP(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,c),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),c}function r3(e,t,n){let r=new Float32Array(t*n*4);return xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,r)),r}var pp=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=J().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,up(t,e)):this.gl=Vr(t);let n="WEBGL_color_buffer_float",r="EXT_color_buffer_half_float";if(J().getNumber("WEBGL_VERSION")===1){let a="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=oc(this.gl,a),Yn(this.gl,s))this.textureHalfFloatExtension=oc(this.gl,s);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),Yn(this.gl,r))this.colorBufferHalfFloatExtension=oc(this.gl,r);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",Yn(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(Yn(this.gl,r))this.colorBufferHalfFloatExtension=this.gl.getExtension(r);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=j_(this.gl),this.indexBuffer=U_(this.gl),this.framebuffer=S_(this.gl),this.textureConfig=aA(this.gl,this.textureHalfFloatExtension)}get debug(){return J().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");let e=this.gl;xe(e,()=>e.finish()),xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.deleteFramebuffer(this.framebuffer)),xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),xe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),H_(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),G_(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),q_(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),J_(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,r){this.throwIfDisposed(),Y_(this.gl,e,t,n,r,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),K_(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),X_(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(tA(this.gl,this.framebuffer),this.outputTexture=null),xe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>t3(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,r,a,s){return n3(this.gl,e,t,n,r,a,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return e3(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let r=Q_(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(J().getBool("WEBGL_FENCE_API_ENABLED")){let r=e,a=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=r.clientWaitSync(a,0,0);return s===r.ALREADY_SIGNALED||s===r.CONDITION_SATISFIED},t=a}else J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>r3(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=x_(t,e),r=V_(t),a=w_(t);return xe(t,()=>t.attachShader(a,r)),xe(t,()=>t.attachShader(a,n)),b_(t,a),this.debug&&ip(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=Z_(t,this.program,this.vertexBuffer)),a}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&xe(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&ip(this.gl,this.program),xe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?T_(this.gl,e,t):E_(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),xe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),C_(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[r,a]=Nl(t,n);this.setOutputMatrixTextureDriver(e,r,a)}setOutputMatrixWriteRegion(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)}setOutputPackedMatrixWriteRegion(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&ip(this.gl,this.program),lc(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),xe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),xe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=oc(this.gl,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.createQuery();return n.beginQuery(r.TIME_ELAPSED_EXT,a),a}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await _.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),a&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),r=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=WP(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&_.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),op(this.gl,e,this.framebuffer),this.debug&&lc(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(op(this.gl,this.outputTexture,this.framebuffer),this.debug&&lc(this.gl)):tA(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let r=this.gl;op(r,e,this.framebuffer),this.debug&&lc(r),this.outputTexture=e,xe(r,()=>r.viewport(0,0,t,n)),xe(r,()=>r.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,r){this.throwIfDisposed(),xe(this.gl,()=>this.gl.scissor(e,t,n,r))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}};function WP(e){let t=0;for(;t{let m=_.sizeFromShape(p.shapeInfo.logicalShape);p.shapeInfo.isUniform?a.push(`uniform float ${p.name}${m>1?`[${m}]`:""};`):(a.push(`uniform sampler2D ${p.name};`),a.push(`uniform int offset${p.name};`))});let s=a.join(` -`),i=e.map(p=>BP(p,t,r)).join(` -`),o=t.texShape,l=cn(),c=UP(l),u,h,d=qP(l);return t.isPacked?(u=VP(t.logicalShape,o),h=GP(l)):(u=jP(t.logicalShape,o),h=HP(l)),r&&(d+=XP),[d,c,h,s,u,i,n].join(` -`)}function Tl(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return ZP(e);case 1:return YP(e);case 2:return JP(e);case 3:return QP(e);case 4:return eL(e);case 5:return tL(e);case 6:return nL(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function s3(e){switch(e.shapeInfo.logicalShape.length){case 0:return rL(e);case 1:return aL(e);case 2:return sL(e);case 3:return iL(e);default:return oL(e)}}function BP(e,t,n=!1){let r="";n?r+=s3(e):r+=Tl(e);let a=e.shapeInfo.logicalShape,s=t.logicalShape;return a.length<=s.length&&(n?r+=lL(e,t):r+=uL(e,t)),r}function VP(e,t){switch(e.length){case 0:return i3();case 1:return cL(e,t);case 2:return pL(e,t);case 3:return hL(e,t);default:return dL(e,t)}}function jP(e,t){switch(e.length){case 0:return i3();case 1:return fL(e,t);case 2:return xL(e,t);case 3:return mL(e,t);case 4:return AL(e,t);case 5:return yL(e,t);case 6:return gL(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function UP(e){return` + }`;return x7(e,n)}function U7(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return k7(e,t)}function H7(e){let t=new Uint16Array([0,1,2,2,1,3]);return I7(e,t)}function hd(e,t,n,a,r,s){N7(t,n);let i=S7(e),o=e.TEXTURE_2D;return xe(e,()=>e.bindTexture(o,i)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),xe(e,()=>e.texImage2D(o,0,a,t,n,0,r,s,null)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function o1(e){return e.internalFormatFloat}function G7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,o1(a),a.textureFormatFloat,e.FLOAT)}function l1(e){return e.internalFormatHalfFloat}function q7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,l1(a),a.textureFormatFloat,a.textureTypeHalfFloat)}function u1(e){return e.downloadTextureFormat}function X7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,u1(a),e.RGBA,e.UNSIGNED_BYTE)}function d1(e){return e.internalFormatPackedFloat}function K7(e,t,n,a){let[r,s]=Tl(t,n);return hd(e,r,s,d1(a),e.RGBA,e.FLOAT)}function p1(e){return e.internalFormatPackedHalfFloat}function Z7(e,t,n,a){let[r,s]=Tl(t,n);return hd(e,r,s,p1(a),e.RGBA,a.textureTypeHalfFloat)}function Y7(e,t,n){let a=0,r=3*4,s=3*4+2*4;return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),e1(e,t,"clipSpacePos",n,3,s,a)&&e1(e,t,"uv",n,2,s,r)}function J7(e,t,n,a,r,s){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;r instanceof Uint8Array?(i=new Uint8Array(n*a*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*a*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(r),xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,a,0,e.RGBA,o,i)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Q7(e,t,n){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function ev(e,t,n,a){let r=e.createBuffer();xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*n;return xe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function tv(e,t,n){let a=e,r=new Float32Array(n);return a.bindBuffer(a.PIXEL_PACK_BUFFER,t),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,r),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),r}function nv(e,t,n,a){let[r,s]=pd(t,n),i=4,o=new Uint8Array(MP(t*n,i));return xe(e,()=>e.readPixels(0,0,r,s,a.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function av(e,t,n,a,r,s,i,o){let l=e,d=new Float32Array(FP(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,d),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),d}function rv(e,t,n){let a=new Float32Array(t*n*4);return xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,a)),a}var hh=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=J().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,uh(t,e)):this.gl=Va(t);let n="WEBGL_color_buffer_float",a="EXT_color_buffer_half_float";if(J().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=od(this.gl,r),Yn(this.gl,s))this.textureHalfFloatExtension=od(this.gl,s);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),Yn(this.gl,a))this.colorBufferHalfFloatExtension=od(this.gl,a);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",Yn(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(Yn(this.gl,a))this.colorBufferHalfFloatExtension=this.gl.getExtension(a);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=U7(this.gl),this.indexBuffer=H7(this.gl),this.framebuffer=T7(this.gl),this.textureConfig=r1(this.gl,this.textureHalfFloatExtension)}get debug(){return J().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");let e=this.gl;xe(e,()=>e.finish()),xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.deleteFramebuffer(this.framebuffer)),xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),xe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),G7(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),q7(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),X7(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),Q7(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,a){this.throwIfDisposed(),J7(this.gl,e,t,n,a,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Z7(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),K7(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(t1(this.gl,this.framebuffer),this.outputTexture=null),xe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>nv(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,a,r,s){return av(this.gl,e,t,n,a,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return tv(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let a=ev(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),a}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(J().getBool("WEBGL_FENCE_API_ENABLED")){let a=e,r=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=a.clientWaitSync(r,0,0);return s===a.ALREADY_SIGNALED||s===a.CONDITION_SATISFIED},t=r}else J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>rv(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=b7(t,e),a=j7(t),r=v7(t);return xe(t,()=>t.attachShader(r,a)),xe(t,()=>t.attachShader(r,n)),w7(t,r),this.debug&&ih(t,r),this.vertexAttrsAreBound||(this.setProgram(r),this.vertexAttrsAreBound=Y7(t,this.program,this.vertexBuffer)),r}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&xe(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&ih(this.gl,this.program),xe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?C7(this.gl,e,t):R7(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),xe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),M7(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[a,r]=Tl(t,n);this.setOutputMatrixTextureDriver(e,a,r)}setOutputMatrixWriteRegion(e,t,n,a){this.setOutputMatrixWriteRegionDriver(n,e,a,t)}setOutputPackedMatrixWriteRegion(e,t,n,a){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&ih(this.gl,this.program),ld(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),xe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),xe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=od(this.gl,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.createQuery();return n.beginQuery(a.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await w.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),a=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=HP(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&w.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),oh(this.gl,e,this.framebuffer),this.debug&&ld(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(oh(this.gl,this.outputTexture,this.framebuffer),this.debug&&ld(this.gl)):t1(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let a=this.gl;oh(a,e,this.framebuffer),this.debug&&ld(a),this.outputTexture=e,xe(a,()=>a.viewport(0,0,t,n)),xe(a,()=>a.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,a){this.throwIfDisposed(),xe(this.gl,()=>this.gl.scissor(e,t,n,a))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}};function HP(e){let t=0;for(;t{let m=w.sizeFromShape(h.shapeInfo.logicalShape);h.shapeInfo.isUniform?r.push(`uniform float ${h.name}${m>1?`[${m}]`:""};`):(r.push(`uniform sampler2D ${h.name};`),r.push(`uniform int offset${h.name};`))});let s=r.join(` +`),i=e.map(h=>GP(h,t,a)).join(` +`),o=t.texShape,l=dn(),d=KP(l),u,p,c=JP(l);return t.isPacked?(u=qP(t.logicalShape,o),p=YP(l)):(u=XP(t.logicalShape,o),p=ZP(l)),a&&(c+=QP),[c,d,p,s,u,i,n].join(` +`)}function El(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return tL(e);case 1:return nL(e);case 2:return aL(e);case 3:return rL(e);case 4:return sL(e);case 5:return iL(e);case 6:return oL(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function iv(e){switch(e.shapeInfo.logicalShape.length){case 0:return lL(e);case 1:return uL(e);case 2:return dL(e);case 3:return pL(e);default:return cL(e)}}function GP(e,t,n=!1){let a="";n?a+=iv(e):a+=El(e);let r=e.shapeInfo.logicalShape,s=t.logicalShape;return r.length<=s.length&&(n?a+=hL(e,t):a+=fL(e,t)),a}function qP(e,t){switch(e.length){case 0:return ov();case 1:return mL(e,t);case 2:return gL(e,t);case 3:return AL(e,t);default:return yL(e,t)}}function XP(e,t){switch(e.length){case 0:return ov();case 1:return xL(e,t);case 2:return IL(e,t);case 3:return bL(e,t);case 4:return vL(e,t);case 5:return wL(e,t);case 6:return kL(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function KP(e){return` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${e.texture2D}(textureSampler, uv).r; } - `}function HP(e){return` + `}function ZP(e){return` void setOutput(float val) { ${e.output} = vec4(val, 0, 0, 0); } - `}function GP(e){return` + `}function YP(e){return` void setOutput(vec4 val) { ${e.output} = val; } - `}function qP(e){return`${e.version} + `}function JP(e){return`${e.version} precision highp float; precision highp int; precision highp sampler2D; @@ -331,10 +331,10 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return fract((p3.x + p3.y) * p3.z); } - ${wL} - ${bL} - ${_L} - `}var wL=` + ${SL} + ${NL} + ${TL} + `}var SL=` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -346,7 +346,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,bL=` +`,NL=` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -354,7 +354,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,_L=` +`,TL=` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -363,7 +363,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,XP=` +`,QP=` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -374,11 +374,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float modCoord = mod(float(dim), 2.); return modCoord == 0. ? frag.r : frag.g; } -`;function i3(){return` +`;function ov(){return` int getOutputCoords() { return 0; } - `}function cL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` + `}function mL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` int getOutputCoords() { return 2 * int(resultUV.x * ${n[1]}.0); } @@ -392,7 +392,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${n[0]}, ${n[1]})); return 2 * (resTexRC.x * ${n[1]} + resTexRC.y); } - `}function fL(e,t){return t[0]===1?` + `}function xL(e,t){return t[0]===1?` int getOutputCoords() { return int(resultUV.x * ${t[1]}.0); } @@ -406,21 +406,21 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${t[0]}, ${t[1]})); return resTexRC.x * ${t[1]} + resTexRC.y; } - `}function hL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2);return` + `}function AL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),r=a*Math.ceil(e[1]/2);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); int index = resTexRC.x * ${n[1]} + resTexRC.y; - int b = index / ${a}; - index -= b * ${a}; + int b = index / ${r}; + index -= b * ${r}; - int r = 2 * (index / ${r}); - int c = imod(index, ${r}) * 2; + int r = 2 * (index / ${a}); + int c = imod(index, ${a}) * 2; return ivec3(b, r, c); } - `}function mL(e,t){let n=ki(["r","c","d"],e);return` + `}function bL(e,t){let n=Ii(["r","c","d"],e);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -428,7 +428,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${n} return ivec3(r, c, d); } - `}function dL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2),s=a,i="",o="b, r, c";for(let l=2;l=1?u="coords = 0;":u=o.map(A=>`coords.${h[A+c]} = 0;`).join(` -`);let d="";i<2&&s>0?d="coords":d=e.shapeInfo.logicalShape.map((A,y)=>`coords.${h[y+c]}`).join(", ");let p="return outputValue;",m=_.sizeFromShape(e.shapeInfo.logicalShape)===1,f=_.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)p=` + `}function hL(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=sv(e.shapeInfo.logicalShape,t.logicalShape),l=lt(i),d=i-s,u,p=["x","y","z","w","u","v"];s===0?u="":i<2&&o.length>=1?u="coords = 0;":u=o.map(A=>`coords.${p[A+d]} = 0;`).join(` +`);let c="";i<2&&s>0?c="coords":c=e.shapeInfo.logicalShape.map((A,y)=>`coords.${p[y+d]}`).join(", ");let h="return outputValue;",m=w.sizeFromShape(e.shapeInfo.logicalShape)===1,f=w.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` return vec4(outputValue.xy, outputValue.xy); - `;else if(m&&!f)i===1?p=` + `;else if(m&&!f)i===1?h=` return vec4(outputValue.x, outputValue.x, 0., 0.); - `:p=` + `:h=` return vec4(outputValue.x); - `;else if(o.length){let A=s-2,y=s-1;o.indexOf(A)>-1&&o.indexOf(y)>-1?p="return vec4(outputValue.x);":o.indexOf(A)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(y)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}return` - vec4 ${a}() { + `;else if(o.length){let A=s-2,y=s-1;o.indexOf(A)>-1&&o.indexOf(y)>-1?h="return vec4(outputValue.x);":o.indexOf(A)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(y)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}return` + vec4 ${r}() { ${l} coords = getOutputCoords(); ${u} - vec4 outputValue = get${r}(${d}); - ${p} + vec4 outputValue = get${a}(${c}); + ${h} } - `}function uL(e,t){let n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),a="get"+r+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&e.shapeInfo.flatOffset==null&&_.arraysEqual(i,s))return` - float ${a}() { + `}function fL(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&e.shapeInfo.flatOffset==null&&w.arraysEqual(i,s))return` + float ${r}() { return sampleTexture(${n}, resultUV); } - `;let c=lt(l),u=a3(e.shapeInfo.logicalShape,t.logicalShape),h=l-o,d,p=["x","y","z","w","u","v"];o===0?d="":l<2&&u.length>=1?d="coords = 0;":d=u.map(f=>`coords.${p[f+h]} = 0;`).join(` -`);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,A)=>`coords.${p[A+h]}`).join(", "),` - float ${a}() { - ${c} coords = getOutputCoords(); - ${d} - return get${r}(${m}); + `;let d=lt(l),u=sv(e.shapeInfo.logicalShape,t.logicalShape),p=l-o,c,h=["x","y","z","w","u","v"];o===0?c="":l<2&&u.length>=1?c="coords = 0;":c=u.map(f=>`coords.${h[f+p]} = 0;`).join(` +`);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,A)=>`coords.${h[A+p]}`).join(", "),` + float ${r}() { + ${d} coords = getOutputCoords(); + ${c} + return get${a}(${m}); } - `}function lt(e){if(e<=1)return"int";if(e===2)return"ivec2";if(e===3)return"ivec3";if(e===4)return"ivec4";if(e===5)return"ivec5";if(e===6)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Cl(e,t){let n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Rl(e,t){return t.map(n=>e[n]).join(", ")}function vL(e,t,n,r){let a=t.userCode,s=n.map((p,m)=>{let f={logicalShape:p.shape,texShape:p.isUniform?null:p.texData.texShape,isUniform:p.isUniform,isPacked:p.isUniform?!1:p.texData.isPacked,flatOffset:null};return p.texData!=null&&p.texData.slice!=null&&p.texData.slice.flatOffset>0&&(f.flatOffset=p.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(p=>p.shapeInfo),o={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},l=KP(s,o,a,t.packedInputs),c=e.createProgram(l),u=null,h=e.getUniformLocation(c,"NAN",!1);J().getNumber("WEBGL_VERSION")===1&&(u=e.getUniformLocation(c,"INFINITY",!1));let d={};for(let p=0;p{let a=n.logicalShape,s=t[r],i=s.shape;if(!_.arraysEqual(a,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${a} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,l=s.isUniform?null:s.texData.texShape;if(!_.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function kL(e,t,n,r,a){o3(t.inShapeInfos,n),o3([t.outShapeInfo],[r]);let s=r.texData.texture,i=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),J().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,l)=>{let c=t.program.variableNames[l],u=t.uniformLocations[c],h=t.uniformLocations[`offset${c}`];if(u!=null){if(o.isUniform){if(_.sizeFromShape(o.shape)<2)e.gl.uniform1f(u,o.uniformValues[0]);else{let d=o.uniformValues;d instanceof Float32Array||(d=new Float32Array(d)),e.gl.uniform1fv(u,d)}return}o.texData.slice!=null&&h!=null&&e.gl.uniform1i(h,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,u,l)}}),a!=null&&a(e,t.webGLProgram),e.executeProgram()}function IL(e,t,n){let r="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,l=i.isUniform?"uniform":i.texData.texShape;r+=`${i.shape}_${l}_${o}`});let a=e.userCode,s=e.constructor.name;return s+="_"+r+"_"+a,s}var{addImpl:SL,bincountImpl:l3,bincountReduceImpl:NL,ceilImpl:TL,concatImpl:EL,expImpl:CL,expm1Impl:RL,floorImpl:ML,gatherV2Impl:FL,greaterImpl:$L,lessImpl:DL,linSpaceImpl:OL,logImpl:zL,maxImpl:PL,maximumImpl:LL,minimumImpl:WL,multiplyImpl:BL,negImpl:VL,prodImpl:jL,rangeImpl:UL,rsqrtImpl:HL,simpleAbsImpl:u3,sliceImpl:GL,sparseReshapeImpl:qL,stridedSliceImpl:XL,subImpl:KL,tileImpl:ZL,topKImpl:YL,transposeImpl:dA,uniqueImpl:JL}=Wm;function c3(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function hn(e,t){return t===1?[e]:c3(e,t)}function QL(e,t){if(e===1)return"rc";let n="";for(let r=0;re[n]).join(", ")}function EL(e,t,n,a){let r=t.userCode,s=n.map((h,m)=>{let f={logicalShape:h.shape,texShape:h.isUniform?null:h.texData.texShape,isUniform:h.isUniform,isPacked:h.isUniform?!1:h.texData.isPacked,flatOffset:null};return h.texData!=null&&h.texData.slice!=null&&h.texData.slice.flatOffset>0&&(f.flatOffset=h.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(h=>h.shapeInfo),o={logicalShape:a.shape,texShape:a.texData.texShape,isUniform:!1,isPacked:a.texData.isPacked,flatOffset:null},l=eL(s,o,r,t.packedInputs),d=e.createProgram(l),u=null,p=e.getUniformLocation(d,"NAN",!1);J().getNumber("WEBGL_VERSION")===1&&(u=e.getUniformLocation(d,"INFINITY",!1));let c={};for(let h=0;h{let r=n.logicalShape,s=t[a],i=s.shape;if(!w.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,l=s.isUniform?null:s.texData.texShape;if(!w.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function CL(e,t,n,a,r){lv(t.inShapeInfos,n),lv([t.outShapeInfo],[a]);let s=a.texData.texture,i=a.texData.texShape;a.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),J().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,l)=>{let d=t.program.variableNames[l],u=t.uniformLocations[d],p=t.uniformLocations[`offset${d}`];if(u!=null){if(o.isUniform){if(w.sizeFromShape(o.shape)<2)e.gl.uniform1f(u,o.uniformValues[0]);else{let c=o.uniformValues;c instanceof Float32Array||(c=new Float32Array(c)),e.gl.uniform1fv(u,c)}return}o.texData.slice!=null&&p!=null&&e.gl.uniform1i(p,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,u,l)}}),r!=null&&r(e,t.webGLProgram),e.executeProgram()}function RL(e,t,n){let a="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,l=i.isUniform?"uniform":i.texData.texShape;a+=`${i.shape}_${l}_${o}`});let r=e.userCode,s=e.constructor.name;return s+="_"+a+"_"+r,s}var{addImpl:ML,bincountImpl:uv,bincountReduceImpl:FL,ceilImpl:$L,concatImpl:DL,expImpl:OL,expm1Impl:zL,floorImpl:_L,gatherV2Impl:PL,greaterImpl:LL,lessImpl:WL,linSpaceImpl:BL,logImpl:VL,maxImpl:jL,maximumImpl:UL,minimumImpl:HL,multiplyImpl:GL,negImpl:qL,prodImpl:XL,rangeImpl:KL,rsqrtImpl:ZL,simpleAbsImpl:dv,sliceImpl:YL,sparseReshapeImpl:JL,stridedSliceImpl:QL,subImpl:eW,tileImpl:tW,topKImpl:nW,transposeImpl:c1,uniqueImpl:aW}=WA;function pv(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function pn(e,t){return t===1?[e]:pv(e,t)}function rW(e,t){if(e===1)return"rc";let n="";for(let a=0;a ${t[0]}`;let r="";for(let a=e-2;a= ${t[a]}`,a ${t[0]}`;let a="";for(let r=e-2;r= ${t[r]}`,r= ${t}; bool rEdge = rp1 >= ${n}; - `}function nW(e,t){let n=e.length,r=aW(n,t);return n===1?`getA(rc), + `}function oW(e,t){let n=e.length,a=uW(n,t);return n===1?`getA(rc), rc + 1 >= ${e[0]} ? 0. : getA(rc + 1), - 0, 0`:`getA(${r[0]}), - cEdge ? 0. : getA(${r[1]}), - rEdge ? 0. : getA(${r[2]}), - rEdge || cEdge ? 0. : getA(${r[3]})`}var h3=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let r=0;r<4;r++){let a="thisRC = rc;";r%2==1&&(a+="thisRC.z += 1;"),r>1&&(a+="thisRC.y += 1;"),n+=` - ${a} - ${r>0?"if(thisRC.y < rows && thisRC.z < cols){":""} + 0, 0`:`getA(${a[0]}), + cEdge ? 0. : getA(${a[1]}), + rEdge ? 0. : getA(${a[2]}), + rEdge || cEdge ? 0. : getA(${a[3]})`}var cv=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let a=0;a<4;a++){let r="thisRC = rc;";a%2==1&&(r+="thisRC.z += 1;"),a>1&&(r+="thisRC.y += 1;"),n+=` + ${r} + ${a>0?"if(thisRC.y < rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); - result[${r}] = + result[${a}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); - ${r>0?"}":""} + ${a>0?"}":""} `}this.userCode=` - ${sW(t)} - ${iA(e)} + ${dW(t)} + ${i1(e)} void main() { ivec3 rc = getOutputCoords(); @@ -876,12 +876,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function sW(e){return` + `}};function dW(e){return` ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } - `}var iW=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let r=p3(t,n),a=f3(e,r,n);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);let s=d3(e,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[a].shift();return this.usedTextures[a].push(o),o}let i;return r===Qt.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):r===Qt.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):r===Qt.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===Qt.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===Qt.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,r){if(this.freeTextures==null)return;let a=p3(n,r),s=f3(t,a,r);s in this.freeTextures||(this.freeTextures[s]=[]);let i=d3(t,a,this.gpgpu.gl,this.gpgpu.textureConfig,r),o=J().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],c=l.indexOf(e);if(c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(c,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function oW(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function d3(e,t,n,r,a){let s=lW(t,r),i;if(a){let[l,c]=Nl(e[0],e[1]);i=l*c}else{let[l,c]=hc(e[0],e[1]);i=l*c}let o=oW(n,s);return i*o}function lW(e,t){switch(e){case Qt.PACKED_2X2_FLOAT32:return cA(t);case Qt.PACKED_2X2_FLOAT16:return hA(t);case Qt.UNPACKED_FLOAT32:return oA(t);case Qt.UNPACKED_FLOAT16:return lA(t);case Qt.PACKED_4X1_UNSIGNED_BYTE:return uA(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function uW(e){return J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Qt.PACKED_2X2_FLOAT32:Qt.UNPACKED_FLOAT32:e?Qt.PACKED_2X2_FLOAT16:Qt.UNPACKED_FLOAT16}function p3(e,t){if(e===Jn.UPLOAD)return Qt.PACKED_2X2_FLOAT32;if(e===Jn.RENDER||e==null)return uW(t);if(e===Jn.DOWNLOAD||e===Jn.PIXELS)return Qt.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function f3(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Wa=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}var pW=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let a=fv(t,n),r=mv(e,a,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=hv(e,a,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].shift();return this.usedTextures[r].push(o),o}let i;return a===Qt.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):a===Qt.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):a===Qt.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):a===Qt.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):a===Qt.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,a){if(this.freeTextures==null)return;let r=fv(n,a),s=mv(t,r,a);s in this.freeTextures||(this.freeTextures[s]=[]);let i=hv(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,a),o=J().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],d=l.indexOf(e);if(d<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(d,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function cW(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function hv(e,t,n,a,r){let s=hW(t,a),i;if(r){let[l,d]=Tl(e[0],e[1]);i=l*d}else{let[l,d]=pd(e[0],e[1]);i=l*d}let o=cW(n,s);return i*o}function hW(e,t){switch(e){case Qt.PACKED_2X2_FLOAT32:return d1(t);case Qt.PACKED_2X2_FLOAT16:return p1(t);case Qt.UNPACKED_FLOAT32:return o1(t);case Qt.UNPACKED_FLOAT16:return l1(t);case Qt.PACKED_4X1_UNSIGNED_BYTE:return u1(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function fW(e){return J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Qt.PACKED_2X2_FLOAT32:Qt.UNPACKED_FLOAT32:e?Qt.PACKED_2X2_FLOAT16:Qt.UNPACKED_FLOAT16}function fv(e,t){if(e===Jn.UPLOAD)return Qt.PACKED_2X2_FLOAT32;if(e===Jn.RENDER||e==null)return fW(t);if(e===Jn.DOWNLOAD||e===Jn.PIXELS)return Qt.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function mv(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Pr=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` float unaryOperation(float x) { ${t} } @@ -892,11 +892,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},xr="if (isnan(x)) return x;",cW="return x;",m3="return abs(x);",hW="return (x >= 0.0) ? x : (exp(x) - 1.0);",dW=xr+` + `}},xa="if (isnan(x)) return x;",mW="return x;",Av="return abs(x);",AW="return (x >= 0.0) ? x : (exp(x) - 1.0);",yW=xa+` return (x < 0.0) ? 0.0 : x; -`,pW=xr+` +`,gW=xa+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,fp="return x;",fW="return 1.0 / (1.0 + exp(-1.0 * x));",mW="return x;",AW=` +`,fh="return x;",xW="return 1.0 / (1.0 + exp(-1.0 * x));",bW="return x;",vW=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -905,7 +905,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,yW=` +`,wW=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -915,7 +915,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,gW=` +`,kW=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -925,7 +925,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,xW="return 1.0 / (1.0 + exp(-1.0 * x));",Ml=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` +`,IW="return 1.0 / (1.0 + exp(-1.0 * x));",Fl=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` vec4 unaryOperation(vec4 x) { ${t} } @@ -936,17 +936,17 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},wW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=hn("rc",t),r=lt(t),a=QL(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` + `}},SW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=pn("rc",t),a=lt(t),r=rW(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` void main() { - ${r} rc = getOutputCoords(); - vec4 packedInput = getA(${a}); + ${a} rc = getOutputCoords(); + vec4 packedInput = getA(${r}); setOutput(getChannel(packedInput, ${i})); } - `}},bW=Wr.whereImpl,_W=1e-7,vW=1e-4,pA={};function kW(e){return e in pA||(pA[e]={}),pA[e]}var IW=128,SW=600;function NW(){return J().global.screen==null?1024:J().global.screen.height*J().global.screen.width*window.devicePixelRatio*SW/1024/1024}var Fl=class extends cu{constructor(e){super();if(this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!J().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Vr(J().getNumber("WEBGL_VERSION"));this.binaryCache=kW(J().getNumber("WEBGL_VERSION")),this.gpgpu=new pp(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new iW(this.gpgpu),this.numMBBeforeWarning=NW(),this.texData=new _h(this,aa())}nextDataId(){return Fl.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((J().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||J().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let r={id:this.nextDataId()};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:Jn.UPLOAD,refCount:1}),r}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,r,a){if(J().getBool("DEBUG")&&this.checkNumericalProblems(t),r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:Jn.UPLOAD,refCount:a})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:r,complexTensorInfos:a,slice:s,shape:i,isPacked:o}=t;if(s!=null){let h;o?h=new Ml(i,fp):h=new Wa(i,fp);let d=this.runWebGLProgram(h,[{dataId:e,shape:i,dtype:r}],r),p=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),p}if(n!=null)return this.convertAndCacheOnCPU(e);if(r==="string")return n;let l=this.activeTimers!=null,c;l&&(c=_.now());let u;if(r==="complex64"){let h=this.readSync(a.real.dataId),d=this.readSync(a.imag.dataId);u=E.mergeRealAndImagArrays(h,d)}else u=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=_.now()-c),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){let p=this.pendingRead.get(e);return new Promise(m=>p.push(m))}let t=this.texData.get(e),{values:n,shape:r,slice:a,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(a!=null){let p;o?p=new Ml(r,fp):p=new Wa(r,fp);let m=this.runWebGLProgram(p,[{dataId:e,shape:r,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!J().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&J().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,c;if(s!=="complex64"&&J().get("WEBGL_BUFFER_SUPPORTED")){c=this.decode(e);let p=this.texData.get(c.dataId);l=this.gpgpu.createBufferFromTexture(p.texture,...dc(r))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let u;if(s==="complex64"){let p=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=p[0],f=p[1];u=E.mergeRealAndImagArrays(m,f)}else if(l==null)u=this.getValuesFromTexture(e);else{let p=_.sizeFromShape(r);u=this.gpgpu.downloadFloat32MatrixFromBuffer(l,p)}c!=null&&this.disposeIntermediateTensorInfo(c);let h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(p=>p(h)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&aa().removeDataId(e,this),this.pendingDeletes--),h}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(r=>_.decodeString(r))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,e();let a=_.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=_.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,r&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(a);i.kernelMs=_.sum(o),i.getExtraProfileInfo=()=>o.map((l,c)=>({name:s[c],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:_.now(),endMs:null}}endTimer(e){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=_.now(),e)}async getQueryTime(e){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:r,usage:a,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(t,r,a,s)));let c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=IW){return J().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&_.sizeFromShape(n.shape)0&&_.isString(n[0])){let a=n.map(s=>_.encodeString(s));r=this.write(a,e,t)}else r=this.write(n,e,t);return this.texData.get(r).usage=null,{dataId:r,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:r}=this.makeTensorInfo(e,t,n);return aa().makeTensorFromDataId(r,e,t,this)}unpackTensor(e){let t=new wW(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new rW(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[bi(e.shape),..._i(e.shape)],r={dtype:e.dtype,shape:n,dataId:e.dataId},a=[bi(t),..._i(t)],s=new h3(a,n),i=!0,o=this.runWebGLProgram(s,[r],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:r,dtype:a}=t,s=lp(r),i;n?i=new DP(s):i=new $P(s);let o=!0,l=this.runWebGLProgram(i,[{shape:s,dtype:a,dataId:e}],a,null,o);return{dtype:a,shape:r,dataId:l.dataId}}runWebGLProgram(e,t,n,r,a=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===cc.DENSE){let f=dc(e.outputShape);i.texShape=f.map(A=>A*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),_.sizeFromShape(s.shape)===0)return i.values=_.getTypedArrayFromDType(s.dtype,0),s;let o=[],l=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let A=this.texData.get(f.dataId);if(A.texture==null){if(!e.packedInputs&&_.sizeFromShape(f.shape)<=J().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:A.values};e.packedInputs&&(A.isPacked=!0,A.shape=f.shape)}else if(!!A.isPacked!=!!e.packedInputs)f=A.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),A=this.texData.get(f.dataId);else if(A.isPacked&&!uc(A.shape,f.shape)){let y=f,g=f.shape;f.shape=A.shape,f=this.packedReshape(f,g),o.push(f),A=this.texData.get(f.dataId),y.shape=g}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:A,isUniform:!1}});this.uploadToGPU(s.dataId);let c={shape:s.shape,texData:i,isUniform:!1},u=IL(e,l,c),h=this.getAndSaveBinary(u,()=>vL(this.gpgpu,e,l,c)),d=this.activeTimers!=null,p;d&&(p=this.startTimer()),kL(this.gpgpu,h,l,c,r),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),d&&(p=this.endTimer(p),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(p)}));let m=J().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=_.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!J().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&a===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,r,a=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,r,a)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(J().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=L(()=>{if(!J().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=J().getBool("DEBUG");J().set("DEBUG",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(J().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?_W:vW}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:r,values:a,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let l=this.activeTimers!=null,c;l&&(c=_.now());let u=t.texShape;if(u==null&&(u=M_(n,o),t.texShape=u),a!=null){let h=lp(n),d,p=u[1],m=u[0],f=a instanceof Uint8Array;o?([p,m]=Nl(u[0],u[1]),d=new LP(h,[m,p],f)):d=new PP(h,[m,p],f);let A=this.makeTensorInfo([m,p],r);f?this.texData.get(A.dataId).usage=Jn.PIXELS:this.texData.get(A.dataId).usage=Jn.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(A.dataId),p,m,a);let y=!0,g=this.runWebGLProgram(d,[A],r,null,y),x=this.texData.get(g.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(A),this.texData.delete(g.dataId),t.values=null,l&&(this.uploadWaitMs+=_.now()-c)}else{let h=this.acquireTexture(u,i,r,o);t.texture=h}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:r}=n;return this.releaseGPUData(e),t!=null&&(n.values=TW(t,r)),n.values}acquireTexture(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let a=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${a} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,r)}computeBytes(e,t){return e[0]*e[1]*_.bytesPerElement(t)}};Fl.nextDataId=0;function TW(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let r=0;rnew Fl,2);var EW={forceHalfFloat:y3},g3=` + `}},NW=Wa.whereImpl,TW=1e-7,EW=1e-4,h1={};function CW(e){return e in h1||(h1[e]={}),h1[e]}var RW=128,MW=600;function FW(){return J().global.screen==null?1024:J().global.screen.height*J().global.screen.width*window.devicePixelRatio*MW/1024/1024}var $l=class extends du{constructor(e){super();if(this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!J().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Va(J().getNumber("WEBGL_VERSION"));this.binaryCache=CW(J().getNumber("WEBGL_VERSION")),this.gpgpu=new hh(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new pW(this.gpgpu),this.numMBBeforeWarning=FW(),this.texData=new wp(this,nr())}nextDataId(){return $l.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((J().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||J().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let a={id:this.nextDataId()};return this.texData.set(a,{shape:t,dtype:n,values:e,usage:Jn.UPLOAD,refCount:1}),a}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,a,r){if(J().getBool("DEBUG")&&this.checkNumericalProblems(t),a==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:a,values:t,usage:Jn.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:a,complexTensorInfos:r,slice:s,shape:i,isPacked:o}=t;if(s!=null){let p;o?p=new Fl(i,fh):p=new Pr(i,fh);let c=this.runWebGLProgram(p,[{dataId:e,shape:i,dtype:a}],a),h=this.readSync(c.dataId);return this.disposeIntermediateTensorInfo(c),h}if(n!=null)return this.convertAndCacheOnCPU(e);if(a==="string")return n;let l=this.activeTimers!=null,d;l&&(d=w.now());let u;if(a==="complex64"){let p=this.readSync(r.real.dataId),c=this.readSync(r.imag.dataId);u=C.mergeRealAndImagArrays(p,c)}else u=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=w.now()-d),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){let h=this.pendingRead.get(e);return new Promise(m=>h.push(m))}let t=this.texData.get(e),{values:n,shape:a,slice:r,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(r!=null){let h;o?h=new Fl(a,fh):h=new Pr(a,fh);let m=this.runWebGLProgram(h,[{dataId:e,shape:a,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!J().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&J().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,d;if(s!=="complex64"&&J().get("WEBGL_BUFFER_SUPPORTED")){d=this.decode(e);let h=this.texData.get(d.dataId);l=this.gpgpu.createBufferFromTexture(h.texture,...cd(a))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let u;if(s==="complex64"){let h=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=h[0],f=h[1];u=C.mergeRealAndImagArrays(m,f)}else if(l==null)u=this.getValuesFromTexture(e);else{let h=w.sizeFromShape(a);u=this.gpgpu.downloadFloat32MatrixFromBuffer(l,h)}d!=null&&this.disposeIntermediateTensorInfo(d);let p=this.convertAndCacheOnCPU(e,u),c=this.pendingRead.get(e);return this.pendingRead.delete(e),c.forEach(h=>h(p)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&nr().removeDataId(e,this),this.pendingDeletes--),p}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>w.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],a=!1;this.programTimersStack==null?(this.programTimersStack=n,a=!0):this.activeTimers.push(n),this.activeTimers=n,e();let r=w.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=w.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,a&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(r);i.kernelMs=w.sum(o),i.getExtraProfileInfo=()=>o.map((l,d)=>({name:s[d],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:w.now(),endMs:null}}endTimer(e){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=w.now(),e)}async getQueryTime(e){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:a,usage:r,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(a,n),this.textureManager.releaseTexture(t,a,r,s)));let d=this.texData.get(e);d.texture=null,d.texShape=null,d.isPacked=!1,d.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=RW){return J().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&w.sizeFromShape(n.shape)0&&w.isString(n[0])){let r=n.map(s=>w.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return this.texData.get(a).usage=null,{dataId:a,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:a}=this.makeTensorInfo(e,t,n);return nr().makeTensorFromDataId(a,e,t,this)}unpackTensor(e){let t=new SW(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new lW(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[vi(e.shape),...wi(e.shape)],a={dtype:e.dtype,shape:n,dataId:e.dataId},r=[vi(t),...wi(t)],s=new cv(r,n),i=!0,o=this.runWebGLProgram(s,[a],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:a,dtype:r}=t,s=lh(a),i;n?i=new WP(s):i=new LP(s);let o=!0,l=this.runWebGLProgram(i,[{shape:s,dtype:r,dataId:e}],r,null,o);return{dtype:r,shape:a,dataId:l.dataId}}runWebGLProgram(e,t,n,a,r=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===dd.DENSE){let f=cd(e.outputShape);i.texShape=f.map(A=>A*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),w.sizeFromShape(s.shape)===0)return i.values=w.getTypedArrayFromDType(s.dtype,0),s;let o=[],l=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let A=this.texData.get(f.dataId);if(A.texture==null){if(!e.packedInputs&&w.sizeFromShape(f.shape)<=J().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:A.values};e.packedInputs&&(A.isPacked=!0,A.shape=f.shape)}else if(!!A.isPacked!=!!e.packedInputs)f=A.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),A=this.texData.get(f.dataId);else if(A.isPacked&&!ud(A.shape,f.shape)){let y=f,g=f.shape;f.shape=A.shape,f=this.packedReshape(f,g),o.push(f),A=this.texData.get(f.dataId),y.shape=g}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:A,isUniform:!1}});this.uploadToGPU(s.dataId);let d={shape:s.shape,texData:i,isUniform:!1},u=RL(e,l,d),p=this.getAndSaveBinary(u,()=>EL(this.gpgpu,e,l,d)),c=this.activeTimers!=null,h;c&&(h=this.startTimer()),CL(this.gpgpu,p,l,d,a),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),c&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let m=J().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=w.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!J().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&r===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,a,r=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,a,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(J().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=L(()=>{if(!J().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=J().getBool("DEBUG");J().set("DEBUG",!1);let t=this.abs(Ie(1e-8)).dataSync()[0];if(J().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?TW:EW}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:a,values:r,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let l=this.activeTimers!=null,d;l&&(d=w.now());let u=t.texShape;if(u==null&&(u=$7(n,o),t.texShape=u),r!=null){let p=lh(n),c,h=u[1],m=u[0],f=r instanceof Uint8Array;o?([h,m]=Tl(u[0],u[1]),c=new UP(p,[m,h],f)):c=new jP(p,[m,h],f);let A=this.makeTensorInfo([m,h],a);f?this.texData.get(A.dataId).usage=Jn.PIXELS:this.texData.get(A.dataId).usage=Jn.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(A.dataId),h,m,r);let y=!0,g=this.runWebGLProgram(c,[A],a,null,y),x=this.texData.get(g.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(A),this.texData.delete(g.dataId),t.values=null,l&&(this.uploadWaitMs+=w.now()-d)}else{let p=this.acquireTexture(u,i,a,o);t.texture=p}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:a}=n;return this.releaseGPUData(e),t!=null&&(n.values=$W(t,a)),n.values}acquireTexture(e,t,n,a){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let r=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${r} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,a)}computeBytes(e,t){return e[0]*e[1]*w.bytesPerElement(t)}};$l.nextDataId=0;function $W(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let a=0;anew $l,2);var DW={forceHalfFloat:gv},xv=` if (isnan(a)) return a; if (isnan(b)) return b; -`,$l=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=E.assertAndGetBroadcastShape(t,n),this.userCode=` +`,Dl=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,n),this.userCode=` float binaryOperation(float a, float b) { ${e} } @@ -956,26 +956,26 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float b = getBAtOutCoords(); setOutput(binaryOperation(a, b)); } - `}},mp=` + `}},mh=` result.r = isNaN.r > 0. ? NAN : result.r; result.g = isNaN.g > 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`,fc=class{constructor(e,t,n,r=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=E.assertAndGetBroadcastShape(t,n);let a=this.outputShape.length,s="";if(r)if(a===0||_.sizeFromShape(this.outputShape)===1)s=` +`,fd=class{constructor(e,t,n,a=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=C.assertAndGetBroadcastShape(t,n);let r=this.outputShape.length,s="";if(a)if(r===0||w.sizeFromShape(this.outputShape)===1)s=` result.y = 0.; result.z = 0.; result.w = 0.; `;else if(s=` - ${lt(a)} coords = getOutputCoords(); - `,a===1)s+=` + ${lt(r)} coords = getOutputCoords(); + `,r===1)s+=` result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; result.z = 0.; result.w = 0.; - `;else{let i=hn("coords",a);s+=` + `;else{let i=pn("coords",r);s+=` bool nextRowOutOfBounds = - (${i[a-2]} + 1) >= ${this.outputShape[a-2]}; + (${i[r-2]} + 1) >= ${this.outputShape[r-2]}; bool nextColOutOfBounds = - (${i[a-1]} + 1) >= ${this.outputShape[a-1]}; + (${i[r-1]} + 1) >= ${this.outputShape[r-1]}; result.y = nextColOutOfBounds ? 0. : result.y; result.z = nextRowOutOfBounds ? 0. : result.z; result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; @@ -993,21 +993,21 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Pn(e){let{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var CW={kernelName:vs,backendName:"webgl",kernelFunc:Pn};function Ba(e){let{inputs:t,backend:n}=e,{real:r,imag:a}=t,s=n.makeTensorInfo(r.shape,"complex64"),i=n.texData.get(s.dataId),o=Pn({inputs:{x:r},backend:n}),l=Pn({inputs:{x:a},backend:n});return i.complexTensorInfos={real:o,imag:l},s}var RW={kernelName:Eh,backendName:"webgl",kernelFunc:Ba},x3="return (a < 0.) ? b * a : a;",w3=` + `}};function Pn(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var OW={kernelName:ks,backendName:"webgl",kernelFunc:Pn};function Lr(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.makeTensorInfo(a.shape,"complex64"),i=n.texData.get(s.dataId),o=Pn({inputs:{x:a},backend:n}),l=Pn({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:l},s}var zW={kernelName:Cp,backendName:"webgl",kernelFunc:Lr},bv="return (a < 0.) ? b * a : a;",vv=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function MW(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{alpha:s}=r,i=n.makeTensorInfo([],"float32",_.createScalarValue(s,"float32")),o=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(w3,a.shape,i.shape):new $l(x3,a.shape,i.shape),l=n.runWebGLProgram(o,[a,i],a.dtype);return n.disposeIntermediateTensorInfo(i),l}var FW={kernelName:ks,backendName:"webgl",kernelFunc:MW},b3="return (a < 0.) ? b * a : a;",_3=` +`;function _W(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a,i=n.makeTensorInfo([],"float32",w.createScalarValue(s,"float32")),o=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd(vv,r.shape,i.shape):new Dl(bv,r.shape,i.shape),l=n.runWebGLProgram(o,[r,i],r.dtype);return n.disposeIntermediateTensorInfo(i),l}var PW={kernelName:Is,backendName:"webgl",kernelFunc:_W},wv="return (a < 0.) ? b * a : a;",kv=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function $W(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(_3,r.shape,a.shape):new $l(b3,r.shape,a.shape);return n.runWebGLProgram(s,[r,a],r.dtype)}var DW={kernelName:zs,backendName:"webgl",kernelFunc:$W},v3="if (isnan(x)) return x;",OW=` +`;function LW(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd(kv,a.shape,r.shape):new Dl(wv,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)}var WW={kernelName:_s,backendName:"webgl",kernelFunc:LW},Iv="if (isnan(x)) return x;",BW=` if (isnan(a)) return a; if (isnan(b)) return b; -`,zW=` +`,VW=` result.r = isNaN.r > 0. ? NAN : result.r; result.g = isNaN.g > 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`;function qe({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:r}){return({inputs:a,backend:s})=>{let{x:i}=a,o=s,l=r||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let h=o.texData.get(i.dataId),d=n(h.values,l);return o.makeTensorInfo(i.shape,l,d)}let c=J().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,u;return c?u=new Ml(i.shape,t):u=new Wa(i.shape,e),o.runWebGLProgram(u,[i],l)}}function en({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:r=!1,cpuKernelImpl:a,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:c}=i,u=o;if(r&&l.dtype==="complex64"){let m=u.texData.get(l.dataId),f=u.texData.get(c.dataId),[A,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[v,w]=x,b={dataId:v.dataId,dtype:v.dtype,shape:l.shape},k={dataId:w.dataId,dtype:w.dtype,shape:c.shape},N=new $l(e,l.shape,c.shape);return u.runWebGLProgram(N,[b,k],ir(v.dtype,w.dtype))}),g=Ba({inputs:{real:A,imag:y},backend:u});return u.disposeIntermediateTensorInfo(A),u.disposeIntermediateTensorInfo(y),g}let h=s||ir(l.dtype,c.dtype);if(u.shouldExecuteOnCPU([l,c])&&a!=null){let m=u.texData.get(l.dataId),f=u.texData.get(c.dataId),[A,y]=a(l.shape,c.shape,m.values,f.values,h),g=u.makeTensorInfo(y,h),x=u.texData.get(g.dataId);return x.values=A,g}let d=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,p;return d?p=new fc(t,l.shape,c.shape,n):p=new $l(e,l.shape,c.shape),u.runWebGLProgram(p,[l,c],h)}}function Ap(e,t=!1){if(e==="linear")return t?mW:cW;if(e==="relu")return t?yW:dW;if(e==="elu")return t?AW:hW;if(e==="relu6")return t?gW:pW;if(e==="prelu")return t?_3:b3;if(e==="leakyrelu")return t?w3:x3;if(e==="sigmoid")return t?xW:fW;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var k3=class{constructor(e,t,n,r=!1,a=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let c=r?e[1]:e[2],u=Math.ceil(c/2),h=r?"i * 2, rc.y":"rc.y, i * 2",d=a?"rc.z, i * 2":"i * 2, rc.z",p=r?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=a?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",A="";i&&(o?f=`vec4 activation(vec4 a) { +`;function qe({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:a}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,l=a||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let p=o.texData.get(i.dataId),c=n(p.values,l);return o.makeTensorInfo(i.shape,l,c)}let d=J().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,u;return d?u=new Fl(i.shape,t):u=new Pr(i.shape,e),o.runWebGLProgram(u,[i],l)}}function en({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:a=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:d}=i,u=o;if(a&&l.dtype==="complex64"){let m=u.texData.get(l.dataId),f=u.texData.get(d.dataId),[A,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[k,b]=x,v={dataId:k.dataId,dtype:k.dtype,shape:l.shape},I={dataId:b.dataId,dtype:b.dtype,shape:d.shape},T=new Dl(e,l.shape,d.shape);return u.runWebGLProgram(T,[v,I],ia(k.dtype,b.dtype))}),g=Lr({inputs:{real:A,imag:y},backend:u});return u.disposeIntermediateTensorInfo(A),u.disposeIntermediateTensorInfo(y),g}let p=s||ia(l.dtype,d.dtype);if(u.shouldExecuteOnCPU([l,d])&&r!=null){let m=u.texData.get(l.dataId),f=u.texData.get(d.dataId),[A,y]=r(l.shape,d.shape,m.values,f.values,p),g=u.makeTensorInfo(y,p),x=u.texData.get(g.dataId);return x.values=A,g}let c=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return c?h=new fd(t,l.shape,d.shape,n):h=new Dl(e,l.shape,d.shape),u.runWebGLProgram(h,[l,d],p)}}function Ah(e,t=!1){if(e==="linear")return t?bW:mW;if(e==="relu")return t?wW:yW;if(e==="elu")return t?vW:AW;if(e==="relu6")return t?kW:gW;if(e==="prelu")return t?kv:wv;if(e==="leakyrelu")return t?vv:bv;if(e==="sigmoid")return t?IW:xW;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var Sv=class{constructor(e,t,n,a=!1,r=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let d=a?e[1]:e[2],u=Math.ceil(d/2),p=a?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",h=a?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",A="";i&&(o?f=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} }`:l?f=`vec4 activation(vec4 a) { @@ -1025,13 +1025,13 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, for (int i = 0; i < ${u}; i++) { int batchA = ${g}; int batchB = ${x}; - vec4 a = getMatrixA(batchA, ${h}); - vec4 b = getMatrixB(batchB, ${d}); + vec4 a = getMatrixA(batchA, ${p}); + vec4 b = getMatrixB(batchB, ${c}); // These swizzled products need to be separately added. // See: https://github.com/tensorflow/tfjs/issues/1735 - result += (${p[0]} * ${m[0]}); - result += (${p[1]} * ${m[1]}); + result += (${h[0]} * ${m[0]}); + result += (${h[1]} * ${m[1]}); } return result; } @@ -1046,7 +1046,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}},I3={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"},S3=class{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=E.assertAndGetBroadcastShape(t,n),this.userCode=` + `}},Nv={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"},Tv=class{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=C.assertAndGetBroadcastShape(t,n),this.userCode=` float binaryOpComplex( float areal, float aimag, float breal, float bimag) { ${e} @@ -1059,15 +1059,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float bimag = getBImagAtOutCoords(); setOutput(binaryOpComplex(areal, aimag, breal, bimag)); } - `}},N3="return a * b;";function fA(e){let{inputs:t,backend:n}=e,{a:r,b:a}=t,s=E.upcastType(r.dtype,a.dtype);if(r.dtype==="complex64"){let o=n.texData.get(r.dataId),l=n.texData.get(a.dataId),c=new S3(I3.REAL,r.shape,a.shape),u=new S3(I3.IMAG,r.shape,a.shape),h=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:r.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:r.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:a.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:a.shape}],d=n.runWebGLProgram(c,h,"float32"),p=n.runWebGLProgram(u,h,"float32"),m=Ba({inputs:{real:d,imag:p},backend:n});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}if(n.shouldExecuteOnCPU([r,a])){let o=n.texData.get(r.dataId),l=n.texData.get(a.dataId),[c,u]=BL(r.shape,a.shape,o.values,l.values,s),h=n.makeTensorInfo(u,s),d=n.texData.get(h.dataId);return d.values=c,h}let i;return J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new fc(N3,r.shape,a.shape):i=new $l(N3,r.shape,a.shape),n.runWebGLProgram(i,[r,a],s)}var PW={kernelName:Fs,backendName:"webgl",kernelFunc:fA};function LW(e,t,n){let r=[bi(e.shape),..._i(e.shape)],a={dtype:e.dtype,shape:r,dataId:e.dataId},s=[bi(t),..._i(t)],i=new h3(s,r),o=!0,l=n.runWebGLProgram(i,[a],e.dtype,null,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}function fe(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{shape:s}=r,i=n,o=_.sizeFromShape(a.shape),l=_.inferFromImplicitShape(s,o),c=_.sizeFromShape(l);_.assert(o===c,()=>`The new shape (${l}) has ${c} elements and the old shape (${a.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let u=i.texData.get(a.dataId);return u.isPacked&&!uc(a.shape,l)&&!(u.texture!==null&&uc(u.shape,l))?LW(a,l,i):(i.incRef(a.dataId),{dataId:a.dataId,shape:l,dtype:a.dtype})}var WW={kernelName:Bo,backendName:"webgl",kernelFunc:fe},T3=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:r,inSize:a,outSize:s}=e;this.outputShape=[r,s];let i=Math.floor(n/4)*4,o=n%4,l="sumValue += dot(values, ones);";if(t!=null){let u=1/t;l=`sumValue += dot(values * ${_.isInt(u)?u.toPrecision(2):u}, ones);`}let c="";a%n>0&&(c=` - if (inIdx < 0 || inIdx >= ${a}) { + `}},Ev="return a * b;";function f1(e){let{inputs:t,backend:n}=e,{a,b:r}=t,s=C.upcastType(a.dtype,r.dtype);if(a.dtype==="complex64"){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),d=new Tv(Nv.REAL,a.shape,r.shape),u=new Tv(Nv.IMAG,a.shape,r.shape),p=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:a.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:r.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:r.shape}],c=n.runWebGLProgram(d,p,"float32"),h=n.runWebGLProgram(u,p,"float32"),m=Lr({inputs:{real:c,imag:h},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}if(n.shouldExecuteOnCPU([a,r])){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),[d,u]=GL(a.shape,r.shape,o.values,l.values,s),p=n.makeTensorInfo(u,s),c=n.texData.get(p.dataId);return c.values=d,p}let i;return J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new fd(Ev,a.shape,r.shape):i=new Dl(Ev,a.shape,r.shape),n.runWebGLProgram(i,[a,r],s)}var jW={kernelName:$s,backendName:"webgl",kernelFunc:f1};function UW(e,t,n){let a=[vi(e.shape),...wi(e.shape)],r={dtype:e.dtype,shape:a,dataId:e.dataId},s=[vi(t),...wi(t)],i=new cv(s,a),o=!0,l=n.runWebGLProgram(i,[r],e.dtype,null,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}function fe(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=n,o=w.sizeFromShape(r.shape),l=w.inferFromImplicitShape(s,o),d=w.sizeFromShape(l);w.assert(o===d,()=>`The new shape (${l}) has ${d} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let u=i.texData.get(r.dataId);return u.isPacked&&!ud(r.shape,l)&&!(u.texture!==null&&ud(u.shape,l))?UW(r,l,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype})}var HW={kernelName:Bo,backendName:"webgl",kernelFunc:fe},Cv=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i=Math.floor(n/4)*4,o=n%4,l="sumValue += dot(values, ones);";if(t!=null){let u=1/t;l=`sumValue += dot(values * ${w.isInt(u)?u.toPrecision(2):u}, ones);`}let d="";r%n>0&&(d=` + if (inIdx < 0 || inIdx >= ${r}) { return 0.0; } `),this.userCode=` const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${c} + ${d} return getX(batch, inIdx); } @@ -1112,7 +1112,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(sumValue); } - `}},BW=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:r,inSize:a,outSize:s}=e;this.outputShape=[r,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?l="sumValue":t==="prod"?l="prodValue":t==="all"?l="allValue":t==="any"&&(l="anyValue");let c=Math.floor(n/4)*4,u=n%4,h=` + `}},GW=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?l="sumValue":t==="prod"?l="prodValue":t==="all"?l="allValue":t==="any"&&(l="anyValue");let d=Math.floor(n/4)*4,u=n%4,p=` if (${t==="sum"}) { sumValue += dot(values, ones); } else if (${t==="prod"}) { @@ -1121,16 +1121,16 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } else { minMaxValue = ${o}(values, minMaxValue); } - `,d="vec4";t==="all"?(i="1.0",h=` + `,c="vec4";t==="all"?(i="1.0",p=` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); - `,d="bvec4"):t==="any"&&(i="0.0",h=` + `,c="bvec4"):t==="any"&&(i="0.0",p=` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); - `,d="bvec4");let p="";a%n>0&&(p=` - if (inIdx < 0 || inIdx >= ${a}) { + `,c="bvec4");let h="";r%n>0&&(h=` + if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } `),this.userCode=` @@ -1138,7 +1138,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${p} + ${h} return getX(batch, inIdx); } @@ -1154,64 +1154,64 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float allValue = 1.0; float anyValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${d}; i += 4) { int inIdx = inOffset + i; - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), getValue(batch, inIdx + 3) ); - ${h} + ${p} } - int inIdx = inOffset + ${c}; + int inIdx = inOffset + ${d}; if (${u===1}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), initializationValue, initializationValue, initializationValue ); - ${h} + ${p} } else if (${u===2}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), initializationValue, initializationValue ); - ${h} + ${p} } else if (${u===3}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), initializationValue ); - ${h} + ${p} } setOutput(${l}); } - `}};function VW(e){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let n=t.length?t[t.length-1].outSize:e[1],r=E.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return t}function Si(e,t,n,r){let a=VW(e.shape),s=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t);for(let a=0;a6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let r=lt(this.rank),a=c3("rc",this.rank),s=new Array(this.rank);for(let c=0;c6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],a=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let a=lt(this.rank),r=pv("rc",this.rank),s=new Array(this.rank);for(let d=0;d=2&&u>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${A}).`);let v=(y>g?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([p,m]);_.assert(h===d,()=>`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${r} must match.`);let w=n?[y,h,p]:[y,p,h],b=r?[g,m,d]:[g,d,m],k=fe({inputs:{x:e},backend:a,attrs:{shape:w}}),N=fe({inputs:{x:t},backend:a,attrs:{shape:b}}),C=[k,N],F=Math.max(y,g),O=n?k.shape[1]:k.shape[2],z=s!=null,V=i!=null,j=l==="leakyrelu",U=l!=null?Ap(l,!0):null,X=z||V||j||U!=null,G;if((p===1||m===1)&&O>E3&&X===!1){let Y=k,ae=N;n&&(Y=dn({inputs:{x:k},backend:a,attrs:{perm:[0,2,1]}}),C.push(Y)),r&&(ae=dn({inputs:{x:N},backend:a,attrs:{perm:[0,2,1]}}),C.push(ae));let te=m!==1,ie=m===1,Q=Y;te&&(Q=fe({inputs:{x:Y},backend:a,attrs:{shape:[F,O,1]}}),C.push(Q));let ce=m===1?2:1,oe=ae;ie&&(oe=fe({inputs:{x:ae},backend:a,attrs:{shape:[F,1,O]}}),C.push(oe));let me=fA({inputs:{a:Q,b:oe},backend:a});G=gp({inputs:{x:me},backend:a,attrs:{axis:ce,keepDims:!0}}),C.push(me)}else{let Y=ir(e.dtype,t.dtype),ae=new k3(w,b,[F,p,m],n,r,z,U,V,j),te=[k,N];if(s!=null&&te.push(s),V&&te.push(i),j){let ie=a.makeTensorInfo([],"float32",_.createScalarValue(o,"float32"));te.push(ie),C.push(ie)}G=a.runWebGLProgram(ae,te,Y)}let ee=fe({inputs:{x:G},backend:a,attrs:{shape:v}});C.push(G);for(let Y of C)a.disposeIntermediateTensorInfo(Y);return ee}function KW(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=r;return xp({a,b:s,transposeA:l,transposeB:c,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:h,activation:u})}var ZW={kernelName:ei,backendName:"webgl",kernelFunc:KW},C3="return abs(x);";function YW(e){let{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])&&r.dtype!=="complex64"){let s=n.texData.get(r.dataId),i=u3(s.values);return n.makeTensorInfo(r.shape,r.dtype,i)}let a;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?a=new Ml(r.shape,C3):a=new Wa(r.shape,C3),n.runWebGLProgram(a,[r],r.dtype)}var JW={kernelName:eo,backendName:"webgl",kernelFunc:YW},QW=xr+` + `}};function yh(e,t,n){let a=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new ZW(e.shape,t):new KW(e.shape,t);return n.runWebGLProgram(a,[e],e.dtype)}function YW(e,t,n,a){let r=t,s=e.shape.length,i=w.parseAxisParam(r,e.shape),o=i,l=C.getAxesPermutation(o,s),d=l!=null,u=e;d&&(u=yh(e,l,a),o=C.getInnerMostAxes(o.length,s)),C.assertAxesAreInnerMostDims("sum",o,s);let[p,c]=C.computeOutAndReduceShapes(u.shape,o),h=p;n&&(h=C.expandShapeToKeepDim(p,i));let m=w.sizeFromShape(c),f=w.sizeFromShape(e.shape)/m,A=fe({inputs:{x:u},attrs:{shape:[f,m]},backend:a}),y=lc(e.dtype),g=Ni(A,y,"sum",a),x=fe({inputs:{x:g},attrs:{shape:h},backend:a});return a.disposeIntermediateTensorInfo(A),a.disposeIntermediateTensorInfo(g),d&&a.disposeIntermediateTensorInfo(u),x}function gh(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;return YW(r,s,i,n)}var JW={kernelName:qs,backendName:"webgl",kernelFunc:gh};function cn(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{perm:s}=a,i=n,o=r.shape.length,l=new Array(o);for(let u=0;u=2&&u>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${A}).`);let k=(y>g?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([h,m]);w.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${a} must match.`);let b=n?[y,p,h]:[y,h,p],v=a?[g,m,c]:[g,c,m],I=fe({inputs:{x:e},backend:r,attrs:{shape:b}}),T=fe({inputs:{x:t},backend:r,attrs:{shape:v}}),R=[I,T],$=Math.max(y,g),z=n?I.shape[1]:I.shape[2],_=s!=null,V=i!=null,j=l==="leakyrelu",U=l!=null?Ah(l,!0):null,X=_||V||j||U!=null,G;if((h===1||m===1)&&z>Rv&&X===!1){let Y=I,re=T;n&&(Y=cn({inputs:{x:I},backend:r,attrs:{perm:[0,2,1]}}),R.push(Y)),a&&(re=cn({inputs:{x:T},backend:r,attrs:{perm:[0,2,1]}}),R.push(re));let te=m!==1,ie=m===1,Q=Y;te&&(Q=fe({inputs:{x:Y},backend:r,attrs:{shape:[$,z,1]}}),R.push(Q));let de=m===1?2:1,oe=re;ie&&(oe=fe({inputs:{x:re},backend:r,attrs:{shape:[$,1,z]}}),R.push(oe));let me=f1({inputs:{a:Q,b:oe},backend:r});G=gh({inputs:{x:me},backend:r,attrs:{axis:de,keepDims:!0}}),R.push(me)}else{let Y=ia(e.dtype,t.dtype),re=new Sv(b,v,[$,h,m],n,a,_,U,V,j),te=[I,T];if(s!=null&&te.push(s),V&&te.push(i),j){let ie=r.makeTensorInfo([],"float32",w.createScalarValue(o,"float32"));te.push(ie),R.push(ie)}G=r.runWebGLProgram(re,te,Y)}let ee=fe({inputs:{x:G},backend:r,attrs:{shape:k}});R.push(G);for(let Y of R)r.disposeIntermediateTensorInfo(Y);return ee}function eB(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:d,activation:u,leakyreluAlpha:p}=a;return xh({a:r,b:s,transposeA:l,transposeB:d,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:p,activation:u})}var tB={kernelName:ei,backendName:"webgl",kernelFunc:eB},Mv="return abs(x);";function nB(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])&&a.dtype!=="complex64"){let s=n.texData.get(a.dataId),i=dv(s.values);return n.makeTensorInfo(a.shape,a.dtype,i)}let r;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Fl(a.shape,Mv):r=new Pr(a.shape,Mv),n.runWebGLProgram(r,[a],a.dtype)}var aB={kernelName:eo,backendName:"webgl",kernelFunc:nB},rB=xa+` if (abs(x) > 1.) { return NAN; } return acos(x); -`,eB=qe({opSnippet:QW}),tB={kernelName:to,backendName:"webgl",kernelFunc:eB},nB=xr+` +`,sB=qe({opSnippet:rB}),iB={kernelName:to,backendName:"webgl",kernelFunc:sB},oB=xa+` if (x < 1.0) return NAN; -return log(x + sqrt(x * x - 1.0));`,rB=qe({opSnippet:nB}),aB={kernelName:no,backendName:"webgl",kernelFunc:rB},R3="return a + b;",sB=en({opSnippet:R3,packedOpSnippet:R3,supportsComplex:!0,cpuKernelImpl:SL}),iB={kernelName:Ia,backendName:"webgl",kernelFunc:sB},oB=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((a,s)=>`T${s}`);let n=[];this.variableNames.forEach(a=>{n.push(`float v${a} = get${a}AtOutCoords();`)});let r=this.variableNames.map(a=>`v${a}`).join(" + ");this.userCode=` +return log(x + sqrt(x * x - 1.0));`,lB=qe({opSnippet:oB}),uB={kernelName:no,backendName:"webgl",kernelFunc:lB},Fv="return a + b;",dB=en({opSnippet:Fv,packedOpSnippet:Fv,supportsComplex:!0,cpuKernelImpl:ML}),pB={kernelName:kr,backendName:"webgl",kernelFunc:dB},cB=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`float v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} - float result = ${r}; + float result = ${a}; setOutput(result); } - `}},lB=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((a,s)=>`T${s}`);let n=[];this.variableNames.forEach(a=>{n.push(`vec4 v${a} = get${a}AtOutCoords();`)});let r=this.variableNames.map(a=>`v${a}`).join(" + ");this.userCode=` + `}},hB=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`vec4 v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} - vec4 result = ${r}; + vec4 result = ${a}; setOutput(result); } - `}};function wp(e){let{inputs:t,backend:n}=e,r=t;if(r.length===1)return Pn({inputs:{x:r[0]},backend:n});if(r.length>J().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(r.length/2),l=wp({inputs:r.slice(0,o),backend:n}),c=wp({inputs:r.slice(o),backend:n});return wp({inputs:[l,c],backend:n})}let a=r.map(o=>o.dtype).reduce((o,l)=>ir(o,l)),s=r.map(o=>o.shape),i=J().getBool("WEBGL_PACK")?new lB(r[0].shape,s):new oB(r[0].shape,s);return n.runWebGLProgram(i,r,a)}var uB={kernelName:is,backendName:"webgl",kernelFunc:wp};function cB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),c=E.getInnerMostAxes(c.length,o)),E.assertAxesAreInnerMostDims("all",c,o);let[d,p]=E.computeOutAndReduceShapes(h.shape,c),m=_.sizeFromShape(p),f=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,m]}}),A=Si(f,f.dtype,"all",n),y;if(i){let g=E.expandShapeToKeepDim(d,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(h),y}var hB={kernelName:ro,backendName:"webgl",kernelFunc:cB};function dB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),c=E.getInnerMostAxes(c.length,o)),E.assertAxesAreInnerMostDims("any",c,o);let[d,p]=E.computeOutAndReduceShapes(h.shape,c),m=_.sizeFromShape(p),f=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,m]}}),A=Si(f,f.dtype,"any",n),y;if(i){let g=E.expandShapeToKeepDim(d,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(h),y}var pB={kernelName:ao,backendName:"webgl",kernelFunc:dB},fB=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:r,batchSize:a,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[a,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + `}};function bh(e){let{inputs:t,backend:n}=e,a=t;if(a.length===1)return Pn({inputs:{x:a[0]},backend:n});if(a.length>J().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(a.length/2),l=bh({inputs:a.slice(0,o),backend:n}),d=bh({inputs:a.slice(o),backend:n});return bh({inputs:[l,d],backend:n})}let r=a.map(o=>o.dtype).reduce((o,l)=>ia(o,l)),s=a.map(o=>o.shape),i=J().getBool("WEBGL_PACK")?new hB(a[0].shape,s):new cB(a[0].shape,s);return n.runWebGLProgram(i,a,r)}var fB={kernelName:is,backendName:"webgl",kernelFunc:bh};function mB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),d=C.getInnerMostAxes(d.length,o)),C.assertAxesAreInnerMostDims("all",d,o);let[c,h]=C.computeOutAndReduceShapes(p.shape,d),m=w.sizeFromShape(h),f=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),A=Ni(f,f.dtype,"all",n),y;if(i){let g=C.expandShapeToKeepDim(c,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(p),y}var AB={kernelName:ao,backendName:"webgl",kernelFunc:mB};function yB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),d=C.getInnerMostAxes(d.length,o)),C.assertAxesAreInnerMostDims("any",d,o);let[c,h]=C.computeOutAndReduceShapes(p.shape,d),m=w.sizeFromShape(h),f=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),A=Ni(f,f.dtype,"any",n),y;if(i){let g=C.expandShapeToKeepDim(c,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(p),y}var gB={kernelName:ro,backendName:"webgl",kernelFunc:yB},xB=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:a,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; - int inOffset = outIdx * ${r}; + int inOffset = outIdx * ${a}; int bestIndex = inOffset; float bestValue = getA(batch, bestIndex); - for (int i = 0; i < ${r}; i++) { + for (int i = 0; i < ${a}; i++) { int inIdx = ${o}; float candidate = getA(batch, inIdx); if (candidate ${i} bestValue) { @@ -1262,55 +1262,55 @@ return log(x + sqrt(x * x - 1.0));`,rB=qe({opSnippet:nB}),aB={kernelName:no,back } setOutput(float(bestIndex)); } - `}},mB=class{constructor(e,t,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,_.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let a=e[e.length-1],s=Math.ceil(a/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),r||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=lt(o),c=hn("coords",o),u,h;if(s===1){h=o+1;let k=lt(h);u=` - ${k} sourceLocR = ${k}(${c.join()}, 0); - ++${c[o-1]}; - ${k} sourceLocG = ${k}(${c.join()}, 0); - ++${c[o-2]}; - ${k} sourceLocA = ${k}(${c.join()}, 0); - --${c[o-1]}; - ${k} sourceLocB = ${k}(${c.join()}, 0); - --${c[o-2]};`}else h=o,u=` + `}},bB=class{constructor(e,t,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,w.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),a||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=lt(o),d=pn("coords",o),u,p;if(s===1){p=o+1;let I=lt(p);u=` + ${I} sourceLocR = ${I}(${d.join()}, 0); + ++${d[o-1]}; + ${I} sourceLocG = ${I}(${d.join()}, 0); + ++${d[o-2]}; + ${I} sourceLocA = ${I}(${d.join()}, 0); + --${d[o-1]}; + ${I} sourceLocB = ${I}(${d.join()}, 0); + --${d[o-2]};`}else p=o,u=` ${l} sourceLocR = coords; - ++${c[o-1]}; + ++${d[o-1]}; ${l} sourceLocG = coords; - ++${c[o-2]}; + ++${d[o-2]}; ${l} sourceLocA = coords; - --${c[o-1]}; + --${d[o-1]}; ${l} sourceLocB = coords; - --${c[o-2]};`;let d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],m=d.map(k=>"int "+k),f=hn("sourceLocR",h-1).concat("inIdx.r"),A=hn("sourceLocG",h-1).concat("inIdx.g"),y=hn("sourceLocB",h-1).concat("inIdx.b"),g=hn("sourceLocA",h-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",v=r?"":` + --${d[o-2]};`;let c=["x","y","z","w","u","v"].slice(0,p),h="."+c[p-1],m=c.map(I=>"int "+I),f=pn("sourceLocR",p-1).concat("inIdx.r"),A=pn("sourceLocG",p-1).concat("inIdx.g"),y=pn("sourceLocB",p-1).concat("inIdx.b"),g=pn("sourceLocA",p-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",k=a?"":` inIdx = round(vec4(getBestIndicesAChannel(${f.join()}), getBestIndicesAChannel(${A.join()}), getBestIndicesAChannel(${y.join()}), - getBestIndicesAChannel(${g.join()})));`,w=`vec4( + getBestIndicesAChannel(${g.join()})));`,b=`vec4( getAChannel(${f.join()}), hasNextCol ? getAChannel(${A.join()}) : 0., hasNextRow ? getAChannel(${y.join()}) : 0., - hasNextRow && hasNextCol ? getAChannel(${g.join()}) : 0.)`,b=r?"":` + hasNextRow && hasNextCol ? getAChannel(${g.join()}) : 0.)`,v=a?"":` float getBestIndicesAChannel(${m.join()}) { - return getChannel(getBestIndicesA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getBestIndicesA(${c.join()}), + vec2(${c.slice(-2).join()})); }`;this.userCode=` float getAChannel(${m.join()}) { - return getChannel(getA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getA(${c.join()}), + vec2(${c.slice(-2).join()})); } - ${b} + ${v} void main() { ${l} coords = getOutputCoords(); - bool hasNextCol = ${c[o-1]} < ${i[o-1]-1}; - bool hasNextRow = ${c[o-2]} < ${i[o-2]-1}; + bool hasNextCol = ${d[o-1]} < ${i[o-1]-1}; + bool hasNextRow = ${d[o-2]} < ${i[o-2]-1}; ${u} - ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p}, - sourceLocB${p}, sourceLocA${p}) * ${t}; + ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h}, + sourceLocB${h}, sourceLocA${h}) * ${t}; ivec4 inIdx = srcIdx; vec4 bestIndex = vec4(inIdx); - vec4 bestValue = ${w}; + vec4 bestValue = ${b}; for (int i = 0; i < ${t}; i++) { inIdx = srcIdx; - ${v} - vec4 candidate = ${w}; + ${k} + vec4 candidate = ${b}; bvec4 nan = isnan(candidate); bvec4 replace = bvec4( vec4(${x}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); @@ -1324,25 +1324,25 @@ return log(x + sqrt(x * x - 1.0));`,rB=qe({opSnippet:nB}),aB={kernelName:no,back } setOutput(bestIndex); } - `}};function M3(e,t,n,r=null){let a=t.shape[0],s=t.shape[1];r!=null&&(a=r.shape[0],s=r.shape[1]);let i=E.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:a,outSize:Math.ceil(s/i)},l=new fB(o,n,r==null),c=[t];r!=null&&c.push(r);let u=e.runWebGLProgram(l,c,"int32");if(u.shape[1]===1)return u;let h=M3(e,t,n,u);return e.disposeIntermediateTensorInfo(u),h}function F3(e,t,n,r=null){let a=r!=null?r.shape:t.shape,s=a[a.length-1],i=E.computeOptimalWindowSize(s),o=new mB(a,i,n,r==null),l=r==null?[t]:[t,r],c=e.runWebGLProgram(o,l,"int32");if(c.shape.length===t.shape.length){let u=F3(e,t,n,c);return e.disposeIntermediateTensorInfo(c),u}return c}function $3(e,t,n,r){let a=[n];if(E.assertAxesAreInnerMostDims("arg"+r.charAt(0).toUpperCase()+r.slice(1),a,t.shape.length),!J().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=E.computeOutAndReduceShapes(t.shape,a),l=_.sizeFromShape(o),c=fe({inputs:{x:t},backend:e,attrs:{shape:[-1,l]}});s.push(c);let u=M3(e,c,r);s.push(u);let h=fe({inputs:{x:u},backend:e,attrs:{shape:i}});return s.forEach(d=>e.disposeIntermediateTensorInfo(d)),h}return F3(e,t,r)}function AB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r,i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=dn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),E.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let u=$3(n,l,i[0],"max");return c.forEach(h=>n.disposeIntermediateTensorInfo(h)),u}var yB={kernelName:os,backendName:"webgl",kernelFunc:AB};function gB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r,i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=dn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),E.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let u=$3(n,l,i[0],"min");return c.forEach(h=>n.disposeIntermediateTensorInfo(h)),u}var xB={kernelName:pu,backendName:"webgl",kernelFunc:gB},wB=xr+` + `}};function $v(e,t,n,a=null){let r=t.shape[0],s=t.shape[1];a!=null&&(r=a.shape[0],s=a.shape[1]);let i=C.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},l=new xB(o,n,a==null),d=[t];a!=null&&d.push(a);let u=e.runWebGLProgram(l,d,"int32");if(u.shape[1]===1)return u;let p=$v(e,t,n,u);return e.disposeIntermediateTensorInfo(u),p}function Dv(e,t,n,a=null){let r=a!=null?a.shape:t.shape,s=r[r.length-1],i=C.computeOptimalWindowSize(s),o=new bB(r,i,n,a==null),l=a==null?[t]:[t,a],d=e.runWebGLProgram(o,l,"int32");if(d.shape.length===t.shape.length){let u=Dv(e,t,n,d);return e.disposeIntermediateTensorInfo(d),u}return d}function Ov(e,t,n,a){let r=[n];if(C.assertAxesAreInnerMostDims("arg"+a.charAt(0).toUpperCase()+a.slice(1),r,t.shape.length),!J().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=C.computeOutAndReduceShapes(t.shape,r),l=w.sizeFromShape(o),d=fe({inputs:{x:t},backend:e,attrs:{shape:[-1,l]}});s.push(d);let u=$v(e,d,a);s.push(u);let p=fe({inputs:{x:u},backend:e,attrs:{shape:i}});return s.forEach(c=>e.disposeIntermediateTensorInfo(c)),p}return Dv(e,t,a)}function vB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=cn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let u=Ov(n,l,i[0],"max");return d.forEach(p=>n.disposeIntermediateTensorInfo(p)),u}var wB={kernelName:os,backendName:"webgl",kernelFunc:vB};function kB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=cn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let u=Ov(n,l,i[0],"min");return d.forEach(p=>n.disposeIntermediateTensorInfo(p)),u}var IB={kernelName:hu,backendName:"webgl",kernelFunc:kB},SB=xa+` if (abs(x) > 1.) { return NAN; } return asin(x); -`,bB=qe({opSnippet:wB}),_B={kernelName:so,backendName:"webgl",kernelFunc:bB},vB=xr+"return log(x + sqrt(x * x + 1.0));",kB=qe({opSnippet:vB}),IB={kernelName:io,backendName:"webgl",kernelFunc:kB},SB=xr+` +`,NB=qe({opSnippet:SB}),TB={kernelName:so,backendName:"webgl",kernelFunc:NB},EB=xa+"return log(x + sqrt(x * x + 1.0));",CB=qe({opSnippet:EB}),RB={kernelName:io,backendName:"webgl",kernelFunc:CB},MB=xa+` return atan(x); -`,NB=qe({opSnippet:SB}),TB={kernelName:oo,backendName:"webgl",kernelFunc:NB},EB=OW+` +`,FB=qe({opSnippet:MB}),$B={kernelName:oo,backendName:"webgl",kernelFunc:FB},DB=BW+` return atan(a, b); -`,CB=` +`,OB=` vec4 result = atan(a, b); vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); - `+zW+` + `+VW+` return result; -`,RB=en({opSnippet:EB,packedOpSnippet:CB}),MB={kernelName:uo,backendName:"webgl",kernelFunc:RB},FB=xr+` +`,zB=en({opSnippet:DB,packedOpSnippet:OB}),_B={kernelName:uo,backendName:"webgl",kernelFunc:zB},PB=xa+` if ((x < -1.0) || (x > 1.0)) return NAN; -return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelName:lo,backendName:"webgl",kernelFunc:$B},mc=class{constructor(e,t,n,r=!1,a=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,A=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let k=">=";this.userCode=` +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,LB=qe({opSnippet:PB}),WB={kernelName:lo,backendName:"webgl",kernelFunc:LB},md=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,d=e.dilationWidth,u=e.effectiveFilterHeight,p=e.effectiveFilterWidth,c=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,A=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let I=">=";this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${p}); + const ivec2 pads = ivec2(${c}, ${h}); void main() { ivec4 coords = getOutputCoords(); @@ -1368,8 +1368,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam continue; } - for (int wC = 0; wC < ${h}; - wC += ${c}) { + for (int wC = 0; wC < ${p}; + wC += ${d}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { @@ -1382,16 +1382,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${k} currMinMaxValue) { + if (value ${I} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${r?a?f:A:`wR * ${h} + wC`}; + minMaxPosition = ${a?r?f:A:`wR * ${p} + wC`}; } } } setOutput(float(minMaxPosition)); } - `;return}let g="max",x=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(x="avgValue / count");let v=Math.floor(s/4)*4,w=s%4,b=` + `;return}let g="max",x=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(x="avgValue / count");let k=Math.floor(s/4)*4,b=s%4,v=` if (${m}) { avgValue += dot(values, ones); } else { @@ -1399,7 +1399,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } `;this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${p}); + const ivec2 pads = ivec2(${c}, ${h}); const float initializationValue = ${y}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); @@ -1436,21 +1436,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam continue; } - for (int wC = 0; wC < ${v}; wC += 4) { - int xC = xCCorner + wC * ${c}; + for (int wC = 0; wC < ${k}; wC += 4) { + int xC = xCCorner + wC * ${d}; vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), - getValue(batch, xR, xC + 2 * ${c}, d), - getValue(batch, xR, xC + 3 * ${c}, d) + getValue(batch, xR, xC + ${d}, d), + getValue(batch, xR, xC + 2 * ${d}, d), + getValue(batch, xR, xC + 3 * ${d}, d) ); - ${b} + ${v} } - int xC = xCCorner + ${v}; - if (${w===1}) { + int xC = xCCorner + ${k}; + if (${b===1}) { vec4 values = vec4( getValue(batch, xR, xC, d), initializationValue, @@ -1458,30 +1458,30 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam initializationValue ); - ${b} - } else if (${w===2}) { + ${v} + } else if (${b===2}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), + getValue(batch, xR, xC + ${d}, d), initializationValue, initializationValue ); - ${b} - } else if (${w===3}) { + ${v} + } else if (${b===3}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), - getValue(batch, xR, xC + 2 * ${c}, d), + getValue(batch, xR, xC + ${d}, d), + getValue(batch, xR, xC + 2 * ${d}, d), initializationValue ); - ${b} + ${v} } } setOutput(${x}); } - `}},mA=class{constructor(e,t,n,r=!1,a=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,A=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let g=t==="avg",x="0.0";if(g||(x="-1.0 / 1e-20"),n){let C=">=";this.userCode=` + `}},m1=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,d=e.dilationDepth,u=e.dilationHeight,p=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,A=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let g=t==="avg",x="0.0";if(g||(x="-1.0 / 1e-20"),n){let R=">=";this.userCode=` const ivec3 strides = ivec3(${i}, ${o}, ${l}); const ivec3 pads = ivec3(${f}, ${A}, ${y}); @@ -1502,15 +1502,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float minMaxValueFound = 0.0; int minMaxPosition = 0; - for (int wD = 0; wD < ${d}; - wD += ${c}) { + for (int wD = 0; wD < ${c}; + wD += ${d}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${h}; wR += ${u}) { int xR = xRCorner + wR; @@ -1519,7 +1519,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } for (int wC = 0; wC < ${m}; - wC += ${h}) { + wC += ${p}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { @@ -1532,10 +1532,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${C} currMinMaxValue) { + if (value ${R} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${r?a?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${m} + + minMaxPosition = ${a?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${h} * ${m} + wR * ${m} + wC`}; } } @@ -1543,11 +1543,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let v="max",w=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(w="avgValue / count");let b=Math.floor(s/4)*4,k=s%4,N=` + `;return}let k="max",b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(b="avgValue / count");let v=Math.floor(s/4)*4,I=s%4,T=` if (${g}) { avgValue += dot(values, ones); } else { - minMaxValue = ${v}(values, minMaxValue); + minMaxValue = ${k}(values, minMaxValue); } `;this.userCode=` const ivec3 strides = @@ -1582,15 +1582,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float avgValue = 0.0; count = 0.0; - for (int wD = 0; wD < ${d}; - wD += ${c}) { + for (int wD = 0; wD < ${c}; + wD += ${d}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${h}; wR += ${u}) { int xR = xRCorner + wR; @@ -1598,21 +1598,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam continue; } - for (int wC = 0; wC < ${b}; wC += 4) { - int xC = xCCorner + wC * ${h}; + for (int wC = 0; wC < ${v}; wC += 4) { + int xC = xCCorner + wC * ${p}; vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), - getValue(batch, xD, xR, xC + 2 * ${h}, ch), - getValue(batch, xD, xR, xC + 3 * ${h}, ch) + getValue(batch, xD, xR, xC + ${p}, ch), + getValue(batch, xD, xR, xC + 2 * ${p}, ch), + getValue(batch, xD, xR, xC + 3 * ${p}, ch) ); - ${N} + ${T} } - int xC = xCCorner + ${b}; - if (${k===1}) { + int xC = xCCorner + ${v}; + if (${I===1}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), initializationValue, @@ -1620,33 +1620,33 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam initializationValue ); - ${N} - } else if (${k===2}) { + ${T} + } else if (${I===2}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), + getValue(batch, xD, xR, xC + ${p}, ch), initializationValue, initializationValue ); - ${N} - } else if (${k===3}) { + ${T} + } else if (${I===3}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), - getValue(batch, xD, xR, xC + 2 * ${h}, ch), + getValue(batch, xD, xR, xC + ${p}, ch), + getValue(batch, xD, xR, xC + 2 * ${p}, ch), initializationValue ); - ${N} + ${T} } } - setOutput(${w}); + setOutput(${b}); } } - `}};function OB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t;Sl(a,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=r,c=1;_.assert(E.eitherStridesOrDilationsAreOne(i,c),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l);if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:a},backend:n});let h=new mc(u,"avg",!1);return n.runWebGLProgram(h,[a],"float32")}var zB={kernelName:ls,backendName:"webgl",kernelFunc:OB};function PB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r,u=[1,1,1],h=E.computePool3DInfo(a.shape,s,i,u,o,l,c),d=new mA(h,"avg",!1);return n.runWebGLProgram(d,[a],"float32")}var LB={kernelName:fu,backendName:"webgl",kernelFunc:PB},WB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=o-1-e.padInfo.top,u=l-1-e.padInfo.left,h=1/(t*n);this.userCode=` - const ivec2 pads = ivec2(${c}, ${u}); - const float avgMultiplier = float(${h}); + `}};function BB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;Nl(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l);if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:r},backend:n});let p=new md(u,"avg",!1);return n.runWebGLProgram(p,[r],"float32")}var VB={kernelName:ls,backendName:"webgl",kernelFunc:BB};function jB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a,u=[1,1,1],p=C.computePool3DInfo(r.shape,s,i,u,o,l,d),c=new m1(p,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}var UB={kernelName:fu,backendName:"webgl",kernelFunc:jB},HB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,d=o-1-e.padInfo.top,u=l-1-e.padInfo.left,p=1/(t*n);this.userCode=` + const ivec2 pads = ivec2(${d}, ${u}); + const float avgMultiplier = float(${p}); void main() { ivec4 coords = getOutputCoords(); @@ -1662,7 +1662,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float dotProd = 0.0; for (int wR = 0; wR < ${o}; wR += ${s}) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -1671,7 +1671,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam for (int wC = 0; wC < ${l}; wC+= ${i}) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -1686,8 +1686,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},BB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=u-1-e.padInfo.front,m=h-1-e.padInfo.top,f=d-1-e.padInfo.left,A=1/(t*n*r);this.userCode=` - const ivec3 pads = ivec3(${p}, ${m}, ${f}); + `}},GB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,d=e.dilationWidth,u=e.effectiveFilterDepth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,h=u-1-e.padInfo.front,m=p-1-e.padInfo.top,f=c-1-e.padInfo.left,A=1/(t*n*a);this.userCode=` + const ivec3 pads = ivec3(${h}, ${m}, ${f}); const float avgMultiplier = float(${A}); void main() { @@ -1707,14 +1707,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam for (int wD = 0; wD < ${u}; wD += ${o}) { - float dyD = float(dyDCorner + wD) / ${a}.0; + float dyD = float(dyDCorner + wD) / ${r}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); - for (int wR = 0; wR < ${h}; + for (int wR = 0; wR < ${p}; wR += ${l}) { float dyR = float(dyRCorner + wR) / ${s}.0; @@ -1724,8 +1724,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${d}; - wC += ${c}) { + for (int wC = 0; wC < ${c}; + wC += ${d}) { float dyC = float(dyCCorner + wC) / ${i}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || @@ -1742,7 +1742,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}};function VB(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=r,h=[1,1,1],d=E.computePool3DInfo(i.shape,o,l,h,c,u),p=new BB(d);return n.runWebGLProgram(p,[a],i.dtype)}var jB={kernelName:Nh,backendName:"webgl",kernelFunc:VB};function UB(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s;Sl([a,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:c}=r,u=E.computePool2DInfo(i.shape,o,l,1,c),h=new WB(u);return n.runWebGLProgram(h,[a],i.dtype)}var HB={kernelName:Sh,backendName:"webgl",kernelFunc:UB};function GB(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;return xp({a,b:s,transposeA:i,transposeB:o,backend:n})}var qB={kernelName:us,backendName:"webgl",kernelFunc:GB},XB=class{constructor(e,t,n,r,a,s){this.outputShape=[],this.variableNames=["x","mean","variance"],E.assertAndGetBroadcastShape(e,t),E.assertAndGetBroadcastShape(e,n);let i="0.0";r!=null&&(E.assertAndGetBroadcastShape(e,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";a!=null&&(E.assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}};function qB(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:d,dimRoundingMode:u}=a,p=[1,1,1],c=C.computePool3DInfo(i.shape,o,l,p,d,u),h=new GB(c);return n.runWebGLProgram(h,[r],i.dtype)}var XB={kernelName:Tp,backendName:"webgl",kernelFunc:qB};function KB(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;Nl([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:d}=a,u=C.computePool2DInfo(i.shape,o,l,1,d),p=new HB(u);return n.runWebGLProgram(p,[r],i.dtype)}var ZB={kernelName:Np,backendName:"webgl",kernelFunc:KB};function YB(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;return xh({a:r,b:s,transposeA:i,transposeB:o,backend:n})}var JB={kernelName:us,backendName:"webgl",kernelFunc:YB},QB=class{constructor(e,t,n,a,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,n);let i="0.0";a!=null&&(C.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";r!=null&&(C.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -1752,7 +1752,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float inv = scale * inversesqrt(variance + float(${s})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } - `}},KB=class{constructor(e,t,n,r,a,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],E.assertAndGetBroadcastShape(e,t),E.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";r!=null&&(E.assertAndGetBroadcastShape(e,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";a!=null&&(E.assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}},eV=class{constructor(e,t,n,a,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";a!=null&&(C.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";r!=null&&(C.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${i}; vec4 scale = ${o}; @@ -1765,7 +1765,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput((x - mean) * inv + offset); } - `}},ZB=({inputs:e,backend:t,attrs:n})=>{let{x:r,mean:a,variance:s,offset:i,scale:o}=e;_.assert(a.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),_.assert(i==null||a.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),_.assert(o==null||a.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;l==null&&(l=.001);let c=[r,a,s],u=null;i!=null&&(u=i.shape,c.push(i));let h=null;o!=null&&(h=o.shape,c.push(o));let d=J().getBool("WEBGL_PACK_NORMALIZATION")?new KB(r.shape,a.shape,s.shape,u,h,l):new XB(r.shape,a.shape,s.shape,u,h,l);return t.runWebGLProgram(d,c,c[0].dtype)},YB={kernelName:bs,backendName:"webgl",kernelFunc:ZB},QB=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=`uniform int start[${this.rank}];`,r=JB(this.rank),a,s=e.map((i,o)=>`sourceLoc.${AA[o]} = start[${o}] + coords.${AA[o]};`);a=` + `}},tV=({inputs:e,backend:t,attrs:n})=>{let{x:a,mean:r,variance:s,offset:i,scale:o}=e;w.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),w.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),w.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;l==null&&(l=.001);let d=[a,r,s],u=null;i!=null&&(u=i.shape,d.push(i));let p=null;o!=null&&(p=o.shape,d.push(o));let c=J().getBool("WEBGL_PACK_NORMALIZATION")?new eV(a.shape,r.shape,s.shape,u,p,l):new QB(a.shape,r.shape,s.shape,u,p,l);return t.runWebGLProgram(c,d,d[0].dtype)},nV={kernelName:vs,backendName:"webgl",kernelFunc:tV},rV=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=`uniform int start[${this.rank}];`,a=aV(this.rank),r,s=e.map((i,o)=>`sourceLoc.${A1[o]} = start[${o}] + coords.${A1[o]};`);r=` ${t} sourceLoc; ${t} coords = getOutputCoords(); ${s.join(` @@ -1773,28 +1773,28 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam `,this.userCode=` ${n} void main() { - ${a} - setOutput(getSource(${r})); + ${r} + setOutput(getSource(${a})); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},AA=["x","y","z","w","u","v"];function JB(e){if(e===1)return"sourceLoc";if(e<=6)return AA.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var eV=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=hn("coords",this.rank),r=hn("sourceLoc",this.rank),a=this.rank===1?"sourceLoc":`vec2(${r.slice(-2).join()})`,s=`getChannel(getSource(${r.join()}), ${a})`,i=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},A1=["x","y","z","w","u","v"];function aV(e){if(e===1)return"sourceLoc";if(e<=6)return A1.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var sV=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=pn("coords",this.rank),a=pn("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${a.slice(-2).join()})`,s=`getChannel(getSource(${a.join()}), ${r})`,i=` result.x = ${s}; if (++${n[this.rank-1]} < ${e[this.rank-1]}) { - ++${r[this.rank-1]}; + ++${a[this.rank-1]}; result.y = ${s}; - --${r[this.rank-1]}; + --${a[this.rank-1]}; } `,o=this.rank===1?"":` --${n[this.rank-1]}; if (++${n[this.rank-2]} < ${e[this.rank-2]}) { - ++${r[this.rank-2]}; + ++${a[this.rank-2]}; result.z = ${s}; if (++${n[this.rank-1]} < ${e[this.rank-1]}) { - ++${r[this.rank-1]}; + ++${a[this.rank-1]}; result.w = ${s}; } } `,l=this.rank<=4?`sourceLoc = coords + - ${t}(${e.map((c,u)=>`start[${u}]`).join()});`:e.map((c,u)=>`${r[u]} = ${n[u]} + start[${u}];`).join(` + ${t}(${e.map((d,u)=>`start[${u}]`).join()});`:e.map((d,u)=>`${a[u]} = ${n[u]} + start[${u}];`).join(` `);this.userCode=` uniform int start[${this.rank}]; void main() { @@ -1806,7 +1806,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam ${o} setOutput(result); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function tV(e,t,n,r){let a=r.texData.get(e.dataId),s=r.makeTensorInfo(n,e.dtype),i=r.texData.get(s.dataId);Object.assign(i,a),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=sn.computeFlatOffset(t,_.computeStrides(e.shape));a.slice&&(o+=a.slice.flatOffset),i.slice={flatOffset:o,origDataId:a.slice&&a.slice.origDataId||e.dataId};let l=r.dataRefCount.get(i.slice.origDataId)||1;return r.dataRefCount.set(i.slice.origDataId,l+1),s}function Ac(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,size:i}=r,[o,l]=sn.parseSliceParams(a,s,i);if(sn.assertParamsValid(a,o,l),_.sizeFromShape(l)===0)return n.makeTensorInfo(l,a.dtype,[]);if(n.shouldExecuteOnCPU([a])||a.dtype==="string"){let h=n.texData.get(a.dataId),d=GL(h.values,o,l,a.shape,a.dtype);return n.makeTensorInfo(l,a.dtype,d)}let{isPacked:c}=n.texData.get(a.dataId),u=sn.isSliceContinous(a.shape,o,l);if(c||!u){let h=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new eV(l):new QB(l),d=h.getCustomSetupFunc(o);return n.runWebGLProgram(h,[a],a.dtype,d)}return n.uploadToGPU(a.dataId),tV(a,o,l,n)}var nV={kernelName:Ho,backendName:"webgl",kernelFunc:Ac},rV=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,crops:i}=r;_.assert(a.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((g,x)=>g*x),l=E.getReshaped(a.shape,s,o),c=E.getPermuted(l.length,s.length),u=E.getReshapedPermuted(a.shape,s,o),h=E.getSliceBeginCoords(i,s.length),d=E.getSliceSize(u,i,s.length),p=[],m=fe({inputs:{x:a},backend:n,attrs:{shape:l}}),f=dn({inputs:{x:m},backend:n,attrs:{perm:c}}),A=fe({inputs:{x:f},backend:n,attrs:{shape:u}}),y=Ac({inputs:{x:A},backend:n,attrs:{begin:h,size:d}});return p.push(m),p.push(f),p.push(A),p.forEach(g=>n.disposeIntermediateTensorInfo(g)),y},aV={kernelName:mu,backendName:"webgl",kernelFunc:rV};function sV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i}=r,o=n.readSync(a.dataId),l=n.readSync(s.dataId),c=l3(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,c)}var iV={kernelName:Th,backendName:"webgl",kernelFunc:sV},oV="return float(a != b);",D3=en({opSnippet:oV,dtype:"bool"}),lV={kernelName:Fo,backendName:"webgl",kernelFunc:D3};function yc(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.texData.get(r.dataId);return Pn({inputs:{x:a.complexTensorInfos.real},backend:n})}var uV={kernelName:Zh,backendName:"webgl",kernelFunc:yc},cV="return float(int(x));";function hV(e,t){let n=new Wa(e.shape,cV),r=t.runWebGLProgram(n,[e],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}function yA(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dtype:s}=r;if(s==="complex64"){if(a.dtype==="complex64")return Pn({inputs:{x:a},backend:n});let i=Et(a.shape),o=yA({inputs:{x:a},backend:n,attrs:{dtype:"float32"}}),l=Ba({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),l}if(a.dtype==="complex64"){let i=yc({inputs:{input:a},backend:n}),o=yA({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!_.hasEncodingLoss(a.dtype,s)){let i=Pn({inputs:{x:a},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return hV(a,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",_.getTypedArrayFromDType("bool",1)),o=D3({inputs:{a,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${s}`)}var dV={kernelName:cs,backendName:"webgl",kernelFunc:yA},O3="return ceil(x);",pV=qe({opSnippet:O3,packedOpSnippet:O3,cpuKernelImpl:TL}),fV={kernelName:hs,backendName:"webgl",kernelFunc:pV},mV=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function iV(e,t,n,a){let r=a.texData.get(e.dataId),s=a.makeTensorInfo(n,e.dtype),i=a.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=sn.computeFlatOffset(t,w.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let l=a.dataRefCount.get(i.slice.origDataId)||1;return a.dataRefCount.set(i.slice.origDataId,l+1),s}function Ad(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a,[o,l]=sn.parseSliceParams(r,s,i);if(sn.assertParamsValid(r,o,l),w.sizeFromShape(l)===0)return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||r.dtype==="string"){let p=n.texData.get(r.dataId),c=YL(p.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,c)}let{isPacked:d}=n.texData.get(r.dataId),u=sn.isSliceContinous(r.shape,o,l);if(d||!u){let p=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new sV(l):new rV(l),c=p.getCustomSetupFunc(o);return n.runWebGLProgram(p,[r],r.dtype,c)}return n.uploadToGPU(r.dataId),iV(r,o,l,n)}var oV={kernelName:Ho,backendName:"webgl",kernelFunc:Ad},lV=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;w.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((g,x)=>g*x),l=C.getReshaped(r.shape,s,o),d=C.getPermuted(l.length,s.length),u=C.getReshapedPermuted(r.shape,s,o),p=C.getSliceBeginCoords(i,s.length),c=C.getSliceSize(u,i,s.length),h=[],m=fe({inputs:{x:r},backend:n,attrs:{shape:l}}),f=cn({inputs:{x:m},backend:n,attrs:{perm:d}}),A=fe({inputs:{x:f},backend:n,attrs:{shape:u}}),y=Ad({inputs:{x:A},backend:n,attrs:{begin:p,size:c}});return h.push(m),h.push(f),h.push(A),h.forEach(g=>n.disposeIntermediateTensorInfo(g)),y},uV={kernelName:mu,backendName:"webgl",kernelFunc:lV};function dV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.readSync(r.dataId),l=n.readSync(s.dataId),d=uv(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}var pV={kernelName:Ep,backendName:"webgl",kernelFunc:dV},cV="return float(a != b);",zv=en({opSnippet:cV,dtype:"bool"}),hV={kernelName:$o,backendName:"webgl",kernelFunc:zv};function yd(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Pn({inputs:{x:r.complexTensorInfos.real},backend:n})}var fV={kernelName:Zp,backendName:"webgl",kernelFunc:yd},mV="return float(int(x));";function AV(e,t){let n=new Pr(e.shape,mV),a=t.runWebGLProgram(n,[e],"int32");return{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}function y1(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Pn({inputs:{x:r},backend:n});let i=Ct(r.shape),o=y1({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=Lr({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=yd({inputs:{input:r},backend:n}),o=y1({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!w.hasEncodingLoss(r.dtype,s)){let i=Pn({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return AV(r,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",w.getTypedArrayFromDType("bool",1)),o=zv({inputs:{a:r,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var yV={kernelName:ds,backendName:"webgl",kernelFunc:y1},_v="return ceil(x);",gV=qe({opSnippet:_v,packedOpSnippet:_v,cpuKernelImpl:$L}),xV={kernelName:ps,backendName:"webgl",kernelFunc:gV},bV=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1819,7 +1819,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput(clamp(value, minVal, maxVal)); } - `}getCustomSetupFunc(e,t){return(n,r)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(r,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(r,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},AV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},vV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1833,7 +1833,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } - `}getCustomSetupFunc(e,t){return(n,r)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(r,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(r,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function yV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{clipValueMin:s,clipValueMax:i}=r,o;J().getBool("WEBGL_PACK_CLIP")?o=new AV(a.shape):o=new mV(a.shape);let l=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[a],a.dtype,l)}var gV={kernelName:Sa,backendName:"webgl",kernelFunc:yV},xV=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function wV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o;J().getBool("WEBGL_PACK_CLIP")?o=new vV(r.shape):o=new bV(r.shape);let l=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[r],r.dtype,l)}var kV={kernelName:Ir,backendName:"webgl",kernelFunc:wV},IV=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -1846,7 +1846,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } - `}};function z3(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function wV(e){let{inputs:t,backend:n}=e,{x:r}=t,a=n.texData.get(r.dataId),s=new xV(r.shape),i=[z3(r,a.complexTensorInfos.real),z3(r,a.complexTensorInfos.imag)];return n.runWebGLProgram(s,i,i[0].dtype)}var bV={kernelName:Au,backendName:"webgl",kernelFunc:wV},_V=class{constructor(e){this.outputShape=[],this.outputShape=E.computeOutShape(e,1),this.variableNames=e.map((s,i)=>`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m= ${o[m-1]}) { return getChannel( - getT${m}(${bp(i,l,f)}), - vec2(${bp(c,l,f)})); - }`}let d=o.length,p=o[o.length-1];h+=` + getT${m}(${vh(i,l,f)}), + vec2(${vh(d,l,f)})); + }`}let c=o.length,h=o[o.length-1];p+=` return getChannel( - getT${d}(${bp(i,l,p)}), - vec2(${bp(c,l,p)}));`,this.userCode=` + getT${c}(${vh(i,l,h)}), + vec2(${vh(d,l,h)}));`,this.userCode=` float getValue(${i.map(m=>"int "+m)}) { - ${h} + ${p} } void main() { - ${a} coords = getOutputCoords(); + ${r} coords = getOutputCoords(); vec4 result = vec4(getValue(${s}), 0., 0., 0.); - ${s[r-1]} = ${s[r-1]} + 1; - if (${s[r-1]} < ${n[r-1]}) { + ${s[a-1]} = ${s[a-1]} + 1; + if (${s[a-1]} < ${n[a-1]}) { result.g = getValue(${s}); } - ${s[r-2]} = ${s[r-2]} + 1; - if (${s[r-2]} < ${n[r-2]}) { + ${s[a-2]} = ${s[a-2]} + 1; + if (${s[a-2]} < ${n[a-2]}) { result.a = getValue(${s}); } - ${s[r-1]} = ${s[r-1]} - 1; - if (${s[r-2]} < ${n[r-2]} && - ${s[r-1]} < ${n[r-1]}) { + ${s[a-1]} = ${s[a-1]} - 1; + if (${s[a-2]} < ${n[a-2]} && + ${s[a-1]} < ${n[a-1]}) { result.b = getValue(${s}); } setOutput(result); } - `}};function bp(e,t,n){let r=e.indexOf(t);return e.map((a,s)=>s===r?`${a} - ${n}`:a).join()}function _p(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.texData.get(r.dataId);return Pn({inputs:{x:a.complexTensorInfos.imag},backend:n})}var kV={kernelName:jh,backendName:"webgl",kernelFunc:_p};function Dl(e,t,n){let r=e[0].dtype;if(r==="complex64"){let u=e.map(f=>yc({inputs:{input:f},backend:n})),h=e.map(f=>_p({inputs:{input:f},backend:n})),d=Dl(u,t,n),p=Dl(h,t,n),m=Ba({inputs:{real:d,imag:p},backend:n});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),h.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}let a=n.shouldExecuteOnCPU(e);if(r==="string"&&(a=!0),a){let u=e.map(y=>{let g=_.sizeFromShape(y.shape.slice(t));return fe({inputs:{x:y},backend:n,attrs:{shape:[-1,g]}})}),h=u.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),d=E.computeOutShape(u.map(y=>y.shape),1),p=u[0].shape[0]===1,m=EL(h,d,r,p),f=E.computeOutShape(e.map(y=>y.shape),t),A=n.makeTensorInfo(f,r,m);return u.forEach(y=>n.disposeIntermediateTensorInfo(y)),A}if(e.length>J().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let u=Math.floor(e.length/2),h=Dl(e.slice(0,u),t,n),d=Dl(e.slice(u),t,n),p=Dl([h,d],t,n);return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),p}if(J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let u=new vV(e.map(h=>h.shape),t);return n.runWebGLProgram(u,e,r)}let{tensors2D:s,outShape:i}=IV(e,t,n),o=new _V(s.map(u=>u.shape)),l=n.runWebGLProgram(o,s,r);s.forEach(u=>n.disposeIntermediateTensorInfo(u));let c=fe({inputs:{x:l},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(l),c}function IV(e,t,n){let r=E.computeOutShape(e.map(a=>a.shape),t);return{tensors2D:e.map(a=>fe({inputs:{x:a},attrs:{shape:[-1,_.sizeFromShape(a.shape.slice(t))]},backend:n})),outShape:r}}function P3(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r,s=_.parseAxisParam(a,t[0].shape)[0],i=E.computeOutShape(t.map(c=>c.shape),s);if(_.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(c=>_.sizeFromShape(c.shape)>0);if(o.length===1)return Pn({inputs:{x:o[0]},backend:n});let l=o.map(c=>c.shape);return E.assertParamsConsistent(l,s),Dl(o,s,n)}var SV={kernelName:co,backendName:"webgl",kernelFunc:P3},L3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",A=f?1:2,y=f?2:3,g=f?3:1,x="",v="";n&&(r?x=`float activation(float a) { + `}};function vh(e,t,n){let a=e.indexOf(t);return e.map((r,s)=>s===a?`${r} - ${n}`:r).join()}function wh(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Pn({inputs:{x:r.complexTensorInfos.imag},backend:n})}var CV={kernelName:jp,backendName:"webgl",kernelFunc:wh};function Ol(e,t,n){let a=e[0].dtype;if(a==="complex64"){let u=e.map(f=>yd({inputs:{input:f},backend:n})),p=e.map(f=>wh({inputs:{input:f},backend:n})),c=Ol(u,t,n),h=Ol(p,t,n),m=Lr({inputs:{real:c,imag:h},backend:n});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),p.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}let r=n.shouldExecuteOnCPU(e);if(a==="string"&&(r=!0),r){let u=e.map(y=>{let g=w.sizeFromShape(y.shape.slice(t));return fe({inputs:{x:y},backend:n,attrs:{shape:[-1,g]}})}),p=u.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),c=C.computeOutShape(u.map(y=>y.shape),1),h=u[0].shape[0]===1,m=DL(p,c,a,h),f=C.computeOutShape(e.map(y=>y.shape),t),A=n.makeTensorInfo(f,a,m);return u.forEach(y=>n.disposeIntermediateTensorInfo(y)),A}if(e.length>J().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let u=Math.floor(e.length/2),p=Ol(e.slice(0,u),t,n),c=Ol(e.slice(u),t,n),h=Ol([p,c],t,n);return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),h}if(J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let u=new EV(e.map(p=>p.shape),t);return n.runWebGLProgram(u,e,a)}let{tensors2D:s,outShape:i}=RV(e,t,n),o=new TV(s.map(u=>u.shape)),l=n.runWebGLProgram(o,s,a);s.forEach(u=>n.disposeIntermediateTensorInfo(u));let d=fe({inputs:{x:l},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(l),d}function RV(e,t,n){let a=C.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>fe({inputs:{x:r},attrs:{shape:[-1,w.sizeFromShape(r.shape.slice(t))]},backend:n})),outShape:a}}function Lv(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a,s=w.parseAxisParam(r,t[0].shape)[0],i=C.computeOutShape(t.map(d=>d.shape),s);if(w.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(d=>w.sizeFromShape(d.shape)>0);if(o.length===1)return Pn({inputs:{x:o[0]},backend:n});let l=o.map(d=>d.shape);return C.assertParamsConsistent(l,s),Ol(o,s,n)}var MV={kernelName:po,backendName:"webgl",kernelFunc:Lv},Wv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,d=e.dilationHeight,u=e.dilationWidth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",A=f?1:2,y=f?2:3,g=f?3:1,x="",k="";n&&(a?x=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} - }`:a?x=`float activation(float a) { + }`:r?x=`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${n} }`:x=` float activation(float x) { ${n} } - `,v="result = activation(result);");let w=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,k="result = activation(result);");let b=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${x} const ivec2 strides = ivec2(${o}, ${l}); @@ -1921,21 +1921,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${h}; wR++) { - int xR = xRCorner + wR * ${c}; + for (int wR = 0; wR < ${p}; wR++) { + int xR = xRCorner + wR * ${d}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int wC = 0; wC < ${d}; wC++) { + for (int wC = 0; wC < ${c}; wC++) { int xC = xCCorner + wC * ${u}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } - for (int d1 = 0; d1 < ${p}; d1 += 4) { + for (int d1 = 0; d1 < ${h}; d1 += 4) { vec4 wValues = vec4( getW(wR, wC, d1, d2), getW(wR, wC, d1 + 1, d2), @@ -1966,53 +1966,53 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam if (${f}) { dotProd += - getX(batch, xR, xC, ${p}) * - getW(wR, wC, ${p}, d2); + getX(batch, xR, xC, ${h}) * + getW(wR, wC, ${h}, d2); } else { dotProd += - getX(batch, ${p}, xR, xC) * - getW(wR, wC, ${p}, d2); + getX(batch, ${h}, xR, xC) * + getW(wR, wC, ${h}, d2); } } else if (${m===2}) { vec2 wValues = vec2( - getW(wR, wC, ${p}, d2), - getW(wR, wC, ${p} + 1, d2) + getW(wR, wC, ${h}, d2), + getW(wR, wC, ${h} + 1, d2) ); if (${f}) { vec2 xValues = vec2( - getX(batch, xR, xC, ${p}), - getX(batch, xR, xC, ${p} + 1) + getX(batch, xR, xC, ${h}), + getX(batch, xR, xC, ${h} + 1) ); dotProd += dot(xValues, wValues); } else { vec2 xValues = vec2( - getX(batch, ${p}, xR, xC), - getX(batch, ${p} + 1, xR, xC) + getX(batch, ${h}, xR, xC), + getX(batch, ${h} + 1, xR, xC) ); dotProd += dot(xValues, wValues); } } else if (${m===3}) { vec3 wValues = vec3( - getW(wR, wC, ${p}, d2), - getW(wR, wC, ${p} + 1, d2), - getW(wR, wC, ${p} + 2, d2) + getW(wR, wC, ${h}, d2), + getW(wR, wC, ${h} + 1, d2), + getW(wR, wC, ${h} + 2, d2) ); if (${f}) { vec3 xValues = vec3( - getX(batch, xR, xC, ${p}), - getX(batch, xR, xC, ${p} + 1), - getX(batch, xR, xC, ${p} + 2) + getX(batch, xR, xC, ${h}), + getX(batch, xR, xC, ${h} + 1), + getX(batch, xR, xC, ${h} + 2) ); dotProd += dot(xValues, wValues); } else { vec3 xValues = vec3( - getX(batch, ${p}, xR, xC), - getX(batch, ${p} + 1, xR, xC), - getX(batch, ${p} + 2, xR, xC) + getX(batch, ${h}, xR, xC), + getX(batch, ${h} + 1, xR, xC), + getX(batch, ${h} + 2, xR, xC) ); dotProd += dot(xValues, wValues); } @@ -2022,13 +2022,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } float result = dotProd; - ${w} - ${v} + ${b} + ${k} setOutput(result); } - `}},NV=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,r=e.padInfo.left,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` - const ivec3 strides = ivec3(${a}, ${s}, ${i}); - const ivec3 pads = ivec3(${t}, ${n}, ${r}); + `}},FV=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,a=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,d=e.dilationWidth,u=e.filterDepth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` + const ivec3 strides = ivec3(${r}, ${s}, ${i}); + const ivec3 pads = ivec3(${t}, ${n}, ${a}); void main() { ivec5 coords = getOutputCoords(); @@ -2051,21 +2051,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam continue; } - for (int wR = 0; wR < ${h}; wR++) { + for (int wR = 0; wR < ${p}; wR++) { int xR = xRCorner + wR * ${l}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${c}; + for (int wC = 0; wC < ${c}; wC++) { + int xC = xCCorner + wC * ${d}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } - for (int d1 = 0; d1 < ${p}; d1 += 4) { + for (int d1 = 0; d1 < ${h}; d1 += 4) { vec4 xValues = vec4( getX(batch, xF, xR, xC, d1), getX(batch, xF, xR, xC, d1 + 1), @@ -2084,28 +2084,28 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam if (${m===1}) { dotProd += - getX(batch, xF, xR, xC, ${p}) * - getW(wF, wR, wC, ${p}, d2); + getX(batch, xF, xR, xC, ${h}) * + getW(wF, wR, wC, ${h}, d2); } else if (${m===2}) { vec2 xValues = vec2( - getX(batch, xF, xR, xC, ${p}), - getX(batch, xF, xR, xC, ${p} + 1) + getX(batch, xF, xR, xC, ${h}), + getX(batch, xF, xR, xC, ${h} + 1) ); vec2 wValues = vec2( - getW(wF, wR, wC, ${p}, d2), - getW(wF, wR, wC, ${p} + 1, d2) + getW(wF, wR, wC, ${h}, d2), + getW(wF, wR, wC, ${h} + 1, d2) ); dotProd += dot(xValues, wValues); } else if (${m===3}) { vec3 xValues = vec3( - getX(batch, xF, xR, xC, ${p}), - getX(batch, xF, xR, xC, ${p} + 1), - getX(batch, xF, xR, xC, ${p} + 2) + getX(batch, xF, xR, xC, ${h}), + getX(batch, xF, xR, xC, ${h} + 1), + getX(batch, xF, xR, xC, ${h} + 2) ); vec3 wValues = vec3( - getW(wF, wR, wC, ${p}, d2), - getW(wF, wR, wC, ${p} + 1, d2), - getW(wF, wR, wC, ${p} + 2, d2) + getW(wF, wR, wC, ${h}, d2), + getW(wF, wR, wC, ${h} + 1, d2), + getW(wF, wR, wC, ${h} + 2, d2) ); dotProd += dot(xValues, wValues); } @@ -2114,31 +2114,31 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},TV=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:r,inChannels:a,strideWidth:s,strideHeight:i,padInfo:o,outWidth:l,dilationWidth:c,dilationHeight:u,dataFormat:h}=n,{left:d,top:p}=o,m=a*r,f=cn(),A=h==="channelsLast",y=A?0:1,g=A?1:2,x="";for(let v=0;v<=1;v++)for(let w=0;w<=1;w++)x+=` - blockIndex = rc.y + ${w}; - pos = rc.x + ${v}; + `}},$V=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:a,inChannels:r,strideWidth:s,strideHeight:i,padInfo:o,outWidth:l,dilationWidth:d,dilationHeight:u,dataFormat:p}=n,{left:c,top:h}=o,m=r*a,f=dn(),A=p==="channelsLast",y=A?0:1,g=A?1:2,x="";for(let k=0;k<=1;k++)for(let b=0;b<=1;b++)x+=` + blockIndex = rc.y + ${b}; + pos = rc.x + ${k}; if(blockIndex < ${e[1]} && pos < ${e[0]}) { - offsetY = int(blockIndex / (${l})) * ${i} - ${p}; + offsetY = int(blockIndex / (${l})) * ${i} - ${h}; d0 = offsetY + ${u} * (pos / ${m}); if(d0 < ${t[y]} && d0 >= 0) { - offsetX = int(mod(float(blockIndex), ${l}.) * ${s}. - ${d}.); - d1 = offsetX + ${c} * (int(mod(float(pos), ${m}.) / ${a}.)); + offsetX = int(mod(float(blockIndex), ${l}.) * ${s}. - ${c}.); + d1 = offsetX + ${d} * (int(mod(float(pos), ${m}.) / ${r}.)); if(d1 < ${t[g]} && d1 >= 0) { - ch = int(mod(float(pos), ${a}.)); + ch = int(mod(float(pos), ${r}.)); if (${A}) { innerDims = vec2(d1, ch); - result[${v*2+w}] = getChannel( + result[${k*2+b}] = getChannel( getA(d0, int(innerDims.x), int(innerDims.y)), innerDims); } else { innerDims = vec2(d0, d1); - result[${v*2+w}] = getChannel( + result[${k*2+b}] = getChannel( getA(ch, int(innerDims.x), int(innerDims.y)), innerDims); } @@ -2158,7 +2158,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam ${f.output} = result; } - `}};function W3({x:e,filter:t,convInfo:n,backend:r,bias:a=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,c=r.texData.get(e.dataId),u=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p=n.dataFormat==="channelsLast",m=!1,f=!1,A,y=[],g=(h===1||d===1)&&u>E3,x=l[2]%2!=0&&!!c.isPacked;if(g||!J().getBool("WEBGL_LAZILY_UNPACK")||!J().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let v=p?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],w=fe({inputs:{x:e},backend:r,attrs:{shape:[1,v,n.inChannels]}}),b=fe({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}}),k=xp({a:w,b,transposeA:m,transposeB:f,backend:r,bias:a,activation:o,preluActivationWeights:s,leakyreluAlpha:i});A=fe({inputs:{x:k},backend:r,attrs:{shape:n.outShape}}),y.push(w),y.push(b),y.push(k)}else{let v=p?l[0]*l[1]*(l[2]+1):l[0]*l[2]*(l[3]+1),w={dataId:e.dataId,shape:[1,v,n.inChannels],dtype:e.dtype},b=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,_.assert(uc(c.shape,w.shape),()=>`packed reshape ${c.shape} to ${w.shape} isn't free`);let k=fe({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(k);let N=xp({a:w,b:k,backend:r,transposeA:m,transposeB:f,bias:a,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),C=r.texData.get(N.dataId);_.assert(C.isPacked,()=>"batchMatMul result is expected to be packed"),c.shape=b,C.shape=n.outShape,A=Pn({inputs:{x:N},backend:r}),A.shape=n.outShape,y.push(N)}for(let v of y)r.disposeIntermediateTensorInfo(v);return A}function B3({x:e,filter:t,convInfo:n,backend:r,bias:a=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:c,inChannels:u,outWidth:h,outHeight:d,dataFormat:p}=n,m=p==="channelsLast",f=l*c*u,A=d*h,y=[f,A],g=!0,x=!1,v=[],w=fe({inputs:{x:e},backend:r,attrs:{shape:e.shape.slice(1)}}),b=fe({inputs:{x:t},backend:r,attrs:{shape:[1,f,_.sizeFromShape(t.shape)/f]}});v.push(w),v.push(b);let k=new TV(y,w.shape,n),N=r.runWebGLProgram(k,[w],"float32"),C=fe({inputs:{x:N},backend:r,attrs:{shape:[1,y[0],y[1]]}});v.push(N),v.push(C);let F=a!=null,O=s!=null,z=o==="leakyrelu",V=o?Ap(o,!0):null,j=new k3(C.shape,b.shape,[1,A,n.outChannels],g,x,F,V,O,z),U=[C,b];if(a&&U.push(a),O&&U.push(s),z){let Y=r.makeTensorInfo([],"float32",_.createScalarValue(i,"float32"));U.push(Y),v.push(Y)}let X=r.runWebGLProgram(j,U,"float32"),G=m?[1,d,h,n.outChannels]:[1,n.outChannels,d,h],ee=fe({inputs:{x:X},backend:r,attrs:{shape:G}});v.push(X);for(let Y of v)r.disposeIntermediateTensorInfo(Y);return ee}function EV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=r,h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,s.shape,i,c,o,u,!1,h),p;if(d.filterHeight===1&&d.filterWidth===1&&d.dilationHeight===1&&d.dilationWidth===1&&d.strideHeight===1&&d.strideWidth===1&&(d.padInfo.type==="SAME"||d.padInfo.type==="VALID"))p=W3({x:a,filter:s,convInfo:d,backend:n});else if(J().getBool("WEBGL_CONV_IM2COL")&&a.shape[0]===1)p=B3({x:a,filter:s,convInfo:d,backend:n});else{let f=new L3(d);p=n.runWebGLProgram(f,[a,s],"float32")}let m=fe({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),m}var CV={kernelName:ds,backendName:"webgl",kernelFunc:EV},RV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,a=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` + `}};function Bv({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,d=a.texData.get(e.dataId),u=n.inChannels,p=l[0]*l[1]*l[2],c=n.outChannels,h=n.dataFormat==="channelsLast",m=!1,f=!1,A,y=[],g=(p===1||c===1)&&u>Rv,x=l[2]%2!=0&&!!d.isPacked;if(g||!J().getBool("WEBGL_LAZILY_UNPACK")||!J().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let k=h?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],b=fe({inputs:{x:e},backend:a,attrs:{shape:[1,k,n.inChannels]}}),v=fe({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}}),I=xh({a:b,b:v,transposeA:m,transposeB:f,backend:a,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});A=fe({inputs:{x:I},backend:a,attrs:{shape:n.outShape}}),y.push(b),y.push(v),y.push(I)}else{let k=h?l[0]*l[1]*(l[2]+1):l[0]*l[2]*(l[3]+1),b={dataId:e.dataId,shape:[1,k,n.inChannels],dtype:e.dtype},v=d.shape;d.shape=d.shape.slice(),d.shape[d.shape.length-2]++,w.assert(ud(d.shape,b.shape),()=>`packed reshape ${d.shape} to ${b.shape} isn't free`);let I=fe({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(I);let T=xh({a:b,b:I,backend:a,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),R=a.texData.get(T.dataId);w.assert(R.isPacked,()=>"batchMatMul result is expected to be packed"),d.shape=v,R.shape=n.outShape,A=Pn({inputs:{x:T},backend:a}),A.shape=n.outShape,y.push(T)}for(let k of y)a.disposeIntermediateTensorInfo(k);return A}function Vv({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:d,inChannels:u,outWidth:p,outHeight:c,dataFormat:h}=n,m=h==="channelsLast",f=l*d*u,A=c*p,y=[f,A],g=!0,x=!1,k=[],b=fe({inputs:{x:e},backend:a,attrs:{shape:e.shape.slice(1)}}),v=fe({inputs:{x:t},backend:a,attrs:{shape:[1,f,w.sizeFromShape(t.shape)/f]}});k.push(b),k.push(v);let I=new $V(y,b.shape,n),T=a.runWebGLProgram(I,[b],"float32"),R=fe({inputs:{x:T},backend:a,attrs:{shape:[1,y[0],y[1]]}});k.push(T),k.push(R);let $=r!=null,z=s!=null,_=o==="leakyrelu",V=o?Ah(o,!0):null,j=new Sv(R.shape,v.shape,[1,A,n.outChannels],g,x,$,V,z,_),U=[R,v];if(r&&U.push(r),z&&U.push(s),_){let Y=a.makeTensorInfo([],"float32",w.createScalarValue(i,"float32"));U.push(Y),k.push(Y)}let X=a.runWebGLProgram(j,U,"float32"),G=m?[1,c,p,n.outChannels]:[1,n.outChannels,c,p],ee=fe({inputs:{x:X},backend:a,attrs:{shape:G}});k.push(X);for(let Y of k)a.disposeIntermediateTensorInfo(Y);return ee}function DV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:d,dimRoundingMode:u}=a,p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!1,p),h;if(c.filterHeight===1&&c.filterWidth===1&&c.dilationHeight===1&&c.dilationWidth===1&&c.strideHeight===1&&c.strideWidth===1&&(c.padInfo.type==="SAME"||c.padInfo.type==="VALID"))h=Bv({x:r,filter:s,convInfo:c,backend:n});else if(J().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)h=Vv({x:r,filter:s,convInfo:c,backend:n});else{let f=new Wv(c);h=n.runWebGLProgram(f,[r,s],"float32")}let m=fe({inputs:{x:h},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(h),m}var OV={kernelName:cs,backendName:"webgl",kernelFunc:DV},zV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2172,14 +2172,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam for (int b = 0; b < ${e.batchSize}; b++) { for (int yR = 0; yR < ${e.outHeight}; yR++) { - int xR = wR + yR * ${t} - ${r}; + int xR = wR + yR * ${t} - ${a}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${n} - ${a}; + int xC = wC + yC * ${n} - ${r}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2200,7 +2200,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},MV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=s?1:2,c=s?2:3,u=s?3:1;this.userCode=` + `}},_V=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=s?1:2,d=s?2:3,u=s?3:1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -2208,7 +2208,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam int batch = coords[0]; int d1 = coords[${u}]; - ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - pads; + ivec2 dyCorner = ivec2(coords[${l}], coords[${d}]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; @@ -2216,7 +2216,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR < ${t}; wR++) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -2226,7 +2226,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${n}; wC++) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -2253,7 +2253,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},FV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,a=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` + `}},PV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` void main() { ivec5 coords = getOutputCoords(); int wF = coords.x; @@ -2266,7 +2266,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam for (int b = 0; b < ${e.batchSize}; b++) { for (int yF = 0; yF < ${e.outDepth}; yF++) { - int xF = wF + yF * ${t} - ${a}; + int xF = wF + yF * ${t} - ${r}; if (xF < 0 || xF >= ${e.inDepth}) { continue; @@ -2280,7 +2280,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${r} - ${i}; + int xC = wC + yC * ${a} - ${i}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2295,8 +2295,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},$V=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,c=r-1-e.padInfo.left;this.userCode=` - const ivec3 pads = ivec3(${o}, ${l}, ${c}); + `}},LV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,d=a-1-e.padInfo.left;this.userCode=` + const ivec3 pads = ivec3(${o}, ${l}, ${d}); void main() { ivec5 coords = getOutputCoords(); @@ -2311,7 +2311,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float dotProd = 0.0; for (int wF = 0; wF < ${t}; wF++) { - float dyF = float(dyFCorner + wF) / ${a}.0; + float dyF = float(dyFCorner + wF) / ${r}.0; if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { continue; @@ -2331,7 +2331,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam int wRPerm = ${n} - 1 - wR; - for (int wC = 0; wC < ${r}; wC++) { + for (int wC = 0; wC < ${a}; wC++) { float dyC = float(dyCCorner + wC) / ${i}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || @@ -2340,7 +2340,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } int idyC = int(dyC); - int wCPerm = ${r} - 1 - wC; + int wCPerm = ${a} - 1 - wC; for (int d2 = 0; d2 < ${e.outChannels}; d2++) { float xValue = getDy(batch, idyF, idyR, idyC, d2); @@ -2352,12 +2352,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}};function DV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:c,filterShape:u}=r,h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,u,i,1,o,c,!1,h),p=new RV(d);return n.runWebGLProgram(p,[a,s],"float32")}var OV={kernelName:Ch,backendName:"webgl",kernelFunc:DV};function zV(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:c,dimRoundingMode:u}=r,h=E.convertConv2DDataFormat(c),d=E.computeConv2DInfo(i,s.shape,o,1,l,u,!1,h),p=new MV(d);return n.runWebGLProgram(p,[a,s],"float32")}var PV={kernelName:ps,backendName:"webgl",kernelFunc:zV};function LV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dilations:l}=r,c=E.computeConv3DInfo(a.shape,s.shape,i,l,o),u=new NV(c);return n.runWebGLProgram(u,[a,s],"float32")}var WV={kernelName:yu,backendName:"webgl",kernelFunc:LV};function BV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,pad:o,filterShape:l}=r,c=E.computeConv3DInfo(a.shape,l,i,1,o),u=new FV(c);return n.runWebGLProgram(u,[a,s],"float32")}var VV={kernelName:Rh,backendName:"webgl",kernelFunc:BV};function jV(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{pad:i,strides:o,inputShape:l}=r,c=E.computeConv3DInfo(l,s.shape,o,1,i),u=new $V(c);return n.runWebGLProgram(u,[a,s],"float32")}var UV={kernelName:Mh,backendName:"webgl",kernelFunc:jV},HV=v3+` + `}};function WV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:d,filterShape:u}=a,p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,u,i,1,o,d,!1,p),h=new zV(c);return n.runWebGLProgram(h,[r,s],"float32")}var BV={kernelName:Rp,backendName:"webgl",kernelFunc:WV};function VV(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:d,dimRoundingMode:u}=a,p=C.convertConv2DDataFormat(d),c=C.computeConv2DInfo(i,s.shape,o,1,l,u,!1,p),h=new _V(c);return n.runWebGLProgram(h,[r,s],"float32")}var jV={kernelName:hs,backendName:"webgl",kernelFunc:VV};function UV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,d=C.computeConv3DInfo(r.shape,s.shape,i,l,o),u=new FV(d);return n.runWebGLProgram(u,[r,s],"float32")}var HV={kernelName:yu,backendName:"webgl",kernelFunc:UV};function GV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=a,d=C.computeConv3DInfo(r.shape,l,i,1,o),u=new PV(d);return n.runWebGLProgram(u,[r,s],"float32")}var qV={kernelName:Mp,backendName:"webgl",kernelFunc:GV};function XV(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:l}=a,d=C.computeConv3DInfo(l,s.shape,o,1,i),u=new LV(d);return n.runWebGLProgram(u,[r,s],"float32")}var KV={kernelName:Fp,backendName:"webgl",kernelFunc:XV},ZV=Iv+` return cos(x); -`,GV=qe({opSnippet:HV}),qV={kernelName:fs,backendName:"webgl",kernelFunc:GV},XV=` +`,YV=qe({opSnippet:ZV}),JV={kernelName:fs,backendName:"webgl",kernelFunc:YV},QV=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; -`,KV=qe({opSnippet:XV}),ZV={kernelName:ho,backendName:"webgl",kernelFunc:KV},YV=class{constructor(e,t,n,r,a){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[c]=t,[u,h]=n;this.outputShape=[c,u,h,l];let d=r==="bilinear"?1:0,[p,m]=[`${i-1}.0`,`${o-1}.0`],[f,A,y]=u>1?[`${(i-1)/(u-1)}`,"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[g,x,v]=h>1?[`${(o-1)/(h-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` +`,ej=qe({opSnippet:QV}),tj={kernelName:co,backendName:"webgl",kernelFunc:ej},nj=class{constructor(e,t,n,a,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[d]=t,[u,p]=n;this.outputShape=[d,u,p,l];let c=a==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,A,y]=u>1?[`${(i-1)/(u-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[g,x,k]=p>1?[`${(o-1)/(p-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` const float height_ratio = float(${f}); const float width_ratio = float(${g}); void main() { @@ -2383,18 +2383,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float width_scale = ${x}; float in_y = ${y}; - if( in_y < 0.0 || in_y > ${p} ) { - setOutput(float(${a})); + if( in_y < 0.0 || in_y > ${h} ) { + setOutput(float(${r})); return; } - float in_x = ${v}; + float in_x = ${k}; if( in_x < 0.0 || in_x > ${m} ) { - setOutput(float(${a})); + setOutput(float(${r})); return; } vec2 sourceFracIndexCR = vec2(in_x,in_y); - if(${d} == 1) { + if(${c} == 1) { // Compute the four integer indices. ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); @@ -2418,21 +2418,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput(newValue); } } - `}},JV=e=>{let{inputs:t,backend:n,attrs:r}=e,{image:a,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:c}=r,u=new YV(a.shape,s.shape,o,l,c);return n.runWebGLProgram(u,[a,s,i],"float32")},QV={kernelName:po,backendName:"webgl",kernelFunc:JV},U3=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let r=e.length,a=t?"0.0":`getX(${V3(r,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` + `}},aj=e=>{let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:d}=a,u=new nj(r.shape,s.shape,o,l,d);return n.runWebGLProgram(u,[r,s,i],"float32")},rj={kernelName:ho,backendName:"webgl",kernelFunc:aj},Hv=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let a=e.length,r=t?"0.0":`getX(${jv(a,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` uniform float index; void main() { - ${lt(r)} coords = getOutputCoords(); - int end = ${j3(r,"coords")}; - float val = ${a}; + ${lt(a)} coords = getOutputCoords(); + int end = ${Uv(a,"coords")}; + float val = ${r}; int pow2 = int(pow(2.0, index)); if (${i}) { int idx = ${o}; - ${j3(r,"coords")} = idx; - val += getX(${V3(r,"coords")}); + ${Uv(a,"coords")} = idx; + val += getX(${jv(a,"coords")}); } setOutput(val); } - `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function V3(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function j3(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function ej(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,exclusive:i,reverse:o}=r,l=a.shape.length,c=E.getAxesPermutation([s],l),u=a;c!=null&&(u=dn({inputs:{x:a},backend:n,attrs:{perm:c}}));let h=E.getInnerMostAxes(1,l)[0];if(h!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${a.shape.length-1} but got axis=${s}`);let d=u.shape[h],p=Pn({inputs:{x:u},backend:n});for(let m=0;m<=Math.ceil(Math.log2(d))-1;m++){let f=new U3(u.shape,!1,o),A=f.getCustomSetupFunc(m),y=p;p=n.runWebGLProgram(f,[p],p.dtype,A),n.disposeIntermediateTensorInfo(y)}if(i){let m=new U3(u.shape,i,o),f=p;p=n.runWebGLProgram(m,[p],p.dtype),n.disposeIntermediateTensorInfo(f)}if(c!=null){let m=E.getUndoAxesPermutation(c),f=dn({inputs:{x:p},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(u),f}return p}var tj={kernelName:ms,backendName:"webgl",kernelFunc:ej};function nj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i,binaryOutput:o}=r;if(a.shape.length===1){let l=n.readSync(a.dataId),c=n.readSync(s.dataId),u=l3(l,c,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}else if(a.shape.length===2){let l=n.bufferSync(a),c=n.bufferSync(s),u=NL(l,c,i,o);return n.makeTensorInfo(u.shape,s.dtype,u.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${a.shape.length}.`)}var rj={kernelName:Fh,backendName:"webgl",kernelFunc:nj},aj=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function jv(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function Uv(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function sj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=a,l=r.shape.length,d=C.getAxesPermutation([s],l),u=r;d!=null&&(u=cn({inputs:{x:r},backend:n,attrs:{perm:d}}));let p=C.getInnerMostAxes(1,l)[0];if(p!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${r.shape.length-1} but got axis=${s}`);let c=u.shape[p],h=Pn({inputs:{x:u},backend:n});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let f=new Hv(u.shape,!1,o),A=f.getCustomSetupFunc(m),y=h;h=n.runWebGLProgram(f,[h],h.dtype,A),n.disposeIntermediateTensorInfo(y)}if(i){let m=new Hv(u.shape,i,o),f=h;h=n.runWebGLProgram(m,[h],h.dtype),n.disposeIntermediateTensorInfo(f)}if(d!=null){let m=C.getUndoAxesPermutation(d),f=cn({inputs:{x:h},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(u),f}return h}var ij={kernelName:ms,backendName:"webgl",kernelFunc:sj};function oj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=a;if(r.shape.length===1){let l=n.readSync(r.dataId),d=n.readSync(s.dataId),u=uv(l,d,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}else if(r.shape.length===2){let l=n.bufferSync(r),d=n.bufferSync(s),u=FL(l,d,i,o);return n.makeTensorInfo(u.shape,s.dtype,u.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var lj={kernelName:$p,backendName:"webgl",kernelFunc:oj},uj=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -2451,20 +2451,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float result = ${this.getInputSamplingString()}; setOutput(result); } - `}getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function sj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockSize:s,dataFormat:i}=r;_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=i==="NHWC"?a.shape[1]:a.shape[2],c=i==="NHWC"?a.shape[2]:a.shape[3],u=i==="NHWC"?a.shape[3]:a.shape[1],h=l*s,d=c*s,p=u/(s*s),m=i==="NHWC"?[o,h,d,p]:[o,p,h,d],f=new aj(m,s,i);return n.runWebGLProgram(f,[a],a.dtype)}var ij={kernelName:fo,backendName:"webgl",kernelFunc:sj},H3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,l=e.padInfo.left,c=e.strideHeight,u=e.strideWidth,h=e.dilationHeight,d=e.dilationWidth,p=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,A="",y="";n&&(r?A=`float activation(float a) { + `}getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function dj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockSize:s,dataFormat:i}=a;w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],d=i==="NHWC"?r.shape[2]:r.shape[3],u=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=d*s,h=u/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=new uj(m,s,i);return n.runWebGLProgram(f,[r],r.dtype)}var pj={kernelName:fo,backendName:"webgl",kernelFunc:dj},Gv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,l=e.padInfo.left,d=e.strideHeight,u=e.strideWidth,p=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,A="",y="";n&&(a?A=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} - }`:a?A=`float activation(float a) { + }`:r?A=`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${n} }`:A=` float activation(float x) { ${n} } - `,y="result = activation(result);");let g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,y="result = activation(result);");let g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${A} - const ivec2 strides = ivec2(${c}, ${u}); + const ivec2 strides = ivec2(${d}, ${u}); const ivec2 pads = ivec2(${o}, ${l}); void main() { @@ -2482,15 +2482,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. - for (int wR = 0; wR < ${p}; wR++) { - int xR = xRCorner + wR * ${h}; + for (int wR = 0; wR < ${h}; wR++) { + int xR = xRCorner + wR * ${p}; if (xR < 0 || xR >= ${s}) { continue; } for (int wC = 0; wC < ${m}; wC++) { - int xC = xCCorner + wC * ${d}; + int xC = xCCorner + wC * ${c}; if (xC < 0 || xC >= ${i}) { continue; @@ -2507,30 +2507,30 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam ${y} setOutput(result); } - `}},G3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,l=e.padInfo.top,c=e.padInfo.left,u=e.strideHeight,h=e.strideWidth,d=e.dilationHeight,p=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,A=f,y=` + `}},qv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,l=e.padInfo.top,d=e.padInfo.left,u=e.strideHeight,p=e.strideWidth,c=e.dilationHeight,h=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,A=f,y=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let w=0;w=0 && xR < ${i}) { - `;for(let b=0;b= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - `,p===1&&k>0?y+=` - xC${k} = vec4(xTexelC${k-2}.zw, xTexelC${k}.xy); + `,h===1&&I>0?y+=` + xC${I} = vec4(xTexelC${I-2}.zw, xTexelC${I}.xy); `:y+=` xCOffset = xC + 1 - 2; @@ -2543,120 +2543,120 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam previous.zw = vec2(0.0); } - xC${k} = vec4(previous.zw, xTexelC${k}.xy); + xC${I} = vec4(previous.zw, xTexelC${I}.xy); } else { - xC${k} = vec4(0.0, 0.0, xTexelC${k}.xy); + xC${I} = vec4(0.0, 0.0, xTexelC${I}.xy); } `):y+=` if (xC >= 0 && xC < ${o}) { - xTexelC${k} = getX(batch, xR, xC, d1); + xTexelC${I} = getX(batch, xR, xC, d1); if (xC + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - xC${k} = xTexelC${k}; - `,k+1= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - `,p>1&&(y+=` + `,h>1&&(y+=` xCOffset -= 2; if (xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); } `),y+=` - xC${k+1} = vec4(xTexelC${k}.zw, xTexelC${k+2}.xy); - `):N===1?y+=` - xC${k+1} = xTexelC${k}; + xC${I+1} = vec4(xTexelC${I}.zw, xTexelC${I+2}.xy); + `):T===1?y+=` + xC${I+1} = xTexelC${I}; `:y+=` - xCOffset = xC + ${N}; + xCOffset = xC + ${T}; if (xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - xC${k+1} = xTexelC${k+2}; - `}}else k= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } if(xC + 1 >= 0 && xC + 1 < ${o}) { - xTexelC${k+2} = getX(batch, xR, xC + 1, d1); + xTexelC${I+2} = getX(batch, xR, xC + 1, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xC + 2 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - xC${k} = vec4(xTexelC${k}.zw, xTexelC${k+2}.zw); - `,k+1= 0 && xCOffset < ${o}) { final = getX(batch, xR, xCOffset, d1); } - xC${k+1} = vec4(xTexelC${k+2}.xy, final.xy); + xC${I+1} = vec4(xTexelC${I+2}.xy, final.xy); `)):(y+=` if(xC >= 0 && xC < ${o}) { - xTexelC${k} = getX(batch, xR, xC, d1); + xTexelC${I} = getX(batch, xR, xC, d1); if (xC + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - xCOffset = xC + ${h}; + xCOffset = xC + ${p}; if(xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.); + xTexelC${I+2}.zw = vec2(0.); } } - xC${k} = vec4( - xTexelC${k}.xy, xTexelC${k+2}.xy); - `,k+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let h=E.computeConv2DInfo(a.shape,s.shape,i,u,o,c,!0),d;return J().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?d=new G3(h):d=new H3(h),n.runWebGLProgram(d,[a,s],"float32")}var lj={kernelName:As,backendName:"webgl",kernelFunc:oj},uj=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,a=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` + `}};function cj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l,dimRoundingMode:d}=a,u=l;u==null&&(u=[1,1]),w.assert(C.eitherStridesOrDilationsAreOne(i,u),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!0),c;return J().getBool("WEBGL_PACK_DEPTHWISECONV")&&p.strideWidth<=2&&p.outChannels/p.inChannels==1?c=new qv(p):c=new Gv(p),n.runWebGLProgram(c,[r,s],"float32")}var hj={kernelName:As,backendName:"webgl",kernelFunc:cj},fj=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2693,14 +2693,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // TO DO: Vec4 over the batch size for (int b = 0; b < ${e.batchSize}; b++) { for (int yR = 0; yR < ${e.outHeight}; yR++) { - int xR = wR + yR * ${t} - ${r}; + int xR = wR + yR * ${t} - ${a}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${n} - ${a}; + int xC = wC + yC * ${n} - ${r}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2714,7 +2714,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},cj=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` + `}},mj=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${s}, ${i}); void main() { @@ -2728,7 +2728,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float dotProd = 0.0; for (int wR = 0; wR < ${t}; wR++) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -2738,7 +2738,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${n}; wC++) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -2759,15 +2759,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}};function hj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:c,filterShape:u}=r,h=E.computeConv2DInfo(a.shape,u,i,o,l,c,!0),d=new uj(h);return n.runWebGLProgram(d,[a,s],"float32")}var dj={kernelName:$h,backendName:"webgl",kernelFunc:hj};function pj(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:c,inputShape:u}=r,h=E.computeConv2DInfo(u,s.shape,i,o,l,c,!0),d=new cj(h);return n.runWebGLProgram(d,[a,s],"float32")}var fj={kernelName:Dh,backendName:"webgl",kernelFunc:pj},mj=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` + `}};function Aj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:d,filterShape:u}=a,p=C.computeConv2DInfo(r.shape,u,i,o,l,d,!0),c=new fj(p);return n.runWebGLProgram(c,[r,s],"float32")}var yj={kernelName:Dp,backendName:"webgl",kernelFunc:Aj};function gj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:d,inputShape:u}=a,p=C.computeConv2DInfo(u,s.shape,i,o,l,d,!0),c=new mj(p);return n.runWebGLProgram(c,[r,s],"float32")}var xj={kernelName:Op,backendName:"webgl",kernelFunc:gj},bj=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` void main() { ivec2 coords = getOutputCoords(); float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; setOutput(val); } - `}};function Aj(e){let{inputs:t,backend:n}=e,{x:r}=t,a=[...r.shape,...r.shape],s=_.sizeFromShape(r.shape),i=fe({inputs:{x:r},backend:n,attrs:{shape:[s]}}),o=new mj(s),l=n.runWebGLProgram(o,[i],i.dtype),c=fe({inputs:{x:l},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),c}var yj={kernelName:Oh,backendName:"webgl",kernelFunc:Aj},gj=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:r,strideHeight:a,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:c}=e,{top:u,left:h}=r;this.userCode=` - const ivec2 strides = ivec2(${a}, ${s}); - const ivec2 pads = ivec2(${u}, ${h}); + `}};function vj(e){let{inputs:t,backend:n}=e,{x:a}=t,r=[...a.shape,...a.shape],s=w.sizeFromShape(a.shape),i=fe({inputs:{x:a},backend:n,attrs:{shape:[s]}}),o=new bj(s),l=n.runWebGLProgram(o,[i],i.dtype),d=fe({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),d}var wj={kernelName:zp,backendName:"webgl",kernelFunc:vj},kj=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:a,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:d}=e,{top:u,left:p}=a;this.userCode=` + const ivec2 strides = ivec2(${r}, ${s}); + const ivec2 pads = ivec2(${u}, ${p}); const float neg_infinity = -3.4e38; void main() { @@ -2785,7 +2785,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam if (hIn >= 0 && hIn < ${t}) { for (int w = 0; w < ${o}; w++) { - int wIn = wBeg + w * ${c}; + int wIn = wBeg + w * ${d}; if (wIn >= 0 && wIn < ${n}) { float xVal = getX(batch, hIn, wIn, d1); @@ -2803,7 +2803,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float result = curVal; setOutput(result); } - `}};function xj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dilations:l}=r,c=E.computeDilation2DInfo(a.shape,s.shape,i,o,"NHWC",l),u,h=new gj(c);u=n.runWebGLProgram(h,[a,s],"float32");let d=fe({inputs:{x:u},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(u),d}var wj={kernelName:gu,backendName:"webgl",kernelFunc:xj};function bj(e){let{inputs:t,backend:n,attrs:r}=e,{equation:a}=r,s=t,{allDims:i,summedDims:o,idDims:l}=E.decodeEinsumEquation(a,s.length);E.checkEinsumDimSizes(i.length,l,s);let{path:c,steps:u}=E.getEinsumComputePath(o,l),h=u.length,d=null,p=i.length,m=[];for(let f=0;f=0&&(d=gp({inputs:{x:d},backend:n,attrs:{axis:c[f]-(i.length-p),keepDims:!1}}),m.push(d)),p--)}for(let f of m)f!==d&&n.disposeIntermediateTensorInfo(f);return d}var _j={kernelName:Lh,backendName:"webgl",kernelFunc:bj},vj="return (x >= 0.0) ? x : (exp(x) - 1.0);",kj=` + `}};function Ij(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,d=C.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),u,p=new kj(d);u=n.runWebGLProgram(p,[r,s],"float32");let c=fe({inputs:{x:u},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(u),c}var Sj={kernelName:gu,backendName:"webgl",kernelFunc:Ij};function Nj(e){let{inputs:t,backend:n,attrs:a}=e,{equation:r}=a,s=t,{allDims:i,summedDims:o,idDims:l}=C.decodeEinsumEquation(r,s.length);C.checkEinsumDimSizes(i.length,l,s);let{path:d,steps:u}=C.getEinsumComputePath(o,l),p=u.length,c=null,h=i.length,m=[];for(let f=0;f=0&&(c=gh({inputs:{x:c},backend:n,attrs:{axis:d[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var Tj={kernelName:Lp,backendName:"webgl",kernelFunc:Nj},Ej="return (x >= 0.0) ? x : (exp(x) - 1.0);",Cj=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -2812,41 +2812,41 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,Ij=qe({opSnippet:vj,packedOpSnippet:kj}),Sj={kernelName:mo,backendName:"webgl",kernelFunc:Ij},Nj="return (b >= 1.0) ? a : a * (b + 1.0);",Tj=` +`,Rj=qe({opSnippet:Ej,packedOpSnippet:Cj}),Mj={kernelName:mo,backendName:"webgl",kernelFunc:Rj},Fj="return (b >= 1.0) ? a : a * (b + 1.0);",$j=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); -`,Ej=e=>{let{inputs:t,backend:n}=e,{dy:r,y:a}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(Tj,r.shape,a.shape):new $l(Nj,r.shape,a.shape);return n.runWebGLProgram(s,[r,a],r.dtype)},Cj={kernelName:Wh,backendName:"webgl",kernelFunc:Ej},Rj=` +`,Dj=e=>{let{inputs:t,backend:n}=e,{dy:a,y:r}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd($j,a.shape,r.shape):new Dl(Fj,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)},Oj={kernelName:Wp,backendName:"webgl",kernelFunc:Dj},zj=` return vec4(equal(a, b)); -`,Mj="return float(a == b);",Fj=en({opSnippet:Mj,packedOpSnippet:Rj,dtype:"bool"}),$j={kernelName:yo,backendName:"webgl",kernelFunc:Fj},Dj=` +`,_j="return float(a == b);",Pj=en({opSnippet:_j,packedOpSnippet:zj,dtype:"bool"}),Lj={kernelName:yo,backendName:"webgl",kernelFunc:Pj},Wj=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - float p = ${E.ERF_P}; - float a1 = ${E.ERF_A1}; - float a2 = ${E.ERF_A2}; - float a3 = ${E.ERF_A3}; - float a4 = ${E.ERF_A4}; - float a5 = ${E.ERF_A5}; + float p = ${C.ERF_P}; + float a1 = ${C.ERF_A1}; + float a2 = ${C.ERF_A2}; + float a3 = ${C.ERF_A3}; + float a4 = ${C.ERF_A4}; + float a5 = ${C.ERF_A5}; float sign = sign(x); x = abs(x); float t = 1.0 / (1.0 + p * x); return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); -`,Oj=qe({opSnippet:Dj}),zj={kernelName:Ao,backendName:"webgl",kernelFunc:Oj},q3="return exp(x);",X3=qe({opSnippet:q3,packedOpSnippet:q3,cpuKernelImpl:CL}),Pj={kernelName:gs,backendName:"webgl",kernelFunc:X3};function gA(e){let{inputs:t,attrs:n,backend:r}=e,{dim:a}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=a;return a<0&&(_.assert(-(i+1)<=a,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+a+1),o.splice(l,0,1),fe({inputs:{x:s},backend:r,attrs:{shape:o}})}var Lj={kernelName:go,backendName:"webgl",kernelFunc:gA},K3="return exp(x) - 1.0;",Wj=qe({opSnippet:K3,packedOpSnippet:K3,cpuKernelImpl:RL}),Bj={kernelName:xo,backendName:"webgl",kernelFunc:Wj},Z3=class{constructor(e,t,n){this.variableNames=["real","imag"];let r=t[1];this.outputShape=t;let a=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${r}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` - const float exponentMultiplier = ${a}; +`,Bj=qe({opSnippet:Wj}),Vj={kernelName:Ao,backendName:"webgl",kernelFunc:Bj},Xv="return exp(x);",Kv=qe({opSnippet:Xv,packedOpSnippet:Xv,cpuKernelImpl:OL}),jj={kernelName:gs,backendName:"webgl",kernelFunc:Kv};function g1(e){let{inputs:t,attrs:n,backend:a}=e,{dim:r}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(w.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),fe({inputs:{x:s},backend:a,attrs:{shape:o}})}var Uj={kernelName:go,backendName:"webgl",kernelFunc:g1},Zv="return exp(x) - 1.0;",Hj=qe({opSnippet:Zv,packedOpSnippet:Zv,cpuKernelImpl:zL}),Gj={kernelName:xo,backendName:"webgl",kernelFunc:Hj},Yv=class{constructor(e,t,n){this.variableNames=["real","imag"];let a=t[1];this.outputShape=t;let r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${a}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` + const float exponentMultiplier = ${r}; float unaryOpComplex(float real, float expR, float imag, float expI) { ${i} } float mulMatDFT(int batch, int index) { - float indexRatio = float(index) / float(${r}); + float indexRatio = float(index) / float(${a}); float exponentMultiplierTimesIndexRatio = exponentMultiplier * indexRatio; float result = 0.0; - for (int i = 0; i < ${r}; i++) { + for (int i = 0; i < ${a}; i++) { // x = (-2|2 * PI / N) * index * i; float x = exponentMultiplierTimesIndexRatio * float(i); float expR = cos(x); @@ -2865,13 +2865,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } - `}};function Y3(e,t,n){let r=n.texData.get(e.dataId),a=_.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=a/s,o=fe({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),l=o.shape,c=new Z3("real",l,t),u=new Z3("imag",l,t),h=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:l},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:l}],d=n.runWebGLProgram(c,h,"float32"),p=n.runWebGLProgram(u,h,"float32"),m=Ba({inputs:{real:d,imag:p},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p);let f=fe({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function Vj(e){let{inputs:t,backend:n}=e,{input:r}=t;return Y3(r,!1,n)}var jj={kernelName:Bh,backendName:"webgl",kernelFunc:Vj},Uj=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` + `}};function Jv(e,t,n){let a=n.texData.get(e.dataId),r=w.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=fe({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),l=o.shape,d=new Yv("real",l,t),u=new Yv("imag",l,t),p=[{dataId:a.complexTensorInfos.real.dataId,dtype:a.complexTensorInfos.real.dtype,shape:l},{dataId:a.complexTensorInfos.imag.dataId,dtype:a.complexTensorInfos.imag.dtype,shape:l}],c=n.runWebGLProgram(d,p,"float32"),h=n.runWebGLProgram(u,p,"float32"),m=Lr({inputs:{real:c,imag:h},backend:n});n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h);let f=fe({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function qj(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jv(a,!1,n)}var Xj={kernelName:Bp,backendName:"webgl",kernelFunc:qj},Kj=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` uniform float value; void main() { // Input can be obtained from uniform value. setOutput(value); } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function xA(e){let{backend:t,attrs:n}=e,{shape:r,value:a}=n,{dtype:s}=n;if(s=s||_.inferDtype(a),s==="string"){let i=_.getArrayFromDType(s,_.sizeFromShape(r));return i.fill(a),t.makeTensorInfo(r,s,i)}else{let i=new Uj(r,a),o=i.getCustomSetupFunc(a);return t.runWebGLProgram(i,[],s,o)}}var Hj={kernelName:xu,backendName:"webgl",kernelFunc:xA},Gj=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function x1(e){let{backend:t,attrs:n}=e,{shape:a,value:r}=n,{dtype:s}=n;if(s=s||w.inferDtype(r),s==="string"){let i=w.getArrayFromDType(s,w.sizeFromShape(a));return i.fill(r),t.makeTensorInfo(a,s,i)}else{let i=new Kj(a,r),o=i.getCustomSetupFunc(r);return t.runWebGLProgram(i,[],s,o)}}var Zj={kernelName:xu,backendName:"webgl",kernelFunc:x1},Yj=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int x = coords[2]; @@ -2885,7 +2885,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(outputValue); } - `}},qj={kernelName:wo,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,r=t,a=new Gj(n.shape);return r.runWebGLProgram(a,[n],n.dtype)}},J3="return floor(x);",Xj=qe({opSnippet:J3,packedOpSnippet:J3,cpuKernelImpl:ML}),Kj={kernelName:xs,backendName:"webgl",kernelFunc:Xj},Zj=` + `}},Jj={kernelName:bo,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,a=t,r=new Yj(n.shape);return a.runWebGLProgram(r,[n],n.dtype)}},Qv="return floor(x);",Qj=qe({opSnippet:Qv,packedOpSnippet:Qv,cpuKernelImpl:_L}),eU={kernelName:xs,backendName:"webgl",kernelFunc:Qj},tU=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -2895,7 +2895,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } else { return NAN; } -`,Yj=` +`,nU=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -2916,13 +2916,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); -`,Jj=en({opSnippet:Zj,packedOpSnippet:Yj,dtype:"int32"}),Qj={kernelName:ws,backendName:"webgl",kernelFunc:Jj},eU=class{constructor(e){this.variableNames=["A"];let t=cn(),[n,r]=e;this.outputShape=e,this.userCode=` +`,aU=en({opSnippet:tU,packedOpSnippet:nU,dtype:"int32"}),rU={kernelName:bs,backendName:"webgl",kernelFunc:aU},sU=class{constructor(e){this.variableNames=["A"];let t=dn(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; int texC = coords[1]; int depth = coords[2]; - vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}.0, ${n}.0); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${a}.0, ${n}.0); vec4 values = ${t.texture2D}(A, uv); float value; @@ -2938,7 +2938,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput(floor(value * 255.0 + 0.5)); } - `}},tU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=cn(),[n,r]=e;this.outputShape=e,this.userCode=` + `}},iU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=dn(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -2953,7 +2953,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam depth = coords[2] + col; vec2 uv = (vec2(texC, texR) + halfCR) / - vec2(${r}.0, ${n}.0); + vec2(${a}.0, ${n}.0); vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { @@ -2972,10 +2972,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam ${t.output} = result; } - `}},rU={kernelName:rd,backendName:"webgl",kernelFunc:nU},Ol;function nU(e){let{inputs:t,backend:n,attrs:r}=e,{pixels:a}=t,{numChannels:s}=r,i=typeof HTMLVideoElement!="undefined"&&a instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&a instanceof HTMLImageElement,[l,c]=i?[a.videoWidth,a.videoHeight]:[a.width,a.height],u=[c,l],h=[c,l,s];(o||i)&&(Ol==null&&(Ol=document.createElement("canvas").getContext("2d")),Ol.canvas.width=l,Ol.canvas.height=c,Ol.drawImage(a,0,0,l,c),a=Ol.canvas);let d=n.makeTensorInfo(u,"int32");n.texData.get(d.dataId).usage=Jn.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),a);let p=J().getBool("WEBGL_PACK")?new tU(h):new eU(h),m=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),m}function aU(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=E.convertConv2DDataFormat(u),A=E.computeConv2DInfo(a.shape,s.shape,l,h,c,d,!1,f),y,g=[];if(A.filterHeight===1&&A.filterWidth===1&&A.dilationHeight===1&&A.dilationWidth===1&&A.strideHeight===1&&A.strideWidth===1&&(A.padInfo.type==="SAME"||A.padInfo.type==="VALID"))y=W3({x:a,filter:s,convInfo:A,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:m});else if(J().getBool("WEBGL_CONV_IM2COL")&&a.shape[0]===1)y=B3({x:a,filter:s,convInfo:A,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:m});else{let v=i!=null,w=o!=null,b=p==="leakyrelu",k=p?Ap(p,!1):null,N=new L3(A,v,k,w,b),C=[a,s];if(i&&C.push(i),o&&C.push(o),b){let F=n.makeTensorInfo([],"float32",_.createScalarValue(m,"float32"));C.push(F),g.push(F)}y=n.runWebGLProgram(N,C,"float32")}let x=fe({inputs:{x:y},backend:n,attrs:{shape:A.outShape}});return g.push(y),g.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var sU={kernelName:ti,backendName:"webgl",kernelFunc:aU};function iU(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=r,m=[],f=u;f==null&&(f=[1,1]),_.assert(E.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let A=E.computeConv2DInfo(a.shape,s.shape,l,f,c,h,!0),y=J().getBool("WEBGL_PACK_DEPTHWISECONV")&&A.strideWidth<=2&&A.outChannels/A.inChannels==1,g=d?Ap(d,y):null,x=[a,s],v=i!=null,w=o!=null,b=d==="leakyrelu";if(v&&x.push(i),w&&x.push(o),b){let C=n.makeTensorInfo([],"float32",_.createScalarValue(p,"float32"));x.push(C),m.push(C)}let k;y?k=new G3(A,v,g,w,b):k=new H3(A,v,g,w,b);let N=n.runWebGLProgram(k,x,"float32");return m.forEach(C=>n.disposeIntermediateTensorInfo(C)),N}var oU={kernelName:ni,backendName:"webgl",kernelFunc:iU},lU=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let r=lt(t.length),a=lt(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` - ${r} strides = ${r}(${this.strides}); + `}},lU={kernelName:ac,backendName:"webgl",kernelFunc:oU},zl;function oU(e){let{inputs:t,backend:n,attrs:a}=e,{pixels:r}=t,{numChannels:s}=a,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[l,d]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],u=[d,l],p=[d,l,s];(o||i)&&(zl==null&&(zl=document.createElement("canvas").getContext("2d")),zl.canvas.width=l,zl.canvas.height=d,zl.drawImage(r,0,0,l,d),r=zl.canvas);let c=n.makeTensorInfo(u,"int32");n.texData.get(c.dataId).usage=Jn.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(c.dataId),r);let h=J().getBool("WEBGL_PACK")?new iU(p):new sU(p),m=n.runWebGLProgram(h,[c],"int32");return n.disposeData(c.dataId),m}function uU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=C.convertConv2DDataFormat(u),A=C.computeConv2DInfo(r.shape,s.shape,l,p,d,c,!1,f),y,g=[];if(A.filterHeight===1&&A.filterWidth===1&&A.dilationHeight===1&&A.dilationWidth===1&&A.strideHeight===1&&A.strideWidth===1&&(A.padInfo.type==="SAME"||A.padInfo.type==="VALID"))y=Bv({x:r,filter:s,convInfo:A,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(J().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)y=Vv({x:r,filter:s,convInfo:A,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let k=i!=null,b=o!=null,v=h==="leakyrelu",I=h?Ah(h,!1):null,T=new Wv(A,k,I,b,v),R=[r,s];if(i&&R.push(i),o&&R.push(o),v){let $=n.makeTensorInfo([],"float32",w.createScalarValue(m,"float32"));R.push($),g.push($)}y=n.runWebGLProgram(T,R,"float32")}let x=fe({inputs:{x:y},backend:n,attrs:{shape:A.outShape}});return g.push(y),g.forEach(k=>n.disposeIntermediateTensorInfo(k)),x}var dU={kernelName:ti,backendName:"webgl",kernelFunc:uU};function pU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dimRoundingMode:p,activation:c,leakyreluAlpha:h}=a,m=[],f=u;f==null&&(f=[1,1]),w.assert(C.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let A=C.computeConv2DInfo(r.shape,s.shape,l,f,d,p,!0),y=J().getBool("WEBGL_PACK_DEPTHWISECONV")&&A.strideWidth<=2&&A.outChannels/A.inChannels==1,g=c?Ah(c,y):null,x=[r,s],k=i!=null,b=o!=null,v=c==="leakyrelu";if(k&&x.push(i),b&&x.push(o),v){let R=n.makeTensorInfo([],"float32",w.createScalarValue(h,"float32"));x.push(R),m.push(R)}let I;y?I=new qv(A,k,g,b,v):I=new Gv(A,k,g,b,v);let T=n.runWebGLProgram(I,x,"float32");return m.forEach(R=>n.disposeIntermediateTensorInfo(R)),T}var cU={kernelName:ni,backendName:"webgl",kernelFunc:pU},hU=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let a=lt(t.length),r=lt(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` + ${a} strides = ${a}(${this.strides}); void main() { - ${a} coords = getOutputCoords(); + ${r} coords = getOutputCoords(); int flattenIndex = 0; for (int j = 0; j < ${this.sliceDim}; j++) { int index = round(getIndices(coords[0], j)); @@ -2983,21 +2983,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(getX(flattenIndex, coords[1])); } - `}};function uU(e){let{inputs:t,backend:n}=e,{params:r,indices:a}=t,s=a.shape,i=s[s.length-1],[o,l,c,u]=E.prepareAndValidate(r,a),h=fe({inputs:{x:a},backend:n,attrs:{shape:[l,i]}}),d=fe({inputs:{x:r},backend:n,attrs:{shape:[_.sizeFromShape(r.shape)/c,c]}}),p=new lU(i,u,[l,c]),m=n.runWebGLProgram(p,[d,h],d.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(m),f}var cU={kernelName:_o,backendName:"webgl",kernelFunc:uU},dU=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=lt(this.rank),r=hU(e,2);this.userCode=` + `}};function fU(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=r.shape,i=s[s.length-1],[o,l,d,u]=C.prepareAndValidate(a,r),p=fe({inputs:{x:r},backend:n,attrs:{shape:[l,i]}}),c=fe({inputs:{x:a},backend:n,attrs:{shape:[w.sizeFromShape(a.shape)/d,d]}}),h=new hU(i,u,[l,d]),m=n.runWebGLProgram(h,[c,p],c.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(m),f}var mU={kernelName:wo,backendName:"webgl",kernelFunc:fU},yU=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=lt(this.rank),a=AU(e,2);this.userCode=` void main() { ${n} resRC = getOutputCoords(); - setOutput(getA(${r})); + setOutput(getA(${a})); } - `}};function hU(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[];for(let a=0;an.disposeIntermediateTensorInfo(w)),n.makeTensorInfo(c.outputShape,v.dtype,v.values)}let f=new dU(d.shape,m),A=n.runWebGLProgram(f,[d,p],d.dtype);h.push(A);let y=fe({inputs:{x:A},backend:n,attrs:{shape:c.outputShape}});return h.forEach(g=>n.disposeIntermediateTensorInfo(g)),y}var fU={kernelName:bo,backendName:"webgl",kernelFunc:pU},mU="return float(a > b);",AU=` + `}};function AU(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let r=0;rn.disposeIntermediateTensorInfo(b)),n.makeTensorInfo(d.outputShape,k.dtype,k.values)}let f=new yU(c.shape,m),A=n.runWebGLProgram(f,[c,h],c.dtype);p.push(A);let y=fe({inputs:{x:A},backend:n,attrs:{shape:d.outputShape}});return p.forEach(g=>n.disposeIntermediateTensorInfo(g)),y}var xU={kernelName:vo,backendName:"webgl",kernelFunc:gU},bU="return float(a > b);",vU=` return vec4(greaterThan(a, b)); -`,yU=en({opSnippet:mU,packedOpSnippet:AU,cpuKernelImpl:$L,dtype:"bool"}),gU={kernelName:vo,backendName:"webgl",kernelFunc:yU},xU="return float(a >= b);",wU=` +`,wU=en({opSnippet:bU,packedOpSnippet:vU,cpuKernelImpl:LL,dtype:"bool"}),kU={kernelName:ko,backendName:"webgl",kernelFunc:wU},IU="return float(a >= b);",SU=` return vec4(greaterThanEqual(a, b)); -`,bU=en({opSnippet:xU,packedOpSnippet:wU,dtype:"bool"}),_U={kernelName:_s,backendName:"webgl",kernelFunc:bU};function vU(e){let{inputs:t,backend:n}=e,{input:r}=t;return Y3(r,!0,n)}var kU={kernelName:Vh,backendName:"webgl",kernelFunc:vU},IU="return float(!isnan(x) && !isinf(x));",SU=qe({opSnippet:IU,dtype:"bool"}),NU={kernelName:ko,backendName:"webgl",kernelFunc:SU},TU="return float(isinf(x));",EU=qe({opSnippet:TU,dtype:"bool"}),CU={kernelName:Io,backendName:"webgl",kernelFunc:EU},RU="return float(isnan(x));",MU=qe({opSnippet:RU,dtype:"bool"}),FU={kernelName:So,backendName:"webgl",kernelFunc:MU},$U="return float(a < b);",DU=` +`,NU=en({opSnippet:IU,packedOpSnippet:SU,dtype:"bool"}),TU={kernelName:ws,backendName:"webgl",kernelFunc:NU};function EU(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jv(a,!0,n)}var CU={kernelName:Vp,backendName:"webgl",kernelFunc:EU},RU="return float(!isnan(x) && !isinf(x));",MU=qe({opSnippet:RU,dtype:"bool"}),FU={kernelName:Io,backendName:"webgl",kernelFunc:MU},$U="return float(isinf(x));",DU=qe({opSnippet:$U,dtype:"bool"}),OU={kernelName:So,backendName:"webgl",kernelFunc:DU},zU="return float(isnan(x));",_U=qe({opSnippet:zU,dtype:"bool"}),PU={kernelName:No,backendName:"webgl",kernelFunc:_U},LU="return float(a < b);",WU=` return vec4(lessThan(a, b)); -`,OU=en({opSnippet:$U,packedOpSnippet:DU,cpuKernelImpl:DL,dtype:"bool"}),zU={kernelName:No,backendName:"webgl",kernelFunc:OU},PU="return float(a <= b);",LU=` +`,BU=en({opSnippet:LU,packedOpSnippet:WU,cpuKernelImpl:WL,dtype:"bool"}),VU={kernelName:To,backendName:"webgl",kernelFunc:BU},jU="return float(a <= b);",UU=` return vec4(lessThanEqual(a, b)); -`,WU=en({opSnippet:PU,packedOpSnippet:LU,dtype:"bool"}),BU={kernelName:To,backendName:"webgl",kernelFunc:WU};function VU(e){let{backend:t,attrs:n}=e,{start:r,stop:a,num:s}=n,i=OL(r,a,s);return t.makeTensorInfo([i.length],"float32",i)}var jU={kernelName:Uh,backendName:"webgl",kernelFunc:VU},UU=`if (x < 0.0) return NAN; - return log(x);`,HU=` +`,HU=en({opSnippet:jU,packedOpSnippet:UU,dtype:"bool"}),GU={kernelName:Eo,backendName:"webgl",kernelFunc:HU};function qU(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=BL(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var XU={kernelName:Up,backendName:"webgl",kernelFunc:qU},KU=`if (x < 0.0) return NAN; + return log(x);`,ZU=` vec4 result = log(x); vec4 isNaN = vec4(lessThan(x, vec4(0.0))); result.r = isNaN.r == 1.0 ? NAN : result.r; @@ -3006,16 +3006,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam result.a = isNaN.a == 1.0 ? NAN : result.a; return result; -`,GU=qe({opSnippet:UU,packedOpSnippet:HU,cpuKernelImpl:zL}),qU={kernelName:Is,backendName:"webgl",kernelFunc:GU},XU="return log(1.0 + x);",KU=qe({opSnippet:XU}),ZU={kernelName:Eo,backendName:"webgl",kernelFunc:KU},YU="return float(a >= 1.0 && b >= 1.0);",JU=` +`,YU=qe({opSnippet:KU,packedOpSnippet:ZU,cpuKernelImpl:VL}),JU={kernelName:Ss,backendName:"webgl",kernelFunc:YU},QU="return log(1.0 + x);",eH=qe({opSnippet:QU}),tH={kernelName:Co,backendName:"webgl",kernelFunc:eH},nH="return float(a >= 1.0 && b >= 1.0);",aH=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); -`,QU=en({opSnippet:YU,packedOpSnippet:JU,dtype:"bool"}),eH={kernelName:Co,backendName:"webgl",kernelFunc:QU},tH="return float(!(x >= 1.0));",nH=qe({opSnippet:tH}),rH={kernelName:wu,backendName:"webgl",kernelFunc:nH},aH="return float(a >= 1.0 || b >= 1.0);",sH=` +`,rH=en({opSnippet:nH,packedOpSnippet:aH,dtype:"bool"}),sH={kernelName:Ro,backendName:"webgl",kernelFunc:rH},iH="return float(!(x >= 1.0));",oH=qe({opSnippet:iH}),lH={kernelName:bu,backendName:"webgl",kernelFunc:oH},uH="return float(a >= 1.0 || b >= 1.0);",dH=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); -`,iH=en({opSnippet:aH,packedOpSnippet:sH,dtype:"bool"}),oH={kernelName:bu,backendName:"webgl",kernelFunc:iH},lH=class{constructor(e,t,n,r,a){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${r}) * sum`;a===.5?o=`inversesqrt(${l})`:a===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${a}));`,this.userCode=` +`,pH=en({opSnippet:uH,packedOpSnippet:dH,dtype:"bool"}),cH={kernelName:vu,backendName:"webgl",kernelFunc:pH},hH=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3034,7 +3034,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float val = x * ${o}; setOutput(val); } - `}},uH=class{constructor(e,t,n,r,a){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${r}) * sum`;a===.5?o=`inversesqrt(${l})`:a===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${a}));`,this.userCode=` + `}},fH=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords.x; @@ -3096,7 +3096,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam vec4 result = xAtOutputCoords * ${o}; setOutput(result); } - `}},cH=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=r,c=J().getBool("WEBGL_PACK_NORMALIZATION")?new uH(a.shape,s,i,o,l):new lH(a.shape,s,i,o,l);return n.runWebGLProgram(c,[a],a.dtype)},hH={kernelName:_u,backendName:"webgl",kernelFunc:cH},dH=class{constructor(e,t,n,r,a){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=a,this.userCode=` + `}},mH=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a,d=J().getBool("WEBGL_PACK_NORMALIZATION")?new fH(r.shape,s,i,o,l):new hH(r.shape,s,i,o,l);return n.runWebGLProgram(d,[r],r.dtype)},AH={kernelName:wu,backendName:"webgl",kernelFunc:mH},yH=class{constructor(e,t,n,a,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=a,this.beta=r,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3125,19 +3125,19 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } } - norm = float(${r}) * norm + float(${n}); + norm = float(${a}) * norm + float(${n}); for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ if (k < depthBegin){ continue; } else if (k >= depthBegin && k < depthEnd){ - float dyi = -2.0 * float(${r}) - * float(${a}) + float dyi = -2.0 * float(${a}) + * float(${r}) * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d) / norm; if (k == d) { - dyi += pow(norm, -1.0 * ${a}); + dyi += pow(norm, -1.0 * ${r}); } if (k == coords[3]) { dyi *= getDy(b, r, c, d); @@ -3151,14 +3151,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(result); } - `}},pH=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:c,beta:u}=r,h=new dH(a.shape,o,l,c,u);return n.runWebGLProgram(h,[a,s,i],a.dtype)},fH={kernelName:Hh,backendName:"webgl",kernelFunc:pH};function mH(e,t,n,r){let a=_.sizeFromShape(t),s=_.sizeFromShape(e.shape)/a,i=fe({inputs:{x:e},attrs:{shape:[s,a]},backend:r}),o=Si(i,e.dtype,"max",r),l=fe({inputs:{x:o},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),l}function Q3(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{reductionIndices:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=u!=null,d=n.shouldExecuteOnCPU([a]),p=a;if(h){if(d){let g=n.texData.get(p.dataId).values,x=new Array(o);for(let b=0;b{let{inputs:t,backend:n,attrs:a}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:d,beta:u}=a,p=new yH(r.shape,o,l,d,u);return n.runWebGLProgram(p,[r,s,i],r.dtype)},xH={kernelName:Hp,backendName:"webgl",kernelFunc:gH};function bH(e,t,n,a){let r=w.sizeFromShape(t),s=w.sizeFromShape(e.shape)/r,i=fe({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Ni(i,e.dtype,"max",a),l=fe({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}function e6(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=u!=null,c=n.shouldExecuteOnCPU([r]),h=r;if(p){if(c){let g=n.texData.get(h.dataId).values,x=new Array(o);for(let v=0;v`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l);if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:a},backend:n});let h=new mc(u,"max",!1);return n.runWebGLProgram(h,[a],a.dtype)}var _H={kernelName:Ts,backendName:"webgl",kernelFunc:bH};function vH(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:c}=r,u=[1,1,1],h=E.computePool3DInfo(a.shape,s,i,u,o,c,l),d=new mA(h,"max",!1);return n.runWebGLProgram(d,[a],a.dtype)}var kH={kernelName:vu,backendName:"webgl",kernelFunc:vH},IH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,r=e.dilationHeight,a=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=a-1-e.padInfo.top,o=s-1-e.padInfo.left,l=a*s-1;this.userCode=` +`,IH=en({opSnippet:wH,packedOpSnippet:kH,cpuKernelImpl:UL}),SH={kernelName:Ts,backendName:"webgl",kernelFunc:IH};function NH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;Nl(r,"maxPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l);if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:r},backend:n});let p=new md(u,"max",!1);return n.runWebGLProgram(p,[r],r.dtype)}var TH={kernelName:Es,backendName:"webgl",kernelFunc:NH};function EH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:d}=a,u=[1,1,1],p=C.computePool3DInfo(r.shape,s,i,u,o,d,l),c=new m1(p,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}var CH={kernelName:ku,backendName:"webgl",kernelFunc:EH},RH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,a=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=s-1-e.padInfo.left,l=r*s-1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -3173,8 +3173,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${a}; - wR += ${r}) { + for (int wR = 0; wR < ${r}; + wR += ${a}) { float dyR = float(dyRCorner + wR) / ${t}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { @@ -3204,8 +3204,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}},SH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,a=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=c-1-e.padInfo.left,p=o*l*c-1;this.userCode=` - const ivec3 pads = ivec3(${u}, ${h}, ${d}); + `}},MH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,d=e.effectiveFilterWidth,u=o-1-e.padInfo.front,p=l-1-e.padInfo.top,c=d-1-e.padInfo.left,h=o*l*d-1;this.userCode=` + const ivec3 pads = ivec3(${u}, ${p}, ${c}); void main() { ivec5 coords = getOutputCoords(); @@ -3223,7 +3223,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam float dotProd = 0.0; for (int wD = 0; wD < ${o}; - wD += ${a}) { + wD += ${r}) { float dyD = float(dyDCorner + wD) / ${t}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { @@ -3241,9 +3241,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${c}; + for (int wC = 0; wC < ${d}; wC += ${i}) { - float dyC = float(dyCCorner + wC) / ${r}.0; + float dyC = float(dyCCorner + wC) / ${a}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -3252,14 +3252,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam int idyC = int(dyC); float dyValue = getDy(batch, idyD, idyR, idyC, ch); - int maxPosValue = ${p} - + int maxPosValue = ${h} - int(getMaxPos(batch, idyD, idyR, idyC, ch)); // Get the current value, check it against the value from the // position matrix. int curPosValue = - wD * ${l} * ${c} + - wR * ${c} + wC; + wD * ${l} * ${d} + + wR * ${d} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; @@ -3268,14 +3268,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam } setOutput(dotProd); } - `}};function NH(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=r,h=[1,1,1],d=E.computePool3DInfo(i.shape,o,l,h,c,u),p=new mA(d,"max",!0),m=n.runWebGLProgram(p,[i],i.dtype),f=new SH(d),A=n.runWebGLProgram(f,[a,m],i.dtype);return n.disposeIntermediateTensorInfo(m),A}var TH={kernelName:qh,backendName:"webgl",kernelFunc:NH};function EH(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s,output:i}=t,o=s;Sl([s,i],"maxPoolGrad");let{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=r,d=E.computePool2DInfo(o.shape,l,c,1,u,h),p=!0,m=new mc(d,"max",p),f=n.runWebGLProgram(m,[o],o.dtype),A=new IH(d),y=n.runWebGLProgram(A,[a,f],o.dtype);return n.disposeIntermediateTensorInfo(f),y}var CH={kernelName:Gh,backendName:"webgl",kernelFunc:EH};function RH(e,t,n,r){let a=new mc(n,"max",!1),s=r.runWebGLProgram(a,[e],"float32");a=new mc(n,"max",!0,!0,t);let i=r.runWebGLProgram(a,[e],"float32");return[s,i]}var MH={kernelName:Xh,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{filterSize:a,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;_.assert(r.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);let c=[1,1];_.assert(E.eitherStridesOrDilationsAreOne(s,c),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${c}'`);let u=E.computePool2DInfo(r.shape,a,s,c,i),[h,d]=RH(r,o,u,l);return[h,d]}};function FH(e,t,n,r){let a=_.sizeFromShape(t),s=_.sizeFromShape(e.shape)/a,i=fe({inputs:{x:e},attrs:{shape:[s,a]},backend:r}),o=Si(i,"float32","mean",r),l=fe({inputs:{x:o},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),l}var $H={kernelName:Es,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{keepDims:a,axis:s}=t,i=n,o=r.shape.length,l=_.parseAxisParam(s,r.shape),c=l,u=E.getAxesPermutation(c,o),h=u!=null,d=i.shouldExecuteOnCPU([r]),p=[],m=r;if(h){if(d){let x=i.texData.get(m.dataId).values,v=new Array(o);for(let k=0;k{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;w.assert(a.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${a.shape.length}.`);let d=[1,1];w.assert(C.eitherStridesOrDilationsAreOne(s,d),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${d}'`);let u=C.computePool2DInfo(a.shape,r,s,d,i),[p,c]=zH(a,o,u,l);return[p,c]}};function PH(e,t,n,a){let r=w.sizeFromShape(t),s=w.sizeFromShape(e.shape)/r,i=fe({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Ni(i,"float32","mean",a),l=fe({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}var LH={kernelName:Cs,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{keepDims:r,axis:s}=t,i=n,o=a.shape.length,l=w.parseAxisParam(s,a.shape),d=l,u=C.getAxesPermutation(d,o),p=u!=null,c=i.shouldExecuteOnCPU([a]),h=[],m=a;if(p){if(c){let x=i.texData.get(m.dataId).values,k=new Array(o);for(let I=0;Ic[0]+e[u]+c[1]);let r=e.length,a=lt(r),s=t.map(c=>c[0]).join(","),i=t.map((c,u)=>c[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r),l=n==="reflect"?0:1;if(r===1){this.userCode=` +`,UH=en({opSnippet:VH,packedOpSnippet:jH,cpuKernelImpl:HL}),HH={kernelName:Ms,backendName:"webgl",kernelFunc:UH},GH=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((d,u)=>d[0]+e[u]+d[1]);let a=e.length,r=lt(a),s=t.map(d=>d[0]).join(","),i=t.map((d,u)=>d[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a),l=n==="reflect"?0:1;if(a===1){this.userCode=` int start = ${s}; int end = ${i}; @@ -3289,84 +3289,84 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam setOutput(getX(outC - start)); } `;return}this.userCode=` - ${a} start = ${a}(${s}); - ${a} end = ${a}(${i}); + ${r} start = ${r}(${s}); + ${r} end = ${r}(${i}); void main() { - ${a} outC = getOutputCoords(); - for (int i = 0; i < ${r}; i++) { + ${r} outC = getOutputCoords(); + for (int i = 0; i < ${a}; i++) { if (outC[i] < start[i]) { outC[i] = start[i] * 2 - outC[i] - ${l}; } else if(outC[i] >= end[i]) { outC[i] = (end[i] - 1) * 2 - outC[i] + ${l}; } } - ${a} coords = outC - start; + ${r} coords = outC - start; setOutput(getX(${o})); } - `}},VH=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((p,m)=>p[0]+e[m]+p[1]);let r=e.length,a=lt(r),s=t.map(p=>p[0]).join(","),i=t.map((p,m)=>p[0]+e[m]).join(","),o=hn("rc",r),l=hn("source",r),c=`${o[r-1]} < ${this.outputShape[r-1]}`,u=r===1?"source":`vec2(${l.slice(-2).join()})`,h=n==="reflect"?0:1,d="";if(r===1){let p=` - ${a} source = rc; + `}},qH=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let a=e.length,r=lt(a),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=pn("rc",a),l=pn("source",a),d=`${o[a-1]} < ${this.outputShape[a-1]}`,u=a===1?"source":`vec2(${l.slice(-2).join()})`,p=n==="reflect"?0:1,c="";if(a===1){let h=` + ${r} source = rc; if (source < start) { - source = start * 2 - source - ${h}; + source = start * 2 - source - ${p}; } else if (source >= end) { - source = (end - 1) * 2 - source + ${h}; + source = (end - 1) * 2 - source + ${p}; } source -= start; - `;d=` - ${a} rc = outputLoc; - ${p} + `;c=` + ${r} rc = outputLoc; + ${h} result[0] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[1] = getChannel(getX(${l.join()}), ${u}); } - `}else{let p=` - ${a} source = rc; - ${a} lt = ${a}(lessThan(source, start)); - ${a} gte = ${a}(greaterThanEqual(source, end)); - ${a} orig = 1 - (lt + gte); + `}else{let h=` + ${r} source = rc; + ${r} lt = ${r}(lessThan(source, start)); + ${r} gte = ${r}(greaterThanEqual(source, end)); + ${r} orig = 1 - (lt + gte); source = orig * source + - lt * (start * 2 - source - ${h}) + - gte * ((end - 1) * 2 - source + ${h}); + lt * (start * 2 - source - ${p}) + + gte * ((end - 1) * 2 - source + ${p}); source -= start; - `;d=` - ${a} rc = outputLoc; - ${p} + `;c=` + ${r} rc = outputLoc; + ${h} result[0] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[1] = getChannel(getX(${l.join()}), ${u}); } rc = outputLoc; - ${o[r-2]} += 1; - if(${o[r-2]} < ${this.outputShape[r-2]}) { - ${p} + ${o[a-2]} += 1; + if(${o[a-2]} < ${this.outputShape[a-2]}) { + ${h} result[2] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[3] = getChannel(getX(${l.join()}), ${u}); } } `}this.userCode=` - const ${a} start = ${a}(${s}); - const ${a} end = ${a}(${i}); + const ${r} start = ${r}(${s}); + const ${r} end = ${r}(${i}); void main() { - ${a} outputLoc = getOutputCoords(); + ${r} outputLoc = getOutputCoords(); vec4 result = vec4(0.); - ${d} + ${c} setOutput(result); } - `}},jH=({inputs:e,backend:t,attrs:n})=>{let{x:r}=e,{paddings:a,mode:s}=n,i=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new VH(r.shape,a,s):new BH(r.shape,a,s);return t.runWebGLProgram(i,[r],r.dtype)},UH={kernelName:Ms,backendName:"webgl",kernelFunc:jH},HH=`if (b == 0.0) return NAN; - return mod(a, b);`,GH=` + `}},XH=({inputs:e,backend:t,attrs:n})=>{let{x:a}=e,{paddings:r,mode:s}=n,i=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new qH(a.shape,r,s):new GH(a.shape,r,s);return t.runWebGLProgram(i,[a],a.dtype)},KH={kernelName:Fs,backendName:"webgl",kernelFunc:XH},ZH=`if (b == 0.0) return NAN; + return mod(a, b);`,YH=` vec4 result = mod(a, b); vec4 isNaN = vec4(equal(b, vec4(0.0))); - `+mp+` + `+mh+` return result; -`,qH=en({opSnippet:HH,packedOpSnippet:GH}),XH={kernelName:Ro,backendName:"webgl",kernelFunc:qH},KH=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` +`,JH=en({opSnippet:ZH,packedOpSnippet:YH}),QH={kernelName:Mo,backendName:"webgl",kernelFunc:JH},eG=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` uniform float seed; void main() { @@ -3388,11 +3388,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,$B=qe({opSnippet:FB}),DB={kernelNam // If no other event happened, last event happened. setOutput(float(${t-1})); } - `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},ZH=` + `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},tG=` if (a == b) { return 1.0; }; -return a / b;`,YH=` +return a / b;`,nG=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -3410,14 +3410,14 @@ return a / b;`,YH=` } return result; -`,e7=en({opSnippet:ZH,packedOpSnippet:YH,checkOutOfBounds:!0}),JH={kernelName:ys,backendName:"webgl",kernelFunc:e7},t7="return a - b;",n7=en({opSnippet:t7,packedOpSnippet:t7,supportsComplex:!0,cpuKernelImpl:KL}),QH={kernelName:Zs,backendName:"webgl",kernelFunc:n7};function r7(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{dim:s}=r,i=_.parseAxisParam([s],a.shape),o=Q3({inputs:{x:a},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=E.expandShapeToKeepDim(o.shape,i),c=fe({inputs:{x:o},backend:n,attrs:{shape:l}}),u=n7({inputs:{a,b:c},backend:n}),h=X3({inputs:{x:u},backend:n}),d=gp({inputs:{x:h},backend:n,attrs:{axis:i,keepDims:!1}}),p=fe({inputs:{x:d},backend:n,attrs:{shape:l}}),m=e7({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}var eG={kernelName:Xs,backendName:"webgl",kernelFunc:r7};function tG(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{numSamples:s,seed:i,normalized:o}=r,l=o?a:r7({inputs:{logits:a},backend:n,attrs:{dim:a.shape.length-1}}),c=l.shape[0],u=l.shape[1],h=new KH(c,u,s),d=h.getCustomSetupFunc(i),p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}var nG={kernelName:Kh,backendName:"webgl",kernelFunc:tG},a7="return -x;";function rG(e){let{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])){let s=n.texData.get(r.dataId),[i,o]=VL(s.values,r.shape,r.dtype);return n.makeTensorInfo(o,r.dtype,i)}let a;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?a=new Ml(r.shape,a7):a=new Wa(r.shape,a7),n.runWebGLProgram(a,[r],r.dtype)}var aG={kernelName:Mo,backendName:"webgl",kernelFunc:rG},sG=Wr.nonMaxSuppressionV3Impl;function iG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=r,c=n.readSync(a.dataId),u=n.readSync(s.dataId),{selectedIndices:h}=sG(c,u,i,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}var oG={kernelName:$o,backendName:"webgl",kernelFunc:iG},lG=Wr.nonMaxSuppressionV4Impl;function uG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:c}=r,u=n.readSync(a.dataId),h=n.readSync(s.dataId),{selectedIndices:d,validOutputs:p}=lG(u,h,i,o,l,c);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}var cG={kernelName:Do,backendName:"webgl",kernelFunc:uG},hG=Wr.nonMaxSuppressionV5Impl;function dG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=r,u=n.readSync(a.dataId),h=n.readSync(s.dataId),d=i,p=o,m=l,f=c,{selectedIndices:A,selectedScores:y}=hG(u,h,d,p,m,f);return[n.makeTensorInfo([A.length],"int32",new Int32Array(A)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var pG={kernelName:Oo,backendName:"webgl",kernelFunc:dG},fG=class{constructor(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` +`,t6=en({opSnippet:tG,packedOpSnippet:nG,checkOutOfBounds:!0}),aG={kernelName:ys,backendName:"webgl",kernelFunc:t6},n6="return a - b;",a6=en({opSnippet:n6,packedOpSnippet:n6,supportsComplex:!0,cpuKernelImpl:eW}),rG={kernelName:Zs,backendName:"webgl",kernelFunc:a6};function r6(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=w.parseAxisParam([s],r.shape),o=e6({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=C.expandShapeToKeepDim(o.shape,i),d=fe({inputs:{x:o},backend:n,attrs:{shape:l}}),u=a6({inputs:{a:r,b:d},backend:n}),p=Kv({inputs:{x:u},backend:n}),c=gh({inputs:{x:p},backend:n,attrs:{axis:i,keepDims:!1}}),h=fe({inputs:{x:c},backend:n,attrs:{shape:l}}),m=t6({inputs:{a:p,b:h},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}var sG={kernelName:Xs,backendName:"webgl",kernelFunc:r6};function iG(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a,l=o?r:r6({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),d=l.shape[0],u=l.shape[1],p=new eG(d,u,s),c=p.getCustomSetupFunc(i),h=n.runWebGLProgram(p,[l],"int32",c);return o||n.disposeIntermediateTensorInfo(l),h}var oG={kernelName:Kp,backendName:"webgl",kernelFunc:iG},s6="return -x;";function lG(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])){let s=n.texData.get(a.dataId),[i,o]=qL(s.values,a.shape,a.dtype);return n.makeTensorInfo(o,a.dtype,i)}let r;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Fl(a.shape,s6):r=new Pr(a.shape,s6),n.runWebGLProgram(r,[a],a.dtype)}var uG={kernelName:Fo,backendName:"webgl",kernelFunc:lG},dG=Wa.nonMaxSuppressionV3Impl;function pG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=a,d=n.readSync(r.dataId),u=n.readSync(s.dataId),{selectedIndices:p}=dG(d,u,i,o,l);return n.makeTensorInfo([p.length],"int32",new Int32Array(p))}var cG={kernelName:Do,backendName:"webgl",kernelFunc:pG},hG=Wa.nonMaxSuppressionV4Impl;function fG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:d}=a,u=n.readSync(r.dataId),p=n.readSync(s.dataId),{selectedIndices:c,validOutputs:h}=hG(u,p,i,o,l,d);return[n.makeTensorInfo([c.length],"int32",new Int32Array(c)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}var mG={kernelName:Oo,backendName:"webgl",kernelFunc:fG},AG=Wa.nonMaxSuppressionV5Impl;function yG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:d}=a,u=n.readSync(r.dataId),p=n.readSync(s.dataId),c=i,h=o,m=l,f=d,{selectedIndices:A,selectedScores:y}=AG(u,p,c,h,m,f);return[n.makeTensorInfo([A.length],"int32",new Int32Array(A)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var gG={kernelName:zo,backendName:"webgl",kernelFunc:yG},xG=class{constructor(e,t,n,a){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); - setOutput(mix(float(${r}), float(${n}), + setOutput(mix(float(${a}), float(${n}), float(index == coords.y))); } - `}},mG=e=>{let{inputs:t,backend:n,attrs:r}=e,{indices:a}=t,{depth:s,onValue:i,offValue:o}=r,l=_.sizeFromShape(a.shape),c=new fG(l,s,i,o),u=fe({inputs:{x:a},backend:n,attrs:{shape:[l]}}),h=n.runWebGLProgram(c,[u],a.dtype);n.disposeIntermediateTensorInfo(u);let d=[...a.shape,s],p=fe({inputs:{x:h},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(h),p},AG={kernelName:$s,backendName:"webgl",kernelFunc:mG};function vp(e){let{inputs:t,backend:n}=e,{x:r}=t;if(r.dtype==="complex64"){let a=yc({inputs:{input:r},backend:n}),s=vp({inputs:{x:a},backend:n}),i=_p({inputs:{input:r},backend:n}),o=vp({inputs:{x:i},backend:n}),l=Ba({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return xA({attrs:{shape:r.shape,dtype:r.dtype,value:r.dtype==="string"?"":0},backend:n})}var yG={kernelName:Qo,backendName:"webgl",kernelFunc:vp};function s7(e){let{inputs:t,backend:n}=e,{x:r}=t;if(r.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(r.dtype==="complex64"){let a=yc({inputs:{input:r},backend:n}),s=s7({inputs:{x:a},backend:n}),i=_p({inputs:{input:r},backend:n}),o=vp({inputs:{x:i},backend:n}),l=Ba({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return xA({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:n})}var gG={kernelName:zo,backendName:"webgl",kernelFunc:s7};function xG(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r;if(t.length===1)return gA({inputs:{input:t[0]},backend:n,attrs:{dim:a}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=gA({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=P3({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),c}var wG={kernelName:Po,backendName:"webgl",kernelFunc:xG},bG=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((l,c)=>l[0]+e[c]+l[1]);let r=e.length,a=lt(r),s=t.map(l=>l[0]).join(","),i=t.map((l,c)=>l[0]+e[c]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);if(r===1){this.userCode=` + `}},bG=e=>{let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=w.sizeFromShape(r.shape),d=new xG(l,s,i,o),u=fe({inputs:{x:r},backend:n,attrs:{shape:[l]}}),p=n.runWebGLProgram(d,[u],r.dtype);n.disposeIntermediateTensorInfo(u);let c=[...r.shape,s],h=fe({inputs:{x:p},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(p),h},vG={kernelName:Ds,backendName:"webgl",kernelFunc:bG};function kh(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="complex64"){let r=yd({inputs:{input:a},backend:n}),s=kh({inputs:{x:r},backend:n}),i=wh({inputs:{input:a},backend:n}),o=kh({inputs:{x:i},backend:n}),l=Lr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return x1({attrs:{shape:a.shape,dtype:a.dtype,value:a.dtype==="string"?"":0},backend:n})}var wG={kernelName:Qo,backendName:"webgl",kernelFunc:kh};function i6(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(a.dtype==="complex64"){let r=yd({inputs:{input:a},backend:n}),s=i6({inputs:{x:r},backend:n}),i=wh({inputs:{input:a},backend:n}),o=kh({inputs:{x:i},backend:n}),l=Lr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return x1({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:n})}var kG={kernelName:_o,backendName:"webgl",kernelFunc:i6};function IG(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return g1({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=g1({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=Lv({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),d}var SG={kernelName:Po,backendName:"webgl",kernelFunc:IG},NG=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((l,d)=>l[0]+e[d]+l[1]);let a=e.length,r=lt(a),s=t.map(l=>l[0]).join(","),i=t.map((l,d)=>l[0]+e[d]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);if(a===1){this.userCode=` int start = ${s}; int end = ${i}; uniform float value; @@ -3431,45 +3431,45 @@ return a / b;`,YH=` } } `;return}this.userCode=` - ${a} start = ${a}(${s}); - ${a} end = ${a}(${i}); + ${r} start = ${r}(${s}); + ${r} end = ${r}(${i}); uniform float value; void main() { - ${a} outC = getOutputCoords(); + ${r} outC = getOutputCoords(); if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { setOutput(value); } else { - ${a} coords = outC - start; + ${r} coords = outC - start; setOutput(getX(${o})); } } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},_G=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let r=e.length,a=lt(r),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=hn("rc",r),l=hn("source",r),c=`${o[r-1]} < ${this.outputShape[r-1]}`,u=r===1?"source":`vec2(${l.slice(-2).join()})`,h=[`${a} rc = outputLoc;`,`${o[r-1]} += 1; - if(${c}) { - `,r===1?"":`} + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},TG=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let a=e.length,r=lt(a),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=pn("rc",a),l=pn("source",a),d=`${o[a-1]} < ${this.outputShape[a-1]}`,u=a===1?"source":`vec2(${l.slice(-2).join()})`,p=[`${r} rc = outputLoc;`,`${o[a-1]} += 1; + if(${d}) { + `,a===1?"":`} rc = outputLoc; - ${o[r-2]} += 1; - if(${o[r-2]} < ${this.outputShape[r-2]}) {`,r===1?"":` ${o[r-1]} += 1; - if(${c}) {`],d=r===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",p="";for(let m=0,f=r===1?2:4;m= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=a===1?2:4;m{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},i7=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{paddings:s,constantValue:i}=r,o=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new _G(a.shape,s,i):new bG(a.shape,s,i),l=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[a],a.dtype,l)},vG={kernelName:Ds,backendName:"webgl",kernelFunc:i7},kG=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},o6=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a,o=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new TG(r.shape,s,i):new NG(r.shape,s,i),l=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[r],r.dtype,l)},EG={kernelName:Os,backendName:"webgl",kernelFunc:o6},CG=` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -3478,7 +3478,7 @@ return a / b;`,YH=` } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); -`,IG=` +`,RG=` // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -3492,11 +3492,11 @@ return a / b;`,YH=` result.a = isExpZero.a ? 1.0 : result.a; vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b)); - `+mp+` + `+mh+` return result; -`,SG=en({opSnippet:kG,packedOpSnippet:IG}),NG={kernelName:Os,backendName:"webgl",kernelFunc:SG};function TG(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=[],c=_.parseAxisParam(s,a.shape),u=c,h=E.getAxesPermutation(u,o),d=a;h!=null&&(d=dn({inputs:{x:a},backend:n,attrs:{perm:h}}),u=E.getInnerMostAxes(u.length,o),l.push(d)),E.assertAxesAreInnerMostDims("prod",u,o);let p;if(n.shouldExecuteOnCPU([d])){let m=n.texData.get(d.dataId).values,{outVals:f,outShape:A,outDtype:y}=jL(d.shape,d.dtype,m,u);p=n.makeTensorInfo(A,y,f)}else{let[m,f]=E.computeOutAndReduceShapes(d.shape,u),A=_.sizeFromShape(f),y=fe({inputs:{x:d},backend:n,attrs:{shape:[-1,A]}}),g=ld(a.dtype),x=Si(y,g,"prod",n);p=fe({inputs:{x},backend:n,attrs:{shape:m}}),l.push(y),l.push(x)}if(i){l.push(p);let m=E.expandShapeToKeepDim(p.shape,c);p=fe({inputs:{x:p},backend:n,attrs:{shape:m}})}return l.forEach(m=>n.disposeIntermediateTensorInfo(m)),p}var EG={kernelName:Lo,backendName:"webgl",kernelFunc:TG},o7=e=>{let{backend:t,attrs:n}=e,{start:r,stop:a,step:s,dtype:i}=n,o=UL(r,a,s,i);return t.makeTensorInfo([o.length],i,o)},CG={kernelName:ku,backendName:"webgl",kernelFunc:o7},RG="return 1.0 / x;",MG=qe({opSnippet:RG}),FG={kernelName:Wo,backendName:"webgl",kernelFunc:MG},$G=xr+` +`,MG=en({opSnippet:CG,packedOpSnippet:RG}),FG={kernelName:zs,backendName:"webgl",kernelFunc:MG};function $G(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=[],d=w.parseAxisParam(s,r.shape),u=d,p=C.getAxesPermutation(u,o),c=r;p!=null&&(c=cn({inputs:{x:r},backend:n,attrs:{perm:p}}),u=C.getInnerMostAxes(u.length,o),l.push(c)),C.assertAxesAreInnerMostDims("prod",u,o);let h;if(n.shouldExecuteOnCPU([c])){let m=n.texData.get(c.dataId).values,{outVals:f,outShape:A,outDtype:y}=XL(c.shape,c.dtype,m,u);h=n.makeTensorInfo(A,y,f)}else{let[m,f]=C.computeOutAndReduceShapes(c.shape,u),A=w.sizeFromShape(f),y=fe({inputs:{x:c},backend:n,attrs:{shape:[-1,A]}}),g=lc(r.dtype),x=Ni(y,g,"prod",n);h=fe({inputs:{x},backend:n,attrs:{shape:m}}),l.push(y),l.push(x)}if(i){l.push(h);let m=C.expandShapeToKeepDim(h.shape,d);h=fe({inputs:{x:h},backend:n,attrs:{shape:m}})}return l.forEach(m=>n.disposeIntermediateTensorInfo(m)),h}var DG={kernelName:Lo,backendName:"webgl",kernelFunc:$G},l6=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=KL(a,r,s,i);return t.makeTensorInfo([o.length],i,o)},OG={kernelName:Iu,backendName:"webgl",kernelFunc:l6},zG="return 1.0 / x;",_G=qe({opSnippet:zG}),PG={kernelName:Wo,backendName:"webgl",kernelFunc:_G},LG=xa+` return (x < 0.0) ? 0.0 : x; -`,DG=` +`,WG=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3506,9 +3506,9 @@ return a / b;`,YH=` result.a = isNaN.a ? x.a : result.a; return result; -`,OG=qe({opSnippet:$G,packedOpSnippet:DG}),zG={kernelName:Ps,backendName:"webgl",kernelFunc:OG},PG=xr+` +`,BG=qe({opSnippet:LG,packedOpSnippet:WG}),VG={kernelName:Ps,backendName:"webgl",kernelFunc:BG},jG=xa+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,LG=` +`,UG=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3518,10 +3518,10 @@ return a / b;`,YH=` result.a = isNaN.a ? x.a : result.a; return result; -`,WG=qe({opSnippet:PG,packedOpSnippet:LG}),BG={kernelName:Ws,backendName:"webgl",kernelFunc:WG},VG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h;a?h="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":h="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` +`,HG=qe({opSnippet:jG,packedOpSnippet:UG}),GG={kernelName:Ws,backendName:"webgl",kernelFunc:HG},qG=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":p="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/u[0]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3531,7 +3531,7 @@ return a / b;`,YH=` ivec2 yRC = coords.yz; // Fractional source index. - vec2 sourceFracIndexRC = ${h}; + vec2 sourceFracIndexRC = ${p}; // Compute the four integer indices. ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); @@ -3551,11 +3551,11 @@ return a / b;`,YH=` setOutput(newValue); } - `}},jG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h;a?h="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":h="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},XG=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":p="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0]/u[0]}, - ${c[1]/u[1]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}, + ${d[1]/u[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -3571,7 +3571,7 @@ return a / b;`,YH=` ivec3 yRC = coords.yzz + ivec3(0, 0, 1); // Fractional source index. - vec3 sourceFracIndexRC = ${h}; + vec3 sourceFracIndexRC = ${p}; // Compute the four integer indices. ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); @@ -3628,7 +3628,7 @@ return a / b;`,YH=` setOutput(newValue); } - `}};function UG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,u=J().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new jG(a.shape,l,c,s,i):new VG(a.shape,l,c,s,i);return n.runWebGLProgram(u,[a],"float32")}var HG={kernelName:Ls,backendName:"webgl",kernelFunc:UG},GG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,r,a]=t,[,s,i]=e,o=[n&&s>1?r-1:r,n&&i>1?a-1:a],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,p=Math.ceil(h)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function KG(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,u=J().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new XG(r.shape,l,d,s,i):new qG(r.shape,l,d,s,i);return n.runWebGLProgram(u,[r],"float32")}var ZG={kernelName:Ls,backendName:"webgl",kernelFunc:KG},YG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],d=o[0]/l[0],u=o[1]/l[1],p=1/d,c=1/u,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3638,13 +3638,13 @@ return a / b;`,YH=` float accumulator = 0.0; - const float heightScale = float(${c}); + const float heightScale = float(${d}); const float widthScale = float(${u}); - const float invHeightScale = float(${h}); - const float invWidthScale = float(${d}); + const float invHeightScale = float(${p}); + const float invWidthScale = float(${c}); - const int winHeight = int(${p}); + const int winHeight = int(${h}); const int winWidth = int(${m}); // Compute bounds for where in dy we will look @@ -3673,13 +3673,13 @@ return a / b;`,YH=` float dxR = float(dyR) * heightScale; int topDxRIndex = int(floor(dxR)); - int bottomDxRIndex = int(min(ceil(dxR), ${r-1}.0)); + int bottomDxRIndex = int(min(ceil(dxR), ${a-1}.0)); float dxRLerp = dxR - float(topDxRIndex); float inverseDxRLerp = 1.0 - dxRLerp; float dxC = float(dyC) * widthScale; int leftDxCIndex = int(floor(dxC)); - int rightDxCIndex = int(min(ceil(dxC), ${a-1}.0)); + int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0)); float dxCLerp = dxC - float(leftDxCIndex); float inverseDxCLerp = 1.0 - dxCLerp; @@ -3709,10 +3709,10 @@ return a / b;`,YH=` setOutput(accumulator); } - `}};function qG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a,dy:s}=t,{alignCorners:i}=r,o=new GG(s.shape,a.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var XG={kernelName:Jh,backendName:"webgl",kernelFunc:qG},KG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h=r?"0.5":"0.0",d;a?d="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":d="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};function JG(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new YG(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var QG={kernelName:Jp,backendName:"webgl",kernelFunc:JG},eq=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/u[0]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3722,16 +3722,16 @@ return a / b;`,YH=` ivec2 yRC = coords.yz; // Fractional source index. - vec2 sourceFracIndexRC = ${d}; + vec2 sourceFracIndexRC = ${c}; // Compute the coordinators of nearest neighbor point. ivec2 sourceNearestRC = ivec2( - min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h}))); + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${p}))); float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); setOutput(newValue); } - `}};function ZG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,u=new KG(a.shape,l,c,s,i);return n.runWebGLProgram(u,[a],a.dtype)}var YG={kernelName:Iu,backendName:"webgl",kernelFunc:ZG},JG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,r,a]=t,[,s,i]=e,o=[n&&s>1?r-1:r,n&&i>1?a-1:a],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,p=Math.ceil(h)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function tq(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,u=new eq(r.shape,l,d,s,i);return n.runWebGLProgram(u,[r],r.dtype)}var nq={kernelName:Su,backendName:"webgl",kernelFunc:tq},aq=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],d=o[0]/l[0],u=o[1]/l[1],p=1/d,c=1/u,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3741,13 +3741,13 @@ return a / b;`,YH=` float accumulator = 0.0; - const float heightScale = float(${c}); + const float heightScale = float(${d}); const float widthScale = float(${u}); - const float invHeightScale = float(${h}); - const float invWidthScale = float(${d}); + const float invHeightScale = float(${p}); + const float invWidthScale = float(${c}); - const int winHeight = int(${p}); + const int winHeight = int(${h}); const int winWidth = int(${m}); // Compute bounds for where in dy we will look @@ -3783,12 +3783,12 @@ return a / b;`,YH=` (float(dyC) / float(${l[1]})); int sourceNearestRow = int(min( - float(int(${r}) - 1), + float(int(${a}) - 1), ${n} ? float(round(sourceFracRow)) : float(floor(sourceFracRow)))); int sourceNearestCol = int(min( - float(int(${a}) - 1), + float(int(${r}) - 1), ${n} ? float(round(sourceFracCol)) : float(floor(sourceFracCol)))); @@ -3801,23 +3801,23 @@ return a / b;`,YH=` setOutput(accumulator); } - `}};function QG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a,dy:s}=t,{alignCorners:i}=r,o=new JG(s.shape,a.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var eq={kernelName:Yh,backendName:"webgl",kernelFunc:QG},tq=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` + `}};function rq(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new aq(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var sq={kernelName:Yp,backendName:"webgl",kernelFunc:rq},iq=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` void main() { int coord = getOutputCoords(); setOutput(getX(${e[0]} - coord - 1)); } - `;return}let r=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,a=e.map((i,o)=>r(o)).join(","),s=lt(n);this.userCode=` + `;return}let a=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,r=e.map((i,o)=>a(o)).join(","),s=lt(n);this.userCode=` void main() { ${s} coords = getOutputCoords(); - setOutput(getX(${a})); + setOutput(getX(${r})); } - `}},nq=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let r=hn("rc",n),a=`${r[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${r[n-2]} + 1 < ${this.outputShape[n-2]}`,i=lt(n);n===1?this.userCode=` + `}},oq=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let a=pn("rc",n),r=`${a[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${a[n-2]} + 1 < ${this.outputShape[n-2]}`,i=lt(n);n===1?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); result.r = getChannel(getX(${e[0]} - rc - 1), ${e[0]} - rc - 1); - if(${a}){ + if(${r}){ result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), ${e[0]} - (rc + 1) - 1); } @@ -3827,19 +3827,19 @@ return a / b;`,YH=` void main() { ${i} rc = getOutputCoords(); vec4 result = vec4(0.); - result.r = ${o(r.slice())}; - if(${a}){ - result.g = ${l(r.slice())}; + result.r = ${o(a.slice())}; + if(${r}){ + result.g = ${l(a.slice())}; } if(${s}) { - result.b = ${c(r.slice())}; - if(${a}) { - result.a = ${u(r.slice())}; + result.b = ${d(a.slice())}; + if(${r}) { + result.a = ${u(a.slice())}; } } setOutput(result); } - `;function o(p){return h(p)}function l(p){return p[n-1]="("+p[n-1]+" + 1)",h(p)}function c(p){return p[n-2]="("+p[n-2]+" + 1)",h(p)}function u(p){return p[n-1]="("+p[n-1]+" + 1)",p[n-2]="("+p[n-2]+" + 1)",h(p)}function h(p){let m=e.map((y,g)=>d(g,p)),f=m.join(","),A=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${A}))`}function d(p,m){return t.indexOf(p)!==-1&&e[p]!==1?`${e[p]} - ${m[p]} - 1`:`${m[p]}`}}};function rq(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r,i=a.shape.length,o=_.parseAxisParam(s,a.shape);if(i===0)return Pn({inputs:{x:a},backend:n});let l=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new nq(a.shape,o):new tq(a.shape,o);return n.runWebGLProgram(l,[a],a.dtype)}var aq={kernelName:Bs,backendName:"webgl",kernelFunc:rq},sq=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],r=e[2];this.outputShape=e;let a="";typeof t=="number"?a=`float outputValue = ${t.toFixed(2)};`:a=` + `;function o(h){return p(h)}function l(h){return h[n-1]="("+h[n-1]+" + 1)",p(h)}function d(h){return h[n-2]="("+h[n-2]+" + 1)",p(h)}function u(h){return h[n-1]="("+h[n-1]+" + 1)",h[n-2]="("+h[n-2]+" + 1)",p(h)}function p(h){let m=e.map((y,g)=>c(g,h)),f=m.join(","),A=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${A}))`}function c(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function lq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=r.shape.length,o=w.parseAxisParam(s,r.shape);if(i===0)return Pn({inputs:{x:r},backend:n});let l=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new oq(r.shape,o):new iq(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}var uq={kernelName:Bs,backendName:"webgl",kernelFunc:lq},dq=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],a=e[2];this.outputShape=e;let r="";typeof t=="number"?r=`float outputValue = ${t.toFixed(2)};`:r=` vec3 fill = vec3(${t.join(",")}); float outputValue = fill[coords[3]];`,this.userCode=` uniform vec4 params; @@ -3853,13 +3853,13 @@ return a / b;`,YH=` (float(y) - params[1]) * params[3]; int coordX = int(round(coordXFloat + params[0])); int coordY = int(round(coordYFloat + params[1])); - ${a} - if(coordX >= 0 && coordX < ${r} && coordY >= 0 && coordY < ${n}) { + ${r} + if(coordX >= 0 && coordX < ${a} && coordY >= 0 && coordY < ${n}) { outputValue = getImage(coords[0], coordY, coordX, coords[3]); } setOutput(outputValue); } - `}getCustomSetupFunc(e,t,n,r){return(a,s)=>{this.paramsLoc==null&&(this.paramsLoc=a.getUniformLocationNoThrow(s,"params")),a.gl.uniform4f(this.paramsLoc,e,t,n,r)}}},iq={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:r}=e,{radians:a,fillValue:s,center:i}=t,o=n,l=new sq(r.shape,s),[c,u]=E.getImageCenter(i,r.shape[1],r.shape[2]),h=l.getCustomSetupFunc(c,u,Math.sin(a),Math.cos(a));return o.runWebGLProgram(l,[r],r.dtype,h)}},oq=` + `}getCustomSetupFunc(e,t,n,a){return(r,s)=>{this.paramsLoc==null&&(this.paramsLoc=r.getUniformLocationNoThrow(s,"params")),r.gl.uniform4f(this.paramsLoc,e,t,n,a)}}},pq={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=new dq(a.shape,s),[d,u]=C.getImageCenter(i,a.shape[1],a.shape[2]),p=l.getCustomSetupFunc(d,u,Math.sin(r),Math.cos(r));return o.runWebGLProgram(l,[a],a.dtype,p)}},cq=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -3874,8 +3874,8 @@ return a / b;`,YH=` return base + 1.0; } } -`,lq=qe({opSnippet:oq}),uq={kernelName:Vs,backendName:"webgl",kernelFunc:lq},cq="return inversesqrt(x);",hq=qe({opSnippet:cq,cpuKernelImpl:HL}),dq={kernelName:js,backendName:"webgl",kernelFunc:hq},l7=class{constructor(e,t,n,r,a,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=lt(a.length),l=lt(s.length),c="";n===1?c="i":n===2&&(c="i, j");let u=`getIndices(${c})`,h="";r===1?h="i":r===2&&(h="i, coords[1]");let d=`getUpdates(${h})`,p=t>1?"strides[j]":"strides";this.userCode=` - ${o} strides = ${o}(${a}); +`,hq=qe({opSnippet:cq}),fq={kernelName:Vs,backendName:"webgl",kernelFunc:hq},mq="return inversesqrt(x);",Aq=qe({opSnippet:mq,cpuKernelImpl:ZL}),yq={kernelName:js,backendName:"webgl",kernelFunc:Aq},u6=class{constructor(e,t,n,a,r,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=lt(r.length),l=lt(s.length),d="";n===1?d="i":n===2&&(d="i, j");let u=`getIndices(${d})`,p="";a===1?p="i":a===2&&(p="i, coords[1]");let c=`getUpdates(${p})`,h=t>1?"strides[j]":"strides";this.userCode=` + ${o} strides = ${o}(${r}); void main() { ${l} coords = getOutputCoords(); @@ -3885,40 +3885,40 @@ return a / b;`,YH=` int flattenedIndex = 0; for (int j = 0; j < ${t}; j++) { int index = round(${u}); - flattenedIndex += index * ${p}; + flattenedIndex += index * ${h}; } if (flattenedIndex == coords[0]) { - sum += ${d}; + sum += ${c}; found = true; } } setOutput(mix(getDefaultValue(), sum, float(found))); } - `}};function pq(e){let{inputs:t,backend:n,attrs:r}=e,{indices:a,updates:s}=t,{shape:i}=r,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=E.calculateShapes(s,a,i),d=[h/c,c];if(h===0)return n.makeTensorInfo(i,a.dtype);let p=fe({inputs:{x:a},backend:n,attrs:{shape:[l,o]}}),m=fe({inputs:{x:s},backend:n,attrs:{shape:[l,c]}}),f=n.makeTensorInfo([],"float32",new Float32Array([0])),A=new l7(l,o,p.shape.length,m.shape.length,u,d),y=n.runWebGLProgram(A,[m,p,f],m.dtype),g=fe({inputs:{x:y},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(f),g}var fq={kernelName:Vo,backendName:"webgl",kernelFunc:pq},mq=class{constructor(e,t,n){this.variableNames=["c","a","b"],this.outputShape=t;let r,a;if(n>4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)a="resRC",r="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let c=0;c4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)r="resRC",a="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let d=0;d= 1.0) { - setOutput(getA(${a})); + setOutput(getA(${r})); } else { - setOutput(getB(${a})); + setOutput(getB(${r})); } } - `}};function Aq(e){let{inputs:t,backend:n}=e,{condition:r,t:a,e:s}=t,i=new mq(r.shape.length,a.shape,a.shape.length);return n.runWebGLProgram(i,[r,a,s],ir(a.dtype,s.dtype))}var yq={kernelName:jo,backendName:"webgl",kernelFunc:Aq},gq=` + `}};function vq(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=new bq(a.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(i,[a,r,s],ia(r.dtype,s.dtype))}var wq={kernelName:jo,backendName:"webgl",kernelFunc:vq},kq=` // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. // see: https://arxiv.org/abs/1706.02515 - float scaleAlpha = ${E.SELU_SCALEALPHA}; - float scale = ${E.SELU_SCALE}; + float scaleAlpha = ${C.SELU_SCALEALPHA}; + float scale = ${C.SELU_SCALE}; return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); -`,xq=qe({opSnippet:gq}),wq={kernelName:Uo,backendName:"webgl",kernelFunc:xq},bq="return 1.0 / (1.0 + exp(-1.0 * x));",_q=qe({opSnippet:bq}),vq={kernelName:Hs,backendName:"webgl",kernelFunc:_q},kq=` +`,Iq=qe({opSnippet:kq}),Sq={kernelName:Uo,backendName:"webgl",kernelFunc:Iq},Nq="return 1.0 / (1.0 + exp(-1.0 * x));",Tq=qe({opSnippet:Nq}),Eq={kernelName:Hs,backendName:"webgl",kernelFunc:Tq},Cq=` if (isnan(x)) { return 0.0; } return sign(x); -`,Iq=qe({opSnippet:kq}),Sq={kernelName:qo,backendName:"webgl",kernelFunc:Iq},Nq=v3+` +`,Rq=qe({opSnippet:Cq}),Mq={kernelName:qo,backendName:"webgl",kernelFunc:Rq},Fq=Iv+` return sin(x); -`,Tq=qe({opSnippet:Nq}),Eq={kernelName:Us,backendName:"webgl",kernelFunc:Tq},Cq=` +`,$q=qe({opSnippet:Fq}),Dq={kernelName:Us,backendName:"webgl",kernelFunc:$q},Oq=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; -`,Rq=qe({opSnippet:Cq}),Mq={kernelName:Go,backendName:"webgl",kernelFunc:Rq},Fq=` +`,zq=qe({opSnippet:Oq}),_q={kernelName:Go,backendName:"webgl",kernelFunc:zq},Pq=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -3938,25 +3938,25 @@ return a / b;`,YH=` result = log(exp_x + 1.0); } return result; -`,$q=qe({opSnippet:Fq}),Dq={kernelName:Xo,backendName:"webgl",kernelFunc:$q},Oq=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,paddings:i}=r;_.assert(a.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,g)=>y*g),l=[[0,0]];l.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),A},zq={kernelName:Su,backendName:"webgl",kernelFunc:Oq};function Pq(e){let{inputs:t,backend:n}=e,{inputIndices:r,inputShape:a,newShape:s}=t;if(r.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${r.shape}`);if(a.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${a.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(a.dataId)),o=n.readSync(r.dataId),l=Array.from(n.readSync(s.dataId)),[c,u,h]=qL(o,r.shape,r.dtype,i,l);return[n.makeTensorInfo(u,r.dtype,c),n.makeTensorInfo([h.length],s.dtype,new Int32Array(h))]}var Lq={kernelName:Qh,backendName:"webgl",kernelFunc:Pq};function Wq(e){let{inputs:t,backend:n,attrs:r}=e,{sparseIndices:a,sparseValues:s,defaultValue:i}=t,{outputShape:o}=r,{sliceRank:l,numUpdates:c,strides:u,outputSize:h}=E.calculateShapes(s,a,o),d=!1,p=new l7(c,l,a.shape.length,s.shape.length,u,[h,1],d),m=n.runWebGLProgram(p,[s,a,i],s.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var Bq={kernelName:ed,backendName:"webgl",kernelFunc:Wq};function Vq(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{numOrSizeSplits:s,axis:i}=r,o=_.parseAxisParam(i,a.shape)[0],l=E.prepareSplitSize(a,s,o),c=a.shape.length,u=new Array(c).fill(0),h=a.shape.slice();return l.map(d=>{let p=[...h];p[o]=d;let m=Ac({inputs:{x:a},backend:n,attrs:{begin:u,size:p}});return u[o]+=d,m})}var jq={kernelName:Ko,backendName:"webgl",kernelFunc:Vq},Uq="return sqrt(x);",Hq=qe({opSnippet:Uq}),Gq={kernelName:Gs,backendName:"webgl",kernelFunc:Hq},qq="return x * x;",Xq=qe({opSnippet:qq}),Kq={kernelName:Nu,backendName:"webgl",kernelFunc:Xq},u7="return (a - b) * (a - b);",Zq=en({opSnippet:u7,packedOpSnippet:u7}),Yq={kernelName:Ks,backendName:"webgl",kernelFunc:Zq};function Jq({inputs:e,attrs:t,backend:n}){let{x:r}=e,a=xr+` +`,Lq=qe({opSnippet:Pq}),Wq={kernelName:Xo,backendName:"webgl",kernelFunc:Lq},Bq=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,paddings:i}=a;w.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,g)=>y*g),l=[[0,0]];l.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),A},Vq={kernelName:Nu,backendName:"webgl",kernelFunc:Bq};function jq(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${a.shape}`);if(r.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(r.dataId)),o=n.readSync(a.dataId),l=Array.from(n.readSync(s.dataId)),[d,u,p]=JL(o,a.shape,a.dtype,i,l);return[n.makeTensorInfo(u,a.dtype,d),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var Uq={kernelName:Qp,backendName:"webgl",kernelFunc:jq};function Hq(e){let{inputs:t,backend:n,attrs:a}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=a,{sliceRank:l,numUpdates:d,strides:u,outputSize:p}=C.calculateShapes(s,r,o),c=!1,h=new u6(d,l,r.shape.length,s.shape.length,u,[p,1],c),m=n.runWebGLProgram(h,[s,r,i],s.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var Gq={kernelName:ec,backendName:"webgl",kernelFunc:Hq};function qq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=w.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),d=r.shape.length,u=new Array(d).fill(0),p=r.shape.slice();return l.map(c=>{let h=[...p];h[o]=c;let m=Ad({inputs:{x:r},backend:n,attrs:{begin:u,size:h}});return u[o]+=c,m})}var Xq={kernelName:Ko,backendName:"webgl",kernelFunc:qq},Kq="return sqrt(x);",Zq=qe({opSnippet:Kq}),Yq={kernelName:Gs,backendName:"webgl",kernelFunc:Zq},Jq="return x * x;",Qq=qe({opSnippet:Jq}),eX={kernelName:Tu,backendName:"webgl",kernelFunc:Qq},d6="return (a - b) * (a - b);",tX=en({opSnippet:d6,packedOpSnippet:d6}),nX={kernelName:Ks,backendName:"webgl",kernelFunc:tX};function aX({inputs:e,attrs:t,backend:n}){let{x:a}=e,r=xa+` return x > 0.0 ? 1.0 : float(${t.alpha}); - `,s=new Wa(r.shape,a);return n.runWebGLProgram(s,[r],r.dtype)}var Qq={kernelName:Ta,backendName:"webgl",kernelFunc:Jq},eX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let r=n.length,a=lt(n.length),s=lt(n.length),i="";if(r===1)i="coords * strides + begin";else{let o=0;i=n.map((l,c)=>(o++,n.length===1?`coords * strides[${c}] + begin[${c}]`:`coords[${o-1}] * strides[${c}] + begin[${c}]`)).join(",")}this.userCode=` - ${a} begin = ${a}(${e}); - ${a} strides = ${a}(${t}); + `,s=new Pr(a.shape,r);return n.runWebGLProgram(s,[a],a.dtype)}var rX={kernelName:Nr,backendName:"webgl",kernelFunc:aX},sX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let a=n.length,r=lt(n.length),s=lt(n.length),i="";if(a===1)i="coords * strides + begin";else{let o=0;i=n.map((l,d)=>(o++,n.length===1?`coords * strides[${d}] + begin[${d}]`:`coords[${o-1}] * strides[${d}] + begin[${d}]`)).join(",")}this.userCode=` + ${r} begin = ${r}(${e}); + ${r} strides = ${r}(${t}); void main() { ${s} coords = getOutputCoords(); setOutput(getX(${i})); } - `}};function tX(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r,{nonStrided:p,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(a.shape,s,i,o,l,c,u,h,d),x=fe({inputs:{x:a},backend:n,attrs:{shape:y}}),v;if(p){let b=Ac({inputs:{x},backend:n,attrs:{begin:m,size:A}});v=fe({inputs:{x:b},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(b)}else if(g.some(b=>b===0))v=n.makeTensorInfo(g,a.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let b=n.texData.get(x.dataId).values,k=We(x.shape,x.dtype,b),N=XL(g,k,f,m);v=n.makeTensorInfo(g,x.dtype,N.values)}else{let b=new eX(m,f,g);v=n.runWebGLProgram(b,[x],x.dtype)}let w=fe({inputs:{x:v},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),w}var nX={kernelName:Zo,backendName:"webgl",kernelFunc:tX},rX="return tan(x);",aX=qe({opSnippet:rX}),sX={kernelName:Ys,backendName:"webgl",kernelFunc:aX},iX=` + `}};function iX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a,{nonStrided:h,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(r.shape,s,i,o,l,d,u,p,c),x=fe({inputs:{x:r},backend:n,attrs:{shape:y}}),k;if(h){let v=Ad({inputs:{x},backend:n,attrs:{begin:m,size:A}});k=fe({inputs:{x:v},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(v)}else if(g.some(v=>v===0))k=n.makeTensorInfo(g,r.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let v=n.texData.get(x.dataId).values,I=We(x.shape,x.dtype,v),T=QL(g,I,f,m);k=n.makeTensorInfo(g,x.dtype,T.values)}else{let v=new sX(m,f,g);k=n.runWebGLProgram(v,[x],x.dtype)}let b=fe({inputs:{x:k},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(k),b}var oX={kernelName:Zo,backendName:"webgl",kernelFunc:iX},lX="return tan(x);",uX=qe({opSnippet:lX}),dX={kernelName:Ys,backendName:"webgl",kernelFunc:uX},pX=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); -`,oX=qe({opSnippet:iX}),lX={kernelName:Js,backendName:"webgl",kernelFunc:oX},cX=class{constructor(e,t){this.variableNames=["A"];let n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[];for(let a=0;a5){let o=n.readSync(a.dataId).map(u=>_.decodeString(u)),l=We(a.shape,a.dtype,o),c=ZL(l,s);return n.makeTensorInfo(c.shape,c.dtype,c.values)}let i=new cX(a.shape,s);return n.runWebGLProgram(i,[a],a.dtype)}var hX={kernelName:Na,backendName:"webgl",kernelFunc:c7};function dX(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{k:s,sorted:i}=r,o=n.readSync(a.dataId),[l,c]=YL(o,a.shape,a.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}var pX={kernelName:Yo,backendName:"webgl",kernelFunc:dX},fX=class{constructor(e,t,n,r,a,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(r){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` + `}};function fX(e){let t=e.length;if(t>5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],a=[];for(let r=0;r5){let o=n.readSync(r.dataId).map(u=>w.decodeString(u)),l=We(r.shape,r.dtype,o),d=tW(l,s);return n.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new mX(r.shape,s);return n.runWebGLProgram(i,[r],r.dtype)}var AX={kernelName:Sr,backendName:"webgl",kernelFunc:p6};function yX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a,o=n.readSync(r.dataId),[l,d]=nW(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(d.shape,d.dtype,d.values)]}var gX={kernelName:Yo,backendName:"webgl",kernelFunc:yX},xX=class{constructor(e,t,n,a,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(a){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` float mapCoord(float outCoord, float len) { float inCoord = outCoord; if(${o} == 2) { @@ -4013,7 +4013,7 @@ return a / b;`,YH=` if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) { outputValue = getImage(batch, coordY, coordX, channel); } else { - outputValue = float(${a}); + outputValue = float(${r}); } return outputValue; } @@ -4037,7 +4037,7 @@ return a / b;`,YH=` float c2 = getTransforms(batch, 7); float projection = c1 * xf + c2 * yf + 1.0; if (projection == 0.0) { - outputValue = float(${a}); + outputValue = float(${r}); } else { float inX = (a1 * xf + a2 * yf + a3) / projection; float inY = (b1 * xf + b2 * yf + b3) / projection; @@ -4068,26 +4068,26 @@ return a / b;`,YH=` } setOutput(outputValue); } - `}};function mX(e){let{inputs:t,backend:n,attrs:r}=e,{image:a,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:c}=r,[u,h,d,p]=a.shape,[m,f]=c!=null?c:[h,d],A=[u,m,f,p],y=new fX(h,d,i,o,l,A);return n.runWebGLProgram(y,[a,s],"float32")}var AX={kernelName:td,backendName:"webgl",kernelFunc:mX};function yX(e){let{inputs:t,attrs:n,backend:r}=e,{axis:a}=n,{x:s}=t;Sl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=r.readSync(s.dataId),{outputValues:o,outputShape:l,indices:c}=JL(i,a,s.shape,s.dtype);return[r.makeTensorInfo(l,s.dtype,o),r.makeTensorInfo([c.length],"int32",c)]}var gX={kernelName:nd,backendName:"webgl",kernelFunc:yX};function xX(e){let{inputs:t,backend:n,attrs:r}=e,{value:a}=t,{axis:s}=r;s<0&&(s+=a.shape.length);let i=a,o=i.shape.length,l=a.shape[s],c=new Array(o-1),u=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var wX={kernelName:Jo,backendName:"webgl",kernelFunc:xX},bX=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,r=e.batchSize,a=e.inSize,s=e.numSegments,i=s*Math.ceil(a/n);this.outputShape=[r,i];let o="0.0",l="sumValue",c=Math.floor(n/4)*4,u=n%4,h=` + `}};function bX(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:d}=a,[u,p,c,h]=r.shape,[m,f]=d!=null?d:[p,c],A=[u,m,f,h],y=new xX(p,c,i,o,l,A);return n.runWebGLProgram(y,[r,s],"float32")}var vX={kernelName:tc,backendName:"webgl",kernelFunc:bX};function wX(e){let{inputs:t,attrs:n,backend:a}=e,{axis:r}=n,{x:s}=t;Nl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=a.readSync(s.dataId),{outputValues:o,outputShape:l,indices:d}=aW(i,r,s.shape,s.dtype);return[a.makeTensorInfo(l,s.dtype,o),a.makeTensorInfo([d.length],"int32",d)]}var kX={kernelName:nc,backendName:"webgl",kernelFunc:wX};function IX(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],d=new Array(o-1),u=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var SX={kernelName:Jo,backendName:"webgl",kernelFunc:IX},NX=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,a=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/n);this.outputShape=[a,i];let o="0.0",l="sumValue",d=Math.floor(n/4)*4,u=n%4,p=` sumValue += dot(values, segFilter); - `,d="";a%n>0&&(d=` - if (inIdx < 0 || inIdx >= ${a}) { + `,c="";r%n>0&&(c=` + if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } - `);let p="";a%n>0&&(p=` - if (inIdx < 0 || inIdx >= ${a}) { + `);let h="";r%n>0&&(h=` + if (inIdx < 0 || inIdx >= ${r}) { return -1.0; } `),this.userCode=` const float initializationValue = ${o}; float getValue(int batch, int inIdx) { - ${d} + ${c} return getX(batch, inIdx); } float getSegmentIdAtIndex(int inIdx) { - ${p} + ${h} return getSegmentIds(inIdx); } @@ -4101,7 +4101,7 @@ return a / b;`,YH=` float sumValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${d}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), @@ -4117,10 +4117,10 @@ return a / b;`,YH=` int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 ); - ${h} + ${p} } - int inIdx = inOffset + ${c}; + int inIdx = inOffset + ${d}; if (${u===1}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4138,7 +4138,7 @@ return a / b;`,YH=` 0 ); - ${h} + ${p} } else if (${u===2}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4154,7 +4154,7 @@ return a / b;`,YH=` 0 ); - ${h} + ${p} } else if (${u===3}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4170,30 +4170,30 @@ return a / b;`,YH=` 0 ); - ${h} + ${p} } setOutput(${l}); } - `}};function _X(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,segmentIds:s}=t,{numSegments:i}=r,o=a.shape.length,l=[],c=0,u=E.getAxesPermutation([c],o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),l.push(h),c=E.getInnerMostAxes(1,o)[0]);let d=E.segment_util.computeOutShape(h.shape,c,i),p=_.sizeFromShape([h.shape[c]]),m=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(m);let f=ld(a.dtype),A=(v,w,b,k,N)=>{let C=v.shape[0],F=v.shape[1],O=E.segment_util.segOpComputeOptimalWindowSize(F,N),z={windowSize:O,inSize:F,batchSize:C,numSegments:N},V=new bX(z,w),j=n.compileAndRun(V,[v,b],k);if(l.push(j),j.shape[1]===N)return j;let U=o7({backend:n,attrs:{start:0,stop:N,step:1,dtype:"float32"}}),X=c7({inputs:{x:U},backend:n,attrs:{reps:[F/O]}});return l.push(U),l.push(X),A(j,w,X,k,N)},y=A(m,"unsortedSegmentSum",s,f,i),g=fe({inputs:{x:y},backend:n,attrs:{shape:d}}),x=g;if(u!=null){l.push(g);let v=E.getUndoAxesPermutation(u);x=dn({inputs:{x},backend:n,attrs:{perm:v}})}return l.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var vX={kernelName:Tu,backendName:"webgl",kernelFunc:_X},kX=[hH,fH,ZW,JW,tB,aB,iB,uB,hB,pB,yB,xB,_B,IB,MB,TB,DB,LB,zB,jB,HB,qB,YB,aV,iV,dV,fV,gV,bV,RW,SV,OV,PV,CV,VV,UV,WV,qV,ZV,QV,tj,rj,ij,dj,fj,lj,yj,wj,_j,Sj,Cj,$j,zj,Pj,Lj,Bj,jj,Hj,qj,Kj,Qj,rU,sU,oU,cU,fU,gU,_U,CW,kU,kV,NU,CU,FU,FW,zU,BU,jU,ZU,qU,eH,rH,oH,AH,kH,_H,TH,CH,MH,wH,$H,OH,WH,UH,XH,nG,PW,aG,oG,cG,pG,lV,AG,gG,wG,vG,NG,DW,EG,CG,uV,JH,FG,BG,zG,WW,HG,XG,YG,eq,aq,iq,uq,dq,fq,yq,wq,vq,Sq,Eq,Mq,nV,eG,Dq,zq,Lq,Bq,jq,Gq,Kq,Yq,Qq,nX,QH,qW,sX,lX,hX,pX,AX,XW,gX,wX,vX,yG];for(let e of kX)ri(e);var In;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(In||(In={}));var gc;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(gc||(gc={}));var h7;function IX(e){h7=e.wasm.cwrap(ei,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function SX(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s,bias:i,preluActivationWeights:o}=t;if(a.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=r,d=n.dataIdMap.get(a.dataId).id,p=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let N=n.dataIdMap.get(i.dataId);if(N.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${N.shape.length}.`);m=N.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,A=gc[u];if(A==null)throw new Error(`${u} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?a.shape[2]:a.shape[1],g=c?s.shape[1]:s.shape[2],x=a.shape[0],v=n.makeOutput([x,y,g],a.dtype),w=n.dataIdMap.get(v.dataId).id,b=new Uint8Array(new Int32Array(a.shape).buffer),k=new Uint8Array(new Int32Array(s.shape).buffer);return h7(d,b,a.shape.length,p,k,s.shape.length,l,c,A,m,f,h||0,w),v}var NX={kernelName:ei,backendName:"wasm",setupFunc:IX,kernelFunc:SX};function pn(e){let t;function n(a){t=a.wasm.cwrap(e,null,["number","number"])}function r(a){let{backend:s,inputs:{x:i}}=a,o=s.dataIdMap.get(i.dataId).id,l=s.makeOutput(i.shape,i.dtype),c=s.dataIdMap.get(l.dataId).id;return _.sizeFromShape(l.shape)===0||t(o,c),l}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:r}}var TX=pn(eo);function fn(e,t,n){let r;function a(i){r=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:c,b:u}=l,h=o.dataIdMap.get(c.dataId).id,d=o.dataIdMap.get(u.dataId).id,p=n!=null?n:c.dtype,m=E.assertAndGetBroadcastShape(c.shape,u.shape),f=o.makeOutput(m,p);if(_.sizeFromShape(m)===0)return f;let A=new Uint8Array(new Int32Array(c.shape).buffer),y=new Uint8Array(new Int32Array(u.shape).buffer),g=o.dataIdMap.get(f.dataId).id,x=()=>r(h,A,c.shape.length,d,y,u.shape.length,In[c.dtype],g);if(t&&c.dtype==="float32")return x(),f;let v=E.getBroadcastDims(c.shape,m),w=E.getBroadcastDims(u.shape,m),b=v.every((N,C)=>N===C),k=w.every((N,C)=>N===C);if(b&&k)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${c.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:a,kernelFunc:s}}var EX=!0,CX=fn(Ia,EX),d7;function RX(e){d7=e.wasm.cwrap(is,null,["array","number","number","number"])}function MX(e){let{inputs:t,backend:n}=e,r=n.makeOutput(t[0].shape,t[0].dtype);if(_.sizeFromShape(r.shape)===0)return r;let a=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(a).buffer),i=n.dataIdMap.get(r.dataId).id;return d7(s,a.length,In[r.dtype],i),r}var FX={kernelName:is,backendName:"wasm",setupFunc:RX,kernelFunc:MX};function kp(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype),a=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(r).set(a),r}var $X={kernelName:vs,backendName:"wasm",kernelFunc:kp},p7;function DX(e){p7=e.wasm.cwrap(Qs,null,["number","array","number","number","number","array","number"])}function Ip(e){let{inputs:t,backend:n,attrs:r}=e,[a,s]=zX(t.x.shape,r.perm),i=!0;for(let m=0;m=a&&(s===-1||r[s]>r[i])&&(s=i);r[s]=a}return[n,r]}var PX={kernelName:Qs,backendName:"wasm",kernelFunc:Ip,setupFunc:DX};function Va(e,t,n){let r=e.shape,a=e.shape.length,s=_.parseAxisParam(t,r),i=s,o=E.getAxesPermutation(i,a),l=null,c=!1;if(o!=null){let u=new Array(a);for(let d=0;d`new shape: ${i}, old shape: ${r.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(r.dataId),{dataId:r.dataId,shape:i,dtype:r.dtype}}var YX={kernelName:Bo,backendName:"wasm",kernelFunc:wr},g7;function JX(e){g7=e.wasm.cwrap(us,null,["number","array","number","number","array","number","number","number","number"])}function QX(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;if(a.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=a.shape.length,c=s.shape.length,u=i?a.shape[l-2]:a.shape[l-1],h=o?s.shape[c-1]:s.shape[c-2],d=i?a.shape[l-1]:a.shape[l-2],p=o?s.shape[c-2]:s.shape[c-1],m=a.shape.slice(0,-2),f=s.shape.slice(0,-2),A=_.sizeFromShape(m),y=_.sizeFromShape(f),g=A===y||A===1||y===1;_.assert(l>=2&&c>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?a.shape.slice(0,-2):s.shape.slice(0,-2)).concat([d,p]);_.assert(u===h,()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${a.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[A,u,d]:[A,d,u],w=o?[y,p,h]:[y,h,p],b=wr({inputs:{x:a},backend:n,attrs:{shape:v}}),k=wr({inputs:{x:s},backend:n,attrs:{shape:w}}),N=n.dataIdMap.get(b.dataId).id,C=n.dataIdMap.get(k.dataId).id,F=i?b.shape[2]:b.shape[1],O=o?k.shape[1]:k.shape[2],z=Math.max(A,y),V=n.makeOutput([z,F,O],b.dtype),j=n.dataIdMap.get(V.dataId).id,U=new Uint8Array(new Int32Array(b.shape).buffer),X=new Uint8Array(new Int32Array(k.shape).buffer);return g7(N,U,b.shape.length,C,X,k.shape.length,i,o,j),n.disposeData(b.dataId),n.disposeData(k.dataId),V.shape=x,V}var eK={kernelName:us,backendName:"wasm",setupFunc:JX,kernelFunc:QX};function Sp(e){let{inputs:{x:t},attrs:{dtype:n},backend:r}=e,a=r.makeOutput(t.shape,n),s=r.typedArrayFromHeap(t);return r.typedArrayFromHeap(a).set(s),a}var tK={kernelName:cs,backendName:"wasm",kernelFunc:Sp},nK=pn(hs),x7;function rK(e){x7=e.wasm.cwrap(Sa,null,["number","number","number","number"])}function aK(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{clipValueMin:s,clipValueMax:i}=r,o=n.dataIdMap.get(a.dataId).id,l=n.makeOutput(a.shape,a.dtype),c=n.dataIdMap.get(l.dataId).id;return x7(o,s,i,c),l}var sK={kernelName:Sa,backendName:"wasm",setupFunc:rK,kernelFunc:aK};function w7(e){let{inputs:t,backend:n}=e,r=_.parseAxisParam(e.attrs.axis,t[0].shape)[0],a=E.computeOutShape(t.map(p=>p.shape),r),s=t.filter(p=>_.sizeFromShape(p.shape)>0);if(s.length===1)return kp({inputs:{x:s[0]},backend:n});let i=n.makeOutput(a,t[0].dtype);if(_.sizeFromShape(a)===0)return i;let o=s.map(p=>p.shape);if(E.assertParamsConsistent(o,r),s[0].dtype==="string"){let p=s.map(x=>{let v=_.sizeFromShape(x.shape.slice(r));return wr({inputs:{x},backend:n,attrs:{shape:[-1,v]}})}),m=p.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));a=E.computeOutShape(p.map(x=>x.shape),1);let f=p[0].shape[0]===1,A=Vm(m,a,t[0].dtype,f),y=E.computeOutShape(s.map(x=>x.shape),r);i.shape=y;let g=n.dataIdMap.get(i.dataId);return g.stringBytes=E.fromStringArrayToUint8(A),p.forEach(x=>n.disposeData(x.dataId)),i}let l=_.sizeFromShape(s[0].shape.slice(0,r)),c=0,u=s.map(p=>{let m=_.sizeFromShape(p.shape.slice(r));return c+=m,m}),h=s.map(p=>n.typedArrayFromHeap(p)),d=n.typedArrayFromHeap(i);for(let p=0;p`cumsum does not support ${a.dtype} tensors in the WASM backend`);let c=E.getAxesPermutation([s],l),u=a;c!==null&&(u=Ip({inputs:{x:a},attrs:{perm:c},backend:n}));let h=E.getInnerMostAxes(1,l)[0];E.assertAxesAreInnerMostDims("cumsum",[h],l);let d=n.makeOutput(u.shape,u.dtype),p=u.shape[h],m=n.dataIdMap.get(u.dataId).id,f=n.dataIdMap.get(d.dataId).id;k7(m,i?1:0,o?1:0,p,f,In[a.dtype]);let A=d;if(c!==null){let y=E.getUndoAxesPermutation(c);A=Ip({inputs:{x:d},attrs:{perm:y},backend:n}),n.disposeData(u.dataId),n.disposeData(d.dataId)}return A}var xK={kernelName:ms,backendName:"wasm",setupFunc:yK,kernelFunc:gK},I7;function wK(e){I7=e.wasm.cwrap(fo,null,["number","number","number","array","number","array","array","number","number"])}function bK(e){let{backend:t,inputs:n,attrs:r}=e,{x:a}=n,{blockSize:s,dataFormat:i}=r;_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=i==="NHWC"?a.shape[1]:a.shape[2],c=i==="NHWC"?a.shape[2]:a.shape[3],u=i==="NHWC"?a.shape[3]:a.shape[1],h=l*s,d=c*s,p=u/(s*s),m=i==="NHWC"?[o,h,d,p]:[o,p,h,d],f=t.makeOutput(m,"float32"),A=t.dataIdMap.get(a.dataId).id,y=new Uint8Array(new Int32Array(_.computeStrides(a.shape)).buffer),g=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(_.computeStrides(m)).buffer),v=t.dataIdMap.get(f.dataId).id;return I7(A,s,i==="NHWC"?1:0,y,a.shape.length-1,g,x,m.length,v),f}var _K={kernelName:fo,backendName:"wasm",setupFunc:wK,kernelFunc:bK},S7;function vK(e){S7=e.wasm.cwrap(As,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function kK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s}=t,i=r.dataIdMap.get(a.dataId).id,o=r.dataIdMap.get(s.dataId).id,{strides:l,dilations:c,pad:u,dimRoundingMode:h}=n,d=c==null?[1,1]:c,p=E.computeConv2DInfo(a.shape,s.shape,l,d,u,h,!0),m=p.filterHeight,f=p.filterWidth,A=p.padInfo.top,y=p.padInfo.right,g=p.padInfo.bottom,x=p.padInfo.left,v=p.dilationHeight,w=p.dilationWidth,b=p.strideHeight,k=p.strideWidth,N=p.inChannels,C=p.outChannels,F=p.padInfo.type==="SAME"?1:0;if(p.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);let O=r.makeOutput(p.outShape,"float32"),z=r.dataIdMap.get(O.dataId).id;return S7(i,a.shape[0],a.shape[1],a.shape[2],o,m,f,A,y,g,x,F,v,w,b,k,N,C,z),O}var IK={kernelName:As,backendName:"wasm",setupFunc:vK,kernelFunc:kK},SK=!1,NK=fn(yo,SK,"bool"),TK=pn(gs);function bA(e){let{inputs:t,attrs:n,backend:r}=e,{input:a}=t,{dim:s}=n,i=a.shape.length,o=a.shape.slice(),l=s;return s<0&&(_.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),wr({inputs:{x:a},backend:r,attrs:{shape:o}})}var EK={kernelName:go,backendName:"wasm",kernelFunc:bA};function CK(e){let{attrs:{shape:t,value:n,dtype:r},backend:a}=e,s=a.makeOutput(t,r);return a.typedArrayFromHeap(s).fill(n),s}var RK={kernelName:xu,backendName:"wasm",kernelFunc:CK},N7;function MK(e){N7=e.wasm.cwrap(wo,null,["number","number","number","number","number","number"])}function FK(e){let{inputs:t,backend:n}=e,{image:r}=t,a=n.makeOutput(r.shape,r.dtype),s=n.dataIdMap.get(r.dataId).id,i=n.dataIdMap.get(a.dataId).id,[o,l,c,u]=r.shape;return N7(s,o,l,c,u,i),a}var $K={kernelName:wo,backendName:"wasm",kernelFunc:FK,setupFunc:MK},DK=pn(xs),OK=!1,zK=fn(ws,OK),T7;function PK(e){T7=e.wasm.cwrap(bs,null,["number","number","number","number","number","number","number"])}function LK(e){let{backend:t,inputs:n,attrs:r}=e,{varianceEpsilon:a}=r,{x:s,mean:i,variance:o,offset:l,scale:c}=n,u=t.dataIdMap.get(s.dataId).id,h=t.dataIdMap.get(i.dataId).id,d=t.dataIdMap.get(o.dataId).id,p=l!=null?t.dataIdMap.get(l.dataId).id:0,m=c!=null?t.dataIdMap.get(c.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(_.sizeFromShape(s.shape)===0)return f;let A=t.dataIdMap.get(f.dataId).id;return T7(u,h,d,p,m,a,A),f}var WK={kernelName:bs,backendName:"wasm",setupFunc:PK,kernelFunc:LK},E7;function BK(e){E7=e.wasm.cwrap(ti,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function VK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dataFormat:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=n,f=E.computeConv2DInfo(a.shape,s.shape,l,u,c,d),A=gc[p];if(A==null)throw new Error(`${p} activation not yet supported for FusedConv2D in the wasm backend.`);let y=r.dataIdMap.get(a.dataId).id,g=r.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Q=r.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);v=Q.id}let w=f.filterHeight,b=f.filterWidth,k=f.padInfo.top,N=f.padInfo.right,C=f.padInfo.bottom,F=f.padInfo.left,O=f.dilationHeight,z=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(h!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);let ae=r.makeOutput(f.outShape,"float32"),te=r.dataIdMap.get(ae.dataId).id,ie=o==null?0:r.dataIdMap.get(o.dataId).id;return E7(y,G,ee,Y,g,w,b,v,k,N,C,F,X,O,z,V,j,U,x,A,ie,m||0,te),ae}var jK={kernelName:ti,backendName:"wasm",setupFunc:BK,kernelFunc:VK},C7;function UK(e){C7=e.wasm.cwrap(ni,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function HK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dataFormat:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=n,f=E.computeConv2DInfo(a.shape,s.shape,l,u,c,d,!0),A=gc[p];if(A==null)throw new Error(`${p} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=r.dataIdMap.get(a.dataId).id,g=r.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Q=r.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);v=Q.id}let w=f.filterHeight,b=f.filterWidth,k=f.padInfo.top,N=f.padInfo.right,C=f.padInfo.bottom,F=f.padInfo.left,O=f.dilationHeight,z=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(h!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);let ae=r.makeOutput(f.outShape,"float32"),te=r.dataIdMap.get(ae.dataId).id,ie=o==null?0:r.dataIdMap.get(o.dataId).id;return C7(y,G,ee,Y,g,w,b,v,k,N,C,F,X,O,z,V,j,U,x,A,ie,m||0,te),ae}var GK={kernelName:ni,backendName:"wasm",setupFunc:UK,kernelFunc:HK},R7;function qK(e){R7=e.wasm.cwrap(_o,null,["number","number","number","number","number","number","array","number"])}function XK(e){let{backend:t,inputs:n}=e,{params:r,indices:a}=n,[s,i,o,l]=Lf.prepareAndValidate(r,a),c=t.makeOutput(s,r.dtype);if(i===0)return c;let u=a.shape,h=u[u.length-1],d=t.dataIdMap.get(r.dataId).id,p=t.dataIdMap.get(a.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(c.dataId).id;return R7(d,In[r.dtype],p,i,h,o,m,f),c}var KK={kernelName:_o,backendName:"wasm",setupFunc:qK,kernelFunc:XK},M7;function ZK(e){M7=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function YK(e){let{backend:t,inputs:n,attrs:r}=e,{x:a,indices:s}=n,{axis:i,batchDims:o}=r,l=_.parseAxisParam(i,a.shape)[0],c=E.segment_util.collectGatherOpShapeInfo(a,s,l,o),u=wr({inputs:{x:a},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:t}),h=_.sizeFromShape(s.shape),d=wr({inputs:{x:s},attrs:{shape:[c.batchSize,h/c.batchSize]},backend:t}),p=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize],m=t.makeOutput(p,a.dtype);if(_.sizeFromShape(a.shape)===0)return m;let f=u.shape.length-1,A=t.dataIdMap.get(u.dataId).id,y=t.dataIdMap.get(d.dataId).id,g=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(_.computeStrides(u.shape)).buffer),v=new Uint8Array(new Int32Array(_.computeStrides(p)).buffer);return M7(A,In[a.dtype],x,f,y,c.batchSize,v,g),t.disposeData(u.dataId),t.disposeData(d.dataId),m.shape=c.outputShape,m}var JK={kernelName:bo,backendName:"wasm",setupFunc:ZK,kernelFunc:YK},QK=!1,eZ=fn(vo,QK,"bool"),tZ=!1,nZ=fn(_s,tZ,"bool"),F7;function rZ(e){F7=e.wasm.cwrap(ks,null,["number","number","number"])}function aZ(e){let{inputs:{x:t},attrs:{alpha:n},backend:r}=e,a=r.dataIdMap.get(t.dataId).id,s=r.makeOutput(t.shape,t.dtype);if(_.sizeFromShape(t.shape)!==0){let i=r.dataIdMap.get(s.dataId).id;F7(a,n,i)}return s}var sZ={kernelName:ks,backendName:"wasm",setupFunc:rZ,kernelFunc:aZ},iZ=!1,oZ=fn(No,iZ,"bool"),lZ=!1,uZ=fn(To,lZ,"bool"),cZ=pn(Is),hZ=!1,dZ=fn(Co,hZ,"bool"),$7;function pZ(e){$7=e.wasm.cwrap(Ss,null,["number, number, number"])}function fZ(e){let{backend:t,inputs:n,attrs:r}=e,{reductionIndices:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:c,axes:u,originalAxes:h,inputWasTransposed:d}=Va(i,a,t);if(d){let g=t.dataIdMap.get(c.dataId).id;l=c,o=g}let p=l.shape.length;E.assertAxesAreInnerMostDims("max",u,p);let[m,f]=E.computeOutAndReduceShapes(l.shape,u),A=_.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(_.sizeFromShape(l.shape)!==0){let g=t.dataIdMap.get(y.dataId).id;$7(o,A,g)}if(d&&t.disposeData(c.dataId),s){let g=E.expandShapeToKeepDim(y.shape,h);y.shape=g}return y}var mZ={kernelName:Ss,backendName:"wasm",setupFunc:pZ,kernelFunc:fZ},AZ=!1,yZ=fn(Ns,AZ),D7;function gZ(e){D7=e.wasm.cwrap(Ts,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function xZ(e){let{inputs:t,attrs:n,backend:r}=e,a=t.x,s=r.dataIdMap.get(a.dataId).id,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=n,u=E.computePool2DInfo(a.shape,i,o,1,l,c),h=u.filterHeight,d=u.filterWidth,p=u.padInfo.top,m=u.padInfo.right,f=u.padInfo.bottom,A=u.padInfo.left,y=u.dilationHeight,g=u.dilationWidth,x=u.strideHeight,v=u.strideWidth,w=u.inChannels,b=u.outChannels;if(u.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${u.dataFormat}'. Please use 'channelsLast'.`);let k=r.makeOutput(u.outShape,"float32"),N=r.dataIdMap.get(k.dataId).id;return D7(s,a.shape[0],a.shape[1],a.shape[2],h,d,p,m,f,A,y,g,x,v,w,b,N),k}var wZ={kernelName:Ts,backendName:"wasm",setupFunc:gZ,kernelFunc:xZ},O7;function bZ(e){O7=e.wasm.cwrap(Es,null,["number, number, number"])}function _Z(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let v=t.dataIdMap.get(u.dataId).id;v!==o&&(c=u,l=v,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("mean",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=c;c.dtype!=="float32"&&(g=Sp({backend:t,inputs:{x:c},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(g.dataId).id);let x=t.makeOutput(f,"float32");if(_.sizeFromShape(c.shape)!==0){let v=t.dataIdMap.get(x.dataId).id;O7(l,y,v)}if(p&&t.disposeData(u.dataId),s){let v=E.expandShapeToKeepDim(x.shape,d);x.shape=v}return c.dtype!=="float32"&&t.disposeData(g.dataId),x}var vZ={kernelName:Es,backendName:"wasm",setupFunc:bZ,kernelFunc:_Z},z7;function kZ(e){z7=e.wasm.cwrap(Cs,null,["number, number, number"])}function IZ(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t);if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x)}let m=c.shape.length;E.assertAxesAreInnerMostDims("min",h,m);let[f,A]=E.computeOutAndReduceShapes(c.shape,h),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;z7(l,y,x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var SZ={kernelName:Cs,backendName:"wasm",setupFunc:kZ,kernelFunc:IZ},NZ=!1,TZ=fn(Rs,NZ),_A;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(_A||(_A={}));var P7;function EZ(e){P7=e.wasm.cwrap(Ms,null,["number","array","number","number","array","array","number","number"])}function CZ(e){let{inputs:{x:t},backend:n,attrs:{paddings:r,mode:a}}=e,s=r.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),u=r.map(m=>m[0]),h=r.map(m=>m[1]),d=new Uint8Array(new Int32Array(u).buffer),p=new Uint8Array(new Int32Array(h).buffer);return P7(i,c,t.shape.length,In[t.dtype],d,p,_A[a],l),o}var RZ={kernelName:Ms,backendName:"wasm",kernelFunc:CZ,setupFunc:EZ},MZ=!0,FZ=fn(Fs,MZ),$Z=pn(Mo);function vA(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),r=n[0],a=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:r,selectedSize:a,pSelectedScores:s,pValidOutputs:i}}var L7;function DZ(e){L7=e.wasm.cwrap($o,"number",["number","number","number","number","number"])}function OZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i}=r,{boxes:o,scores:l}=n,c=t.dataIdMap.get(o.dataId).id,u=t.dataIdMap.get(l.dataId).id,h=L7(c,u,s,a,i),{pSelectedIndices:d,selectedSize:p,pSelectedScores:m,pValidOutputs:f}=vA(t,h);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([p],"int32",d)}var zZ={kernelName:$o,backendName:"wasm",setupFunc:DZ,kernelFunc:OZ},W7;function PZ(e){W7=e.wasm.cwrap(Do,"number",["number","number","number","number","number","bool"])}function LZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=r,{boxes:l,scores:c}=n,u=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(c.dataId).id,d=W7(u,h,s,a,i,o),{pSelectedIndices:p,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=vA(t,d);t.wasm._free(f);let y=t.makeOutput([m],"int32",p),g=t.makeOutput([],"int32",A);return[y,g]}var WZ={kernelName:Do,backendName:"wasm",setupFunc:PZ,kernelFunc:LZ},B7;function BZ(e){B7=e.wasm.cwrap(Oo,"number",["number","number","number","number","number","number"])}function VZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=r,{boxes:l,scores:c}=n,u=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(c.dataId).id,d=B7(u,h,s,a,i,o),{pSelectedIndices:p,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=vA(t,d);t.wasm._free(A);let y=t.makeOutput([m],"int32",p),g=t.makeOutput([m],"float32",f);return[y,g]}var jZ={kernelName:Oo,backendName:"wasm",setupFunc:BZ,kernelFunc:VZ},UZ=!1,HZ=fn(Fo,UZ,"bool"),V7;function GZ(e){V7=e.wasm.cwrap($s,null,["number","number","number","number","number"])}function qZ(e){let{inputs:t,backend:n,attrs:r}=e,{indices:a}=t,{depth:s,onValue:i,offValue:o}=r,l=n.makeOutput([...a.shape,s],"int32"),c=n.dataIdMap.get(l.dataId).id,u=n.dataIdMap.get(a.dataId).id;return V7(u,s,i,o,c),l}var XZ={kernelName:$s,backendName:"wasm",setupFunc:GZ,kernelFunc:qZ};function KZ(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(1),r}var ZZ={kernelName:zo,backendName:"wasm",kernelFunc:KZ};function YZ(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r;if(t.length===1)return bA({inputs:{input:t[0]},backend:n,attrs:{dim:a}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=bA({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=w7({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeData(u.dataId)),c}var JZ={kernelName:Po,backendName:"wasm",kernelFunc:YZ},j7;function QZ(e){j7=e.wasm.cwrap(Ds,null,["number","array","number","number","array","array","number","number"])}function eY(e){let{inputs:{x:t},backend:n,attrs:{paddings:r,constantValue:a}}=e,s=r.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),u=r.map(m=>m[0]),h=r.map(m=>m[1]),d=new Uint8Array(new Int32Array(u).buffer),p=new Uint8Array(new Int32Array(h).buffer);return j7(i,c,t.shape.length,In[t.dtype],d,p,a,l),o}var tY={kernelName:Ds,backendName:"wasm",kernelFunc:eY,setupFunc:QZ},nY=!1,rY=fn(Os,nY),U7;function aY(e){U7=e.wasm.cwrap(zs,null,["number","number","number"])}function sY(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t,s=n.dataIdMap.get(r.dataId).id,i=n.dataIdMap.get(a.dataId).id,o=n.makeOutput(r.shape,"float32"),l=n.dataIdMap.get(o.dataId).id;return U7(s,i,l),o}var iY={kernelName:zs,backendName:"wasm",setupFunc:aY,kernelFunc:sY},H7;function oY(e){H7=e.wasm.cwrap(Lo,null,["number","number","number","number"])}function lY(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("prod",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;H7(l,y,In[g.dtype],x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var uY={kernelName:Lo,backendName:"wasm",setupFunc:oY,kernelFunc:lY},cY=e=>{let{backend:t,attrs:n}=e,{start:r,stop:a,step:s,dtype:i}=n,o=Hm(r,a,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},hY={kernelName:ku,backendName:"wasm",kernelFunc:cY},dY=!0,pY=fn(ys,dY),fY=pn(Ps),mY=pn(Ws),G7;function AY(e){G7=e.wasm.cwrap(Ls,null,["number","number","number","number","number","number","number","number","number","number"])}function yY(e){let{backend:t,inputs:n,attrs:r}=e,{images:a}=n,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,[u,h,d,p]=a.shape,m=[u,l,c,p],f=t.dataIdMap.get(a.dataId),A;f.dtype!=="float32"&&(A=Sp({backend:t,inputs:{x:a},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(A.dataId));let y=f.id,g=t.makeOutput(m,"float32");if(_.sizeFromShape(a.shape)===0)return g;let x=t.dataIdMap.get(g.dataId).id;return G7(y,u,h,d,p,l,c,s?1:0,i?1:0,x),A!=null&&t.disposeData(A.dataId),g}var gY={kernelName:Ls,backendName:"wasm",setupFunc:AY,kernelFunc:yY},q7;function xY(e){q7=e.wasm.cwrap(Bs,null,["number","array","number","array","number","number"])}function wY(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r,i=_.parseAxisParam(s,a.shape);if(a.shape.length===0)return kp({inputs:{x:a},backend:n});let o=n.makeOutput(a.shape,a.dtype),l=n.dataIdMap.get(a.dataId).id,c=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(i).buffer),h=new Uint8Array(new Int32Array(a.shape).buffer);q7(l,u,i.length,h,a.shape.length,c);let d=wr({inputs:{x:o},attrs:{shape:a.shape},backend:n});return n.disposeData(o.dataId),d}var bY={kernelName:Bs,backendName:"wasm",kernelFunc:wY,setupFunc:xY},X7;function _Y(e){X7=e.wasm.cwrap(el,null,["number","number","number","number","number","number","number","number","array","number","number"])}function vY(e){let{inputs:t,backend:n,attrs:r}=e,{image:a}=t,{radians:s,fillValue:i,center:o}=r,l=n.makeOutput(a.shape,a.dtype),c=n.dataIdMap.get(a.dataId).id,u=n.dataIdMap.get(l.dataId).id,[h,d,p,m]=a.shape,[f,A]=E.getImageCenter(o,d,p),y=i===0,g=255,x=typeof i=="number"?[i,i,i,y?0:g]:[...i,g],v=new Uint8Array(new Int32Array(x).buffer);return X7(c,h,d,p,m,s,f,A,v,x.length,u),l}var kY={kernelName:el,backendName:"wasm",kernelFunc:vY,setupFunc:_Y},IY=pn(Vs),SY=pn(js),K7;function NY(e){K7=e.wasm.cwrap(Vo,null,["number","number","number","number","number","number","array","number","number"])}function TY(e){let{backend:t,inputs:n,attrs:r}=e,{indices:a,updates:s}=n,{shape:i}=r,o=t.makeOutput(i,s.dtype);if(_.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:c,sliceSize:u,strides:h,outputSize:d}=Wf.calculateShapes(s,a,i),p=t.dataIdMap.get(a.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(h).buffer),A=t.dataIdMap.get(o.dataId).id;return K7(p,m,In[s.dtype],l,c,u,f,d,A),o}var EY={kernelName:Vo,backendName:"wasm",setupFunc:NY,kernelFunc:TY},Z7;function CY(e){Z7=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function RY(e){let{inputs:t,backend:n}=e,{condition:r,t:a,e:s}=t,i=n.dataIdMap.get(r.dataId).id,o=n.dataIdMap.get(a.dataId).id,l=n.dataIdMap.get(s.dataId).id,c=n.makeOutput(a.shape,a.dtype),u=n.dataIdMap.get(c.dataId).id,h=r.shape.length,d=a.shape.length,p=h===0||h>1||d===1?1:_.sizeFromShape(a.shape.slice(1));return Z7(i,o,l,p,u),c}var MY={kernelName:jo,backendName:"wasm",kernelFunc:RY,setupFunc:CY},Y7;function FY(e){Y7=e.wasm.cwrap(Hs,null,["number","number"])}function $Y(e){let{backend:t,inputs:{x:n}}=e,r=t.dataIdMap.get(n.dataId).id,a=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(a.dataId).id;return _.sizeFromShape(a.shape)===0||Y7(r,s),a}var DY={kernelName:"Sigmoid",backendName:"wasm",setupFunc:FY,kernelFunc:$Y},OY=pn(Us);function Np(e){let{inputs:{x:t},attrs:{begin:n,size:r},backend:a}=e,[s,i]=sn.parseSliceParams(t,n,r),o=sn.isSliceContinous(t.shape,s,i),l=a.readSync(t.dataId),c=a.makeOutput(i,t.dtype),u=_.computeStrides(t.shape),h=a.dataIdMap.get(c.dataId);if(o){let m=sn.computeFlatOffset(s,u);return t.dtype==="string"?h.stringBytes=l.slice(m,m+_.sizeFromShape(i)):a.typedArrayFromHeap(c).set(l.subarray(m,m+_.sizeFromShape(i))),c}if(t.dtype==="string"){let m=tp(l,s,i,t.shape,t.dtype);return h.stringBytes=m,c}let d=a.typedArrayFromHeap(c),p=t.shape.length;if(p===2)zY(l,u[0],d,s,i);else if(p===3)PY(l,u[0],u[1],d,s,i);else if(p===4)LY(l,u[0],u[1],u[2],d,s,i);else{let m=tp(l,s,i,t.shape,t.dtype);d.set(m)}return c}function zY(e,t,n,r,a){let s=0,i=r[0],o=r[1],l=i+a[0];for(let c=i;c{let d=[...u];d[o]=h;let p=Np({inputs:{x:a},attrs:{begin:c,size:d},backend:r});return c[o]+=h,p})}var HY={kernelName:Ko,backendName:"wasm",kernelFunc:UY},GY=pn(Gs),qY=pn(Nu),XY=!0,KY=fn(Ks,XY),Q7;function ZY(e){Q7=e.wasm.cwrap(Ta,null,["number","number","number"])}function YY(e){let{backend:t,inputs:n,attrs:r}=e,{alpha:a}=r,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return Q7(i,a,l),o}var JY={kernelName:Ta,backendName:"wasm",setupFunc:ZY,kernelFunc:YY},ev;function QY(e){ev=e.wasm.cwrap(Zo,null,["number","array","number","array","array","array","array","array","number","number"])}function eJ(e){let{backend:t,inputs:n,attrs:r}=e,{x:a}=n,{begin:s,end:i,strides:o}=r;o==null&&(o=new Array(s.length));let{beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r,p=E.slice_util.maskToAxes(u);if(p.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(u!==0&&h!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(u!==0&&d!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=a.shape.length-s.length,f=E.slice_util.maskToAxes(h),A=a.shape.slice();f.forEach(F=>{s[F]=0,i[F]=1,A.splice(F,0,1)});let y=wr({inputs:{x:a},attrs:{shape:A},backend:t}),{begin:g,end:x,strides:v}=E.slice_util.getNormalizedAxes(y.shape,p,m,s,i,o,l,c,u);s=g,i=x,o=v;let w=E.slice_util.maskToAxes(d);w.forEach(F=>{i[F]=s[F]+1,o[F]=1});let b=E.slice_util.computeOutShape(s,i,o),k=b.filter((F,O)=>w.indexOf(O)===-1);if(o.every(F=>F===1)){let F=Np({inputs:{x:y},attrs:{begin:s,size:b},backend:t});t.disposeData(y.dataId);let O=wr({inputs:{x:F},attrs:{shape:k},backend:t});return t.disposeData(F.dataId),O}let N=t.makeOutput(k,"float32");if(!k.some(F=>F===0)){let F=t.dataIdMap.get(y.dataId).id,O=new Uint8Array(new Int32Array(_.computeStrides(y.shape)).buffer),z=new Uint8Array(new Int32Array(s).buffer),V=new Uint8Array(new Int32Array(i).buffer),j=new Uint8Array(new Int32Array(o).buffer),U=new Uint8Array(new Int32Array(k).buffer),X=new Uint8Array(new Int32Array(_.computeStrides(k)).buffer),G=t.dataIdMap.get(N.dataId).id;ev(F,O,y.shape.length,z,V,j,U,X,k.length,G)}t.disposeData(y.dataId);let C=wr({inputs:{x:N},attrs:{shape:k},backend:t});return t.disposeData(N.dataId),C}var tJ={kernelName:Zo,backendName:"wasm",setupFunc:QY,kernelFunc:eJ},nJ=!0,rJ=fn(Zs,nJ),tv;function aJ(e){tv=e.wasm.cwrap(qs,null,["number, number, number"])}function sJ(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("sum",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;tv(l,y,x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var iJ={kernelName:qs,backendName:"wasm",setupFunc:aJ,kernelFunc:sJ},oJ=pn(Ys),lJ=pn(Js),nv;function uJ(e){nv=e.wasm.cwrap(Na,null,["number","array","number","array","number","number"])}function cJ(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,s=n.dataIdMap.get(a.dataId).id,{reps:i}=r,o=new Array(a.shape.length);for(let d=0;d{let{x:r}=e,{k:a,sorted:s}=n,i=t.dataIdMap.get(r.dataId).id,o=new Uint8Array(new Int32Array(r.shape).buffer),l=r.shape.slice();l[l.length-1]=a;let c=t.makeOutput(l,r.dtype),u=t.dataIdMap.get(c.dataId).id,h=t.makeOutput(l,"int32"),d=t.dataIdMap.get(h.dataId).id;return rv(i,o,r.shape.length,In[r.dtype],a,s,u,d),[c,h]},fJ={kernelName:Yo,backendName:"wasm",setupFunc:dJ,kernelFunc:pJ};function mJ(e){let{inputs:t,backend:n,attrs:r}=e,{value:a}=t,{axis:s}=r;s<0&&(s+=a.shape.length);let i=a.shape[s],o=a.shape.length,l=new Array(o-1),c=0;for(let p=0;p({dataId:p,dtype:m,shape:l}))}var AJ={kernelName:Jo,backendName:"wasm",kernelFunc:mJ};function yJ(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(0),r}var gJ={kernelName:Qo,backendName:"wasm",kernelFunc:yJ},xJ=[TX,CX,FX,BX,UX,qX,ZX,eK,tK,nK,sK,iK,uK,dK,pK,AK,xK,_K,IK,NK,TK,EK,RK,$K,DK,zK,NX,WK,jK,GK,KK,JK,eZ,nZ,$X,sZ,oZ,uZ,cZ,dZ,mZ,yZ,wZ,vZ,SZ,TZ,RZ,FZ,$Z,zZ,WZ,jZ,HZ,XZ,ZZ,JZ,tY,rY,iY,uY,hY,pY,fY,mY,YX,gY,bY,kY,SY,IY,EY,MY,DY,OY,WY,jY,HY,GY,qY,KY,JY,tJ,rJ,iJ,oJ,lJ,hJ,fJ,PX,AJ,gJ];for(let e of xJ)ri(e);var kA=J();kA.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])));kA.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(kA.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var av=Yi(qk()),wJ='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',bJ=Yi(Xk()),sv=class extends cu{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new _h(this,aa())}write(e,t,n){let r={id:this.dataIdNextNumber++};return this.move(r,e,t,n,1),r}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=_.now();return e(),{kernelMs:_.now()-t}}move(e,t,n,r,a){let s=this.dataIdNextNumber++;if(r==="string"){let c=t;this.dataIdMap.set(e,{id:s,stringBytes:c,shape:n,dtype:r,memoryOffset:null,refCount:a});return}let i=_.sizeFromShape(n),o=i*_.bytesPerElement(r),l=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:n,dtype:r,refCount:a}),this.wasm.tfjs.registerTensor(s,i,l),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),l)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:r,stringBytes:a}=this.dataIdMap.get(e);if(n==="string")return a;let s=this.wasm.HEAPU8.slice(t,t+_.sizeFromShape(r)*_.bytesPerElement(n));return _J(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let r;if(n==null)r=this.write(null,e,t);else{let a=this.dataIdNextNumber++;r={id:a},this.dataIdMap.set(r,{id:a,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=_.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,s,n)}return{dataId:r,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let r=this.wasm.HEAPU8.buffer,{memoryOffset:a}=this.dataIdMap.get(n),s=_.sizeFromShape(e);switch(t){case"float32":return new Float32Array(r,a,s);case"int32":return new Int32Array(r,a,s);case"bool":return new Uint8Array(r,a,s);default:throw new Error(`Unknown dtype ${t}`)}}};function vJ(e){return(t,n)=>(_.fetch(e,{credentials:"same-origin"}).then(r=>{r.ok||t.env.a(`failed to load wasm binary file at '${e}'`),r.arrayBuffer().then(a=>{WebAssembly.instantiate(a,t).then(s=>{n(s.instance,s.module)})})}),{})}function iv(e,t,n){if(Tp!=null)return Tp;let r="tfjs-backend-wasm.wasm";return e&&t?r="tfjs-backend-wasm-threaded-simd.wasm":e&&(r="tfjs-backend-wasm-simd.wasm"),xc!=null&&xc[r]!=null?xc[r]:n+r}async function kJ(){let[e,t]=await Promise.all([J().getAsync("WASM_HAS_SIMD_SUPPORT"),J().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,r)=>{let a={};a.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let c=wJ,u=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(u)}return o.endsWith(".wasm")?iv(e,t,wc!=null?wc:l):l+o},IA&&(a.instantiateWasm=vJ(iv(e,t,wc!=null?wc:"")));let s=!1;a.onAbort=()=>{s||bc||(bc=!0,r({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&Tp==null?(a.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+av.default.toString()],{type:"text/javascript"}),i=(0,av.default)(a)):i=(0,bJ.default)(a),i.then(o=>{s=!0,bc=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},n({wasm:o})})})}function _J(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var IJ=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Tp=null,wc=null,xc={},bc=!1,IA=!1;function SJ(e,t=!1){if(Gf("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),bc)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Tp=e,IA=t}function NJ(e,t=!1){if(bc)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")wc=e;else{xc=e;let n=IJ.filter(r=>xc[r]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}IA=t}var ov="3.5.0",TJ=2;ul("wasm",async()=>{let{wasm:e}=await kJ();return new sv(e)},TJ);Z().prototype.abs=function(){return this.throwIfDisposed(),Dt(this)};Z().prototype.acos=function(){return this.throwIfDisposed(),Xf(this)};Z().prototype.acosh=function(){return this.throwIfDisposed(),Kf(this)};Z().prototype.add=function(e){return this.throwIfDisposed(),se(this,e)};Z().prototype.all=function(e,t){return this.throwIfDisposed(),Ad(this,e,t)};Z().prototype.any=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)};Z().prototype.argMax=function(e){return this.throwIfDisposed(),Bu(this,e)};Z().prototype.argMin=function(e){return this.throwIfDisposed(),Zf(this,e)};Z().prototype.asScalar=function(){return this.throwIfDisposed(),M(this.size===1,()=>"The array must have only 1 element."),H(this,[])};Z().prototype.asType=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.as1D=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.as2D=function(e,t){return this.throwIfDisposed(),H(this,[e,t])};Z().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),H(this,[e,t,n])};Z().prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),H(this,[e,t,n,r])};Z().prototype.as5D=function(e,t,n,r,a){return this.throwIfDisposed(),H(this,[e,t,n,r,a])};Z().prototype.asin=function(){return this.throwIfDisposed(),Yf(this)};Z().prototype.asinh=function(){return this.throwIfDisposed(),Jf(this)};Z().prototype.atan=function(){return this.throwIfDisposed(),Qf(this)};Z().prototype.atan2=function(e){return this.throwIfDisposed(),em(this,e)};Z().prototype.atanh=function(){return this.throwIfDisposed(),tm(this)};Z().prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),ju(this,e,t,n,r)};Z().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Uu(this,e,t)};Z().prototype.batchNorm=function(e,t,n,r,a){return this.throwIfDisposed(),hi(this,e,t,n,r,a)};Z().prototype.broadcastTo=function(e){return this.throwIfDisposed(),hl(this,e)};Z().prototype.cast=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.ceil=function(){return this.throwIfDisposed(),sm(this)};Z().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),vn(this,e,t)};Z().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Le&&(e=[e]),ot([this,...e],t)};Z().prototype.conv1d=function(e,t,n,r,a,s){return this.throwIfDisposed(),gd(this,e,t,n,r,a,s)};Z().prototype.conv2dTranspose=function(e,t,n,r,a){return this.throwIfDisposed(),xd(this,e,t,n,r,a)};Z().prototype.conv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),sa(this,e,t,n,r,a,s)};Z().prototype.cos=function(){return this.throwIfDisposed(),Hu(this)};Z().prototype.cosh=function(){return this.throwIfDisposed(),wd(this)};Z().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),bd(this,e,t,n)};Z().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),lm(this,e,t)};Z().prototype.depthwiseConv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),pl(this,e,t,n,r,a,s)};Z().prototype.dilation2d=function(e,t,n,r,a){return this.throwIfDisposed(),um(this,e,t,n,r,a)};Z().prototype.divNoNan=function(e){return this.throwIfDisposed(),cm(this,e)};Z().prototype.div=function(e){return this.throwIfDisposed(),ge(this,e)};Z().prototype.dot=function(e){return this.throwIfDisposed(),Fw(this,e)};Z().prototype.elu=function(){return this.throwIfDisposed(),fl(this)};Z().prototype.equal=function(e){return this.throwIfDisposed(),$a(this,e)};Z().prototype.erf=function(){return this.throwIfDisposed(),hm(this)};Z().prototype.exp=function(){return this.throwIfDisposed(),qn(this)};Z().prototype.expandDims=function(e){return this.throwIfDisposed(),on(this,e)};Z().prototype.expm1=function(){return this.throwIfDisposed(),dm(this)};Z().prototype.fft=function(){return this.throwIfDisposed(),tc(this)};Z().prototype.flatten=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.floor=function(){return this.throwIfDisposed(),ml(this)};Z().prototype.floorDiv=function(e){return this.throwIfDisposed(),fd(this,e)};Z().prototype.gather=function(e,t){return this.throwIfDisposed(),di(this,e,t)};Z().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Oa(this,e)};Z().prototype.greater=function(e){return this.throwIfDisposed(),or(this,e)};Z().prototype.ifft=function(){return this.throwIfDisposed(),xl(this)};Z().prototype.irfft=function(){return this.throwIfDisposed(),Pd(this)};Z().prototype.isFinite=function(){return this.throwIfDisposed(),Dw(this)};Z().prototype.isInf=function(){return this.throwIfDisposed(),Ow(this)};Z().prototype.isNaN=function(){return this.throwIfDisposed(),fm(this)};Z().prototype.leakyRelu=function(e){return this.throwIfDisposed(),qu(this,e)};Z().prototype.lessEqual=function(e){return this.throwIfDisposed(),pi(this,e)};Z().prototype.less=function(e){return this.throwIfDisposed(),vd(this,e)};Z().prototype.localResponseNormalization=function(e,t,n,r){return this.throwIfDisposed(),mm(this,e,t,n,r)};Z().prototype.logSigmoid=function(){return this.throwIfDisposed(),Lw(this)};Z().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Sd(this,e)};Z().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),gm(this,e,t)};Z().prototype.log=function(){return this.throwIfDisposed(),Mn(this)};Z().prototype.log1p=function(){return this.throwIfDisposed(),kd(this)};Z().prototype.logicalAnd=function(e){return this.throwIfDisposed(),lr(this,e)};Z().prototype.logicalNot=function(){return this.throwIfDisposed(),Xu(this)};Z().prototype.logicalOr=function(e){return this.throwIfDisposed(),Nd(this,e)};Z().prototype.logicalXor=function(e){return this.throwIfDisposed(),jw(this,e)};Z().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Be(this,e,t,n)};Z().prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),Ku(this,e,t,n,r)};Z().prototype.max=function(e,t){return this.throwIfDisposed(),Xn(this,e,t)};Z().prototype.maximum=function(e){return this.throwIfDisposed(),Pr(this,e)};Z().prototype.mean=function(e,t){return this.throwIfDisposed(),vt(this,e,t)};Z().prototype.min=function(e,t){return this.throwIfDisposed(),Al(this,e,t)};Z().prototype.minimum=function(e){return this.throwIfDisposed(),yl(this,e)};Z().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),wm(this,e,t)};Z().prototype.mod=function(e){return this.throwIfDisposed(),bm(this,e)};Z().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};Z().prototype.neg=function(){return this.throwIfDisposed(),_t(this)};Z().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Vd(this,e,t,n)};Z().prototype.notEqual=function(e){return this.throwIfDisposed(),Ai(this,e)};Z().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),ol(this,e,t,n)};Z().prototype.onesLike=function(){return this.throwIfDisposed(),$n(this)};Z().prototype.pad=function(e,t){return this.throwIfDisposed(),ia(this,e,t)};Z().prototype.pool=function(e,t,n,r,a){return this.throwIfDisposed(),Gw(this,e,t,n,r,a)};Z().prototype.pow=function(e){return this.throwIfDisposed(),oa(this,e)};Z().prototype.prelu=function(e){return this.throwIfDisposed(),Yu(this,e)};Z().prototype.prod=function(e,t){return this.throwIfDisposed(),Ed(this,e,t)};Z().prototype.reciprocal=function(){return this.throwIfDisposed(),km(this)};Z().prototype.relu=function(){return this.throwIfDisposed(),Lr(this)};Z().prototype.relu6=function(){return this.throwIfDisposed(),Rd(this)};Z().prototype.reshapeAs=function(e){return this.throwIfDisposed(),H(this,e.shape)};Z().prototype.reshape=function(e){return this.throwIfDisposed(),H(this,e)};Z().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),cb(this,e,t,n)};Z().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),hb(this,e,t,n)};Z().prototype.reverse=function(e){return this.throwIfDisposed(),Dn(this,e)};Z().prototype.rfft=function(){return this.throwIfDisposed(),nc(this)};Z().prototype.round=function(){return this.throwIfDisposed(),Im(this)};Z().prototype.rsqrt=function(){return this.throwIfDisposed(),Md(this)};Z().prototype.selu=function(){return this.throwIfDisposed(),Fd(this)};Z().prototype.separableConv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),Sm(this,e,t,n,r,a,s)};Z().prototype.sigmoid=function(){return this.throwIfDisposed(),_n(this)};Z().prototype.sign=function(){return this.throwIfDisposed(),Nm(this)};Z().prototype.sin=function(){return this.throwIfDisposed(),$d(this)};Z().prototype.sinh=function(){return this.throwIfDisposed(),Dd(this)};Z().prototype.slice=function(e,t){return this.throwIfDisposed(),Re(this,e,t)};Z().prototype.softmax=function(e){return this.throwIfDisposed(),ec(this,e)};Z().prototype.softplus=function(){return this.throwIfDisposed(),fi(this)};Z().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Zu(this,e,t)};Z().prototype.split=function(e,t){return this.throwIfDisposed(),ln(this,e,t)};Z().prototype.sqrt=function(){return this.throwIfDisposed(),Jt(this)};Z().prototype.square=function(){return this.throwIfDisposed(),st(this)};Z().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Ld(this,e)};Z().prototype.squeeze=function(e){return this.throwIfDisposed(),za(this,e)};Z().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Le?[this,e]:[this,...e];return On(n,t)};Z().prototype.step=function(e){return this.throwIfDisposed(),wl(this,e)};Z().prototype.stridedSlice=function(e,t,n,r,a,s,i,o){return this.throwIfDisposed(),Em(this,e,t,n,r,a,s,i,o)};Z().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};Z().prototype.sum=function(e,t){return this.throwIfDisposed(),Ne(this,e,t)};Z().prototype.tan=function(){return this.throwIfDisposed(),Cm(this)};Z().prototype.tanh=function(){return this.throwIfDisposed(),ci(this)};Z().prototype.tile=function(e){return this.throwIfDisposed(),Da(this,e)};Z().prototype.toBool=function(){return this.throwIfDisposed(),Ae(this,"bool")};Z().prototype.toFloat=function(){return this.throwIfDisposed(),Ae(this,"float32")};Z().prototype.toInt=function(){return this.throwIfDisposed(),Ae(this,"int32")};Z().prototype.topk=function(e,t){return this.throwIfDisposed(),Rm(this,e,t)};Z().prototype.transpose=function(e){return this.throwIfDisposed(),Ze(this,e)};Z().prototype.unique=function(e){return this.throwIfDisposed(),Bd(this,e)};Z().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Mm(this,e,t)};Z().prototype.unstack=function(e){return this.throwIfDisposed(),ur(this,e)};Z().prototype.where=function(e,t){return this.throwIfDisposed(),kn(e,this,t)};Z().prototype.zerosLike=function(){return this.throwIfDisposed(),Ue(this)};var lv={kernelName:eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,wl(Ae(n,"float32"),-1))}}},EJ={kernelName:to,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=st(Ae(n,"float32")),a=Jt(ye(ke(1),r));return _t(ge(e,a))}}}},CJ={kernelName:no,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=Jt(ye(st(Ae(n,"float32")),1));return ge(e,r)}}}},RJ={kernelName:Ia,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=e,i=Ot(n.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,n.shape)},b:()=>{let s=e,i=Ot(r.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,r.shape)}}}},MJ={kernelName:is,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((r,a)=>{n[a]=()=>e.clone()}),n}},FJ={kernelName:os,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},$J={kernelName:pu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},DJ={kernelName:so,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Jt(ye(ke(1),st(Ae(n,"float32")))))}}},OJ={kernelName:io,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=Jt(se(ke(1),st(Ae(n,"float32"))));return ge(e,r)}}}},zJ={kernelName:uo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=se(st(n),st(r)),i=B(e,ge(r,s)),o=Ot(n.shape,a);return o.length>0&&(i=Ne(i,o)),H(i,n.shape)},b:()=>{let s=se(st(n),st(r)),i=_t(B(e,ge(n,s))),o=Ot(r.shape,a);return o.length>0&&(i=Ne(i,o)),H(i,r.shape)}}}},PJ={kernelName:oo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(st(Ae(n,"float32")),1))}}},LJ={kernelName:lo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,ye(ke(1),st(Ae(n,"float32"))))}}};function WJ(e,t,n,r,a,s){let i=R(e,"dy","avgPool3dGrad"),o=R(t,"input","avgPool3dGrad"),l=i,c=o,u=!1;o.rank===4&&(u=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),c=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),M(l.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),M(c.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`),s!=null&&M(Bt(a),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${a}.`);let h={dy:l,input:c},d={filterSize:n,strides:r,pad:a,dimRoundingMode:s},p=$.runKernel(Nh,h,d);return u?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var BJ=D({avgPool3dGrad_:WJ}),VJ={kernelName:fu,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{filterSize:a,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>BJ(e,r,a,s,i,o)}}};function jJ(e,t,n,r,a){let s=R(e,"dy","avgPoolGrad"),i=R(t,"input","avgPoolGrad");M(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,l=s,c=!1;i.rank===3&&(c=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),M(l.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),M(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let u={dy:l,input:o},h={filterSize:n,strides:r,pad:a},d=$.runKernel(Sh,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var UJ=D({avgPoolGrad_:jJ}),HJ={kernelName:ls,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{filterSize:a,strides:s,pad:i}=n;return{x:()=>UJ(e,r,a,s,i)}}},GJ={kernelName:us,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[r,a]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>Be(e,a,!1,!0),b:()=>Be(r,e,!0,!1)}:!s&&i?{a:()=>Be(e,a,!1,!1),b:()=>Be(e,r,!0,!1)}:s&&!i?{a:()=>Be(a,e,!1,!0),b:()=>Be(r,e,!1,!1)}:{a:()=>Be(a,e,!0,!0),b:()=>Be(e,r,!0,!0)}}},qJ={kernelName:mu,gradFunc:(e,t,n)=>{let{blockShape:r,crops:a}=n;return{x:()=>Zu(e,r,a)}}},XJ={kernelName:Sx,gradFunc:(e,t,n)=>{let r=n,a=r.inputShape,s=r.shape,i=Array.from(s);for(let l=a.length-1;l>=0;l--)if(a[l]===s[l])i[l]=1;else if(a[l]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${s}].`);let o=[];for(let l=0;l1&&o.push(l);return{x:()=>Ne(e,o,!0)}}},KJ={kernelName:cs,gradFunc:e=>({x:()=>e.clone()})},ZJ={kernelName:hs,gradFunc:e=>({x:()=>Ue(e)})},YJ={kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{clipValueMin:a,clipValueMax:s}=n;return{x:()=>kn(lr(Oa(r,a),pi(r,s)),e,Ue(e))}}},JJ={kernelName:Au,inputsToSave:["x"],gradFunc:lv.gradFunc},QJ={kernelName:co,saveAllInputs:!0,gradFunc:(e,t,n)=>{let r=t.map(o=>o.shape),{axis:a}=n,s=sr(a,t[0].shape)[0],i=r.map(o=>o[s]);return ln(e,i,s).map(o=>()=>o)}},eQ={kernelName:ds,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,{dilations:s,strides:i,pad:o,dataFormat:l}=n;return M(Fa(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>im(r.shape,e,a,i,o,l),filter:()=>Om(r,e,a.shape,i,o,l)}}},tQ={kernelName:ps,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>sa(e,a,s,i,o,1,l),filter:()=>Om(e,r,a.shape,s,i,o,l)}}};function nQ(e,t,n,r,a){let s=e;e.rank===4&&(s=H(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),M(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),M(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),M(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),M(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),M(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},l={strides:r,pad:a,filterShape:n};return $.runKernel(Rh,o,l)}var rQ=D({conv3DBackpropFilter_:nQ}),aQ={kernelName:yu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:r,strides:a,pad:s}=n;M(Fa(r),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${r}'`);let[i,o]=t;return{x:()=>Cw(i.shape,e,o,a,s),filter:()=>rQ(i,e,o.shape,a,s)}}},sQ={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(_t($d(Ae(n,"float32"))),e)}}},iQ={kernelName:ho,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Dd(Ae(n,"float32")),e)}}},oQ={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{axis:a,exclusive:s,reverse:i}=n;return{x:()=>{let o=Vw([a],r.rank),l=bd(e,a,s,!i);return o!=null&&(l=Ze(l,o)),l}}}},lQ={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:r,strides:a,pad:s,dimRoundingMode:i}=n,o=r==null?[1,1]:r;M(Fa(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[l,c]=t;return M(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),M(c.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`),M(l.shape[3]===c.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),M(Or(a,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${o}'.`),i!=null&&M(Bt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>rb(l.shape,e,c,a,s,r,i),filter:()=>nb(l,e,c.shape,a,s,r,i)}}},uQ={kernelName:gu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,s={x:r,filter:a,dy:e},i={x:r,filter:a,dy:e};return{x:()=>$.runKernel(zh,s,n),filter:()=>$.runKernel(Ph,i,n)}}},cQ={kernelName:mo,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,r={dy:e,y:n};return{x:()=>$.runKernel(Wh,r)}}},hQ={kernelName:Ao,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,r=B(qn(_t(st(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,r)}}},dQ={kernelName:gs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},pQ={kernelName:go,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>H(e,n.shape)}}},fQ={kernelName:xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,qn(n))}}},mQ={kernelName:xs,gradFunc:e=>({x:()=>Ue(e)})},AQ={kernelName:ws,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=ge(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);i.length>0&&(s=H(Ne(s,i),r.shape));let o=st(r);return _t(ge(s,Ae(o,"float32")))}}}},yQ={kernelName:bs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:r}=n,[a,s,i,o]=t,l=o==null?ke(1):o,c=Ot(s.shape,a.shape),u=[];if(s.rank===1){for(let f=0;fs.rank===1?H(B(B(e,Da(H(p,[1,1,1,s.shape[0]]),u)),l),a.shape):H(B(B(e,p),l),a.shape),mean:()=>{let f=B(B(p,ke(-1)),d);return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)},variance:()=>{let f=B(B(m,h),d);return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)},scale:()=>{let f=B(h,p),A=B(e,f);return s.rank===1&&(A=Ne(A,c)),H(A,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)}}}},gQ={kernelName:bo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[r,a]=t,{axis:s}=n,i=sr(s,r.shape)[0];return{x:()=>{let o=r.shape,l=a.size,c=o.slice(0,i),u=c.length,h=o.slice(s,o.length).slice(1),d=h.length,p=uv(0,u),m=uv(u+1,u+1+d),f=cv([c,[l],h]),A=H(e,f),y=H(a,[l]),g=cv([[u],p,m]),x=Ze(A,g),v=Mm(x,y,r.shape[i]),w=ym(g);return v=Ze(v,w),v},indices:()=>a}}};function uv(e,t){let n=[];for(let r=e;r{let[n,r]=t;return{a:()=>Ue(n),b:()=>Ue(r)}}},wQ={kernelName:vs,gradFunc:e=>({x:()=>Ae(e,"float32")})},bQ={kernelName:ko,gradFunc:e=>({x:()=>Ue(e)})},_Q={kernelName:Io,gradFunc:e=>({x:()=>Ue(e)})},vQ={kernelName:So,gradFunc:e=>({x:()=>Ue(e)})},kQ={kernelName:ks,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{alpha:a}=n,s=or(r,0);return{x:()=>kn(s,e,B(e,a))}}},IQ={kernelName:Eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(n,1))}}},SQ={kernelName:Is,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Ae(n,"float32"))}}},NQ={kernelName:Nx,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r]=t,{axis:a}=n;return{logits:()=>{let s=!0,i=qn(r);return ye(e,B(Ne(e,a,s),i))}}}};function TQ(e,t,n,r=5,a=1,s=1,i=.5){let o={x:e,y:t,dy:n},l={depthRadius:r,bias:a,alpha:s,beta:i};return $.runKernel(Hh,o,l)}var EQ=D({localResponseNormalizationBackprop_:TQ}),CQ={kernelName:_u,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;return{x:()=>EQ(r,a,e,s,i,o,l)}}};function hv(e,t,n,r){return t.rankB(e,Ae($a(n,t),e.dtype))}}var dv={kernelName:Ss,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let r=n,{reductionIndices:a}=r,s=t[0],i=t[1],o=sr(a,s.shape),l=hv(e,i,s,o);return{x:()=>l.x()}}},RQ={kernelName:Ns,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t;return{a:()=>B(e,Ae(Oa(n,r),"float32")),b:()=>B(e,Ae(vd(n,r),"float32"))}}};function MQ(e,t,n,r,a,s,i){let o=R(e,"dy","maxPool3dGrad"),l=R(t,"input","maxPool3dGrad"),c=R(n,"output","maxPool3dGrad"),u=o,h=l,d=c,p=!1;l.rank===4&&(p=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=H(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=H(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),M(u.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`),M(h.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`),M(d.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`),i!=null&&M(Bt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:u,input:h,output:d},f={filterSize:r,strides:a,pad:s,dimRoundingMode:i},A=$.runKernel(qh,m,f);return p?H(A,[A.shape[1],A.shape[2],A.shape[3],A.shape[4]]):A}var FQ=D({maxPool3dGrad_:MQ}),$Q={kernelName:vu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>FQ(e,r,a,s,i,o,l)}}};function DQ(e,t,n,r,a,s,i){let o=R(e,"dy","maxPoolGrad"),l=R(t,"input","maxPoolGrad"),c=R(n,"output","maxPoolGrad");M(l.rank===o.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`),M(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),M(l.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),i!=null&&M(Bt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let u={dy:o,input:l,output:c},h={filterSize:r,strides:a,pad:s,dimRoundingMode:i};return $.runKernel(Gh,u,h)}var OQ=D({maxPoolGrad_:DQ}),zQ={kernelName:Ts,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>OQ(e,r,a,s,i,o)}}},PQ={kernelName:Es,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{axis:a}=n,s=sr(a,r.shape),i=Bw(r.shape,s)[1],o=Nt(i);return{x:()=>{let l=r.shape.slice();s.forEach(u=>{l[u]=1});let c=H(e,l);return ge(B(c,Fn(r.shape,"float32")),o)}}}},LQ={kernelName:Cs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let r=n,{axis:a}=r,[s,i]=t,o=sr(a,s.shape),l=hv(e,i,s,o);return{x:()=>l.x()}}},WQ={kernelName:Rs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t;return{a:()=>B(e,Ae(pi(n,r),"float32")),b:()=>B(e,Ae(or(n,r),"float32"))}}},BQ={kernelName:Ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let r=t[0],{paddings:a}=n,s=a.map(i=>i[0]);return{x:()=>Re(e,s,r.shape)}}},VQ={kernelName:Ro,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=Ot(n.shape,a);return s.length>0?H(Ne(e,s),n.shape):e},b:()=>{let s=B(e,_t(ml(ge(n,r)))),i=Ot(r.shape,a);return i.length>0?H(Ne(s,i),r.shape):s}}}},jQ={kernelName:Fs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=B(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);return i.length>0?H(Ne(s,i),r.shape):s}}}},UQ={kernelName:Mo,gradFunc:e=>({x:()=>_t(e)})},HQ={kernelName:$s,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>Et(n.shape,"float32")}}},GQ={kernelName:zo,gradFunc:e=>({x:()=>Ue(e)})},qQ={kernelName:Po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:r}=n;return ur(e,r).map(a=>()=>a)}},pv={kernelName:Ds,inputsToSave:["x"],gradFunc:(e,t,n)=>{let r=t[0],{paddings:a}=n,s=a.map(i=>i[0]);return{x:()=>Re(e,s,r.shape)}}},XQ={kernelName:Os,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,r,a]=t,s=n,i=r,o=dt(s.shape,i.shape);return{a:()=>{let l=Ae(i,"float32"),c=B(e,B(l,oa(s,ye(l,ke(1))))),u=Ot(s.shape,o);return u.length>0&&(c=Ne(c,u)),H(c,s.shape)},b:()=>{let l=or(s,0),c=kn(l,Mn(s),Ue(s)),u=B(e,B(a,c)),h=Ot(i.shape,o);return h.length>0&&(u=Ne(u,h)),H(u,i.shape)}}}},KQ={kernelName:zs,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,r]=t,a=or(n,0);return{x:()=>kn(a,e,B(e,r)),alpha:()=>{let s=kn(a,Ue(e),B(e,n)),i=Ot(r.shape,e.shape);return i.length>0&&(s=Ne(s,i)),H(s,r.shape)}}}},ZQ={kernelName:ys,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=ge(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);i.length>0&&(s=H(Ne(s,i),r.shape));let o=st(r);return _t(ge(s,Ae(o,"float32")))}}}},YQ={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,_t(st(n)))}}},JQ={kernelName:Ws,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,r=B(pi(n,6),wl(n));return{x:()=>B(e,Ae(r,"float32"))}}},QQ={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Ae(wl(n),"float32"))}}},eee={kernelName:Bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>H(e,n.shape)}}},tee={kernelName:Ls,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[r]=t,a={dy:e,images:r};return{images:()=>$.runKernel(Jh,a,n)}}},nee={kernelName:Iu,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[r]=t,a={dy:e,images:r};return{images:()=>$.runKernel(Yh,a,n)}}},ree={kernelName:Bs,gradFunc:(e,t,n)=>{let{dims:r}=n,a=sr(r,e.shape);return{x:()=>Dn(e,a)}}},aee={kernelName:Vs,gradFunc:e=>({x:()=>Ue(e)})},see={kernelName:js,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>_t(ge(e,B(oa(n,1.5),2)))}}},iee={kernelName:jo,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>Ae(Ue(n),"float32"),t:()=>B(e,Ae(n,e.dtype)),e:()=>B(e,Ae(Xu(n),e.dtype))}}},oee={kernelName:Uo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=or(n,ke(0)),a=ke(mb),s=ke(Ab),i=B(e,s),o=B(B(e,a),qn(Ae(n,"float32")));return kn(r,i,o)}}}},lee={kernelName:Hs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(ke(1),n)))}}},uee={kernelName:qo,gradFunc:e=>({x:()=>Ue(e)})},cee={kernelName:Us,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Hu(Ae(n,"float32")),e)}}},hee={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(wd(Ae(n,"float32")),e)}}},dee={kernelName:Ho,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{begin:a,size:s}=n,i=r.shape,[o,l]=dw(r,a,s),c=[];for(let u=0;uia(e,c)}}},pee={kernelName:Xs,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r]=t,{dim:a}=n,s=!0,i=B(e,r);return{logits:()=>ye(i,B(Ne(i,[a],s),r))}}},fee={kernelName:Xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,_n(n))}}},fv={kernelName:Su,gradFunc:(e,t,n)=>{let{blockShape:r,paddings:a}=n;return{x:()=>Uu(e,r,a)}}},mv={kernelName:Ko,gradFunc:(e,t,n)=>{let{axis:r}=n;return{x:()=>ot(e,r)}}},mee={kernelName:Gs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,B(Jt(Ae(n,"float32")),2))}}},Aee={kernelName:Nu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(Ae(n,"float32"),2))}}},yee={kernelName:Ks,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=ke(2);return{a:()=>B(e,B(a,ye(n,r))),b:()=>B(e,B(a,ye(r,n)))}}},gee={kernelName:Ta,gradFunc:e=>({x:()=>Ue(e)})},xee={kernelName:Zs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=e,i=Ot(n.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,n.shape)},b:()=>{let s=e,i=Ot(r.shape,a);return i.length>0&&(s=Ne(s,i)),H(_t(s),r.shape)}}}},wee={kernelName:qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,a=r.shape.slice(),{axis:s}=n;sr(s,r.shape).forEach(l=>{a[l]=1});let i=H(e,a),o=B(i,Fn(r.shape,"float32"));return{x:()=>o}}},bee={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,st(Hu(n)))}}},_ee={kernelName:Js,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(ke(1),st(n)),e)}}},vee={kernelName:Na,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{reps:a}=n;return{x:()=>{let s=Ue(r);if(r.rank===1)for(let i=0;i{let r=n,{perm:a}=r,s=ym(a);return{x:()=>Ze(e,s)}}},Iee={kernelName:Jo,gradFunc:(e,t,n)=>{let r=n,{axis:a}=r;return{value:()=>On(e,a)}}},Nee={kernelName:Tu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>See(e,n)}}};function See(e,t){let n=Pr(t,Ue(t)),r=di(e,n),a=Oa(t,ke(0,"int32")),s=r.rank-a.rank;for(let o=0;o({x:()=>Ue(e)})},Eee=[lv,EJ,CJ,RJ,MJ,FJ,$J,DJ,OJ,zJ,PJ,LJ,VJ,HJ,GJ,qJ,XJ,KJ,ZJ,YJ,JJ,QJ,tQ,eQ,aQ,sQ,iQ,oQ,lQ,uQ,ZQ,cQ,hQ,dQ,pQ,fQ,AQ,mQ,yQ,gQ,xQ,wQ,bQ,_Q,vQ,kQ,IQ,SQ,NQ,CQ,dv,dv,RQ,$Q,zQ,PQ,LQ,WQ,BQ,VQ,jQ,UQ,HQ,GQ,qQ,pv,pv,XQ,KQ,YQ,JQ,QQ,eee,tee,nee,ree,aee,see,iee,oee,lee,uee,cee,hee,dee,pee,fee,fv,fv,mv,mv,mee,yee,Aee,gee,xee,wee,bee,_ee,vee,kee,Iee,Nee,Tee];for(let e of Eee)Tx(e);var Av={};Me(Av,{maxNorm:()=>Cee,minMaxNorm:()=>Fee,nonNeg:()=>Mee,unitNorm:()=>Ree});var SA;function zt(){return SA==null&&(SA=xw().epsilon()),SA}function br(){return"channelsLast"}var ha=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,ha.prototype)}},_r=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,_r.prototype)}},W=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,W.prototype)}},De=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,De.prototype)}},yv=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,yv.prototype)}};function Ni(e,t){if(Array.isArray(e)){let n=[];for(let r=0;rn.toUpperCase())}var cr={};function NA(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function TA(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>TA(t));else{let t=Object.keys(e);for(let n of t){let r=e[n];r!=null&&typeof r=="object"&&(!Array.isArray(r)&&r.type==="ndarray"&&typeof r.value=="number"?e[n]=r.value:TA(r))}}}function _c(e,t={},n={},r="object",a=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in cr)i=cr[s];else if(i=t[s],i==null)throw new W(`Unknown ${r}: ${e}. This may be due to one of the following reasons: -1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. -2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}else{let s=e;if(s.className==null||s.config==null)throw new W(`${r}: Improper config format: ${JSON.stringify(s)}. -'className' and 'config' must set.`);let i=s.className,o,l;if(i in n?[o,l]=n[i]:i in cr?[o,l]=cr.className:i in t&&([o,l]=t[i]),o==null)throw new W(`Unknown ${r}: ${i}. This may be due to one of the following reasons: -1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. -2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(l!=null){let c={};for(let p of Object.keys(cr))c[p]=cr[p];for(let p of Object.keys(n))c[p]=n[p];let u=s.config;u.customObjects=c;let h=Object.assign({},cr);for(let p of Object.keys(n))cr[p]=n[p];TA(s.config);let d=l(o,s.config,n,a);return cr=Object.assign({},h),d}else{let c=Object.assign({},cr);for(let h of Object.keys(n))cr[h]=n[h];let u=new o(s.config);return cr=Object.assign({},c),u}}}function $ee(e,t){return et?1:0}function Ep(e,t){return-1*$ee(e,t)}function ja(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function Dee(e){if(e==null)throw new W(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Ei(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new W(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function EA(e,t,n=0,r=Infinity){return jr(n>=0),jr(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(a=>typeof a===t)}function Ut(e,t){Array.isArray(e)?(_.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,r)=>Ut(n,`element ${r+1} of ${t}`))):_.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${xv(e)}.`)}function xv(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>xv(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function Oee(e,t){let n=_.now(),r;return(...a)=>{let s=_.now();return s-nJt(Ne(B(e,e),t,!0)))}var vc=class extends re.Serializable{getConfig(){return{}}},RA=class extends vc{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=CA(e,this.axis),n=vn(t,0,this.maxValue);return B(e,ge(n,se(zt(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};RA.className="MaxNorm";re.registerClass(RA);var MA=class extends vc{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>ge(e,se(zt(),CA(e,this.axis))))}getConfig(){return{axis:this.axis}}};MA.className="UnitNorm";re.registerClass(MA);var FA=class extends vc{apply(e){return Lr(e)}};FA.className="NonNeg";re.registerClass(FA);var $A=class extends vc{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=CA(e,this.axis),n=se(B(this.rate,vn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,ge(n,se(zt(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};$A.className="MinMaxNorm";re.registerClass($A);var bv={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Pt(e){return NA(e)}function _v(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"constraint")}function Lt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in bv?bv[e]:e,config:{}};return _v(t)}else return e instanceof vc?e:_v(e)}function Cee(e){return new RA(e)}function Ree(e){return new MA(e)}function Mee(){return new FA}function Fee(e){return new $A(e)}var vv={};Me(vv,{constant:()=>Lee,glorotNormal:()=>Gee,glorotUniform:()=>Hee,heNormal:()=>qee,heUniform:()=>Xee,identity:()=>jee,leCunNormal:()=>Kee,leCunUniform:()=>Zee,ones:()=>Pee,orthogonal:()=>Yee,randomNormal:()=>Bee,randomUniform:()=>Wee,truncatedNormal:()=>Vee,varianceScaling:()=>Uee,zeros:()=>zee});var Jee=["channelsFirst","channelsLast"],Qee=["nearest","bilinear"],ete=["valid","same","causal"],tte=["max","avg"],nte=["sum","mul","concat","ave"],zl=new Map;function Tt(e){Ei(Jee,"DataFormat",e)}function rte(e){Ei(Qee,"InterpolationFormat",e)}function Qn(e){Ei(ete,"PaddingMode",e)}function kv(e){Ei(tte,"PoolMode",e)}var kc=[],Iv="/";function Ci(e,t){kc.push(e);try{let n=t();return kc.pop(),n}catch(n){throw kc.pop(),n}}function ate(){return kc.length===0?"":kc.join(Iv)+Iv}function Nv(e){if(!Sv(e))throw new Error("Not a valid tensor name: '"+e+"'");return ate()+e}function Tv(e){if(!Sv(e))throw new Error("Not a valid tensor name: '"+e+"'");zl.has(e)||zl.set(e,0);let t=zl.get(e);if(zl.set(e,zl.get(e)+1),t>0){let n=`${e}_${t}`;return zl.set(n,1),n}else return e}var ste=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Sv(e){return!!e.match(ste)}function ite(e){return e===parseInt(e.toString(),10)}function Ua(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let r=1;for(let a=t;a{if(e.shape.length!==2)throw new W(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Sc(e,1);return DA(n,[1,t,1])})}function lte(e){let t=[Ua(e.shape)];return e.reshape(t)}function ute(e){if(e.rank<=1)throw new W(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],Ua(e.shape,1)];return e.reshape(t)}function Ri(e,t,n){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:return Tm(e,[t,0],[n,e.shape[1]]);case 3:return zd(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Qu(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Re(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Re(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new W(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function OA(e,t,n){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:return Tm(e,[0,t],[e.shape[0],n]);case 3:return zd(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Qu(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function Cp(e,t,n,r){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:switch(r){case 1:return Ri(e,t,n);case 2:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}case 3:switch(r){case 1:return Ri(e,t,n);case 2:return zd(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}case 4:switch(r){case 1:return Ri(e,t,n);case 2:return Qu(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Qu(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function zA(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),ot(e,t)}function Cv(e,t){switch(e.rank){case 1:return Nw([e,t]);case 2:return dl([e,t],0);case 3:return Tw([e,t],0);case 4:return Ew([e,t],0);default:throw new W(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function DA(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new W(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Da(e,t)}function Rp(e,t=0,n=1,r,a){return qw(e,t,n,r,a)}function Ur(e,t,n,r){if(e.rank<2||t.rank<2)throw new De(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let a=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(a!==s)throw new De(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let a=!1,s=!1;return Pa.matMul({a:e,b:t,transposeA:a,transposeB:s,bias:r?PA(e.rank,r,br()):null,activation:n})}else{let a=e.shape.slice(),s=a.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),l=i.pop(),c=[...i,o],u=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(u).reshape([l,-1]);let h=[...a,...c],d=!1,p=!1;return Pa.matMul({a:e,b:t,transposeA:d,transposeB:p,bias:r?PA(e.rank,r,br()):null,activation:n}).reshape(h)}}function Rv(e,t,n){return L(()=>(Array.isArray(t)?t=nn(t,"int32"):t=t.toInt(),di(e,t,n)))}function Nc(e){return B(e,e)}function PA(e,t,n){let r=t.shape;if(t.rank!==1&&t.rank!==e)throw new W(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1,1,1]):t.reshape([1,r[3],r[0],r[1],r[2]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,1,1,r[0]]):t.reshape([1].concat(r))}else if(e===4){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1,1]):t.reshape([1,r[2],r[0],r[1]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,1,r[0]]):t.reshape([1].concat(r))}else if(e===3){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1]):t.reshape([1,r[1],r[0]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,r[0]]):t.reshape([1].concat(r))}else if(e<3)return t;throw new W(`Unsupported input rank by biasAdd: ${t.rank}`)}function kr(e,t,n){return L(()=>(n==null&&(n=br()),Tt(n),e.add(PA(e.rank,t,n))))}function cte(e,t=1){if(t!==1)throw new De(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return fl(e)}function hte(e){return L(()=>ge(e,Dt(e).add(1)))}function Mv(e,t,n,r){return L(()=>eb(e,t,n,r))}function dte(e){return L(()=>{let t=se(.5,B(.2,e));return vn(t,0,1)})}function Tc(e,t,n=!1){return n?e():t()}var pte=["fanIn","fanOut","fanAvg"],fte=["normal","uniform","truncatedNormal"];function mte(e){Ei(pte,"FanMode",e)}function Ate(e){Ei(fte,"Distribution",e)}var hr=class extends re.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},LA=class extends hr{apply(e,t){return Et(e,t)}};LA.className="Zeros";re.registerClass(LA);var Mp=class extends hr{apply(e,t){return Fn(e,t)}};Mp.className="Ones";re.registerClass(Mp);var WA=class extends hr{constructor(e){super();if(typeof e!="object")throw new W(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new W(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return L(()=>B(ke(this.value),Fn(e,t)))}getConfig(){return{value:this.value}}};WA.className="Constant";re.registerClass(WA);var BA=class extends hr{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return gl(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};BA.className="RandomUniform";re.registerClass(BA);var VA=class extends hr{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`randomNormal does not support dType ${t}.`);return Rp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};VA.className="RandomNormal";re.registerClass(VA);var jA=class extends hr{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`truncatedNormal does not support dType ${t}.`);return Wd(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};jA.className="TruncatedNormal";re.registerClass(jA);var UA=class extends hr{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return L(()=>{if(e.length!==2||e[0]!==e[1])throw new W("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,pm(e[0]))})}getConfig(){return{gain:this.gain}}};UA.className="Identity";re.registerClass(UA);function yte(e,t="channelsLast"){let n,r;if(Tt(t),e.length===2)n=e[0],r=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let a=Ua(e,2);n=e[1]*a,r=e[0]*a}else if(t==="channelsLast"){let a=Ua(e,0,e.length-2);n=e[e.length-2]*a,r=e[e.length-1]*a}}else{let a=Ua(e);n=Math.sqrt(a),r=Math.sqrt(a)}return[n,r]}var Nn=class extends hr{constructor(e){super();if(e.scale<0)throw new W(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,mte(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,Ate(this.distribution),this.seed=e.seed}apply(e,t){let n=yte(e),r=n[0],a=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,r):this.mode==="fanOut"?s/=Math.max(1,a):s/=Math.max(1,(r+a)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`${this.getClassName()} does not support dType ${t}.`);return Wd(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return gl(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Nn.className="VarianceScaling";re.registerClass(Nn);var Fp=class extends Nn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Fp.className="GlorotUniform";re.registerClass(Fp);var $p=class extends Nn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};$p.className="GlorotNormal";re.registerClass($p);var Dp=class extends Nn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Dp.className="HeNormal";re.registerClass(Dp);var Op=class extends Nn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Op.className="HeUniform";re.registerClass(Op);var zp=class extends Nn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};zp.className="LeCunNormal";re.registerClass(zp);var Pp=class extends Nn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Pp.className="LeCunNormal";re.registerClass(Pp);var HA=class extends hr{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new De("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return L(()=>{if(e.length<2)throw new De("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,r=Rp(n,0,1,"float32"),a=pb.gramSchmidt(r);return e[0]>e[1]&&(a=a.transpose()),B(this.gain,a)})}getConfig(){return{gain:this.gain,seed:this.seed}}};HA.className="Orthogonal";re.registerClass(HA);var Fv={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function $v(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"initializer")}function kt(e){return NA(e)}function At(e){if(typeof e=="string"){let t=e in Fv?Fv[e]:e;if(t==="GlorotNormal")return new $p;if(t==="GlorotUniform")return new Fp;if(t==="HeNormal")return new Dp;if(t==="HeUniform")return new Op;if(t==="LeCunNormal")return new zp;if(t==="LeCunUniform")return new Pp;{let n={};return n.className=t,n.config={},$v(n)}}else return e instanceof hr?e:$v(e)}function zee(){return new LA}function Pee(){return new Mp}function Lee(e){return new WA(e)}function Wee(e){return new BA(e)}function Bee(e){return new VA(e)}function Vee(e){return new jA(e)}function jee(e){return new UA(e)}function Uee(e){return new Nn(e)}function Hee(e){return new Fp(e)}function Gee(e){return new $p(e)}function qee(e){return new Dp(e)}function Xee(e){return new Op(e)}function Kee(e){return new zp(e)}function Zee(e){return new Pp(e)}function Yee(e){return new HA(e)}var Dv={};Me(Dv,{Layer:()=>Ge,RNN:()=>Hr,RNNCell:()=>Ec,activation:()=>$te,add:()=>jte,alphaDropout:()=>Sne,average:()=>Ute,averagePooling1d:()=>GA,averagePooling2d:()=>qA,averagePooling3d:()=>XA,avgPool1d:()=>Qte,avgPool2d:()=>tne,avgPool3d:()=>rne,avgPooling1d:()=>ene,avgPooling2d:()=>nne,avgPooling3d:()=>ane,batchNormalization:()=>Zte,bidirectional:()=>gne,concatenate:()=>Hte,conv1d:()=>Ite,conv2d:()=>Ste,conv2dTranspose:()=>Nte,conv3d:()=>Tte,conv3dTranspose:()=>Ete,convLstm2d:()=>fne,convLstm2dCell:()=>mne,cropping2D:()=>Rte,dense:()=>Dte,depthwiseConv2d:()=>Fte,dot:()=>Kte,dropout:()=>Ote,elu:()=>xte,embedding:()=>Vte,flatten:()=>Pte,gaussianDropout:()=>Ine,gaussianNoise:()=>kne,globalAveragePooling1d:()=>sne,globalAveragePooling2d:()=>ine,globalMaxPool1d:()=>wne,globalMaxPool2d:()=>bne,globalMaxPooling1d:()=>zv,globalMaxPooling2d:()=>Pv,gru:()=>lne,gruCell:()=>une,input:()=>Ov,inputLayer:()=>gte,layerNormalization:()=>Yte,leakyReLU:()=>bte,lstm:()=>cne,lstmCell:()=>hne,masking:()=>Nne,maxPool1d:()=>_ne,maxPool2d:()=>vne,maxPooling1d:()=>Lv,maxPooling2d:()=>Wv,maxPooling3d:()=>one,maximum:()=>Gte,minimum:()=>qte,multiply:()=>Xte,permute:()=>Bte,prelu:()=>_te,reLU:()=>wte,repeatVector:()=>Lte,reshape:()=>Wte,rnn:()=>Ane,separableConv2d:()=>Cte,simpleRNN:()=>dne,simpleRNNCell:()=>pne,softmax:()=>vte,spatialDropout1d:()=>zte,stackedRNNCells:()=>yne,thresholdedReLU:()=>kte,timeDistributed:()=>xne,upSampling2d:()=>Mte,zeroPadding2d:()=>Jte});var Tne=0;function Bv(){return Tne++}var Lp={};function Wp(e=""){return e in Lp||(Lp[e]=0),Lp[e]+=1,e+Lp[e].toString()}function KA(e){return Array.isArray(e)&&Array.isArray(e[0])}function Bp(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function ze(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new W(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function rt(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new W(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function Vp(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((r,a)=>r*a);return t}var Vv="Variable",jv=class{constructor(e,t="float32",n=Vv,r=!0,a=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=Bv(),n=n==null?Vv:n,this.originalName=Nv(n),this.name=Tv(this.originalName),this.trainable_=r,this.constraint=a,this.val=Kw(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Ene(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function Ene(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function ZA(e){return e.map(t=>t.read())}function YA(e){e.forEach(t=>{t[0].write(t[1])})}var Rt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Ir=class{constructor(e,t,n,r,a,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=r,this.callArgs=a,this.outputTensorIndex=i,this.id=Bv(),s!=null&&(this.originalName=Nv(s),this.name=Tv(this.originalName)),this.rank=t.length}},Cne=0,jp=class{constructor(e,t){this.callArgs=t,this.id=Cne++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},Rne=0,Ge=class extends re.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Rne++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=da(n)+"_"+Wp(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let a=null;e.batchSize!=null&&(a=e.batchSize),n=[a].concat(e.inputShape)}this.batchInputShape=n;let r=e.dtype;r==null&&(r=e.inputDType),r==null&&(r="float32"),this.dtype=r}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new _r(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new W(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return Sn(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return Sn(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new ha(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new ha(`Layer ${this.name} is not connected, no input to return.`);return Sn(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new ha(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new ha(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Sn(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=ft(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=ft(this.inputSpec);if(e.length!==t.length)throw new W(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;na.maxNDim)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${a.maxNDim}, found ndim=${s}`);if(a.minNDim!=null&&s=0?i[l]:i[i.length+l];if(c!=null&&[c,null].indexOf(u)===-1)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected axis ${l} of input shape to have value ${c} but got shape ${i}.`)}}if(a.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of ft(e))s.push(i.shape);this.build(Sn(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&a&&(this._refCount=1)}if(this.assertInputCompatibility(e),a){let s=this.call(e,t),i=ft(s),o=[];for(let l of i)n.indexOf(l)!==-1&&(l=l.clone()),o.push(l);if(s=Sn(o),this.activityRegularizer!=null)throw new De("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=Mne(e),i=this.computeOutputShape(s),o,l=Fne(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((c,u)=>new Ir(l,c,this,ft(e),t,this.name,u)):o=new Ir(l,i,this,ft(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new De("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,r)=>{n!=null&&e[r]!=null&&e[r]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new ha(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new ha(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new _r(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Vp(this.weights)}build(e){this.built=!0}getWeights(e=!1){return ZA(e?this.trainableWeights:this.weights)}setWeights(e){L(()=>{let t=this.weights;if(t.length!==e.length)throw new W(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],r=ZA(t);for(let a=0;aa.apply(l.read())),s==null&&(s=!0),s?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=ft(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,r,a,s,i=null){let o=ft(e);t=ft(t),n=ft(n),r=ft(r),a=Bp(a),s=Bp(s);let l=[],c=[],u=[];for(let h of o)l.push(h.sourceLayer),c.push(h.nodeIndex),u.push(h.tensorIndex);new jp({outboundLayer:this,inboundLayers:l,nodeIndices:c,tensorIndices:u,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:a,outputShapes:s},i);for(let h=0;he.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function Mne(e){e=ft(e);let t=[];for(let n of e)t.push(n.shape);return Sn(t)}function Fne(e){return"float32"}function Uv(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let r=t.inboundNodes[n];if(r.inboundLayers.length===0)return r.inputTensors;{let a=[];for(let s=0;s0){let a=await Promise.all(t);for(let s=0;sse(this.totals[r],B(a,n)));this.totals[r]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:L(()=>{let r=B(ge(1,this.seen),this.totals[n]);t[n]=r,this.totals[n].dispose(),Vt(t[n])}))}},Kv=class extends Wl{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let a in this.history){let s=this.history[a];for(let i=0;inew Zv(n,t))}var dr=class{constructor(){}static registerCallbackConstructor(e,t){_.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),dr.checkForDuplicate(t),dr.constructors[e]==null&&(dr.constructors[e]=[]),dr.constructors[e].push(t)}static checkForDuplicate(e){for(let t in dr.constructors)dr.constructors[+t].forEach(n=>{if(n===e)throw new W("Duplicate callback constructor.")})}static clear(){dr.constructors={}}static createCallbacks(e){let t=[];for(let n in dr.constructors){let r=+n;e>=r&&t.push(...dr.constructors[r])}return t.map(n=>new n)}};dr.constructors={};function Jv(e,t,n,r,a,s,i,o,l){let c=new Kv,u=[new Dne,...dr.createCallbacks(t)];e!=null&&u.push(...e),u.push(c);let h=new Xv(u);return h.setParams({epochs:n,initialEpoch:r,samples:a,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:c}}function Sr(e,t={},n=!1){return _c(e,re.SerializationMap.getMap().classNameMap,t,"layer",n)}function Up(e,t){return L(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Ne(Nc(e),t,!0),r=Gu(n.shape,zt()),a=Jt(Pr(n,r));return ge(e,a)})}function Mi(e,t){return L(()=>vt(Nc(ye(t,e)),-1))}function Hp(e,t){return L(()=>vt(Dt(ye(t,e)),-1))}function Bl(e,t){return L(()=>{let n=ye(e,t),r=vn(Dt(e),zt(),Number.MAX_VALUE),a=Dt(ge(n,r));return B(100,vt(a,-1))})}function One(e,t){return L(()=>{let n=vn(t,zt(),Number.MAX_VALUE),r=Mn(se(1,n)),a=vn(e,zt(),Number.MAX_VALUE),s=Mn(se(1,a));return vt(Nc(ye(r,s)),-1)})}function zne(e,t){return L(()=>{let n=Pr(0,ye(1,B(e,t)));return vt(Nc(n),-1)})}function Pne(e,t){return L(()=>{let n=Pr(0,ye(1,B(e,t)));return vt(n,-1)})}function Lne(e,t){return L(()=>{let n=Ne(B(e,t),-1),r=Xn(B(ye(1,e),t),-1);return Pr(0,se(1,ye(r,n)))})}function Wne(e,t){return L(()=>{let n=Math.log(2),r=ye(t,e),a=ye(se(r,fi(B(-2,r))),n);return vt(a,-1)})}function Cc(e,t,n=!1){return L(()=>{if(n)t=ec(t);else{let r=Ne(t,t.shape.length-1,!0);t=ge(t,r)}return t=vn(t,zt(),1-zt()),_t(Ne(B(e.toFloat(),Mn(t)),t.shape.length-1))})}function Gp(e,t,n=!1){return L(()=>{let r=ml(lte(e)).toInt();t=vn(t,zt(),1-zt());let a=t.shape,s=ol(r,a[a.length-1]).reshape(a);return Cc(s,t,n)})}function Bne(e,t){if(!_.arraysEqual(e.shape,t.shape))throw new W(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return L(()=>{let n=t.relu(),r=t.abs().neg();return n.sub(t.mul(e)).add(r.exp().log1p())})}function qp(e,t){return L(()=>{let n;return n=vn(t,zt(),1-zt()),n=Mn(ge(n,ye(1,n))),vt(Bne(e,n),-1)})}function Vne(e,t){return L(()=>{let n=vn(e,zt(),1),r=vn(t,zt(),1);return Ne(B(e,Mn(ge(n,r))),-1)})}function jne(e,t){return L(()=>{let n=Mn(se(zt(),t));return vt(ye(t,B(e,n)),-1)})}function JA(e,t){return L(()=>{let n=Up(e,-1),r=Up(t,-1),a=B(n,r);return _t(Ne(a,-1))})}var Xp={meanSquaredError:Mi,meanAbsoluteError:Hp,meanAbsolutePercentageError:Bl,meanSquaredLogarithmicError:One,squaredHinge:zne,hinge:Pne,categoricalHinge:Lne,logcosh:Wne,categoricalCrossentropy:Cc,sparseCategoricalCrossentropy:Gp,binaryCrossentropy:qp,kullbackLeiblerDivergence:Vne,poisson:jne,cosineProximity:JA};function QA(e){if(typeof e=="string"){if(e in Xp)return Xp[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new W(t)}else return e}function ey(e,t){return L(()=>{let n=B(.5,$n(t)),r=Ic(or(t,n),e.dtype);return vt($a(e,r),-1)})}function ty(e,t){return L(()=>Ic($a(Bu(e,-1),Bu(t,-1)),"float32"))}function Qv(e,t){return L(()=>lr(e.equal(1),t.equal(1)).sum().cast("float32"))}function Une(e,t){return L(()=>lr(e.equal(1),t.equal(0)).sum().cast("float32"))}function Hne(e,t){return L(()=>lr(e.equal(0),t.equal(1)).sum().cast("float32"))}function e6(e,t){return L(()=>{let n=Qv(e,t),r=Hne(e,t),a=n.add(r);return kn(or(a,0),n.div(a),0).cast("float32")})}function Gne(e,t){return L(()=>{let n=Qv(e,t),r=Une(e,t),a=n.add(r);return kn(or(a,0),n.div(a),0).cast("float32")})}function t6(e,t){return qp(e,t)}function n6(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),$a(e,t).asType("float32")}var qne=Mi,Xne=Mi,Kne=Hp,Zne=Hp,Yne=Bl,Jne=Bl,ny=Cc,Qne=JA,r6=Gp,Kp={binaryAccuracy:ey,categoricalAccuracy:ty,precision:e6,categoricalCrossentropy:ny,sparseCategoricalCrossentropy:r6,mse:qne,MSE:Xne,mae:Kne,MAE:Zne,mape:Yne,MAPE:Jne,cosine:Qne};function ere(e){if(typeof e=="string"&&e in Kp)return Kp[e];if(typeof e!="string"&&e!=null)return e;throw new W(`Unknown metric ${e}`)}function Zp(e){if(jr(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(Xp))if(Xp[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(Kp))if(Kp[n]===e){t=n;break}return t!==void 0?t:e.name}}function tre(e){let t={Adagrad:()=>gi.adagrad(.01),Adadelta:()=>gi.adadelta(1,.95,zt()),Adam:()=>gi.adam(.001,.9,.999,zt()),Adamax:()=>gi.adamax(.002,.9,.999,zt(),0),RMSProp:()=>gi.rmsprop(.001,.9,0,zt()),SGD:()=>gi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new W(`Unknown Optimizer ${e}`)}var a6=1*1024*1024;function s6(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!ry(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let r=JSON.stringify(e);r.length>a6&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${r.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${a6}.`)}}function ry(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!ry(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!ry(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function ire(e,t,n,r=console.log){let a=rre(e),s=["Layer (type)","Output shape","Param #"];a?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(u=>Math.floor(t*u)));let i;if(!a){s.push("Receives inputs"),i=[];for(let u in e.nodesByDepth)i.push(...e.nodesByDepth[u])}r("_".repeat(t)),Yp(s,n,r),r("=".repeat(t));let o=e.layers;for(let u=0;u1||a.length===1&&a[0].inboundLayers.length>1){t=!1;break}r.push(...a)}if(t)for(let a of e.layers){let s=!1;for(let i of a.inboundNodes)if(r.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function Yp(e,t,n=console.log){let r="";for(let a=0;a0&&(r=r.slice(0,r.length-1)+" "),r+=e[a],r=r.slice(0,t[a]),r+=" ".repeat(t[a]-r.length);n(r)}function are(e,t,n){let r;try{r=JSON.stringify(e.outputShape)}catch(o){r="multiple"}let a=e.name,s=e.getClassName(),i=[`${a} (${s})`,r,e.countParams().toString()];Yp(i,t,n)}function sre(e,t,n,r){let a;try{a=JSON.stringify(e.outputShape)}catch(u){a="multiple"}let s=[];for(let u of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(u)===-1))for(let h=0;hm.name),l=[],c=t.names();for(let m of o)c.indexOf(m)!==-1?l.push(t.getValue(m)):l.push(null);r!=null&&(r.maxNumTensors=-Infinity,r.minNumTensors=Infinity);let u=o.join(",")+"|"+t.names().join(","),h,d;if(iy[u]==null){let m=lre(i,t);h=m.sorted,d=m.recipientCounts,iy[u]=h,o6[u]=d}h=iy[u],d={},a||Object.assign(d,o6[u]);let p=new Fi(t);for(let m=0;mr.maxNumTensors&&(r.maxNumTensors=C),C0,()=>"Expected at least one fetch, got none");let n=[],r={};if(e.length===1){let a=l6(e[0],t);n=a.sorted,r=a.recipientMap}else{let a=new Set;for(let s of e){let{sorted:i,recipientMap:o}=l6(s,t);for(let l of i)a.has(l.name)||(n.push(l),a.add(l.name));for(let l in o)r[l]==null&&(r[l]=new Set),o[l].forEach(c=>r[l].add(c))}}return{sorted:n,recipientCounts:cre(r)}}function cre(e){let t={};for(let n in e)t[n]=e[n].size;return t}function l6(e,t){let n=new Set,r=[],a={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let l=i[i.length-1]===s.length-1;if(o.inputs.length===0||l)s.pop(),r.push(o),n.add(o.name),l&&i.pop();else{i.push(s.length-1);for(let c of o.inputs)a[c.name]==null&&(a[c.name]=new Set),a[c.name].add(o.name),!n.has(c.name)&&s.push(c)}}return{sorted:r,recipientMap:a}}function ure(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let r=0;ry.name)}`);ja(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let g=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;this.outputLayers.push(g),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(v)}for(let y of this.inputs){let g=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;jr(x===0,"input layer has >1 nodes"),jr(v===0,"input layer has >1 tensors"),this.inputLayers.push(g),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(v)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},r={},a={},s={},i=[],o=(y,g,x,v,w,b)=>{(v==null||w==null||b==null)&&(v=y.sourceLayer,w=y.nodeIndex,b=y.tensorIndex);let k=v.inboundNodes[w];if(x.indexOf(k)!==-1)throw new _r(`The tensor ${y.name} at layer "${v.name}" is part of a cycle.`);if(g.indexOf(k)!==-1)return;this.containerNodes.add(Gr.nodeKey(v,w)),v.id in s||(s[v.id]=Object.keys(s).length),x.indexOf(k)===-1&&x.push(k);let N=k.inboundLayers.length;for(let C=0;C=0;)x.splice(x.indexOf(k),1);i.push(k)},l=[],c=[];for(let y of this.outputs)o(y,l,c);let u=i.slice().reverse();for(let y of u){n[y.id]=y,y.id in t||(t[y.id]=0);let g=t[y.id],x=r[y.outboundLayer.id]==null?0:r[y.outboundLayer.id];g=Math.max(g,x),r[y.outboundLayer.id]=g,a[y.outboundLayer.id]=y.outboundLayer,t[y.id]=g;for(let v=0;vparseInt(y,10)).sort(Ep);this.layers=[];for(let y of p){let g=d[y];g.sort((x,v)=>{let w=s[x.id],b=s[v.id];return wb?1:0});for(let x of g)x instanceof Gr&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=d,p=Object.keys(h).map(y=>parseInt(y,10)).sort(Ep);let m=this.inputs.slice(),f=[];for(let y of p)for(let g of h[y]){let x=g.outboundLayer;if(x!=null){for(let v of g.inputTensors)if(m.indexOf(v)===-1)throw new _r(`Graph disconnected: cannot obtain value for tensor ${v} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let v of g.outputTensors)m.push(v);f.push(x.name)}}this.nodesByDepth=h;let A=this.layers.map(y=>y.name);for(let y of A){let g=A.filter(x=>x===y).length;if(g!==1)throw new _r(`The name "${y}" is used ${g} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(A))}this.outboundNodes=[],this.inboundNodes=[],new jp({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new W("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},r=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new W(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,r++}let a=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)a.push([n[i],e[s]]);else if(t)throw new W(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new W(`${s.length} of ${r} weights are not set: ${s}`)}YA(a)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${sy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=ay(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return L(()=>{e=ft(e);let n=new Fi;for(let r=0;r{e=ft(e);let n;return t==null?n=Ni(null,e.length):n=ft(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=Bp(e);if(t.length!==this.inputLayers.length)throw new W(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(Ep);if(r.length>1)for(let i of r){let o=this.nodesByDepth[i];for(let l of o){let c=l.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(c.id)!==-1)continue;let u=[];for(let m=0;mparseInt(o,10)).sort(Ep);for(let o of r){let l=this.nodesByDepth[o];for(let c of l){let u=c.outboundLayer,h=c.inputTensors,d=c.outputTensors,p=new Array;for(let m of h)m.id in n&&p.push(n[m.id]);if(p.length===h.length){let m={},f,A,y,g;if(c.callArgs!=null&&(m=c.callArgs),p.length===1){let[x,v]=p[0];m.mask==null&&(m.mask=v),y=ft(u.call(x,m)),g=ft(u.computeMask(x,v)),f=[x],A=[v]}else f=p.map(x=>x[0]),A=p.map(x=>x[1]),m.mask==null&&(m.mask=A),y=ft(u.call(f,m)),g=ft(u.computeMask(f,A));if(u.activityRegularizer)throw new De("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply(Sn(y),g)}function l(f){let A=f.name,y=Sr(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(r),a[A]=y,f.inboundNodes.forEach(g=>{if(!(g instanceof Array))throw new W(`Corrupted configuration, expected array for nodeData: ${g}`);i(y,g)})}let c=t.name,u=t.layers;for(let f of u)l(f);for(;!Dee(s);)for(let f of u){let A=a[f.name];if(A.name in s){let y=s[A.name];delete s[A.name];for(let g of y)o(A,g)}}let h=[],d=[],p=t.inputLayers;for(let f of p){let A=f[0],y=f[1],g=f[2];jr(A in a);let x=a[A].inboundNodes[y].outputTensors;h.push(x[g])}let m=t.outputLayers;for(let f of m){let A=f[0],y=f[1],g=f[2];jr(A in a);let x=a[A].inboundNodes[y].outputTensors;d.push(x[g])}return new e({inputs:h,outputs:d,name:c})}get stateful(){if(this._stateful)throw new W("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){L(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function hre(e,t,n){let r=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(a=>null);if(r===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==r)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${r} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let a=[];return t.forEach(s=>{s in e?a.push(e[s]):a.push(null)}),a}else throw new Error(`The model has multiple (${r}) outputs, so ${n} must be either an array with ${r} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function u6(e,t){return hre(e,t,"classWeight")}async function c6(e,t,n,r){if(t!=null||r!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let a=L(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await a.data());Te(a);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),nn(i,"float32")}else return null}function dre(e,t){return B(e,t)}var pre=32;function d6(e,t){let n,r,a=t;n=a.xs,r=a.ys,_.assert(n!=null&&r!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=h6("input",e.inputNames,n),i=h6("output",e.outputNames,r),o=s[0].shape[0];_.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),_.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let l=0;l`Batch size mismatch: input ${e.inputNames[l]} has ${s[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let l=0;l`Batch size mismatch: output ${e.outputNames[l]} has ${i[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function h6(e,t,n){if(n instanceof Le)return[n];if(Array.isArray(n))return _.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let r=[];for(let a of t){if(n[a]==null)throw new W(`The feature data generated by the dataset lacks the required ${e} key '${a}'.`);r.push(n[a])}return r}}function fre(e){if(e.length===3)throw new De("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function Are(e,t,n){let r=n.batchesPerEpoch!=null;if(_.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),_.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),_.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),_.assert(!r||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),_.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let a=n.validationData!=null,s,i;if(a)if(p6(n.validationData))_.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let A=fre(n.validationData);s=A.xs,i=A.ys}let o=e.makeTrainFunction(),l=e.getDedupedMetricsNames(),c;a?c=l.slice().concat(l.map(A=>"val_"+A)):c=l.slice();let u=Yv(n.callbacks,n.yieldEvery),h=n.verbose==null?1:n.verbose,{callbackList:d,history:p}=Jv(u,h,n.epochs,null,null,mre(t,n),null,a,c);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(a){let v;p6(n.validationData)?v=ft(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):v=ft(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?pre:n.validationBatchSize,verbose:0}));for(let w=0;w0)throw new De("Verbose mode is not implemented yet.");_.assert(!r||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=yre(t)?t:await t.iterator(),o=0,l=0;for(;r?l{if(c.value){let{xs:u,ys:h}=d6(e,c.value),d=u.concat(h),p=L(()=>a(d));if(Te(d),l===0)for(let f=0;fse(s[f],B(m,A))),l>0&&Te(y)}Te(p),o+=m,++l}return s}),c.done){r&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let c=0;c0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function Fc(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(r=>Ri(r,t,n-t)):Ri(e,t,n-t)}function ly(e,t){return L(()=>e==null?null:Array.isArray(e)?e.map(n=>ly(n,t)):Rv(e,t.dtype==="int32"?t:t.toInt()))}function uy(e,t){let n=[],r=0,a=null;for(;r=e&&(a=e),n.push([r,a]),r=a;return n}async function xre(e,t,n,r,a,s,i,o,l,c,u,h,d,p,m){a==null&&(a=32),s==null&&(s=1),u==null&&(u=!0),d==null&&(d=0);let f=!1;if(l!=null&&c!=null&&(f=!0),m!=null&&(f=!0,p==null))throw new W("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let A=e.checkNumSamples(n,a,p,"steps_per_epoch"),y;A!=null&&(y=vr(0,A)),i==null&&(i=1);let{callbackList:g,history:x}=Jv(o,i,s,d,A,p,a,f,h);g.setModel(e),e.history=x,await g.onTrainBegin(),e.stopTraining_=!1;for(let v=d;v{let F=k[N][0],O=k[N][1],z=Ri(b,F,O-F);C.batch=N,C.size=O-F;let V=ly(n,z),j=t(V);for(let U=0;U0){if(m=!0,r.validationData.length===2)i=r.validationData[0],o=r.validationData[1];else throw r.validationData.length===3?new De("validationData including sample weights is not supported yet."):new W(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${r.validationData} is invalid.`);let b=!0,k=await e.standardizeUserData(i,o,null,null,b,h);l=k[0],c=k[1],f=l.concat(c)}else if(r.validationSplit!=null&&r.validationSplit>0&&r.validationSplit<1){m=!0;let b=Math.floor(a[0].shape[0]*(1-r.validationSplit)),k=a[0].shape[0];l=Fc(a,b,k),a=Fc(a,0,b),c=Fc(s,b,k),s=Fc(s,0,b),f=l.concat(c)}else r.validationSteps!=null&&(m=!0);let A=a.concat(s).concat(u);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),g=e.getDedupedMetricsNames(),x,v;m?(e.makeTestFunction(),x=e.testFunction,v=g.slice().concat(g.map(b=>"val_"+b))):(x=null,f=[],v=g.slice());let w=Yv(r.callbacks,r.yieldEvery);return await xre(e,y,A,g,h,r.epochs,r.verbose,w,x,f,r.shuffle,v,r.initialEpoch,null,null)}finally{e.isTraining=!1,$i(a,t),$i(s,n),$i(l,i),$i(c,o),u!=null&&Te(u)}}function f6(e){let t=[];e instanceof Le&&(e=[e]);for(let n=0;nn.push(a.id));else if(t!=null)for(let a in t){let s=t[a];n.push(s.id)}let r=[];if(e instanceof Le)n.indexOf(e.id)===-1&&r.push(e);else if(Array.isArray(e))e.forEach(a=>{n.indexOf(a.id)===-1&&r.push(a)});else if(e!=null)for(let a in e){let s=e[a];n.indexOf(s.id)===-1&&r.push(s)}r.forEach(a=>{a.isDisposed||a.dispose()})}function bre(e){return e instanceof Le}function cy(e){return Array.isArray(e)}function m6(e){return!bre(e)&&!cy(e)}function A6(e,t,n,r=!0,a=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(cy(e)&&e.length>0)i=!0;else if(m6(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new W(`Error when checking model ${a} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(m6(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new W(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(cy(e)){if(e=e,e.length!==t.length)throw new W(`Error when checking model ${a}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new W(`The model ${a} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=f6(s),n!=null)for(let i=0;i=0&&c!==u)throw new W(`Error when checking ${a}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function _re(e,t,n){let r=ja(e.map(s=>s.shape[0]));r.sort();let a=ja(t.map(s=>s.shape[0]));if(a.sort(),r.length>1)throw new W(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(a.length>1)throw new W(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(r.length>0&&a.length>0&&!_.arraysEqual(r,a))throw new W(`Input Tensors should have the same number of samples as target Tensors. Found ${r[0]} input sample(s) and ${a[0]} target sample(s).`)}function vre(e,t,n){let r=[Mi,qp,Cc];for(let a=0;a1)throw new W(`The model expects ${t.length} ${a} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(r=>n);{let r=[];for(let a of t){let s=n.hasOwnProperty(a)?n[a]:[];Array.isArray(s)||(s=[s]),r.push(s)}return r}}var Ire="layers-model",pa=class extends Gr{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new W("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");ire(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=tre(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof ua))throw new W("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new W(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(QA(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new W(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>QA(s))}else{let s=QA(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let r=kre(e.metrics,this.outputNames),a=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ci("metric",()=>{for(let s=0;s{let l="",c,u,h;for(let d of o){if(typeof d=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(d)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===qp?["accuracy","acc"].indexOf(d)!==-1?u=ey:["crossentropy","ce"].indexOf(d)!==-1&&(u=t6):this.lossFunctions[s]===Gp?["accuracy","acc"].indexOf(d)!==-1?u=n6:["crossentropy","ce"].indexOf(d)!==-1&&(u=r6):["accuracy","acc"].indexOf(d)!==-1?u=ty:["crossentropy","ce"].indexOf(d)!==-1&&(u=ny);let f;["accuracy","acc"].indexOf(d)!==-1?f="acc":["crossentropy","ce"].indexOf(d)!==-1&&(f="ce"),h=u,c=l+f}else h=ere(d),c=l+Zp(d);let p;Ci(c,()=>{p=h}),a(s,c,p)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let r=n.batchSize==null?32:n.batchSize;oy(r);let a=!0,s=this.standardizeUserDataXY(e,t,a,r);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,l=this.testLoop(o,i,r,n.verbose,n.steps);return Sn(l)}finally{$i(s[0],e),$i(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),gre(this,e,t)}checkNumSamples(e,t,n,r="steps"){let a;if(n!=null){if(a=null,t!=null)throw new W(`If ${r} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?a=e[0].shape[0]:a=e.shape[0];else throw new W(`Either the input data should have a defined shape, or ${r} shoud be specified.`);return a}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new W("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),r=n?t:[t],a=this.retrieveSymbolicTensors(r),s=new Fi;if(e instanceof Le&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new W(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let r=[];throw t.forEach((a,s)=>{a==null&&r.push(e[s])}),new W(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(r)}`)}return t}predictLoop(e,t=32,n=!1){return L(()=>{let r=this.checkNumSamples(e);if(n)throw new De("Verbose predictLoop() is not implemented yet.");let a=uy(r,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=a[i][0],l=a[i][1],c=Fc(e,o,l),u=[];if(Array.isArray(c))for(let d=0;ds[l].push(o));return Sn(s.map(i=>ot(i,0)))})}predict(e,t={}){let n=f6(e);y6(n,this.inputNames,this.feedInputShapes,!1);try{let r=t.batchSize==null?32:t.batchSize;return oy(r),this.predictLoop(n,r)}finally{$i(n,e)}}predictOnBatch(e){y6(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,r){if(this.optimizer_==null)throw new _r("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let a=[];for(let s=0;s0&&e[0].shape[0]%r!=0)throw new W(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${r}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,r,a=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,a,s);if(n!=null)throw new Error("sample weight is not supported yet.");let l=null;if(r!=null){let c=u6(r,this.outputNames);l=[];for(let u=0;u{let s=this.checkNumSamples(t,n,a,"steps"),i=[];if(r>0)throw new De("Verbose mode is not implemented yet.");if(a!=null)throw new De("steps mode in testLoop() is not implemented yet");{let o=uy(s,n),l=nn(vr(0,s));for(let c=0;c1&&(a+=`_${gv(e.slice(0,n),r)}`),t.push(a)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let c=[];for(let p=0;p1&&p{d=se(d,p)}),d},o=this.collectedTrainableWeights.map(c=>c.read()),l=!0;return[this.optimizer_.minimize(i,l,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>L(()=>{let t=[],n,r=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let l=0;lda(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let r of t)if(typeof n[r]=="string")e[r]=da(n[r]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[da(Zp(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>da(Zp(e)));{let e={};for(let t in this.metrics)e[t]=da(Zp(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Rc(e.optimizer_config),n=Sr(t),r;if(typeof e.loss=="string")r=Ti(e.loss);else if(Array.isArray(e.loss))r=e.loss.map(s=>Ti(s));else if(e.loss!=null){r={};for(let s in e.loss)r[s]=Ti(e.loss[s])}let a;if(Array.isArray(e.metrics))a=e.metrics.map(s=>Ti(s));else if(e.metrics!=null){a={};for(let s in e.metrics)a[s]=Ti(e.metrics[s])}this.compile({loss:r,metrics:a,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=bn.getSaveHandlers(e);if(i.length===0)throw new W(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new W(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new W("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await bn.encodeWeights(this.getNamedWeights(t)),r=!1,a=null,s={modelTopology:this.toJSON(a,r),format:Ire,generatedBy:`TensorFlow.js tfjs-layers v${sy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:l}=await bn.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...l),n.data=bn.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;s6(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){s6(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};pa.className="Model";re.registerClass(pa);var g6=class extends pa{};g6.className="Functional";re.registerClass(g6);async function Sre(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let r=Rc(n),a=Sr(r,t);if(e.weightsManifest!=null){let s=await bn.loadWeights(e.weightsManifest,e.pathPrefix,a.weights.map(o=>o.originalName)),i={};for(let o of a.weights)i[o.originalName]=s[o.originalName];a.loadWeights(i),Te(s)}return a}async function Tre(e,t){if(t==null&&(t={}),typeof e=="string"){let n=bn.getLoadHandlers(e,t);if(n.length===0)n.push(bn.browserHTTPRequest(e,t));else if(n.length>1)throw new W(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return Nre(e,void 0,t)}async function Nre(e,t,n){if(n==null&&(n={}),e.load==null)throw new W("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let r=await e.load(),a=r.modelTopology;a.model_config!=null&&(a=a.model_config);let s=n.strict==null?!0:n.strict,i=r.weightData!=null&&r.weightSpecs!=null&&s,o=Sr(Rc(a),t,i),l=r.trainingConfig;if(l!=null&&o.loadTrainingConfig(l),r.userDefinedMetadata!=null&&o.setUserDefinedMetadata(r.userDefinedMetadata),r.weightData!=null){if(r.weightSpecs==null)throw new W("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:c,optimizerWeights:u}=Ere(r.weightData,r.weightSpecs);o.loadWeights(c,s),o.optimizer!=null&&u.length>0&&await o.optimizer.setWeights(u),Te(c),Te(u.map(h=>h.tensor))}return o}function Ere(e,t){let n=bn.decodeWeights(e,t),r={},a=[];return t.forEach(s=>{s.group==="optimizer"?a.push({name:s.name,tensor:n[s.name]}):r[s.name]=n[s.name]}),{modelWeights:r,optimizerWeights:a}}var Vl=class extends pa{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:Wp("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new W(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof Vl||e instanceof pa,n;if(t){if(n=e,n.outputs.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new W("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new W("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let r=Hv({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(r)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new W(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Uv(this.outputs[0])}this.inboundNodes=[],new jp({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Ni(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(r=>r.shape),outputShapes:this.outputs[0].shape})}else{let r=e.apply(this.outputs[0]);if(Array.isArray(r))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[r],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(rt(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new pa({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new _r("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new _r("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new _r("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new _r("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},r=!1){let a,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new W("Legacy serialization format not supported yet.");a=t}else _.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),a=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof Vl))throw new De(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of a){let l=Sr(o,void 0,r);r&&l.setFastWeightInitDuringBuild(!0),i.add(l)}return i}set stopTraining(e){if(this.model==null)throw new W("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new W("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};Vl.className="Sequential";re.registerClass(Vl);function Cre(e){return new pa(e)}function Rre(e){return new Vl(e)}function Mre(e,t){return t==null&&(t={}),Tre(e,t)}function Ov(e){return Hv(e)}function Fre(e,t){dr.registerCallbackConstructor(e,t)}var Tn=class extends re.Serializable{getConfig(){return{}}},x6=class extends Tn{apply(e,t=1){return cte(e,t)}};x6.className="elu";re.registerClass(x6);var w6=class extends Tn{apply(e){return Fd(e)}};w6.className="selu";re.registerClass(w6);var b6=class extends Tn{apply(e){return Lr(e)}};b6.className="relu";re.registerClass(b6);var _6=class extends Tn{apply(e){return L(()=>yl(6,Lr(e)))}};_6.className="relu6";re.registerClass(_6);var v6=class extends Tn{apply(e){return e}};v6.className="linear";re.registerClass(v6);var k6=class extends Tn{apply(e){return _n(e)}};k6.className="sigmoid";re.registerClass(k6);var I6=class extends Tn{apply(e){return dte(e)}};I6.className="hardSigmoid";re.registerClass(I6);var S6=class extends Tn{apply(e){return fi(e)}};S6.className="softplus";re.registerClass(S6);var N6=class extends Tn{apply(e){return hte(e)}};N6.className="softsign";re.registerClass(N6);var T6=class extends Tn{apply(e){return ci(e)}};T6.className="tanh";re.registerClass(T6);var hy=class extends Tn{apply(e,t=-1){return ec(e,t)}};hy.className="softmax";re.registerClass(hy);var E6=class extends Tn{apply(e,t=-1){return Sd(e,t)}};E6.className="logSoftmax";re.registerClass(E6);var C6=class extends Tn{apply(e,t=1){return L(()=>_n(e.mul(t)).mul(e))}};C6.className="swish";re.registerClass(C6);var R6=class extends Tn{apply(e){return L(()=>B(e,ci(fi(e))))}};R6.className="mish";re.registerClass(R6);function qa(e){return e.getClassName()}function dy(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"activation")}function Xa(e){if(e==null){let t={};return t.className="linear",t.config={},dy(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},dy(t)}else return e instanceof Tn?e:dy(e)}function py(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var M6=class extends re.Serializable{},$c=class extends M6{constructor(e){super();py(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return L(()=>{let t=Et([1]);return this.hasL1&&(t=se(t,Ne(B(this.l1,Dt(e))))),this.hasL2&&(t=se(t,Ne(B(this.l2,Nc(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};$c.className="L1L2";re.registerClass($c);function $re(e){return py(e),new $c({l1:e!=null?e.l1:null,l2:0})}function Dre(e){return py(e),new $c({l2:e!=null?e.l2:null,l1:0})}var F6={l1l2:"L1L2"};function ut(e){return NA(e)}function $6(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"regularizer")}function yt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in F6?F6[e]:e,config:{}};return $6(t)}else return e instanceof M6?e:$6(e)}var fy=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=ze(e);let n=Lr(e);return this.maxValue!=null&&(n=vn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};fy.className="ReLU";re.registerClass(fy);var my=class extends Ge{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=ze(e);return qu(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};my.className="LeakyReLU";re.registerClass(my);var Ay=class extends Ge{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=At(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=yt(e.alphaRegularizer),this.alphaConstraint=Lt(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new W(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=rt(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let r of this.sharedAxes)t[r-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let r=1;r(Tt(t),t==="channelsFirst"?Ze(e,[0,2,3,1]):e))}function D6(e,t){return L(()=>(Tt(t),t==="channelsFirst"?Ze(e,[0,2,3,4,1]):e))}function Ore(e,t,n,r=1,a="valid",s,i=1){return L(()=>{if(s==null&&(s=br()),Tt(s),e.shape.length!==3)throw new W(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new W(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new W(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Ze(e,[0,2,1])),a==="causal")throw new De("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=gd(e,t,r,a==="same"?"same":"valid","NWC",i);return n!=null&&(o=kr(o,n)),o})}function O6(e,t,n,r=[1,1],a="valid",s,i,o=null){return L(()=>{if(s==null&&(s=br()),Tt(s),e.rank!==3&&e.rank!==4)throw new W(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new W(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=wy(e,s);if(a==="causal")throw new De("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Pa.conv2d({x:l,filter:t,strides:r,pad:a==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(l=Ze(l,[0,3,1,2])),l})}function zre(e,t,n,r=[1,1,1],a="valid",s,i){return L(()=>{if(s==null&&(s=br()),Tt(s),e.rank!==4&&e.rank!==5)throw new W(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new W(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=D6(e,s);if(a==="causal")throw new De("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=om(o,t,r,a==="same"?"same":"valid","NDHWC",i),n!=null&&(o=kr(o,n)),s==="channelsFirst"&&(o=Ze(o,[0,4,1,2,3])),o})}var by=class extends Ge{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",by.verifyArgs(t),this.rank=e,Ut(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new De(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=jl(t.kernelSize,e,"kernelSize"),this.strides=jl(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,Qn(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Tt(this.dataFormat),this.activation=Xa(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=At(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Lt(t.biasConstraint),this.biasRegularizer=yt(t.biasRegularizer),this.activityRegularizer=yt(t.activityRegularizer),this.dilationRate=jl(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new W(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new W(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new W(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(jr("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,3))throw new W(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:qa(this.activation),useBias:this.useBias,biasInitializer:kt(this.biasInitializer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},Dc=class extends by{constructor(e,t){super(e,t);this.kernel=null,Dc.verifyArgs(t),this.filters=t.filters,Ut(this.filters,"filters"),this.kernelInitializer=At(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Lt(t.kernelConstraint),this.kernelRegularizer=yt(t.kernelRegularizer)}build(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],r=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return L(()=>{e=ze(e);let n,r=this.bias==null?null:this.bias.read(),a=wv(this.activation.getClassName());if(a!=null&&this.rank===2)n=O6(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate,a);else{if(this.rank===1)n=Ore(e,this.kernel.read(),r,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=O6(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=zre(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new De("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=rt(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let a=0;a 0 but got ${JSON.stringify(e.filters)}`)}},Oc=class extends Dc{constructor(e){super(2,e);Oc.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,2))throw new W(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};Oc.className="Conv2D";re.registerClass(Oc);var zc=class extends Dc{constructor(e){super(3,e);zc.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new W(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};zc.className="Conv3D";re.registerClass(zc);var _y=class extends Oc{constructor(e){super(e);if(this.inputSpec=[new Rt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=rt(e),e.length!==4)throw new W("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Rt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=ze(e);if(n.shape.length!==4)throw new W(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let r=n.shape,a=r[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=r[s],l=r[i],c=this.kernelSize[0],u=this.kernelSize[1],h=this.strides[0],d=this.strides[1],p=qr(o,h,c,this.padding),m=qr(l,d,u,this.padding),f=[a,p,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,1]));let A=xd(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(A=Ze(A,[0,3,1,2])),this.bias!=null&&(A=kr(A,this.bias.read(),this.dataFormat)),this.activation!=null&&(A=this.activation.apply(A)),A})}computeOutputShape(e){e=rt(e);let t=e.slice(),n,r,a;this.dataFormat==="channelsFirst"?(n=1,r=2,a=3):(n=3,r=1,a=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[r]=qr(t[r],o,s,this.padding),t[a]=qr(t[a],l,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};_y.className="Conv2DTranspose";re.registerClass(_y);var vy=class extends zc{constructor(e){super(e);if(this.inputSpec=[new Rt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=rt(e),e.length!==5)throw new W("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Rt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=ze(e);if(n.shape.length!==5)throw new W(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let r=n.shape,a=r[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let l=r[o],c=r[s],u=r[i],h=this.kernelSize[0],d=this.kernelSize[1],p=this.kernelSize[2],m=this.strides[0],f=this.strides[1],A=this.strides[2],y=qr(l,m,h,this.padding),g=qr(c,f,d,this.padding),x=qr(u,A,p,this.padding),v=[a,y,g,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,4,1]));let w=Rw(n,this.kernel.read(),v,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(w=Ze(w,[0,4,1,2,3])),this.bias!==null&&(w=kr(w,this.bias.read(),this.dataFormat)),this.activation!==null&&(w=this.activation.apply(w)),w})}computeOutputShape(e){e=rt(e);let t=e.slice(),n,r,a,s;this.dataFormat==="channelsFirst"?(n=1,r=2,a=3,s=4):(n=4,r=1,a=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],c=this.strides[0],u=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[r]=qr(t[r],c,i,this.padding),t[a]=qr(t[a],u,o,this.padding),t[s]=qr(t[s],h,l,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};vy.className="Conv3DTranspose";re.registerClass(vy);var z6=class extends Dc{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new W("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new W("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new W(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=yt(t.depthwiseRegularizer),this.depthwiseConstraint=Lt(t.depthwiseConstraint),this.pointwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=yt(t.pointwiseRegularizer),this.pointwiseConstraint=Lt(t.pointwiseConstraint)}build(e){if(e=rt(e),e.length{e=ze(e);let n;if(this.rank===1)throw new De("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Ze(e,[0,2,3,1])),n=Sm(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=kr(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Ze(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=kt(this.depthwiseInitializer),e.pointwiseInitializer=kt(this.pointwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.pointwiseRegularizer=ut(this.pointwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseConstraint),e.pointwiseConstraint=Pt(this.pointwiseConstraint),e}};z6.className="SeparableConv";var ky=class extends z6{constructor(e){super(2,e)}};ky.className="SeparableConv2D";re.registerClass(ky);var Jp=class extends Dc{constructor(e){super(1,e);Jp.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,1))throw new W(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};Jp.className="Conv1D";re.registerClass(Jp);var Iy=class extends Ge{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return L(()=>{if(e=ze(e),this.dataFormat==="channelsLast"){let n=Cp(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Cp(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=Cp(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Cp(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Iy.className="Cropping2D";re.registerClass(Iy);var Sy=class extends Ge{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,rte(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return L(()=>{let n=ze(e),r=n.shape;if(this.dataFormat==="channelsFirst"){n=Ze(n,[0,2,3,1]);let a=this.size[0]*r[2],s=this.size[1]*r[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([a,s]):n.resizeBilinear([a,s]);return Ze(i,[0,3,1,2])}else{let a=this.size[0]*r[1],s=this.size[1]*r[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([a,s]):n.resizeBilinear([a,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Sy.className="UpSampling2D";re.registerClass(Sy);function Pre(e,t,n=[1,1],r="valid",a,s){return L(()=>{a==null&&(a=br()),Tt(a);let i=wy(e,a);if(e.rank!==4)throw new W(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new W(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=pl(i,t,n,r==="same"?"same":"valid","NHWC",s),a==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}var Ny=class extends by{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=At(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Lt(e.depthwiseConstraint),this.depthwiseRegularizer=yt(e.depthwiseRegularizer)}build(e){if(e=rt(e),e.length<4)throw new W(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new W(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],r=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",r,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{e=ze(e);let n=Pre(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=kr(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],r=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,a=Nr(t,this.kernelSize[0],this.padding,this.strides[0]),s=Nr(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],r,a,s]:[e[0],a,s,r]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=kt(this.depthwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseRegularizer),e}};Ny.className="DepthwiseConv2D";re.registerClass(Ny);function P6(e,t,n,r){if(Array.isArray(e)){if(t!=null||n!=null)throw new W("When inputs is an array, neither initialState or constants should be provided");r!=null&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function a(s){return s==null||Array.isArray(s)?s:[s]}return t=a(t),n=a(n),{inputs:e,initialState:t,constants:n}}function L6(e,t,n,r=!1,a,s,i=!1,o=!1){return L(()=>{let l=t.shape.length;if(l<3)throw new W(`Input should be at least 3D, but is ${l}D.`);let c=[1,0].concat(vr(2,l));if(t=Ze(t,c),s!=null)throw new De("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),a!=null&&(a=a.asType("bool").asType("float32"),a.rank===l-1&&(a=on(a,-1)),a=Ze(a,c)),r&&(t=Dn(t,0),a!=null&&(a=Dn(a,0)));let u=[],h,d=n,p=t.shape[0],m=ur(t),f;a!=null&&(f=ur(a));for(let y=0;ye(g,d));if(a==null)h=x[0],d=x[1];else{let v=L(()=>{let w=f[y],b=$n(w).sub(w),k=x[0].mul(w).add(d[0].mul(b)),N=d.map((C,F)=>x[1][F].mul(w).add(C.mul(b)));return{output:k,newStates:N}});h=v.output,d=v.newStates}o&&u.push(h)}let A;return o&&(A=On(u,1)),[h,A,d]})}var Hr=class extends Ge{constructor(e){super(e);let t;if(e.cell==null)throw new W("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new Qp({cells:e.cell}):t=e.cell,t.stateSize==null)throw new W("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new Rt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return vr(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){KA(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],r;if(this.returnSequences?r=[e[0],e[1],n]:r=[e[0],n],this.returnState){let a=[];for(let s of t)a.push([e[0],s]);return[r].concat(a)}else return r}computeMask(e,t){return L(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let r=this.states.map(a=>null);return[n].concat(r)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new W(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new Rt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ha("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(r=>Et([n,r])):this.states_=[Et([n,this.cell.stateSize])];else if(e==null)Te(this.states_),this.keptStates!=null&&(Te(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(r=>Et([n,r])):this.states_[0]=Et([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):Te(this.states_);for(let r=0;rVt(r.clone()))})}apply(e,t){let n=t==null?null:t.initialState,r=t==null?null:t.constants;t==null&&(t={});let a=P6(e,n,r,this.numConstants);e=a.inputs,n=a.initialState,r=a.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new Rt({shape:o.shape}));i=i.concat(this.stateSpec)}if(r!=null&&(t.constants=r,s=s.concat(r),this.numConstants=r.length),s[0]instanceof Ir){let o=[e].concat(s),l=this.inputSpec.concat(i),c=this.inputSpec;this.inputSpec=l;let u=super.apply(o,t);return this.inputSpec=c,u}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;e=ze(e),a==null&&(this.stateful?a=this.states_:a=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(a.length!==s)throw new W(`RNN Layer has ${s} state(s) but was passed ${a.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:r},o=L6((d,p)=>{let m=this.cell.call([d].concat(p),i);return[m[0],m.slice(1)]},e,a,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],c=o[1],u=o[2];this.stateful&&this.resetStates(u,r);let h=this.returnSequences?c:l;return this.returnState?[h].concat(u):h})}getInitialState(e){return L(()=>{let t=Et(e.shape);return t=Ne(t,[1,2]),t=Sc(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?DA(t,[1,n]):t):this.cell.stateSize>1?[DA(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===Hr.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let r=t.cell,a=Sr(r,n);return new e(Object.assign(t,{cell:a}))}};Hr.className="RNN";re.registerClass(Hr);var Ec=class extends Ge{},e0=class extends Ec{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=rt(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let r=t.training==null?!1:t.training;0$n(e),rate:this.dropout,training:r})),0$n(n),rate:this.recurrentDropout,training:r}));let a,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?a=Ur(B(e,s),this.kernel.read()):a=Ur(e,this.kernel.read()),this.bias!=null&&(a=kr(a,this.bias.read())),i!=null&&(n=B(n,i));let o=se(a,Ur(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:qa(this.activation),useBias:this.useBias,kernelInitializer:kt(this.kernelInitializer),recurrentInitializer:kt(this.recurrentInitializer),biasInitializer:kt(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),recurrentRegularizer:ut(this.recurrentRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),recurrentConstraint:Pt(this.recurrentConstraint),biasConstraint:Pt(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};e0.className="SimpleRNNCell";re.registerClass(e0);var Ty=class extends Hr{constructor(e){e.cell=new e0(e),super(e)}call(e,t){return L(()=>{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return new e(t)}};Ty.className="SimpleRNN";re.registerClass(Ty);var t0=class extends Ec{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new W("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Xa(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=rt(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,r=e[1];e=e[0],0$n(e),rate:this.dropout,training:n,count:3})),0$n(r),rate:this.recurrentDropout,training:n,count:3}));let a=this.dropoutMask,s=this.recurrentDropoutMask,i,o,l;0{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Ey.className="GRU";re.registerClass(Ey);var Pc=class extends Ec{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Xa(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=rt(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let r;if(this.useBias){if(this.unitForgetBias){let a=this.biasInitializer,s=this.units;r=new(t=class extends hr{apply(i,o){let l=a.apply([s]),c=new Mp().apply([s]),u=a.apply([s*2]);return Cv(Cv(l,c),u)}},t.className="CustomInit",t)}else r=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,r,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new W(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let r=e[1],a=e[2];e=e[0],0$n(e),rate:this.dropout,training:n,count:4})),0$n(r),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,l,c,u;0{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Cy.className="LSTM";re.registerClass(Cy);var Qp=class extends Ec{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return L(()=>{e=e;let n=e.slice(1),r=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?r.push(n.splice(0,i.stateSize.length)):r.push(n.splice(0,1));r.reverse();let a=[],s;for(let i=0;i{Ci(`RNNCell_${r}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=r=>({className:r.getClassName(),config:r.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let r=[];for(let a of t.cells)r.push(Sr(a,n));return new e({cells:r})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return ZA(e)}setWeights(e){let t=[];for(let n of this.cells){let r=n.weights.length,a=e.splice(r);for(let s=0;sMv(t(),n),i=()=>Tc(s,t,r);return!a||a<=1?Vt(i().clone()):Array(a).fill(void 0).map(i).map(o=>Vt(o.clone()))}var Lre=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{if(this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new W("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return L(()=>{let{stateSize:t}=this.cell,n=e.shape,r=this.computeSingleOutputShape(n),a=[r[0],...r.slice(2)],s=Et(a);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ha("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,r=this.computeSingleOutputShape(n),a=[r[0],...r.slice(2)];if(n[0]==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Et(a)):this.states_=[Et(a)];else if(e==null)Te(this.states_),this.keptStates!=null&&(Te(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Et(a)):this.states_[0]=Et(a);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):Te(this.states_);for(let s=0;sVt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:r,padding:a,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",l=e[o?3:2],c=e[o?4:3],u=Nr(l,r[0],a,s[0],i[0]),h=Nr(c,r[1],a,s[1],i[1]);return[...e.slice(0,2),...o?[n,u,h]:[u,h,n]]}};W6.className="ConvRNN2D";var n0=class extends Pc{constructor(e){let{filters:t,kernelSize:n,strides:r,padding:a,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Ut(this.filters,"filters"),this.kernelSize=jl(n,2,"kernelSize"),this.kernelSize.forEach(o=>Ut(o,"kernelSize")),this.strides=jl(r||1,2,"strides"),this.strides.forEach(o=>Ut(o,"strides")),this.padding=a||"valid",Qn(this.padding),this.dataFormat=s||"channelsLast",Tt(this.dataFormat),this.dilationRate=jl(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Ut(o,"dilationRate"))}build(e){var t;e=rt(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[n]}`);let r=e[n],a=4,s=this.kernelSize.concat([r,this.filters*a]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*a]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let l=this.biasInitializer,c=this.filters;o=new(t=class extends hr{apply(u,h){let d=l.apply([c]),p=Fn([c]),m=l.apply([c*2]);return zA([d,p,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*a],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return L(()=>{if(e.length!==3)throw new W(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,r=e[0],a=e[1],s=e[2],i=4;0$n(r),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,l=(Y,ae,te)=>!ae||!ae[te]?Y:B(ae[te],Y),c=l(r,o,0),u=l(r,o,1),h=l(r,o,2),d=l(r,o,3);0$n(a),rate:this.recurrentDropout,training:n,count:i}));let p=this.recurrentDropoutMask,m=l(a,p,0),f=l(a,p,1),A=l(a,p,2),y=l(a,p,3),g=3,[x,v,w,b]=ln(this.kernel.read(),i,g),[k,N,C,F]=this.useBias?ln(this.bias.read(),i):[null,null,null,null];c=this.inputConv(c,x,k,this.padding),u=this.inputConv(u,v,N,this.padding),h=this.inputConv(h,w,C,this.padding),d=this.inputConv(d,b,F,this.padding);let[O,z,V,j]=ln(this.recurrentKernel.read(),i,g);m=this.recurrentConv(m,O),f=this.recurrentConv(f,z),A=this.recurrentConv(A,V),y=this.recurrentConv(y,j);let U=this.recurrentActivation.apply(se(c,m)),X=this.recurrentActivation.apply(se(u,f)),G=se(B(X,s),B(U,this.activation.apply(se(h,A)))),ee=B(this.recurrentActivation.apply(se(d,y)),this.activation.apply(G));return[ee,ee,G]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Lre(e,["units"]),r={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,r)}inputConv(e,t,n,r){let a=sa(e,t,this.strides,r||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?kr(a,n,this.dataFormat):a}recurrentConv(e,t){return sa(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};n0.className="ConvLSTM2DCell";re.registerClass(n0);var Ry=class extends W6{constructor(e){let t=new n0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};Ry.className="ConvLSTM2D";re.registerClass(Ry);var r0=class extends Ge{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let r=0;r{this.invokeCallHook(e,t);let n=ze(e);if(0Mv(n,this.rate,a,this.seed),()=>n,r)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};r0.className="Dropout";re.registerClass(r0);var My=class extends r0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};My.className="SpatialDropout1D";re.registerClass(My);var Fy=class extends Ge{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Lt(e.kernelConstraint),this.biasConstraint=Lt(e.biasConstraint),this.kernelRegularizer=yt(e.kernelRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=rt(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=rt(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e),r=wv(this.activation.getClassName()),a;return r!=null?a=Ur(n,this.kernel.read(),r,this.bias?this.bias.read():null):(a=Ur(n,this.kernel.read()),this.bias!=null&&(a=kr(a,this.bias.read())),this.activation!=null&&(a=this.activation.apply(a))),a})}getConfig(){let e={units:this.units,activation:qa(this.activation),useBias:this.useBias,kernelInitializer:kt(this.kernelInitializer),biasInitializer:kt(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Fy.className="Dense";re.registerClass(Fy);var $y=class extends Ge{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=rt(e);for(let t of e.slice(1))if(t==null)throw new W(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Ua(e,1)]}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let r=[0];for(let a=2;a{this.invokeCallHook(e,t);let n=ze(e);return this.activation.apply(n)})}getConfig(){let e={activation:qa(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};Dy.className="Activation";re.registerClass(Dy);var Oy=class extends Ge{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return L(()=>(e=ze(e),ote(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};Oy.className="RepeatVector";re.registerClass(Oy);var zy=class extends Ge{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=ze(e),r=n.shape,a=r.slice(0,1).concat(this.fixUnknownDimension(r.slice(1),this.targetShape));return n.reshape(a)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};zy.className="Reshape";re.registerClass(zy);var Py=class extends Ge{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=vr(1,e.dims.length+1);if(!_.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Rt({ndim:this.dims.length+1})]}computeOutputShape(e){e=rt(e);let t=e.slice();return this.dims.forEach((n,r)=>{t[r+1]=e[n]}),t}call(e,t){return Ze(ze(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};Py.className="Permute";re.registerClass(Py);var Ly=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=ze(e),r=-1;return Wu(Ai(n,this.maskValue),r)}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e),r=-1,a=!0,s=Wu(Ai(n,this.maskValue),r,a);return n.mul(s.asType(n.dtype))})}};Ly.className="Masking";re.registerClass(Ly);var Wy=class extends Ge{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ft(e.inputLength))}this.inputDim=e.inputDim,Ut(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Ut(this.outputDim,"outputDim"),this.embeddingsInitializer=At(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=yt(e.embeddingsRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.embeddingsConstraint=Lt(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return L(()=>this.maskZero?(e=ze(e),Ai(e,Ue(e))):null)}computeOutputShape(e){if(e=rt(e),this.inputLength==null)return[...e,this.outputDim];let t=ft(this.inputLength);if(t.length!==e.length-1)throw new W(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let r=0;r{this.invokeCallHook(e,t);let n=ze(e);return n.dtype!=="int32"&&(n=Ic(n,"int32")),Rv(this.embeddings.read(),n.as1D()).reshape(rt(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:kt(this.embeddingsInitializer),embeddingsRegularizer:ut(this.embeddingsRegularizer),activityRegularizer:ut(this.activityRegularizer),embeddingsConstraint:Pt(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};Wy.className="Embedding";re.registerClass(Wy);var Di=class extends Ge{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new De}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new W(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let a=1;aa.length);e.indexOf(null)===-1&&ja(r).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return L(()=>{if(e=e,this.reshapeRequired){let n=[],r=e.map(a=>a.rank);if(r.indexOf(null)===-1){let a=Ha(r);for(let s of e){let i=s.rank;for(let o=0;o1){let c=vr(1,l).concat([0]);n.push(Ze(o,c)),a=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(a){if(i==null){let o=s.shape,l=o.length,c=o[l-1],u=[c].concat(o.slice(0,o.length-1));s=Ze(s.reshape([-1,c]),[1,0]).reshape(u)}else if(i>1){let o=[i-1].concat(vr(0,i-1));s=Ze(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let r=1;r{if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an Array");if(!Array.isArray(e))throw new W("`inputs` should be an Array");if(t.length!==e.length)throw new W(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(r=>r==null))return null;t=t.map(r=>r==null?r:on(r,0));let n=t[0];for(let r=1;r{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new W("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return L(()=>zA(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new W("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis;for(let a of t.slice(1)){if(n[r]==null||a[r]==null){n[r]=null;break}n[r]+=a[r]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new W("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new W(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return L(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let r=[];for(let s=0;s3||t.shape.length>3)throw new De("batchDot is not implemented for tensors of 4D or higher rank yet");if(_.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),_.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new De("batchDot is not implemented for complex64-type Tensors yet.");let r=e.shape.length,a=t.shape.length;n==null&&(n=[r-1,a-2]);let s=n;return L(()=>{let i;if(r>a){i=r-a;let l=[];for(let c=0;cr){i=a-r;let l=[];for(let c=0;c0){let l;r>a?l=r+a-3:l=r-1;let c=[];for(let u=l;u"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new De("Dot layer does not support tensors of 4D or higher rank yet.");let r=this.interpretAxes(t,n);if(t[r[0]]!==n[r[1]])throw new W(`Dimension incompatibility: ${t[r[0]]} !== ${n[r[1]]}`)}mergeFunction(e){if(e.length!==2)throw new W(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],r;return Array.isArray(this.axes)?r=this.axes.map((a,s)=>Lc(a,e[s].shape.length)):r=[Lc(this.axes,t.shape.length),Lc(this.axes,n.shape.length)],this.normalize&&(t=Up(t,r[0]),n=Up(n,r[1])),Wre(t,n,r)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[Lc(this.axes,e.length),Lc(this.axes,t.length)],n}computeOutputShape(e){_.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new De("Dot layer does not support tensors of 4D or higher rank yet.");let r=this.interpretAxes(t,n);t.splice(r[0],1),n.splice(r[1],1),n.splice(0,1);let a=t.concat(n);return a.length===1&&a.push(1),a}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};qy.className="Dot";re.registerClass(qy);var Xy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);return Tc(()=>Rp(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};Xy.className="GaussianNoise";re.registerClass(Xy);var Ky=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);return this.rate>0&&this.rate<1?Tc(()=>{let r=Math.sqrt(this.rate/(1-this.rate));return n.mul(Rp(n.shape,1,r))},()=>n,t.training||!1):n})}};Ky.className="GaussianDropout";re.registerClass(Ky);var Zy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||ze(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Tc(()=>{let r=ze(e),a=1.6732632423543772,s=1.0507009873554805,i=-a*s,o=Oa(gl(n),this.rate);o=Ic(o,"float32");let l=((1-this.rate)*(1+this.rate*i**2))**-.5,c=-l*i*this.rate;return r.mul(o).add(o.add(-1).mul(i)).mul(l).add(c)},()=>ze(e),t.training||!1)}return e})}};Zy.className="AlphaDropout";re.registerClass(Zy);function Wc(e,t,n,r,a,s=.001){let i;if(e.rank===2)i=vw(e,t,n,r,a,s);else if(e.rank===3)i=kw(e,t,n,r,a,s);else if(e.rank===4)i=Iw(e,t,n,r,a,s);else throw new De(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function Bre(e,t,n,r,a=.001){return L(()=>{let s=Td(e,r),i=s.mean,o=s.variance;return[Wc(e,i,o,n,t,a),i,o]})}function Vre(e,t,n,r,a=.001){return L(()=>{let s=Td(e,r),i=s.mean,o=s.variance,l=[];for(let p of vr(0,e.rank))r.indexOf(p)!==-1?l.push(1):l.push(e.shape[p]);let c=i.reshape(l),u=o.reshape(l),h=t==null?null:t.reshape(l),d=n==null?null:n.reshape(l);return[Wc(e,c,u,d,h,a),i,o]})}function jre(e,t,n,r,a=.001){return _.arraysEqual(r.slice().sort(),vr(0,e.rank-1))?Bre(e,t,n,r,a):Vre(e,t,n,r,a)}var Yy=class extends Ge{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.movingMeanInitializer=At(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=At(e.movingVarianceInitializer||"ones"),this.betaConstraint=Lt(e.betaConstraint),this.gammaConstraint=Lt(e.gammaConstraint),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer)}build(e){e=rt(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new W(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Rt({ndim:e.length,axes:{[t]:n}})];let r=[n];this.scale&&(this.gamma=this.addWeight("gamma",r,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",r,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",r,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",r,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training,r=ze(e),a=r.shape,s=a.length,i=vr(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let l=Ni(1,s);l[o]=a[o];let c=i.slice();c.sort();let u=!_.arraysEqual(c,vr(0,s).slice(0,s-1)),h=()=>{if(u){let A=this.movingMean.read().reshape(l),y=this.movingVariance.read().reshape(l),g=this.center?this.beta.read().reshape(l):null,x=this.scale?this.gamma.read().reshape(l):null;return Wc(r,A,y,g,x,this.epsilon)}else return Wc(r,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return h();let[d,p,m]=jre(r,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(A,y,g)=>{L(()=>{let x=1-g,v=A.read(),w=v.sub(y).mul(x);A.write(v.sub(w))})};return(()=>{f(this.movingMean,p,this.momentum),f(this.movingVariance,m,this.momentum)})(),d})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:kt(this.betaInitializer),gammaInitializer:kt(this.gammaInitializer),movingMeanInitializer:kt(this.movingMeanInitializer),movingVarianceInitializer:kt(this.movingVarianceInitializer),betaRegularizer:ut(this.betaRegularizer),gammaRegularizer:ut(this.gammaRegularizer),betaConstraint:Pt(this.betaConstraint),gammaConstraint:Pt(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Yy.className="BatchNormalization";re.registerClass(Yy);var Jy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=rt(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let a=0;a=t)throw new Error(`Invalid axis: ${a}`);if(this.axis.length!==ja(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(a=>e[a]),r=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,r):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,r):this.beta=null,this.built=!0}call(e,t){let n=ze(e),r=n.shape,a=r.length;return L(()=>{let s=!0,{mean:i,variance:o}=Td(n,this.axis,s),l=Ni(1,a);for(let m of this.axis)l[m]=r[m];let c=m=>m!=null&&m.shape.length!==a&&this.axis!==[a-1]?m.reshape(l):m,u=c(this.gamma.read()),h=c(this.beta.read()),d=[],p=[];for(let m=0;m{if(e.rank!==4)throw new W(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new W("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=br()),n!=="channelsLast"&&n!=="channelsFirst")throw new W(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let r;return n==="channelsFirst"?r=[[0,0],[0,0],t[0],t[1]]:r=[[0,0],t[0],t[1],[0,0]],ia(e,r)})}var Qy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?br():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new W(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new W(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new W(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){e=rt(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return L(()=>Ure(ze(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Qy.className="ZeroPadding2D";re.registerClass(Qy);function a0(e,t,n,r,a,s){return L(()=>{Tt(a),kv(s),Qn(r),n==null&&(n=[1,1]),r==null&&(r="valid"),a==null&&(a=br()),s==null&&(s="max"),e=wy(e,a);let i,o=r==="same"?"same":"valid";return s==="max"?i=Ku(e,t,n,o):i=ju(e,t,n,o),a==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}function B6(e,t,n,r,a,s){return L(()=>{Tt(a),kv(s),Qn(r),n==null&&(n=[1,1,1]),r==null&&(r="valid"),a==null&&(a=br()),s==null&&(s="max"),e=D6(e,a);let i,o=r==="same"?"same":"valid";return s==="max"?i=xm(e,t,n,o):i=am(e,t,n,o),a==="channelsFirst"&&(i=Ze(i,[0,4,1,2,3])),i})}var V6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new W(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Ut(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new W(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,Qn(this.padding),this.inputSpec=[new Rt({ndim:3})]}computeOutputShape(e){e=rt(e);let t=Nr(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return L(()=>{this.invokeCallHook(e,t),e=Sc(ze(e),2);let n=this.poolingFunction(ze(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return za(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},e2=class extends V6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"max")}};e2.className="MaxPooling1D";re.registerClass(e2);var t2=class extends V6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"avg")}};t2.className="AveragePooling1D";re.registerClass(t2);var j6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new W(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Ut(this.poolSize,"poolSize"),Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),Qn(this.padding),this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=Nr(t,this.poolSize[0],this.padding,this.strides[0]),n=Nr(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(ze(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},n2=class extends j6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"max")}};n2.className="MaxPooling2D";re.registerClass(n2);var r2=class extends j6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"avg")}};r2.className="AveragePooling2D";re.registerClass(r2);var U6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new W(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Ut(this.poolSize,"poolSize"),Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),Qn(this.padding),this.inputSpec=[new Rt({ndim:5})]}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],r=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=Nr(t,this.poolSize[0],this.padding,this.strides[0]),n=Nr(n,this.poolSize[1],this.padding,this.strides[1]),r=Nr(r,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,r]:[e[0],t,n,r,e[4]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(ze(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},a2=class extends U6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),B6(e,t,n,r,a,"max")}};a2.className="MaxPooling3D";re.registerClass(a2);var s2=class extends U6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),B6(e,t,n,r,a,"avg")}};s2.className="AveragePooling3D";re.registerClass(s2);var H6=class extends Ge{constructor(e){super(e);this.inputSpec=[new Rt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new De}},i2=class extends H6{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=ze(e);return vt(n,1)})}};i2.className="GlobalAveragePooling1D";re.registerClass(i2);var o2=class extends H6{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=ze(e);return Xn(n,1)})}};o2.className="GlobalMaxPooling1D";re.registerClass(o2);var G6=class extends Ge{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new De}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},l2=class extends G6{call(e,t){return L(()=>{let n=ze(e);return this.dataFormat==="channelsLast"?vt(n,[1,2]):vt(n,[2,3])})}};l2.className="GlobalAveragePooling2D";re.registerClass(l2);var u2=class extends G6{call(e,t){return L(()=>{let n=ze(e);return this.dataFormat==="channelsLast"?Xn(n,[1,2]):Xn(n,[2,3])})}};u2.className="GlobalMaxPooling2D";re.registerClass(u2);var q6=class extends Ge{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let r=t.layer,a=Sr(r,n);delete t.layer;let s={layer:a};return Object.assign(s,t),new e(s)}},c2=class extends q6{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=rt(e),e.length<3)throw new W(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=rt(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))}call(e,t){return L(()=>(e=ze(e),L6((n,r)=>[ze(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};c2.className="TimeDistributed";re.registerClass(c2);function Hre(e){Ei(nte,"BidirectionalMergeMode",e)}var Gre="concat",h2=class extends q6{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Sr(n),t.goBackwards=t.goBackwards!==!0;let r={};if(r.className=e.layer.getClassName(),r.config=t,this.backwardLayer=Sr(r),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Gre:e.mergeMode,Hre(this.mergeMode),e.weights)throw new De("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,r,a;return this.returnState&&(a=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,r=[n]):this.mergeMode==null?r=[n,n.slice()]:r=[n],this.returnState?this.mergeMode==null?r.concat(a).concat(a.slice()):[n].concat(a).concat(a.slice()):Sn(r)}apply(e,t){let n=t==null?null:t.initialState,r=t==null?null:t.constants;t==null&&(t={});let a=P6(e,n,r,this.numConstants);if(e=a.inputs,n=a.initialState,r=a.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&r==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let l=n.length;if(l%2>0)throw new W("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let c=n.map(u=>new Rt({shape:u.shape}));this.forwardLayer.stateSpec=c.slice(0,l/2),this.backwardLayer.stateSpec=c.slice(l/2),i.push(...c)}if(r!=null)throw new De("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Ir;for(let l of s)if(l instanceof Ir!==o)throw new W("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let l=[e].concat(s),c=this.inputSpec.concat(i),u=this.inputSpec;this.inputSpec=c;let h=super.apply(l,t);return this.inputSpec=u,h}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t.initialState,r,a;if(n==null)r=this.forwardLayer.call(e,t),a=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),l=n.slice(n.length/2);r=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),a=this.backwardLayer.call(e,Object.assign(t,{initialState:l}))}let s;this.returnState&&(Array.isArray(r)&&(s=r.slice(1).concat(a.slice(1))),r=r[0],a=a[0]),this.returnSequences&&(a=Dn(a,1));let i;return this.mergeMode==="concat"?i=zA([r,a]):this.mergeMode==="sum"?i=se(r,a):this.mergeMode==="ave"?i=B(.5,se(r,a)):this.mergeMode==="mul"?i=B(r,a):this.mergeMode==null&&(i=[r,a]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ci(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ci(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let r=this.forwardLayer.states.map(a=>null);return Array.isArray(n)?n.concat(r).concat(r):[n].concat(r).concat(r)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Sr(t.layer);if(delete t.layer,t.numConstants!=null)throw new De("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let r=t;return r.layer=n,new e(r)}};h2.className="Bidirectional";re.registerClass(h2);function gte(e){return new Ll(e)}function xte(e){return new yy(e)}function wte(e){return new fy(e)}function bte(e){return new my(e)}function _te(e){return new Ay(e)}function vte(e){return new xy(e)}function kte(e){return new gy(e)}function Ite(e){return new Jp(e)}function Ste(e){return new Oc(e)}function Nte(e){return new _y(e)}function Tte(e){return new zc(e)}function Ete(e){return new vy(e)}function Cte(e){return new ky(e)}function Rte(e){return new Iy(e)}function Mte(e){return new Sy(e)}function Fte(e){return new Ny(e)}function $te(e){return new Dy(e)}function Dte(e){return new Fy(e)}function Ote(e){return new r0(e)}function zte(e){return new My(e)}function Pte(e){return new $y(e)}function Lte(e){return new Oy(e)}function Wte(e){return new zy(e)}function Bte(e){return new Py(e)}function Vte(e){return new Wy(e)}function jte(e){return new By(e)}function Ute(e){return new jy(e)}function Hte(e){return new Gy(e)}function Gte(e){return new Uy(e)}function qte(e){return new Hy(e)}function Xte(e){return new Vy(e)}function Kte(e){return new qy(e)}function Zte(e){return new Yy(e)}function Yte(e){return new Jy(e)}function Jte(e){return new Qy(e)}function GA(e){return new t2(e)}function Qte(e){return GA(e)}function ene(e){return GA(e)}function qA(e){return new r2(e)}function tne(e){return qA(e)}function nne(e){return qA(e)}function XA(e){return new s2(e)}function rne(e){return XA(e)}function ane(e){return XA(e)}function sne(e){return new i2(e)}function ine(e){return new l2(e)}function zv(e){return new o2(e)}function Pv(e){return new u2(e)}function Lv(e){return new e2(e)}function Wv(e){return new n2(e)}function one(e){return new a2(e)}function lne(e){return new Ey(e)}function une(e){return new t0(e)}function cne(e){return new Cy(e)}function hne(e){return new Pc(e)}function dne(e){return new Ty(e)}function pne(e){return new e0(e)}function fne(e){return new Ry(e)}function mne(e){return new n0(e)}function Ane(e){return new Hr(e)}function yne(e){return new Qp(e)}function gne(e){return new h2(e)}function xne(e){return new c2(e)}var wne=zv,bne=Pv,_ne=Lv,vne=Wv;function kne(e){return new Xy(e)}function Ine(e){return new Ky(e)}function Sne(e){return new Zy(e)}function Nne(e){return new Ly(e)}var X6={};Me(X6,{MAPE:()=>rae,MSE:()=>iae,binaryAccuracy:()=>qre,binaryCrossentropy:()=>Xre,categoricalAccuracy:()=>Zre,categoricalCrossentropy:()=>Yre,cosineProximity:()=>eae,mape:()=>aae,meanAbsoluteError:()=>tae,meanAbsolutePercentageError:()=>nae,meanSquaredError:()=>sae,mse:()=>oae,precision:()=>Jre,recall:()=>Qre,sparseCategoricalAccuracy:()=>Kre});function qre(e,t){return ey(e,t)}function Xre(e,t){return t6(e,t)}function Kre(e,t){return n6(e,t)}function Zre(e,t){return ty(e,t)}function Yre(e,t){return ny(e,t)}function Jre(e,t){return e6(e,t)}function Qre(e,t){return Gne(e,t)}function eae(e,t){return JA(e,t)}function tae(e,t){return Hp(e,t)}function nae(e,t){return Bl(e,t)}function rae(e,t){return Bl(e,t)}function aae(e,t){return Bl(e,t)}function sae(e,t){return Mi(e,t)}function iae(e,t){return Mi(e,t)}function oae(e,t){return Mi(e,t)}var K6={};Me(K6,{modelFromJSON:()=>Sre});var Z6={};Me(Z6,{l1:()=>uae,l1l2:()=>lae,l2:()=>cae});function lae(e){return new $c(e)}function uae(e){return $re(e)}function cae(e){return Dre(e)}var Y6=class extends Wl{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof pa))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function s0(e,t){return et}var Q6=class extends Y6{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new De("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=s0:this.mode==="max"?this.monitorFunc=J6:this.monitor.indexOf("acc")!==-1?this.monitorFunc=J6:this.monitorFunc=s0,this.monitorFunc===s0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===s0?Infinity:-Infinity}async onEpochEnd(e,t){await Ga(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function hae(e){return new Q6(e)}var dae={earlyStopping:hae},Tr;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(Tr||(Tr={}));var e4;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(e4||(e4={}));var d2={};function pae(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};d2[e]=n}function t4(e){return d2[e]}function fae(e){delete d2[e]}function I(e,t,n,r,a){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,l=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return mn(t.inputNames[s.inputIndexStart],n,r,a);if(s.type==="tensors")return t.inputNames.slice(o,l).map(h=>mn(h,n,r,a));let c=mn(t.inputNames.slice(o)[0],n,r,a),u=c.dataSync();return s.type==="number"?u[0]:_.toNestedArray(c.shape,u)}let i=t.attrParams[e];return i&&i.value}function mn(e,t,n,r){let[a,s]=Ln(e);if(r!=null){let o=r.getHashTableHandleByName(a);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[i0(a,o)]);return i!==void 0?t[i0(a,i)][s]:void 0}function mae(e,t,n){return t[i0(e,n.currentContextId)]}function fa(e,t){let[n,r]=Ln(e);return[i0(n,t&&t.currentContextId),r]}function i0(e,t){return t?`${e}-${t}`:e}function Ln(e){let t=e.split(":");return t.length===1?[e,0]:[t[0],Number(t[t.length-1])]}function o0(e,t,n){let r=I("pad",e,t,n);if(r==="explicit"){r=I("explicitPaddings",e,t,n);let a=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)a[s][0]=r[s*2],a[s][1]=r[s*2+1];return a}return r}function ma(e){return e.kept?e:Dr(e)}var n4={};Me(n4,{json:()=>Aae});var Aae=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],r4={};Me(r4,{json:()=>yae});var yae=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],a4={};Me(a4,{json:()=>gae});var gae=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],s4={};Me(s4,{json:()=>xae});var xae=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],i4={};Me(i4,{json:()=>wae});var wae=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],o4={};Me(o4,{json:()=>bae});var bae=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],l4={};Me(l4,{json:()=>_ae});var _ae=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],u4={};Me(u4,{json:()=>vae});var vae=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],c4={};Me(c4,{json:()=>kae});var kae=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],h4={};Me(h4,{json:()=>Iae});var Iae=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],d4={};Me(d4,{json:()=>Sae});var Sae=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],p4={};Me(p4,{json:()=>Nae});var Nae=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],f4={};Me(f4,{json:()=>Tae});var Tae=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],m4={};Me(m4,{json:()=>Eae});var Eae=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],A4={};Me(A4,{json:()=>Cae});var Cae=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],y4={};Me(y4,{json:()=>Rae});var Rae=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],g4={};Me(g4,{json:()=>Mae});var Mae=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}],w4=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[n4,r4,a4,s4,i4,o4,l4,d4,h4,u4,p4,f4,m4,A4,y4,g4,c4],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,r)=>(n[r.tfOpName]=r,n),{})}transformGraph(e,t={}){let n=e.node,r=[],a=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?r.push(m[f.name]):f.op==="Const"?a.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],l=[],c={},u={};t!=null&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));let h=Object.keys(i);h.forEach(m=>{let f=i[m];f.inputNames.forEach(A=>{let[y]=fa(A);f.inputs.push(i[y]),i[y].children.push(f)})}),Object.keys(u).length===0?h.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(u).forEach(m=>{let[f]=fa(m),A=i[f];A!=null&&(A.signatureKey=u[m],l.push(A))}),Object.keys(c).length>0?Object.keys(c).forEach(m=>{let[f]=fa(m),A=i[f];A&&(A.signatureKey=c[m],o.push(A))}):o=r;let d={};e.library!=null&&e.library.function!=null&&(d=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let p={nodes:i,inputs:o,outputs:l,weights:a,placeholders:r,signature:t,functions:d};return s.length>0&&(p.initNodes=s),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=t4(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(r=>r.startsWith("^")?r.substr(1):r),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((r,a)=>(r[a.name]={type:a.type,inputIndexStart:a.start,inputIndexEnd:a.end},r),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((r,a)=>{let s=a.type,i;switch(a.type){case"string":i=p2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=p2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"string[]":i=b2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=b2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number":i=m2(e.attr,a.tfName,a.defaultValue||0),i===void 0&&!!a.tfDeprecatedName&&(i=m2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number[]":i=w2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=w2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool":i=f2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=f2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool[]":i=v2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=v2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape":i=x2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=x2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape[]":i=_2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=_2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype":i=y2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=y2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype[]":i=g2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=g2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"func":i=x4(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=x4(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${a.type} for op: ${e.op}`)}return r[a.name]={value:i,type:s},r},{})),n}mapFunction(e){let t=e.nodeDef,n=[],r=[],a={};t!=null&&(a=t.reduce((c,u)=>(c[u.name]=this.mapNode(u),u.op==="Const"&&r.push(c[u.name]),c),{}));let s=[],i=[];e.signature.inputArg.forEach(c=>{let[u]=fa(c.name),h={name:u,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:A2(c.type),type:"dtype"}},children:[]};h.signatureKey=c.name,s.push(h),a[u]=h}),Object.keys(a).forEach(c=>{let u=a[c];u.inputNames.forEach(h=>{let[d]=fa(h);u.inputs.push(a[d]),a[d].children.push(u)})});let o=e.ret;e.signature.outputArg.forEach(c=>{let[u,h]=fa(o[c.name]),d=a[u];d!=null&&(d.defaultOutput=h,i.push(d))});let l=this.mapArgsToSignature(e);return{nodes:a,inputs:s,outputs:i,weights:r,placeholders:n,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function Fae(e){let t=J().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function b4(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):Fae(e);return t?n:n.toLowerCase()}function p2(e,t,n,r=!1){let a=e[t];return a!=null?b4(a.s,r):n}function f2(e,t,n){let r=e[t];return r?r.b:n}function m2(e,t,n){let r=e[t]||{},a=r.i!=null?r.i:r.f!=null?r.f:n;return typeof a=="number"?a:parseInt(a,10)}function A2(e){switch(typeof e=="string"&&(e=Tr[e]),e){case Tr.DT_FLOAT:return"float32";case Tr.DT_INT32:case Tr.DT_INT64:case Tr.DT_INT8:case Tr.DT_UINT8:return"int32";case Tr.DT_BOOL:return"bool";case Tr.DT_DOUBLE:return"float32";case Tr.DT_STRING:return"string";default:return null}}function x4(e,t,n){let r=e[t];return r&&r.func?r.func.name:n}function y2(e,t,n){let r=e[t];return r&&r.type?A2(r.type):n}function g2(e,t,n){let r=e[t];return r&&r.list&&r.list.type?r.list.type.map(a=>A2(a)):n}function _4(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function x2(e,t,n){let r=e[t];return r&&r.shape?_4(r.shape):n}function w2(e,t,n){let r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(a=>typeof a=="number"?a:parseInt(a,10)):n}function b2(e,t,n,r=!1){let a=e[t];return a&&a.list&&a.list.s?a.list.s.map(s=>b4(s,r)):n}function _2(e,t,n){let r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(a=>_4(a)):n}function v2(e,t,n){let r=e[t];return r&&r.list&&r.list.b?r.list.b:n}var $ae=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(r=>this.getInput(r)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((r,a)=>(r[a]=this.getAttr(a),r),{}))}getInput(e){return mn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return mn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return m2(this.node.rawAttrs,e,t);if(n.s!=null)return p2(this.node.rawAttrs,e,t);if(n.b!=null)return f2(this.node.rawAttrs,e,t);if(n.shape!=null)return x2(this.node.rawAttrs,e,t);if(n.type!=null)return y2(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return w2(this.node.rawAttrs,e,t);if(n.list.s!=null)return b2(this.node.rawAttrs,e,t);if(n.list.shape!=null)return _2(this.node.rawAttrs,e,t);if(n.list.b!=null)return v2(this.node.rawAttrs,e,t);if(n.list.type!=null)return g2(this.node.rawAttrs,e,t)}return t}},Dae=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[se(I("a",e,t,n),I("b",e,t,n))];case"AddN":return[md(I("tensors",e,t,n))];case"FloorMod":case"Mod":return[bm(I("a",e,t,n),I("b",e,t,n))];case"Mul":return[B(I("a",e,t,n),I("b",e,t,n))];case"RealDiv":case"Div":return[ge(I("a",e,t,n),I("b",e,t,n))];case"DivNoNan":return[cm(I("a",e,t,n),I("b",e,t,n))];case"FloorDiv":return[fd(I("a",e,t,n),I("b",e,t,n))];case"Sub":return[ye(I("a",e,t,n),I("b",e,t,n))];case"Minimum":return[yl(I("a",e,t,n),I("b",e,t,n))];case"Maximum":return[Pr(I("a",e,t,n),I("b",e,t,n))];case"Pow":return[oa(I("a",e,t,n),I("b",e,t,n))];case"SquaredDifference":return[Ld(I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Oae=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Dt(I("x",e,t,n))];case"Acos":return[Xf(I("x",e,t,n))];case"Acosh":return[Kf(I("x",e,t,n))];case"Asin":return[Yf(I("x",e,t,n))];case"Asinh":return[Jf(I("x",e,t,n))];case"Atan":return[Qf(I("x",e,t,n))];case"Atan2":return[em(I("x",e,t,n),I("y",e,t,n))];case"Atanh":return[tm(I("x",e,t,n))];case"Ceil":return[sm(I("x",e,t,n))];case"Complex":return[Ea(I("real",e,t,n),I("imag",e,t,n))];case"Cos":return[Hu(I("x",e,t,n))];case"Cosh":return[wd(I("x",e,t,n))];case"Elu":return[fl(I("x",e,t,n))];case"Erf":return[hm(I("x",e,t,n))];case"Exp":return[qn(I("x",e,t,n))];case"Expm1":return[dm(I("x",e,t,n))];case"Floor":return[ml(I("x",e,t,n))];case"Log":return[Mn(I("x",e,t,n))];case"Log1p":return[kd(I("x",e,t,n))];case"Imag":return[_d(I("x",e,t,n))];case"Neg":return[_t(I("x",e,t,n))];case"Reciprocal":return[km(I("x",e,t,n))];case"Real":return[Ju(I("x",e,t,n))];case"Relu":return[Lr(I("x",e,t,n))];case"Round":return[Im(I("x",e,t,n))];case"Selu":return[Fd(I("x",e,t,n))];case"Sigmoid":return[_n(I("x",e,t,n))];case"Sin":return[$d(I("x",e,t,n))];case"Sign":return[Nm(I("x",e,t,n))];case"Sinh":return[Dd(I("x",e,t,n))];case"Softplus":return[fi(I("x",e,t,n))];case"Sqrt":return[Jt(I("x",e,t,n))];case"Square":return[st(I("x",e,t,n))];case"Tanh":return[ci(I("x",e,t,n))];case"Tan":return[Cm(I("x",e,t,n))];case"ClipByValue":return[vn(I("x",e,t,n),I("clipValueMin",e,t,n),I("clipValueMax",e,t,n))];case"Relu6":return[Rd(I("x",e,t,n))];case"Rsqrt":return[Md(mn(e.inputNames[0],t,n))];case"Prod":return[Ed(I("x",e,t,n),I("axes",e,t,n))];case"LeakyRelu":return[qu(I("x",e,t,n),I("alpha",e,t,n))];case"Prelu":return[Yu(I("x",e,t,n),I("alpha",e,t,n))];case"IsNan":return[fm(mn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function pr(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){_.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let r=0;rn+` Shapes ${e} and ${t} must match`)}}}function v4(e){return!(typeof e=="number"||e.some(t=>t<0))}function Bc(e,t,n){let r=k2(e,n),a=!v4(r);if(a&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&t.forEach(s=>{r=k2(s.shape,r)}),!v4(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function k2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let r=0;r=0&&s>=0&&a!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=a>=0?a:s}return n}var zae=class{constructor(e,t,n,r,a,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=a,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Vt(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.tensor.id))&&t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);let t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(t=>this.read(t))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, - because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),pr(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Vt(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((n,r)=>this.write(n,t[r]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let r=0;r=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,ur(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0,r=e.map(o=>(n+=o,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to + `}};function TX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,segmentIds:s}=t,{numSegments:i}=a,o=r.shape.length,l=[],d=0,u=C.getAxesPermutation([d],o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),l.push(p),d=C.getInnerMostAxes(1,o)[0]);let c=C.segment_util.computeOutShape(p.shape,d,i),h=w.sizeFromShape([p.shape[d]]),m=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,h]}});l.push(m);let f=lc(r.dtype),A=(k,b,v,I,T)=>{let R=k.shape[0],$=k.shape[1],z=C.segment_util.segOpComputeOptimalWindowSize($,T),_={windowSize:z,inSize:$,batchSize:R,numSegments:T},V=new NX(_,b),j=n.compileAndRun(V,[k,v],I);if(l.push(j),j.shape[1]===T)return j;let U=l6({backend:n,attrs:{start:0,stop:T,step:1,dtype:"float32"}}),X=p6({inputs:{x:U},backend:n,attrs:{reps:[$/z]}});return l.push(U),l.push(X),A(j,b,X,I,T)},y=A(m,"unsortedSegmentSum",s,f,i),g=fe({inputs:{x:y},backend:n,attrs:{shape:c}}),x=g;if(u!=null){l.push(g);let k=C.getUndoAxesPermutation(u);x=cn({inputs:{x},backend:n,attrs:{perm:k}})}return l.forEach(k=>n.disposeIntermediateTensorInfo(k)),x}var EX={kernelName:Eu,backendName:"webgl",kernelFunc:TX},CX=[AH,xH,tB,aB,iB,uB,pB,fB,AB,gB,wB,IB,TB,RB,_B,$B,WB,UB,VB,XB,ZB,JB,nV,uV,pV,yV,xV,kV,NV,zW,MV,BV,jV,OV,qV,KV,HV,JV,tj,rj,ij,lj,pj,yj,xj,hj,wj,Sj,Tj,Mj,Oj,Lj,Vj,jj,Uj,Gj,Xj,Zj,Jj,eU,rU,lU,dU,cU,mU,xU,kU,TU,OW,CU,CV,FU,OU,PU,PW,VU,GU,XU,tH,JU,sH,lH,cH,vH,CH,TH,$H,OH,_H,SH,LH,BH,HH,KH,QH,oG,jW,uG,cG,mG,gG,hV,vG,kG,SG,EG,FG,WW,DG,OG,fV,aG,PG,GG,VG,HW,ZG,QG,nq,sq,uq,pq,fq,yq,xq,wq,Sq,Eq,Mq,Dq,_q,oV,sG,Wq,Vq,Uq,Gq,Xq,Yq,eX,nX,rX,oX,rG,JW,dX,hX,AX,gX,vX,QW,kX,SX,EX,wG];for(let e of CX)ai(e);var Sn;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(Sn||(Sn={}));var gd;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(gd||(gd={}));var c6;function RX(e){c6=e.wasm.cwrap(ei,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function MX(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:l,transposeB:d,activation:u,leakyreluAlpha:p}=a,c=n.dataIdMap.get(r.dataId).id,h=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let T=n.dataIdMap.get(i.dataId);if(T.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${T.shape.length}.`);m=T.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,A=gd[u];if(A==null)throw new Error(`${u} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?r.shape[2]:r.shape[1],g=d?s.shape[1]:s.shape[2],x=r.shape[0],k=n.makeOutput([x,y,g],r.dtype),b=n.dataIdMap.get(k.dataId).id,v=new Uint8Array(new Int32Array(r.shape).buffer),I=new Uint8Array(new Int32Array(s.shape).buffer);return c6(c,v,r.shape.length,h,I,s.shape.length,l,d,A,m,f,p||0,b),k}var FX={kernelName:ei,backendName:"wasm",setupFunc:RX,kernelFunc:MX};function hn(e){let t;function n(r){t=r.wasm.cwrap(e,null,["number","number"])}function a(r){let{backend:s,inputs:{x:i}}=r,o=s.dataIdMap.get(i.dataId).id,l=s.makeOutput(i.shape,i.dtype),d=s.dataIdMap.get(l.dataId).id;return w.sizeFromShape(l.shape)===0||t(o,d),l}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:a}}var $X=hn(eo);function fn(e,t,n){let a;function r(i){a=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:d,b:u}=l,p=o.dataIdMap.get(d.dataId).id,c=o.dataIdMap.get(u.dataId).id,h=n!=null?n:d.dtype,m=C.assertAndGetBroadcastShape(d.shape,u.shape),f=o.makeOutput(m,h);if(w.sizeFromShape(m)===0)return f;let A=new Uint8Array(new Int32Array(d.shape).buffer),y=new Uint8Array(new Int32Array(u.shape).buffer),g=o.dataIdMap.get(f.dataId).id,x=()=>a(p,A,d.shape.length,c,y,u.shape.length,Sn[d.dtype],g);if(t&&d.dtype==="float32")return x(),f;let k=C.getBroadcastDims(d.shape,m),b=C.getBroadcastDims(u.shape,m),v=k.every((T,R)=>T===R),I=b.every((T,R)=>T===R);if(v&&I)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${d.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var DX=!0,OX=fn(kr,DX),h6;function zX(e){h6=e.wasm.cwrap(is,null,["array","number","number","number"])}function _X(e){let{inputs:t,backend:n}=e,a=n.makeOutput(t[0].shape,t[0].dtype);if(w.sizeFromShape(a.shape)===0)return a;let r=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=n.dataIdMap.get(a.dataId).id;return h6(s,r.length,Sn[a.dtype],i),a}var PX={kernelName:is,backendName:"wasm",setupFunc:zX,kernelFunc:_X};function Ih(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype),r=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(r),a}var LX={kernelName:ks,backendName:"wasm",kernelFunc:Ih},f6;function WX(e){f6=e.wasm.cwrap(Qs,null,["number","array","number","number","number","array","number"])}function Sh(e){let{inputs:t,backend:n,attrs:a}=e,[r,s]=VX(t.x.shape,a.perm),i=!0;for(let m=0;m=r&&(s===-1||a[s]>a[i])&&(s=i);a[s]=r}return[n,a]}var jX={kernelName:Qs,backendName:"wasm",kernelFunc:Sh,setupFunc:WX};function Wr(e,t,n){let a=e.shape,r=e.shape.length,s=w.parseAxisParam(t,a),i=s,o=C.getAxesPermutation(i,r),l=null,d=!1;if(o!=null){let u=new Array(r);for(let c=0;c`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}var nK={kernelName:Bo,backendName:"wasm",kernelFunc:ba},x6;function aK(e){x6=e.wasm.cwrap(us,null,["number","array","number","number","array","number","number","number","number"])}function rK(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=r.shape.length,d=s.shape.length,u=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[d-1]:s.shape[d-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[d-2]:s.shape[d-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),A=w.sizeFromShape(m),y=w.sizeFromShape(f),g=A===y||A===1||y===1;w.assert(l>=2&&d>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);w.assert(u===p,()=>`Error in matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let k=i?[A,u,c]:[A,c,u],b=o?[y,h,p]:[y,p,h],v=ba({inputs:{x:r},backend:n,attrs:{shape:k}}),I=ba({inputs:{x:s},backend:n,attrs:{shape:b}}),T=n.dataIdMap.get(v.dataId).id,R=n.dataIdMap.get(I.dataId).id,$=i?v.shape[2]:v.shape[1],z=o?I.shape[1]:I.shape[2],_=Math.max(A,y),V=n.makeOutput([_,$,z],v.dtype),j=n.dataIdMap.get(V.dataId).id,U=new Uint8Array(new Int32Array(v.shape).buffer),X=new Uint8Array(new Int32Array(I.shape).buffer);return x6(T,U,v.shape.length,R,X,I.shape.length,i,o,j),n.disposeData(v.dataId),n.disposeData(I.dataId),V.shape=x,V}var sK={kernelName:us,backendName:"wasm",setupFunc:aK,kernelFunc:rK};function Nh(e){let{inputs:{x:t},attrs:{dtype:n},backend:a}=e,r=a.makeOutput(t.shape,n),s=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(r).set(s),r}var iK={kernelName:ds,backendName:"wasm",kernelFunc:Nh},oK=hn(ps),b6;function lK(e){b6=e.wasm.cwrap(Ir,null,["number","number","number","number"])}function uK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o=n.dataIdMap.get(r.dataId).id,l=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(l.dataId).id;return b6(o,s,i,d),l}var dK={kernelName:Ir,backendName:"wasm",setupFunc:lK,kernelFunc:uK};function v6(e){let{inputs:t,backend:n}=e,a=w.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=C.computeOutShape(t.map(h=>h.shape),a),s=t.filter(h=>w.sizeFromShape(h.shape)>0);if(s.length===1)return Ih({inputs:{x:s[0]},backend:n});let i=n.makeOutput(r,t[0].dtype);if(w.sizeFromShape(r)===0)return i;let o=s.map(h=>h.shape);if(C.assertParamsConsistent(o,a),s[0].dtype==="string"){let h=s.map(x=>{let k=w.sizeFromShape(x.shape.slice(a));return ba({inputs:{x},backend:n,attrs:{shape:[-1,k]}})}),m=h.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));r=C.computeOutShape(h.map(x=>x.shape),1);let f=h[0].shape[0]===1,A=VA(m,r,t[0].dtype,f),y=C.computeOutShape(s.map(x=>x.shape),a);i.shape=y;let g=n.dataIdMap.get(i.dataId);return g.stringBytes=C.fromStringArrayToUint8(A),h.forEach(x=>n.disposeData(x.dataId)),i}let l=w.sizeFromShape(s[0].shape.slice(0,a)),d=0,u=s.map(h=>{let m=w.sizeFromShape(h.shape.slice(a));return d+=m,m}),p=s.map(h=>n.typedArrayFromHeap(h)),c=n.typedArrayFromHeap(i);for(let h=0;h`cumsum does not support ${r.dtype} tensors in the WASM backend`);let d=C.getAxesPermutation([s],l),u=r;d!==null&&(u=Sh({inputs:{x:r},attrs:{perm:d},backend:n}));let p=C.getInnerMostAxes(1,l)[0];C.assertAxesAreInnerMostDims("cumsum",[p],l);let c=n.makeOutput(u.shape,u.dtype),h=u.shape[p],m=n.dataIdMap.get(u.dataId).id,f=n.dataIdMap.get(c.dataId).id;S6(m,i?1:0,o?1:0,h,f,Sn[r.dtype]);let A=c;if(d!==null){let y=C.getUndoAxesPermutation(d);A=Sh({inputs:{x:c},attrs:{perm:y},backend:n}),n.disposeData(u.dataId),n.disposeData(c.dataId)}return A}var IK={kernelName:ms,backendName:"wasm",setupFunc:wK,kernelFunc:kK},N6;function SK(e){N6=e.wasm.cwrap(fo,null,["number","number","number","array","number","array","array","number","number"])}function NK(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{blockSize:s,dataFormat:i}=a;w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],d=i==="NHWC"?r.shape[2]:r.shape[3],u=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=d*s,h=u/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=t.makeOutput(m,"float32"),A=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(w.computeStrides(r.shape)).buffer),g=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(w.computeStrides(m)).buffer),k=t.dataIdMap.get(f.dataId).id;return N6(A,s,i==="NHWC"?1:0,y,r.shape.length-1,g,x,m.length,k),f}var TK={kernelName:fo,backendName:"wasm",setupFunc:SK,kernelFunc:NK},T6;function EK(e){T6=e.wasm.cwrap(As,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function CK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s}=t,i=a.dataIdMap.get(r.dataId).id,o=a.dataIdMap.get(s.dataId).id,{strides:l,dilations:d,pad:u,dimRoundingMode:p}=n,c=d==null?[1,1]:d,h=C.computeConv2DInfo(r.shape,s.shape,l,c,u,p,!0),m=h.filterHeight,f=h.filterWidth,A=h.padInfo.top,y=h.padInfo.right,g=h.padInfo.bottom,x=h.padInfo.left,k=h.dilationHeight,b=h.dilationWidth,v=h.strideHeight,I=h.strideWidth,T=h.inChannels,R=h.outChannels,$=h.padInfo.type==="SAME"?1:0;if(h.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${h.dataFormat}'. Please use 'channelsLast'.`);let z=a.makeOutput(h.outShape,"float32"),_=a.dataIdMap.get(z.dataId).id;return T6(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,A,y,g,x,$,k,b,v,I,T,R,_),z}var RK={kernelName:As,backendName:"wasm",setupFunc:EK,kernelFunc:CK},MK=!1,FK=fn(yo,MK,"bool"),$K=hn(gs);function v1(e){let{inputs:t,attrs:n,backend:a}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(w.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),ba({inputs:{x:r},backend:a,attrs:{shape:o}})}var DK={kernelName:go,backendName:"wasm",kernelFunc:v1};function OK(e){let{attrs:{shape:t,value:n,dtype:a},backend:r}=e,s=r.makeOutput(t,a);return r.typedArrayFromHeap(s).fill(n),s}var zK={kernelName:xu,backendName:"wasm",kernelFunc:OK},E6;function _K(e){E6=e.wasm.cwrap(bo,null,["number","number","number","number","number","number"])}function PK(e){let{inputs:t,backend:n}=e,{image:a}=t,r=n.makeOutput(a.shape,a.dtype),s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,[o,l,d,u]=a.shape;return E6(s,o,l,d,u,i),r}var LK={kernelName:bo,backendName:"wasm",kernelFunc:PK,setupFunc:_K},WK=hn(xs),BK=!1,VK=fn(bs,BK),C6;function jK(e){C6=e.wasm.cwrap(vs,null,["number","number","number","number","number","number","number"])}function UK(e){let{backend:t,inputs:n,attrs:a}=e,{varianceEpsilon:r}=a,{x:s,mean:i,variance:o,offset:l,scale:d}=n,u=t.dataIdMap.get(s.dataId).id,p=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(o.dataId).id,h=l!=null?t.dataIdMap.get(l.dataId).id:0,m=d!=null?t.dataIdMap.get(d.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(w.sizeFromShape(s.shape)===0)return f;let A=t.dataIdMap.get(f.dataId).id;return C6(u,p,c,h,m,r,A),f}var HK={kernelName:vs,backendName:"wasm",setupFunc:jK,kernelFunc:UK},R6;function GK(e){R6=e.wasm.cwrap(ti,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function qK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=C.computeConv2DInfo(r.shape,s.shape,l,u,d,c),A=gd[h];if(A==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,g=a.dataIdMap.get(s.dataId).id,x=f.outChannels,k=0;if(i!=null){let Q=a.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);k=Q.id}let b=f.filterHeight,v=f.filterWidth,I=f.padInfo.top,T=f.padInfo.right,R=f.padInfo.bottom,$=f.padInfo.left,z=f.dilationHeight,_=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let re=a.makeOutput(f.outShape,"float32"),te=a.dataIdMap.get(re.dataId).id,ie=o==null?0:a.dataIdMap.get(o.dataId).id;return R6(y,G,ee,Y,g,b,v,k,I,T,R,$,X,z,_,V,j,U,x,A,ie,m||0,te),re}var XK={kernelName:ti,backendName:"wasm",setupFunc:GK,kernelFunc:qK},M6;function KK(e){M6=e.wasm.cwrap(ni,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function ZK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=C.computeConv2DInfo(r.shape,s.shape,l,u,d,c,!0),A=gd[h];if(A==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,g=a.dataIdMap.get(s.dataId).id,x=f.outChannels,k=0;if(i!=null){let Q=a.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);k=Q.id}let b=f.filterHeight,v=f.filterWidth,I=f.padInfo.top,T=f.padInfo.right,R=f.padInfo.bottom,$=f.padInfo.left,z=f.dilationHeight,_=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let re=a.makeOutput(f.outShape,"float32"),te=a.dataIdMap.get(re.dataId).id,ie=o==null?0:a.dataIdMap.get(o.dataId).id;return M6(y,G,ee,Y,g,b,v,k,I,T,R,$,X,z,_,V,j,U,x,A,ie,m||0,te),re}var YK={kernelName:ni,backendName:"wasm",setupFunc:KK,kernelFunc:ZK},F6;function JK(e){F6=e.wasm.cwrap(wo,null,["number","number","number","number","number","number","array","number"])}function QK(e){let{backend:t,inputs:n}=e,{params:a,indices:r}=n,[s,i,o,l]=Lm.prepareAndValidate(a,r),d=t.makeOutput(s,a.dtype);if(i===0)return d;let u=r.shape,p=u[u.length-1],c=t.dataIdMap.get(a.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(d.dataId).id;return F6(c,Sn[a.dtype],h,i,p,o,m,f),d}var eZ={kernelName:wo,backendName:"wasm",setupFunc:JK,kernelFunc:QK},$6;function tZ(e){$6=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function nZ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r,indices:s}=n,{axis:i,batchDims:o}=a,l=w.parseAxisParam(i,r.shape)[0],d=C.segment_util.collectGatherOpShapeInfo(r,s,l,o),u=ba({inputs:{x:r},attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]},backend:t}),p=w.sizeFromShape(s.shape),c=ba({inputs:{x:s},attrs:{shape:[d.batchSize,p/d.batchSize]},backend:t}),h=[d.batchSize,d.outerSize,p/d.batchSize,d.sliceSize],m=t.makeOutput(h,r.dtype);if(w.sizeFromShape(r.shape)===0)return m;let f=u.shape.length-1,A=t.dataIdMap.get(u.dataId).id,y=t.dataIdMap.get(c.dataId).id,g=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(w.computeStrides(u.shape)).buffer),k=new Uint8Array(new Int32Array(w.computeStrides(h)).buffer);return $6(A,Sn[r.dtype],x,f,y,d.batchSize,k,g),t.disposeData(u.dataId),t.disposeData(c.dataId),m.shape=d.outputShape,m}var aZ={kernelName:vo,backendName:"wasm",setupFunc:tZ,kernelFunc:nZ},rZ=!1,sZ=fn(ko,rZ,"bool"),iZ=!1,oZ=fn(ws,iZ,"bool"),D6;function lZ(e){D6=e.wasm.cwrap(Is,null,["number","number","number"])}function uZ(e){let{inputs:{x:t},attrs:{alpha:n},backend:a}=e,r=a.dataIdMap.get(t.dataId).id,s=a.makeOutput(t.shape,t.dtype);if(w.sizeFromShape(t.shape)!==0){let i=a.dataIdMap.get(s.dataId).id;D6(r,n,i)}return s}var dZ={kernelName:Is,backendName:"wasm",setupFunc:lZ,kernelFunc:uZ},pZ=!1,cZ=fn(To,pZ,"bool"),hZ=!1,fZ=fn(Eo,hZ,"bool"),mZ=hn(Ss),AZ=!1,yZ=fn(Ro,AZ,"bool"),O6;function gZ(e){O6=e.wasm.cwrap(Ns,null,["number, number, number"])}function xZ(e){let{backend:t,inputs:n,attrs:a}=e,{reductionIndices:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:d,axes:u,originalAxes:p,inputWasTransposed:c}=Wr(i,r,t);if(c){let g=t.dataIdMap.get(d.dataId).id;l=d,o=g}let h=l.shape.length;C.assertAxesAreInnerMostDims("max",u,h);let[m,f]=C.computeOutAndReduceShapes(l.shape,u),A=w.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(w.sizeFromShape(l.shape)!==0){let g=t.dataIdMap.get(y.dataId).id;O6(o,A,g)}if(c&&t.disposeData(d.dataId),s){let g=C.expandShapeToKeepDim(y.shape,p);y.shape=g}return y}var bZ={kernelName:Ns,backendName:"wasm",setupFunc:gZ,kernelFunc:xZ},vZ=!1,wZ=fn(Ts,vZ),z6;function kZ(e){z6=e.wasm.cwrap(Es,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function IZ(e){let{inputs:t,attrs:n,backend:a}=e,r=t.x,s=a.dataIdMap.get(r.dataId).id,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=n,u=C.computePool2DInfo(r.shape,i,o,1,l,d),p=u.filterHeight,c=u.filterWidth,h=u.padInfo.top,m=u.padInfo.right,f=u.padInfo.bottom,A=u.padInfo.left,y=u.dilationHeight,g=u.dilationWidth,x=u.strideHeight,k=u.strideWidth,b=u.inChannels,v=u.outChannels;if(u.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${u.dataFormat}'. Please use 'channelsLast'.`);let I=a.makeOutput(u.outShape,"float32"),T=a.dataIdMap.get(I.dataId).id;return z6(s,r.shape[0],r.shape[1],r.shape[2],p,c,h,m,f,A,y,g,x,k,b,v,T),I}var SZ={kernelName:Es,backendName:"wasm",setupFunc:kZ,kernelFunc:IZ},_6;function NZ(e){_6=e.wasm.cwrap(Cs,null,["number, number, number"])}function TZ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let k=t.dataIdMap.get(u.dataId).id;k!==o&&(d=u,l=k,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("mean",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=d;d.dtype!=="float32"&&(g=Nh({backend:t,inputs:{x:d},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(g.dataId).id);let x=t.makeOutput(f,"float32");if(w.sizeFromShape(d.shape)!==0){let k=t.dataIdMap.get(x.dataId).id;_6(l,y,k)}if(h&&t.disposeData(u.dataId),s){let k=C.expandShapeToKeepDim(x.shape,c);x.shape=k}return d.dtype!=="float32"&&t.disposeData(g.dataId),x}var EZ={kernelName:Cs,backendName:"wasm",setupFunc:NZ,kernelFunc:TZ},P6;function CZ(e){P6=e.wasm.cwrap(Rs,null,["number, number, number"])}function RZ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t);if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x)}let m=d.shape.length;C.assertAxesAreInnerMostDims("min",p,m);let[f,A]=C.computeOutAndReduceShapes(d.shape,p),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;P6(l,y,x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var MZ={kernelName:Rs,backendName:"wasm",setupFunc:CZ,kernelFunc:RZ},FZ=!1,$Z=fn(Ms,FZ),w1;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(w1||(w1={}));var L6;function DZ(e){L6=e.wasm.cwrap(Fs,null,["number","array","number","number","array","array","number","number"])}function OZ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,mode:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(t.shape).buffer),u=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(u).buffer),h=new Uint8Array(new Int32Array(p).buffer);return L6(i,d,t.shape.length,Sn[t.dtype],c,h,w1[r],l),o}var zZ={kernelName:Fs,backendName:"wasm",kernelFunc:OZ,setupFunc:DZ},_Z=!0,PZ=fn($s,_Z),LZ=hn(Fo);function k1(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),a=n[0],r=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:a,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var W6;function WZ(e){W6=e.wasm.cwrap(Do,"number",["number","number","number","number","number"])}function BZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=a,{boxes:o,scores:l}=n,d=t.dataIdMap.get(o.dataId).id,u=t.dataIdMap.get(l.dataId).id,p=W6(d,u,s,r,i),{pSelectedIndices:c,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=k1(t,p);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",c)}var VZ={kernelName:Do,backendName:"wasm",setupFunc:WZ,kernelFunc:BZ},B6;function jZ(e){B6=e.wasm.cwrap(Oo,"number",["number","number","number","number","number","bool"])}function UZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=a,{boxes:l,scores:d}=n,u=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(d.dataId).id,c=B6(u,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=k1(t,c);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),g=t.makeOutput([],"int32",A);return[y,g]}var HZ={kernelName:Oo,backendName:"wasm",setupFunc:jZ,kernelFunc:UZ},V6;function GZ(e){V6=e.wasm.cwrap(zo,"number",["number","number","number","number","number","number"])}function qZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=a,{boxes:l,scores:d}=n,u=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(d.dataId).id,c=V6(u,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=k1(t,c);t.wasm._free(A);let y=t.makeOutput([m],"int32",h),g=t.makeOutput([m],"float32",f);return[y,g]}var XZ={kernelName:zo,backendName:"wasm",setupFunc:GZ,kernelFunc:qZ},KZ=!1,ZZ=fn($o,KZ,"bool"),j6;function YZ(e){j6=e.wasm.cwrap(Ds,null,["number","number","number","number","number"])}function JZ(e){let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=n.makeOutput([...r.shape,s],"int32"),d=n.dataIdMap.get(l.dataId).id,u=n.dataIdMap.get(r.dataId).id;return j6(u,s,i,o,d),l}var QZ={kernelName:Ds,backendName:"wasm",setupFunc:YZ,kernelFunc:JZ};function eY(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(1),a}var tY={kernelName:_o,backendName:"wasm",kernelFunc:eY};function nY(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return v1({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=v1({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=v6({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeData(u.dataId)),d}var aY={kernelName:Po,backendName:"wasm",kernelFunc:nY},U6;function rY(e){U6=e.wasm.cwrap(Os,null,["number","array","number","number","array","array","number","number"])}function sY(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,constantValue:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(t.shape).buffer),u=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(u).buffer),h=new Uint8Array(new Int32Array(p).buffer);return U6(i,d,t.shape.length,Sn[t.dtype],c,h,r,l),o}var iY={kernelName:Os,backendName:"wasm",kernelFunc:sY,setupFunc:rY},oY=!1,lY=fn(zs,oY),H6;function uY(e){H6=e.wasm.cwrap(_s,null,["number","number","number"])}function dY(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,o=n.makeOutput(a.shape,"float32"),l=n.dataIdMap.get(o.dataId).id;return H6(s,i,l),o}var pY={kernelName:_s,backendName:"wasm",setupFunc:uY,kernelFunc:dY},G6;function cY(e){G6=e.wasm.cwrap(Lo,null,["number","number","number","number"])}function hY(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("prod",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;G6(l,y,Sn[g.dtype],x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var fY={kernelName:Lo,backendName:"wasm",setupFunc:cY,kernelFunc:hY},mY=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=HA(a,r,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},AY={kernelName:Iu,backendName:"wasm",kernelFunc:mY},yY=!0,gY=fn(ys,yY),xY=hn(Ps),bY=hn(Ws),q6;function vY(e){q6=e.wasm.cwrap(Ls,null,["number","number","number","number","number","number","number","number","number","number"])}function wY(e){let{backend:t,inputs:n,attrs:a}=e,{images:r}=n,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,[u,p,c,h]=r.shape,m=[u,l,d,h],f=t.dataIdMap.get(r.dataId),A;f.dtype!=="float32"&&(A=Nh({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(A.dataId));let y=f.id,g=t.makeOutput(m,"float32");if(w.sizeFromShape(r.shape)===0)return g;let x=t.dataIdMap.get(g.dataId).id;return q6(y,u,p,c,h,l,d,s?1:0,i?1:0,x),A!=null&&t.disposeData(A.dataId),g}var kY={kernelName:Ls,backendName:"wasm",setupFunc:vY,kernelFunc:wY},X6;function IY(e){X6=e.wasm.cwrap(Bs,null,["number","array","number","array","number","number"])}function SY(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=w.parseAxisParam(s,r.shape);if(r.shape.length===0)return Ih({inputs:{x:r},backend:n});let o=n.makeOutput(r.shape,r.dtype),l=n.dataIdMap.get(r.dataId).id,d=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(i).buffer),p=new Uint8Array(new Int32Array(r.shape).buffer);X6(l,u,i.length,p,r.shape.length,d);let c=ba({inputs:{x:o},attrs:{shape:r.shape},backend:n});return n.disposeData(o.dataId),c}var NY={kernelName:Bs,backendName:"wasm",kernelFunc:SY,setupFunc:IY},K6;function TY(e){K6=e.wasm.cwrap(el,null,["number","number","number","number","number","number","number","number","array","number","number"])}function EY(e){let{inputs:t,backend:n,attrs:a}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=a,l=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(r.dataId).id,u=n.dataIdMap.get(l.dataId).id,[p,c,h,m]=r.shape,[f,A]=C.getImageCenter(o,c,h),y=i===0,g=255,x=typeof i=="number"?[i,i,i,y?0:g]:[...i,g],k=new Uint8Array(new Int32Array(x).buffer);return K6(d,p,c,h,m,s,f,A,k,x.length,u),l}var CY={kernelName:el,backendName:"wasm",kernelFunc:EY,setupFunc:TY},RY=hn(Vs),MY=hn(js),Z6;function FY(e){Z6=e.wasm.cwrap(Vo,null,["number","number","number","number","number","number","array","number","number"])}function $Y(e){let{backend:t,inputs:n,attrs:a}=e,{indices:r,updates:s}=n,{shape:i}=a,o=t.makeOutput(i,s.dtype);if(w.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:d,sliceSize:u,strides:p,outputSize:c}=Wm.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(p).buffer),A=t.dataIdMap.get(o.dataId).id;return Z6(h,m,Sn[s.dtype],l,d,u,f,c,A),o}var DY={kernelName:Vo,backendName:"wasm",setupFunc:FY,kernelFunc:$Y},Y6;function OY(e){Y6=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function zY(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=n.dataIdMap.get(a.dataId).id,o=n.dataIdMap.get(r.dataId).id,l=n.dataIdMap.get(s.dataId).id,d=n.makeOutput(r.shape,r.dtype),u=n.dataIdMap.get(d.dataId).id,p=a.shape.length,c=r.shape.length,h=p===0||p>1||c===1?1:w.sizeFromShape(r.shape.slice(1));return Y6(i,o,l,h,u),d}var _Y={kernelName:jo,backendName:"wasm",kernelFunc:zY,setupFunc:OY},J6;function PY(e){J6=e.wasm.cwrap(Hs,null,["number","number"])}function LY(e){let{backend:t,inputs:{x:n}}=e,a=t.dataIdMap.get(n.dataId).id,r=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(r.dataId).id;return w.sizeFromShape(r.shape)===0||J6(a,s),r}var WY={kernelName:"Sigmoid",backendName:"wasm",setupFunc:PY,kernelFunc:LY},BY=hn(Us);function Th(e){let{inputs:{x:t},attrs:{begin:n,size:a},backend:r}=e,[s,i]=sn.parseSliceParams(t,n,a),o=sn.isSliceContinous(t.shape,s,i),l=r.readSync(t.dataId),d=r.makeOutput(i,t.dtype),u=w.computeStrides(t.shape),p=r.dataIdMap.get(d.dataId);if(o){let m=sn.computeFlatOffset(s,u);return t.dtype==="string"?p.stringBytes=l.slice(m,m+w.sizeFromShape(i)):r.typedArrayFromHeap(d).set(l.subarray(m,m+w.sizeFromShape(i))),d}if(t.dtype==="string"){let m=th(l,s,i,t.shape,t.dtype);return p.stringBytes=m,d}let c=r.typedArrayFromHeap(d),h=t.shape.length;if(h===2)VY(l,u[0],c,s,i);else if(h===3)jY(l,u[0],u[1],c,s,i);else if(h===4)UY(l,u[0],u[1],u[2],c,s,i);else{let m=th(l,s,i,t.shape,t.dtype);c.set(m)}return d}function VY(e,t,n,a,r){let s=0,i=a[0],o=a[1],l=i+r[0];for(let d=i;d{let c=[...u];c[o]=p;let h=Th({inputs:{x:r},attrs:{begin:d,size:c},backend:a});return d[o]+=p,h})}var ZY={kernelName:Ko,backendName:"wasm",kernelFunc:KY},YY=hn(Gs),JY=hn(Tu),QY=!0,eJ=fn(Ks,QY),ew;function tJ(e){ew=e.wasm.cwrap(Nr,null,["number","number","number"])}function nJ(e){let{backend:t,inputs:n,attrs:a}=e,{alpha:r}=a,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return ew(i,r,l),o}var aJ={kernelName:Nr,backendName:"wasm",setupFunc:tJ,kernelFunc:nJ},tw;function rJ(e){tw=e.wasm.cwrap(Zo,null,["number","array","number","array","array","array","array","array","number","number"])}function sJ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{begin:s,end:i,strides:o}=a;o==null&&(o=new Array(s.length));let{beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a,h=C.slice_util.maskToAxes(u);if(h.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(u!==0&&p!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(u!==0&&c!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=r.shape.length-s.length,f=C.slice_util.maskToAxes(p),A=r.shape.slice();f.forEach($=>{s[$]=0,i[$]=1,A.splice($,0,1)});let y=ba({inputs:{x:r},attrs:{shape:A},backend:t}),{begin:g,end:x,strides:k}=C.slice_util.getNormalizedAxes(y.shape,h,m,s,i,o,l,d,u);s=g,i=x,o=k;let b=C.slice_util.maskToAxes(c);b.forEach($=>{i[$]=s[$]+1,o[$]=1});let v=C.slice_util.computeOutShape(s,i,o),I=v.filter(($,z)=>b.indexOf(z)===-1);if(o.every($=>$===1)){let $=Th({inputs:{x:y},attrs:{begin:s,size:v},backend:t});t.disposeData(y.dataId);let z=ba({inputs:{x:$},attrs:{shape:I},backend:t});return t.disposeData($.dataId),z}let T=t.makeOutput(I,"float32");if(!I.some($=>$===0)){let $=t.dataIdMap.get(y.dataId).id,z=new Uint8Array(new Int32Array(w.computeStrides(y.shape)).buffer),_=new Uint8Array(new Int32Array(s).buffer),V=new Uint8Array(new Int32Array(i).buffer),j=new Uint8Array(new Int32Array(o).buffer),U=new Uint8Array(new Int32Array(I).buffer),X=new Uint8Array(new Int32Array(w.computeStrides(I)).buffer),G=t.dataIdMap.get(T.dataId).id;tw($,z,y.shape.length,_,V,j,U,X,I.length,G)}t.disposeData(y.dataId);let R=ba({inputs:{x:T},attrs:{shape:I},backend:t});return t.disposeData(T.dataId),R}var iJ={kernelName:Zo,backendName:"wasm",setupFunc:rJ,kernelFunc:sJ},oJ=!0,lJ=fn(Zs,oJ),nw;function uJ(e){nw=e.wasm.cwrap(qs,null,["number, number, number"])}function dJ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("sum",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;nw(l,y,x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var pJ={kernelName:qs,backendName:"wasm",setupFunc:uJ,kernelFunc:dJ},cJ=hn(Ys),hJ=hn(Js),aw;function fJ(e){aw=e.wasm.cwrap(Sr,null,["number","array","number","array","number","number"])}function mJ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,s=n.dataIdMap.get(r.dataId).id,{reps:i}=a,o=new Array(r.shape.length);for(let c=0;c{let{x:a}=e,{k:r,sorted:s}=n,i=t.dataIdMap.get(a.dataId).id,o=new Uint8Array(new Int32Array(a.shape).buffer),l=a.shape.slice();l[l.length-1]=r;let d=t.makeOutput(l,a.dtype),u=t.dataIdMap.get(d.dataId).id,p=t.makeOutput(l,"int32"),c=t.dataIdMap.get(p.dataId).id;return rw(i,o,a.shape.length,Sn[a.dtype],r,s,u,c),[d,p]},xJ={kernelName:Yo,backendName:"wasm",setupFunc:yJ,kernelFunc:gJ};function bJ(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,l=new Array(o-1),d=0;for(let h=0;h({dataId:h,dtype:m,shape:l}))}var vJ={kernelName:Jo,backendName:"wasm",kernelFunc:bJ};function wJ(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(0),a}var kJ={kernelName:Qo,backendName:"wasm",kernelFunc:wJ},IJ=[$X,OX,PX,GX,KX,JX,tK,sK,iK,oK,dK,pK,fK,yK,gK,vK,IK,TK,RK,FK,$K,DK,zK,LK,WK,VK,FX,HK,XK,YK,eZ,aZ,sZ,oZ,LX,dZ,cZ,fZ,mZ,yZ,bZ,wZ,SZ,EZ,MZ,$Z,zZ,PZ,LZ,VZ,HZ,XZ,ZZ,QZ,tY,aY,iY,lY,pY,fY,AY,gY,xY,bY,nK,kY,NY,CY,MY,RY,DY,_Y,WY,BY,HY,XY,ZY,YY,JY,eJ,aJ,iJ,lJ,pJ,cJ,hJ,AJ,xJ,jX,vJ,kJ];for(let e of IJ)ai(e);var I1=J();I1.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])));I1.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(I1.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var sw=Yi(J9()),SJ='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',NJ=Yi(Q9()),iw=class extends du{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new wp(this,nr())}write(e,t,n){let a={id:this.dataIdNextNumber++};return this.move(a,e,t,n,1),a}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=w.now();return e(),{kernelMs:w.now()-t}}move(e,t,n,a,r){let s=this.dataIdNextNumber++;if(a==="string"){let d=t;this.dataIdMap.set(e,{id:s,stringBytes:d,shape:n,dtype:a,memoryOffset:null,refCount:r});return}let i=w.sizeFromShape(n),o=i*w.bytesPerElement(a),l=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:n,dtype:a,refCount:r}),this.wasm.tfjs.registerTensor(s,i,l),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),l)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:a,stringBytes:r}=this.dataIdMap.get(e);if(n==="string")return r;let s=this.wasm.HEAPU8.slice(t,t+w.sizeFromShape(a)*w.bytesPerElement(n));return TJ(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let a;if(n==null)a=this.write(null,e,t);else{let r=this.dataIdNextNumber++;a={id:r},this.dataIdMap.set(a,{id:r,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=w.sizeFromShape(e);this.wasm.tfjs.registerTensor(r,s,n)}return{dataId:a,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let a=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(n),s=w.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,r,s);case"int32":return new Int32Array(a,r,s);case"bool":return new Uint8Array(a,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function EJ(e){return(t,n)=>(w.fetch(e,{credentials:"same-origin"}).then(a=>{a.ok||t.env.a(`failed to load wasm binary file at '${e}'`),a.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{n(s.instance,s.module)})})}),{})}function ow(e,t,n){if(Eh!=null)return Eh;let a="tfjs-backend-wasm.wasm";return e&&t?a="tfjs-backend-wasm-threaded-simd.wasm":e&&(a="tfjs-backend-wasm-simd.wasm"),xd!=null&&xd[a]!=null?xd[a]:n+a}async function CJ(){let[e,t]=await Promise.all([J().getAsync("WASM_HAS_SIMD_SUPPORT"),J().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,a)=>{let r={};r.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let d=SJ,u=new Blob([d],{type:"application/javascript"});return URL.createObjectURL(u)}return o.endsWith(".wasm")?ow(e,t,bd!=null?bd:l):l+o},S1&&(r.instantiateWasm=EJ(ow(e,t,bd!=null?bd:"")));let s=!1;r.onAbort=()=>{s||vd||(vd=!0,a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&Eh==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+sw.default.toString()],{type:"text/javascript"}),i=(0,sw.default)(r)):i=(0,NJ.default)(r),i.then(o=>{s=!0,vd=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},n({wasm:o})})})}function TJ(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var RJ=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Eh=null,bd=null,xd={},vd=!1,S1=!1;function MJ(e,t=!1){if(Gm("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),vd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Eh=e,S1=t}function FJ(e,t=!1){if(vd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")bd=e;else{xd=e;let n=RJ.filter(a=>xd[a]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}S1=t}var lw="3.5.0",$J=2;ul("wasm",async()=>{let{wasm:e}=await CJ();return new iw(e)},$J);Z().prototype.abs=function(){return this.throwIfDisposed(),Ot(this)};Z().prototype.acos=function(){return this.throwIfDisposed(),Xm(this)};Z().prototype.acosh=function(){return this.throwIfDisposed(),Km(this)};Z().prototype.add=function(e){return this.throwIfDisposed(),se(this,e)};Z().prototype.all=function(e,t){return this.throwIfDisposed(),Ac(this,e,t)};Z().prototype.any=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)};Z().prototype.argMax=function(e){return this.throwIfDisposed(),Bu(this,e)};Z().prototype.argMin=function(e){return this.throwIfDisposed(),Zm(this,e)};Z().prototype.asScalar=function(){return this.throwIfDisposed(),F(this.size===1,()=>"The array must have only 1 element."),H(this,[])};Z().prototype.asType=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.as1D=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.as2D=function(e,t){return this.throwIfDisposed(),H(this,[e,t])};Z().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),H(this,[e,t,n])};Z().prototype.as4D=function(e,t,n,a){return this.throwIfDisposed(),H(this,[e,t,n,a])};Z().prototype.as5D=function(e,t,n,a,r){return this.throwIfDisposed(),H(this,[e,t,n,a,r])};Z().prototype.asin=function(){return this.throwIfDisposed(),Ym(this)};Z().prototype.asinh=function(){return this.throwIfDisposed(),Jm(this)};Z().prototype.atan=function(){return this.throwIfDisposed(),Qm(this)};Z().prototype.atan2=function(e){return this.throwIfDisposed(),eA(this,e)};Z().prototype.atanh=function(){return this.throwIfDisposed(),tA(this)};Z().prototype.avgPool=function(e,t,n,a){return this.throwIfDisposed(),ju(this,e,t,n,a)};Z().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Uu(this,e,t)};Z().prototype.batchNorm=function(e,t,n,a,r){return this.throwIfDisposed(),pi(this,e,t,n,a,r)};Z().prototype.broadcastTo=function(e){return this.throwIfDisposed(),pl(this,e)};Z().prototype.cast=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.ceil=function(){return this.throwIfDisposed(),sA(this)};Z().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),kn(this,e,t)};Z().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Le&&(e=[e]),ot([this,...e],t)};Z().prototype.conv1d=function(e,t,n,a,r,s){return this.throwIfDisposed(),gc(this,e,t,n,a,r,s)};Z().prototype.conv2dTranspose=function(e,t,n,a,r){return this.throwIfDisposed(),xc(this,e,t,n,a,r)};Z().prototype.conv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),ar(this,e,t,n,a,r,s)};Z().prototype.cos=function(){return this.throwIfDisposed(),Hu(this)};Z().prototype.cosh=function(){return this.throwIfDisposed(),bc(this)};Z().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),vc(this,e,t,n)};Z().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),lA(this,e,t)};Z().prototype.depthwiseConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),hl(this,e,t,n,a,r,s)};Z().prototype.dilation2d=function(e,t,n,a,r){return this.throwIfDisposed(),uA(this,e,t,n,a,r)};Z().prototype.divNoNan=function(e){return this.throwIfDisposed(),dA(this,e)};Z().prototype.div=function(e){return this.throwIfDisposed(),ge(this,e)};Z().prototype.dot=function(e){return this.throwIfDisposed(),Db(this,e)};Z().prototype.elu=function(){return this.throwIfDisposed(),fl(this)};Z().prototype.equal=function(e){return this.throwIfDisposed(),Fr(this,e)};Z().prototype.erf=function(){return this.throwIfDisposed(),pA(this)};Z().prototype.exp=function(){return this.throwIfDisposed(),qn(this)};Z().prototype.expandDims=function(e){return this.throwIfDisposed(),on(this,e)};Z().prototype.expm1=function(){return this.throwIfDisposed(),cA(this)};Z().prototype.fft=function(){return this.throwIfDisposed(),td(this)};Z().prototype.flatten=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.floor=function(){return this.throwIfDisposed(),ml(this)};Z().prototype.floorDiv=function(e){return this.throwIfDisposed(),fc(this,e)};Z().prototype.gather=function(e,t){return this.throwIfDisposed(),ci(this,e,t)};Z().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Dr(this,e)};Z().prototype.greater=function(e){return this.throwIfDisposed(),oa(this,e)};Z().prototype.ifft=function(){return this.throwIfDisposed(),xl(this)};Z().prototype.irfft=function(){return this.throwIfDisposed(),Pc(this)};Z().prototype.isFinite=function(){return this.throwIfDisposed(),zb(this)};Z().prototype.isInf=function(){return this.throwIfDisposed(),_b(this)};Z().prototype.isNaN=function(){return this.throwIfDisposed(),fA(this)};Z().prototype.leakyRelu=function(e){return this.throwIfDisposed(),qu(this,e)};Z().prototype.lessEqual=function(e){return this.throwIfDisposed(),hi(this,e)};Z().prototype.less=function(e){return this.throwIfDisposed(),kc(this,e)};Z().prototype.localResponseNormalization=function(e,t,n,a){return this.throwIfDisposed(),mA(this,e,t,n,a)};Z().prototype.logSigmoid=function(){return this.throwIfDisposed(),Wb(this)};Z().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Nc(this,e)};Z().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),gA(this,e,t)};Z().prototype.log=function(){return this.throwIfDisposed(),Fn(this)};Z().prototype.log1p=function(){return this.throwIfDisposed(),Ic(this)};Z().prototype.logicalAnd=function(e){return this.throwIfDisposed(),la(this,e)};Z().prototype.logicalNot=function(){return this.throwIfDisposed(),Xu(this)};Z().prototype.logicalOr=function(e){return this.throwIfDisposed(),Tc(this,e)};Z().prototype.logicalXor=function(e){return this.throwIfDisposed(),Ub(this,e)};Z().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Be(this,e,t,n)};Z().prototype.maxPool=function(e,t,n,a){return this.throwIfDisposed(),Ku(this,e,t,n,a)};Z().prototype.max=function(e,t){return this.throwIfDisposed(),Xn(this,e,t)};Z().prototype.maximum=function(e){return this.throwIfDisposed(),Pa(this,e)};Z().prototype.mean=function(e,t){return this.throwIfDisposed(),kt(this,e,t)};Z().prototype.min=function(e,t){return this.throwIfDisposed(),Al(this,e,t)};Z().prototype.minimum=function(e){return this.throwIfDisposed(),yl(this,e)};Z().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),bA(this,e,t)};Z().prototype.mod=function(e){return this.throwIfDisposed(),vA(this,e)};Z().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};Z().prototype.neg=function(){return this.throwIfDisposed(),wt(this)};Z().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Vc(this,e,t,n)};Z().prototype.notEqual=function(e){return this.throwIfDisposed(),Ai(this,e)};Z().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),ol(this,e,t,n)};Z().prototype.onesLike=function(){return this.throwIfDisposed(),Dn(this)};Z().prototype.pad=function(e,t){return this.throwIfDisposed(),rr(this,e,t)};Z().prototype.pool=function(e,t,n,a,r){return this.throwIfDisposed(),qb(this,e,t,n,a,r)};Z().prototype.pow=function(e){return this.throwIfDisposed(),sr(this,e)};Z().prototype.prelu=function(e){return this.throwIfDisposed(),Yu(this,e)};Z().prototype.prod=function(e,t){return this.throwIfDisposed(),Cc(this,e,t)};Z().prototype.reciprocal=function(){return this.throwIfDisposed(),IA(this)};Z().prototype.relu=function(){return this.throwIfDisposed(),La(this)};Z().prototype.relu6=function(){return this.throwIfDisposed(),Mc(this)};Z().prototype.reshapeAs=function(e){return this.throwIfDisposed(),H(this,e.shape)};Z().prototype.reshape=function(e){return this.throwIfDisposed(),H(this,e)};Z().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),p3(this,e,t,n)};Z().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),c3(this,e,t,n)};Z().prototype.reverse=function(e){return this.throwIfDisposed(),On(this,e)};Z().prototype.rfft=function(){return this.throwIfDisposed(),nd(this)};Z().prototype.round=function(){return this.throwIfDisposed(),SA(this)};Z().prototype.rsqrt=function(){return this.throwIfDisposed(),Fc(this)};Z().prototype.selu=function(){return this.throwIfDisposed(),$c(this)};Z().prototype.separableConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),NA(this,e,t,n,a,r,s)};Z().prototype.sigmoid=function(){return this.throwIfDisposed(),wn(this)};Z().prototype.sign=function(){return this.throwIfDisposed(),TA(this)};Z().prototype.sin=function(){return this.throwIfDisposed(),Dc(this)};Z().prototype.sinh=function(){return this.throwIfDisposed(),Oc(this)};Z().prototype.slice=function(e,t){return this.throwIfDisposed(),Me(this,e,t)};Z().prototype.softmax=function(e){return this.throwIfDisposed(),ed(this,e)};Z().prototype.softplus=function(){return this.throwIfDisposed(),fi(this)};Z().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Zu(this,e,t)};Z().prototype.split=function(e,t){return this.throwIfDisposed(),ln(this,e,t)};Z().prototype.sqrt=function(){return this.throwIfDisposed(),Jt(this)};Z().prototype.square=function(){return this.throwIfDisposed(),st(this)};Z().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Lc(this,e)};Z().prototype.squeeze=function(e){return this.throwIfDisposed(),Or(this,e)};Z().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Le?[this,e]:[this,...e];return zn(n,t)};Z().prototype.step=function(e){return this.throwIfDisposed(),bl(this,e)};Z().prototype.stridedSlice=function(e,t,n,a,r,s,i,o){return this.throwIfDisposed(),CA(this,e,t,n,a,r,s,i,o)};Z().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};Z().prototype.sum=function(e,t){return this.throwIfDisposed(),Te(this,e,t)};Z().prototype.tan=function(){return this.throwIfDisposed(),RA(this)};Z().prototype.tanh=function(){return this.throwIfDisposed(),di(this)};Z().prototype.tile=function(e){return this.throwIfDisposed(),$r(this,e)};Z().prototype.toBool=function(){return this.throwIfDisposed(),Ae(this,"bool")};Z().prototype.toFloat=function(){return this.throwIfDisposed(),Ae(this,"float32")};Z().prototype.toInt=function(){return this.throwIfDisposed(),Ae(this,"int32")};Z().prototype.topk=function(e,t){return this.throwIfDisposed(),MA(this,e,t)};Z().prototype.transpose=function(e){return this.throwIfDisposed(),Ze(this,e)};Z().prototype.unique=function(e){return this.throwIfDisposed(),Bc(this,e)};Z().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),FA(this,e,t)};Z().prototype.unstack=function(e){return this.throwIfDisposed(),ua(this,e)};Z().prototype.where=function(e,t){return this.throwIfDisposed(),In(e,this,t)};Z().prototype.zerosLike=function(){return this.throwIfDisposed(),Ue(this)};var uw={kernelName:eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,bl(Ae(n,"float32"),-1))}}},DJ={kernelName:to,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=st(Ae(n,"float32")),r=Jt(ye(Ie(1),a));return wt(ge(e,r))}}}},OJ={kernelName:no,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Jt(ye(st(Ae(n,"float32")),1));return ge(e,a)}}}},zJ={kernelName:kr,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=e,i=zt(n.shape,r);return i.length>0&&(s=Te(s,i)),H(s,n.shape)},b:()=>{let s=e,i=zt(a.shape,r);return i.length>0&&(s=Te(s,i)),H(s,a.shape)}}}},_J={kernelName:is,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((a,r)=>{n[r]=()=>e.clone()}),n}},PJ={kernelName:os,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},LJ={kernelName:hu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},WJ={kernelName:so,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Jt(ye(Ie(1),st(Ae(n,"float32")))))}}},BJ={kernelName:io,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Jt(se(Ie(1),st(Ae(n,"float32"))));return ge(e,a)}}}},VJ={kernelName:uo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=se(st(n),st(a)),i=B(e,ge(a,s)),o=zt(n.shape,r);return o.length>0&&(i=Te(i,o)),H(i,n.shape)},b:()=>{let s=se(st(n),st(a)),i=wt(B(e,ge(n,s))),o=zt(a.shape,r);return o.length>0&&(i=Te(i,o)),H(i,a.shape)}}}},jJ={kernelName:oo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(st(Ae(n,"float32")),1))}}},UJ={kernelName:lo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,ye(Ie(1),st(Ae(n,"float32"))))}}};function HJ(e,t,n,a,r,s){let i=M(e,"dy","avgPool3dGrad"),o=M(t,"input","avgPool3dGrad"),l=i,d=o,u=!1;o.rank===4&&(u=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),d=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),F(l.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),F(d.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${d.rank}.`),s!=null&&F(Vt(r),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${r}.`);let p={dy:l,input:d},c={filterSize:n,strides:a,pad:r,dimRoundingMode:s},h=D.runKernel(Tp,p,c);return u?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var GJ=O({avgPool3dGrad_:HJ}),qJ={kernelName:fu,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>GJ(e,a,r,s,i,o)}}};function XJ(e,t,n,a,r){let s=M(e,"dy","avgPoolGrad"),i=M(t,"input","avgPoolGrad");F(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,l=s,d=!1;i.rank===3&&(d=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),F(l.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),F(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let u={dy:l,input:o},p={filterSize:n,strides:a,pad:r},c=D.runKernel(Np,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var KJ=O({avgPoolGrad_:XJ}),ZJ={kernelName:ls,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i}=n;return{x:()=>KJ(e,a,r,s,i)}}},YJ={kernelName:us,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[a,r]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>Be(e,r,!1,!0),b:()=>Be(a,e,!0,!1)}:!s&&i?{a:()=>Be(e,r,!1,!1),b:()=>Be(e,a,!0,!1)}:s&&!i?{a:()=>Be(r,e,!1,!0),b:()=>Be(a,e,!1,!1)}:{a:()=>Be(r,e,!0,!0),b:()=>Be(e,a,!0,!0)}}},JJ={kernelName:mu,gradFunc:(e,t,n)=>{let{blockShape:a,crops:r}=n;return{x:()=>Zu(e,a,r)}}},QJ={kernelName:Tx,gradFunc:(e,t,n)=>{let a=n,r=a.inputShape,s=a.shape,i=Array.from(s);for(let l=r.length-1;l>=0;l--)if(r[l]===s[l])i[l]=1;else if(r[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);let o=[];for(let l=0;l1&&o.push(l);return{x:()=>Te(e,o,!0)}}},eQ={kernelName:ds,gradFunc:e=>({x:()=>e.clone()})},tQ={kernelName:ps,gradFunc:e=>({x:()=>Ue(e)})},nQ={kernelName:Ir,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>In(la(Dr(a,r),hi(a,s)),e,Ue(e))}}},aQ={kernelName:Au,inputsToSave:["x"],gradFunc:uw.gradFunc},rQ={kernelName:po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let a=t.map(o=>o.shape),{axis:r}=n,s=sa(r,t[0].shape)[0],i=a.map(o=>o[s]);return ln(e,i,s).map(o=>()=>o)}},sQ={kernelName:cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{dilations:s,strides:i,pad:o,dataFormat:l}=n;return F(Mr(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>iA(a.shape,e,r,i,o,l),filter:()=>zA(a,e,r.shape,i,o,l)}}},iQ={kernelName:hs,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>ar(e,r,s,i,o,1,l),filter:()=>zA(e,a,r.shape,s,i,o,l)}}};function oQ(e,t,n,a,r){let s=e;e.rank===4&&(s=H(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),F(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),F(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),F(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),F(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),F(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},l={strides:a,pad:r,filterShape:n};return D.runKernel(Mp,o,l)}var lQ=O({conv3DBackpropFilter_:oQ}),uQ={kernelName:yu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s}=n;F(Mr(a),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`);let[i,o]=t;return{x:()=>Mb(i.shape,e,o,r,s),filter:()=>lQ(i,e,o.shape,r,s)}}},dQ={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(wt(Dc(Ae(n,"float32"))),e)}}},pQ={kernelName:co,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Oc(Ae(n,"float32")),e)}}},cQ={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r,exclusive:s,reverse:i}=n;return{x:()=>{let o=jb([r],a.rank),l=vc(e,r,s,!i);return o!=null&&(l=Ze(l,o)),l}}}},hQ={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s,dimRoundingMode:i}=n,o=a==null?[1,1]:a;F(Mr(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[l,d]=t;return F(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),F(d.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${d.rank}.`),F(l.shape[3]===d.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),F(za(r,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`),i!=null&&F(Vt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>r3(l.shape,e,d,r,s,a,i),filter:()=>a3(l,e,d.shape,r,s,a,i)}}},fQ={kernelName:gu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,s={x:a,filter:r,dy:e},i={x:a,filter:r,dy:e};return{x:()=>D.runKernel(_p,s,n),filter:()=>D.runKernel(Pp,i,n)}}},mQ={kernelName:mo,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,a={dy:e,y:n};return{x:()=>D.runKernel(Wp,a)}}},AQ={kernelName:Ao,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(qn(wt(st(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,a)}}},yQ={kernelName:gs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},gQ={kernelName:go,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>H(e,n.shape)}}},xQ={kernelName:xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,qn(n))}}},bQ={kernelName:xs,gradFunc:e=>({x:()=>Ue(e)})},vQ={kernelName:bs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=ge(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);i.length>0&&(s=H(Te(s,i),a.shape));let o=st(a);return wt(ge(s,Ae(o,"float32")))}}}},wQ={kernelName:vs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:a}=n,[r,s,i,o]=t,l=o==null?Ie(1):o,d=zt(s.shape,r.shape),u=[];if(s.rank===1){for(let f=0;fs.rank===1?H(B(B(e,$r(H(h,[1,1,1,s.shape[0]]),u)),l),r.shape):H(B(B(e,h),l),r.shape),mean:()=>{let f=B(B(h,Ie(-1)),c);return s.rank===1&&(f=Te(f,d)),H(f,s.shape)},variance:()=>{let f=B(B(m,p),c);return s.rank===1&&(f=Te(f,d)),H(f,s.shape)},scale:()=>{let f=B(p,h),A=B(e,f);return s.rank===1&&(A=Te(A,d)),H(A,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Te(f,d)),H(f,s.shape)}}}},kQ={kernelName:vo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[a,r]=t,{axis:s}=n,i=sa(s,a.shape)[0];return{x:()=>{let o=a.shape,l=r.size,d=o.slice(0,i),u=d.length,p=o.slice(s,o.length).slice(1),c=p.length,h=dw(0,u),m=dw(u+1,u+1+c),f=pw([d,[l],p]),A=H(e,f),y=H(r,[l]),g=pw([[u],h,m]),x=Ze(A,g),k=FA(x,y,a.shape[i]),b=yA(g);return k=Ze(k,b),k},indices:()=>r}}};function dw(e,t){let n=[];for(let a=e;a{let[n,a]=t;return{a:()=>Ue(n),b:()=>Ue(a)}}},SQ={kernelName:ks,gradFunc:e=>({x:()=>Ae(e,"float32")})},NQ={kernelName:Io,gradFunc:e=>({x:()=>Ue(e)})},TQ={kernelName:So,gradFunc:e=>({x:()=>Ue(e)})},EQ={kernelName:No,gradFunc:e=>({x:()=>Ue(e)})},CQ={kernelName:Is,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{alpha:r}=n,s=oa(a,0);return{x:()=>In(s,e,B(e,r))}}},RQ={kernelName:Co,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(n,1))}}},MQ={kernelName:Ss,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Ae(n,"float32"))}}},FQ={kernelName:Ex,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n;return{logits:()=>{let s=!0,i=qn(a);return ye(e,B(Te(e,r,s),i))}}}};function $Q(e,t,n,a=5,r=1,s=1,i=.5){let o={x:e,y:t,dy:n},l={depthRadius:a,bias:r,alpha:s,beta:i};return D.runKernel(Hp,o,l)}var DQ=O({localResponseNormalizationBackprop_:$Q}),OQ={kernelName:wu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;return{x:()=>DQ(a,r,e,s,i,o,l)}}};function cw(e,t,n,a){return t.rankB(e,Ae(Fr(n,t),e.dtype))}}var hw={kernelName:Ns,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{reductionIndices:r}=a,s=t[0],i=t[1],o=sa(r,s.shape),l=cw(e,i,s,o);return{x:()=>l.x()}}},zQ={kernelName:Ts,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,Ae(Dr(n,a),"float32")),b:()=>B(e,Ae(kc(n,a),"float32"))}}};function _Q(e,t,n,a,r,s,i){let o=M(e,"dy","maxPool3dGrad"),l=M(t,"input","maxPool3dGrad"),d=M(n,"output","maxPool3dGrad"),u=o,p=l,c=d,h=!1;l.rank===4&&(h=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),p=H(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),c=H(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),F(u.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`),F(p.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${p.rank}.`),F(c.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${c.rank}.`),i!=null&&F(Vt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:u,input:p,output:c},f={filterSize:a,strides:r,pad:s,dimRoundingMode:i},A=D.runKernel(qp,m,f);return h?H(A,[A.shape[1],A.shape[2],A.shape[3],A.shape[4]]):A}var PQ=O({maxPool3dGrad_:_Q}),LQ={kernelName:ku,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>PQ(e,a,r,s,i,o,l)}}};function WQ(e,t,n,a,r,s,i){let o=M(e,"dy","maxPoolGrad"),l=M(t,"input","maxPoolGrad"),d=M(n,"output","maxPoolGrad");F(l.rank===o.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`),F(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),F(l.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),i!=null&&F(Vt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let u={dy:o,input:l,output:d},p={filterSize:a,strides:r,pad:s,dimRoundingMode:i};return D.runKernel(Gp,u,p)}var BQ=O({maxPoolGrad_:WQ}),VQ={kernelName:Es,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>BQ(e,a,r,s,i,o)}}},jQ={kernelName:Cs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n,s=sa(r,a.shape),i=Vb(a.shape,s)[1],o=Tt(i);return{x:()=>{let l=a.shape.slice();s.forEach(u=>{l[u]=1});let d=H(e,l);return ge(B(d,$n(a.shape,"float32")),o)}}}},UQ={kernelName:Rs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{axis:r}=a,[s,i]=t,o=sa(r,s.shape),l=cw(e,i,s,o);return{x:()=>l.x()}}},HQ={kernelName:Ms,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,Ae(hi(n,a),"float32")),b:()=>B(e,Ae(oa(n,a),"float32"))}}},GQ={kernelName:Fs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Me(e,s,a.shape)}}},qQ={kernelName:Mo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=zt(n.shape,r);return s.length>0?H(Te(e,s),n.shape):e},b:()=>{let s=B(e,wt(ml(ge(n,a)))),i=zt(a.shape,r);return i.length>0?H(Te(s,i),a.shape):s}}}},XQ={kernelName:$s,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=B(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);return i.length>0?H(Te(s,i),a.shape):s}}}},KQ={kernelName:Fo,gradFunc:e=>({x:()=>wt(e)})},ZQ={kernelName:Ds,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>Ct(n.shape,"float32")}}},YQ={kernelName:_o,gradFunc:e=>({x:()=>Ue(e)})},JQ={kernelName:Po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:a}=n;return ua(e,a).map(r=>()=>r)}},fw={kernelName:Os,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Me(e,s,a.shape)}}},QQ={kernelName:zs,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,a,r]=t,s=n,i=a,o=ct(s.shape,i.shape);return{a:()=>{let l=Ae(i,"float32"),d=B(e,B(l,sr(s,ye(l,Ie(1))))),u=zt(s.shape,o);return u.length>0&&(d=Te(d,u)),H(d,s.shape)},b:()=>{let l=oa(s,0),d=In(l,Fn(s),Ue(s)),u=B(e,B(r,d)),p=zt(i.shape,o);return p.length>0&&(u=Te(u,p)),H(u,i.shape)}}}},eee={kernelName:_s,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,a]=t,r=oa(n,0);return{x:()=>In(r,e,B(e,a)),alpha:()=>{let s=In(r,Ue(e),B(e,n)),i=zt(a.shape,e.shape);return i.length>0&&(s=Te(s,i)),H(s,a.shape)}}}},tee={kernelName:ys,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=ge(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);i.length>0&&(s=H(Te(s,i),a.shape));let o=st(a);return wt(ge(s,Ae(o,"float32")))}}}},nee={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,wt(st(n)))}}},aee={kernelName:Ws,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(hi(n,6),bl(n));return{x:()=>B(e,Ae(a,"float32"))}}},ree={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Ae(bl(n),"float32"))}}},see={kernelName:Bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>H(e,n.shape)}}},iee={kernelName:Ls,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>D.runKernel(Jp,r,n)}}},oee={kernelName:Su,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>D.runKernel(Yp,r,n)}}},lee={kernelName:Bs,gradFunc:(e,t,n)=>{let{dims:a}=n,r=sa(a,e.shape);return{x:()=>On(e,r)}}},uee={kernelName:Vs,gradFunc:e=>({x:()=>Ue(e)})},dee={kernelName:js,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>wt(ge(e,B(sr(n,1.5),2)))}}},pee={kernelName:jo,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>Ae(Ue(n),"float32"),t:()=>B(e,Ae(n,e.dtype)),e:()=>B(e,Ae(Xu(n),e.dtype))}}},cee={kernelName:Uo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=oa(n,Ie(0)),r=Ie(A3),s=Ie(y3),i=B(e,s),o=B(B(e,r),qn(Ae(n,"float32")));return In(a,i,o)}}}},hee={kernelName:Hs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(Ie(1),n)))}}},fee={kernelName:qo,gradFunc:e=>({x:()=>Ue(e)})},mee={kernelName:Us,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Hu(Ae(n,"float32")),e)}}},Aee={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(bc(Ae(n,"float32")),e)}}},yee={kernelName:Ho,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{begin:r,size:s}=n,i=a.shape,[o,l]=hb(a,r,s),d=[];for(let u=0;urr(e,d)}}},gee={kernelName:Xs,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{dim:r}=n,s=!0,i=B(e,a);return{logits:()=>ye(i,B(Te(i,[r],s),a))}}},xee={kernelName:Xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,wn(n))}}},mw={kernelName:Nu,gradFunc:(e,t,n)=>{let{blockShape:a,paddings:r}=n;return{x:()=>Uu(e,a,r)}}},Aw={kernelName:Ko,gradFunc:(e,t,n)=>{let{axis:a}=n;return{x:()=>ot(e,a)}}},bee={kernelName:Gs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,B(Jt(Ae(n,"float32")),2))}}},vee={kernelName:Tu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(Ae(n,"float32"),2))}}},wee={kernelName:Ks,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=Ie(2);return{a:()=>B(e,B(r,ye(n,a))),b:()=>B(e,B(r,ye(a,n)))}}},kee={kernelName:Nr,gradFunc:e=>({x:()=>Ue(e)})},Iee={kernelName:Zs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=e,i=zt(n.shape,r);return i.length>0&&(s=Te(s,i)),H(s,n.shape)},b:()=>{let s=e,i=zt(a.shape,r);return i.length>0&&(s=Te(s,i)),H(wt(s),a.shape)}}}},See={kernelName:qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,r=a.shape.slice(),{axis:s}=n;sa(s,a.shape).forEach(l=>{r[l]=1});let i=H(e,r),o=B(i,$n(a.shape,"float32"));return{x:()=>o}}},Nee={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,st(Hu(n)))}}},Tee={kernelName:Js,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(Ie(1),st(n)),e)}}},Eee={kernelName:Sr,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{reps:r}=n;return{x:()=>{let s=Ue(a);if(a.rank===1)for(let i=0;i{let a=n,{perm:r}=a,s=yA(r);return{x:()=>Ze(e,s)}}},Ree={kernelName:Jo,gradFunc:(e,t,n)=>{let a=n,{axis:r}=a;return{value:()=>zn(e,r)}}},Fee={kernelName:Eu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Mee(e,n)}}};function Mee(e,t){let n=Pa(t,Ue(t)),a=ci(e,n),r=Dr(t,Ie(0,"int32")),s=a.rank-r.rank;for(let o=0;o({x:()=>Ue(e)})},Dee=[uw,DJ,OJ,zJ,_J,PJ,LJ,WJ,BJ,VJ,jJ,UJ,qJ,ZJ,YJ,JJ,QJ,eQ,tQ,nQ,aQ,rQ,iQ,sQ,uQ,dQ,pQ,cQ,hQ,fQ,tee,mQ,AQ,yQ,gQ,xQ,vQ,bQ,wQ,kQ,IQ,SQ,NQ,TQ,EQ,CQ,RQ,MQ,FQ,OQ,hw,hw,zQ,LQ,VQ,jQ,UQ,HQ,GQ,qQ,XQ,KQ,ZQ,YQ,JQ,fw,fw,QQ,eee,nee,aee,ree,see,iee,oee,lee,uee,dee,pee,cee,hee,fee,mee,Aee,yee,gee,xee,mw,mw,Aw,Aw,bee,wee,vee,kee,Iee,See,Nee,Tee,Eee,Cee,Ree,Fee,$ee];for(let e of Dee)Cx(e);var yw={};Fe(yw,{maxNorm:()=>Oee,minMaxNorm:()=>Pee,nonNeg:()=>_ee,unitNorm:()=>zee});var N1;function _t(){return N1==null&&(N1=bb().epsilon()),N1}function va(){return"channelsLast"}var ur=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,ur.prototype)}},wa=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,wa.prototype)}},W=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,W.prototype)}},Oe=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,Oe.prototype)}},gw=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,gw.prototype)}};function Ti(e,t){if(Array.isArray(e)){let n=[];for(let a=0;an.toUpperCase())}var da={};function T1(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function E1(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>E1(t));else{let t=Object.keys(e);for(let n of t){let a=e[n];a!=null&&typeof a=="object"&&(!Array.isArray(a)&&a.type==="ndarray"&&typeof a.value=="number"?e[n]=a.value:E1(a))}}}function wd(e,t={},n={},a="object",r=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in da)i=da[s];else if(i=t[s],i==null)throw new W(`Unknown ${a}: ${e}. This may be due to one of the following reasons: +1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}else{let s=e;if(s.className==null||s.config==null)throw new W(`${a}: Improper config format: ${JSON.stringify(s)}. +'className' and 'config' must set.`);let i=s.className,o,l;if(i in n?[o,l]=n[i]:i in da?[o,l]=da.className:i in t&&([o,l]=t[i]),o==null)throw new W(`Unknown ${a}: ${i}. This may be due to one of the following reasons: +1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(l!=null){let d={};for(let h of Object.keys(da))d[h]=da[h];for(let h of Object.keys(n))d[h]=n[h];let u=s.config;u.customObjects=d;let p=Object.assign({},da);for(let h of Object.keys(n))da[h]=n[h];E1(s.config);let c=l(o,s.config,n,r);return da=Object.assign({},p),c}else{let d=Object.assign({},da);for(let p of Object.keys(n))da[p]=n[p];let u=new o(s.config);return da=Object.assign({},d),u}}}function Lee(e,t){return et?1:0}function Ch(e,t){return-1*Lee(e,t)}function Br(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function Wee(e){if(e==null)throw new W(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Ci(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new W(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function C1(e,t,n=0,a=Infinity){return ja(n>=0),ja(a>=n),Array.isArray(e)&&e.length>=n&&e.length<=a&&e.every(r=>typeof r===t)}function Ht(e,t){Array.isArray(e)?(w.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,a)=>Ht(n,`element ${a+1} of ${t}`))):w.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${bw(e)}.`)}function bw(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>bw(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function Bee(e,t){let n=w.now(),a;return(...r)=>{let s=w.now();return s-nJt(Te(B(e,e),t,!0)))}var kd=class extends ae.Serializable{getConfig(){return{}}},M1=class extends kd{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=R1(e,this.axis),n=kn(t,0,this.maxValue);return B(e,ge(n,se(_t(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};M1.className="MaxNorm";ae.registerClass(M1);var F1=class extends kd{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>ge(e,se(_t(),R1(e,this.axis))))}getConfig(){return{axis:this.axis}}};F1.className="UnitNorm";ae.registerClass(F1);var $1=class extends kd{apply(e){return La(e)}};$1.className="NonNeg";ae.registerClass($1);var D1=class extends kd{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=R1(e,this.axis),n=se(B(this.rate,kn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,ge(n,se(_t(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};D1.className="MinMaxNorm";ae.registerClass(D1);var ww={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Pt(e){return T1(e)}function kw(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"constraint")}function Lt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in ww?ww[e]:e,config:{}};return kw(t)}else return e instanceof kd?e:kw(e)}function Oee(e){return new M1(e)}function zee(e){return new F1(e)}function _ee(){return new $1}function Pee(e){return new D1(e)}var Iw={};Fe(Iw,{constant:()=>Uee,glorotNormal:()=>Yee,glorotUniform:()=>Zee,heNormal:()=>Jee,heUniform:()=>Qee,identity:()=>Xee,leCunNormal:()=>ete,leCunUniform:()=>tte,ones:()=>jee,orthogonal:()=>nte,randomNormal:()=>Gee,randomUniform:()=>Hee,truncatedNormal:()=>qee,varianceScaling:()=>Kee,zeros:()=>Vee});var ate=["channelsFirst","channelsLast"],rte=["nearest","bilinear"],ste=["valid","same","causal"],ite=["max","avg"],ote=["sum","mul","concat","ave"],_l=new Map;function Et(e){Ci(ate,"DataFormat",e)}function lte(e){Ci(rte,"InterpolationFormat",e)}function Qn(e){Ci(ste,"PaddingMode",e)}function Sw(e){Ci(ite,"PoolMode",e)}var Id=[],Nw="/";function Ri(e,t){Id.push(e);try{let n=t();return Id.pop(),n}catch(n){throw Id.pop(),n}}function ute(){return Id.length===0?"":Id.join(Nw)+Nw}function Ew(e){if(!Tw(e))throw new Error("Not a valid tensor name: '"+e+"'");return ute()+e}function Cw(e){if(!Tw(e))throw new Error("Not a valid tensor name: '"+e+"'");_l.has(e)||_l.set(e,0);let t=_l.get(e);if(_l.set(e,_l.get(e)+1),t>0){let n=`${e}_${t}`;return _l.set(n,1),n}else return e}var dte=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Tw(e){return!!e.match(dte)}function pte(e){return e===parseInt(e.toString(),10)}function Vr(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let a=1;for(let r=t;r{if(e.shape.length!==2)throw new W(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Nd(e,1);return O1(n,[1,t,1])})}function hte(e){let t=[Vr(e.shape)];return e.reshape(t)}function fte(e){if(e.rank<=1)throw new W(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],Vr(e.shape,1)];return e.reshape(t)}function Mi(e,t,n){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:return EA(e,[t,0],[n,e.shape[1]]);case 3:return _c(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Qu(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Me(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Me(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new W(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function z1(e,t,n){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:return EA(e,[0,t],[e.shape[0],n]);case 3:return _c(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Qu(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function Rh(e,t,n,a){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:switch(a){case 1:return Mi(e,t,n);case 2:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}case 3:switch(a){case 1:return Mi(e,t,n);case 2:return _c(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}case 4:switch(a){case 1:return Mi(e,t,n);case 2:return Qu(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Qu(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function _1(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),ot(e,t)}function Mw(e,t){switch(e.rank){case 1:return Eb([e,t]);case 2:return cl([e,t],0);case 3:return Cb([e,t],0);case 4:return Rb([e,t],0);default:throw new W(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function O1(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new W(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return $r(e,t)}function Mh(e,t=0,n=1,a,r){return Xb(e,t,n,a,r)}function Ua(e,t,n,a){if(e.rank<2||t.rank<2)throw new Oe(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let r=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(r!==s)throw new Oe(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let r=!1,s=!1;return zr.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:a?P1(e.rank,a,va()):null,activation:n})}else{let r=e.shape.slice(),s=r.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),l=i.pop(),d=[...i,o],u=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(u).reshape([l,-1]);let p=[...r,...d],c=!1,h=!1;return zr.matMul({a:e,b:t,transposeA:c,transposeB:h,bias:a?P1(e.rank,a,va()):null,activation:n}).reshape(p)}}function Fw(e,t,n){return L(()=>(Array.isArray(t)?t=nn(t,"int32"):t=t.toInt(),ci(e,t,n)))}function Td(e){return B(e,e)}function P1(e,t,n){let a=t.shape;if(t.rank!==1&&t.rank!==e)throw new W(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1,1]):t.reshape([1,a[3],a[0],a[1],a[2]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===4){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1]):t.reshape([1,a[2],a[0],a[1]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===3){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1]):t.reshape([1,a[1],a[0]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,a[0]]):t.reshape([1].concat(a))}else if(e<3)return t;throw new W(`Unsupported input rank by biasAdd: ${t.rank}`)}function Ia(e,t,n){return L(()=>(n==null&&(n=va()),Et(n),e.add(P1(e.rank,t,n))))}function mte(e,t=1){if(t!==1)throw new Oe(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return fl(e)}function Ate(e){return L(()=>ge(e,Ot(e).add(1)))}function $w(e,t,n,a){return L(()=>t3(e,t,n,a))}function yte(e){return L(()=>{let t=se(.5,B(.2,e));return kn(t,0,1)})}function Ed(e,t,n=!1){return n?e():t()}var gte=["fanIn","fanOut","fanAvg"],xte=["normal","uniform","truncatedNormal"];function bte(e){Ci(gte,"FanMode",e)}function vte(e){Ci(xte,"Distribution",e)}var pa=class extends ae.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},L1=class extends pa{apply(e,t){return Ct(e,t)}};L1.className="Zeros";ae.registerClass(L1);var Fh=class extends pa{apply(e,t){return $n(e,t)}};Fh.className="Ones";ae.registerClass(Fh);var W1=class extends pa{constructor(e){super();if(typeof e!="object")throw new W(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new W(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return L(()=>B(Ie(this.value),$n(e,t)))}getConfig(){return{value:this.value}}};W1.className="Constant";ae.registerClass(W1);var B1=class extends pa{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return gl(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};B1.className="RandomUniform";ae.registerClass(B1);var V1=class extends pa{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`randomNormal does not support dType ${t}.`);return Mh(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};V1.className="RandomNormal";ae.registerClass(V1);var j1=class extends pa{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`truncatedNormal does not support dType ${t}.`);return Wc(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};j1.className="TruncatedNormal";ae.registerClass(j1);var U1=class extends pa{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return L(()=>{if(e.length!==2||e[0]!==e[1])throw new W("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,hA(e[0]))})}getConfig(){return{gain:this.gain}}};U1.className="Identity";ae.registerClass(U1);function wte(e,t="channelsLast"){let n,a;if(Et(t),e.length===2)n=e[0],a=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let r=Vr(e,2);n=e[1]*r,a=e[0]*r}else if(t==="channelsLast"){let r=Vr(e,0,e.length-2);n=e[e.length-2]*r,a=e[e.length-1]*r}}else{let r=Vr(e);n=Math.sqrt(r),a=Math.sqrt(r)}return[n,a]}var Tn=class extends pa{constructor(e){super();if(e.scale<0)throw new W(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,bte(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,vte(this.distribution),this.seed=e.seed}apply(e,t){let n=wte(e),a=n[0],r=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,a):this.mode==="fanOut"?s/=Math.max(1,r):s/=Math.max(1,(a+r)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`${this.getClassName()} does not support dType ${t}.`);return Wc(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return gl(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Tn.className="VarianceScaling";ae.registerClass(Tn);var $h=class extends Tn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};$h.className="GlorotUniform";ae.registerClass($h);var Dh=class extends Tn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Dh.className="GlorotNormal";ae.registerClass(Dh);var Oh=class extends Tn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Oh.className="HeNormal";ae.registerClass(Oh);var zh=class extends Tn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};zh.className="HeUniform";ae.registerClass(zh);var _h=class extends Tn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};_h.className="LeCunNormal";ae.registerClass(_h);var Ph=class extends Tn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Ph.className="LeCunNormal";ae.registerClass(Ph);var H1=class extends pa{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new Oe("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return L(()=>{if(e.length<2)throw new Oe("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,a=Mh(n,0,1,"float32"),r=f3.gramSchmidt(a);return e[0]>e[1]&&(r=r.transpose()),B(this.gain,r)})}getConfig(){return{gain:this.gain,seed:this.seed}}};H1.className="Orthogonal";ae.registerClass(H1);var Dw={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Ow(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"initializer")}function It(e){return T1(e)}function At(e){if(typeof e=="string"){let t=e in Dw?Dw[e]:e;if(t==="GlorotNormal")return new Dh;if(t==="GlorotUniform")return new $h;if(t==="HeNormal")return new Oh;if(t==="HeUniform")return new zh;if(t==="LeCunNormal")return new _h;if(t==="LeCunUniform")return new Ph;{let n={};return n.className=t,n.config={},Ow(n)}}else return e instanceof pa?e:Ow(e)}function Vee(){return new L1}function jee(){return new Fh}function Uee(e){return new W1(e)}function Hee(e){return new B1(e)}function Gee(e){return new V1(e)}function qee(e){return new j1(e)}function Xee(e){return new U1(e)}function Kee(e){return new Tn(e)}function Zee(e){return new $h(e)}function Yee(e){return new Dh(e)}function Jee(e){return new Oh(e)}function Qee(e){return new zh(e)}function ete(e){return new _h(e)}function tte(e){return new Ph(e)}function nte(e){return new H1(e)}var zw={};Fe(zw,{Layer:()=>Ge,RNN:()=>Ha,RNNCell:()=>Cd,activation:()=>Lte,add:()=>Xte,alphaDropout:()=>Mne,average:()=>Kte,averagePooling1d:()=>G1,averagePooling2d:()=>q1,averagePooling3d:()=>X1,avgPool1d:()=>rne,avgPool2d:()=>ine,avgPool3d:()=>lne,avgPooling1d:()=>sne,avgPooling2d:()=>one,avgPooling3d:()=>une,batchNormalization:()=>tne,bidirectional:()=>kne,concatenate:()=>Zte,conv1d:()=>Rte,conv2d:()=>Mte,conv2dTranspose:()=>Fte,conv3d:()=>$te,conv3dTranspose:()=>Dte,convLstm2d:()=>xne,convLstm2dCell:()=>bne,cropping2D:()=>zte,dense:()=>Wte,depthwiseConv2d:()=>Pte,dot:()=>ene,dropout:()=>Bte,elu:()=>Ite,embedding:()=>qte,flatten:()=>jte,gaussianDropout:()=>Rne,gaussianNoise:()=>Cne,globalAveragePooling1d:()=>dne,globalAveragePooling2d:()=>pne,globalMaxPool1d:()=>Sne,globalMaxPool2d:()=>Nne,globalMaxPooling1d:()=>Pw,globalMaxPooling2d:()=>Lw,gru:()=>hne,gruCell:()=>fne,input:()=>_w,inputLayer:()=>kte,layerNormalization:()=>nne,leakyReLU:()=>Nte,lstm:()=>mne,lstmCell:()=>Ane,masking:()=>Fne,maxPool1d:()=>Tne,maxPool2d:()=>Ene,maxPooling1d:()=>Ww,maxPooling2d:()=>Bw,maxPooling3d:()=>cne,maximum:()=>Yte,minimum:()=>Jte,multiply:()=>Qte,permute:()=>Gte,prelu:()=>Tte,reLU:()=>Ste,repeatVector:()=>Ute,reshape:()=>Hte,rnn:()=>vne,separableConv2d:()=>Ote,simpleRNN:()=>yne,simpleRNNCell:()=>gne,softmax:()=>Ete,spatialDropout1d:()=>Vte,stackedRNNCells:()=>wne,thresholdedReLU:()=>Cte,timeDistributed:()=>Ine,upSampling2d:()=>_te,zeroPadding2d:()=>ane});var $ne=0;function Vw(){return $ne++}var Lh={};function Wh(e=""){return e in Lh||(Lh[e]=0),Lh[e]+=1,e+Lh[e].toString()}function K1(e){return Array.isArray(e)&&Array.isArray(e[0])}function Bh(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function _e(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new W(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function at(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new W(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function Vh(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((a,r)=>a*r);return t}var jw="Variable",Uw=class{constructor(e,t="float32",n=jw,a=!0,r=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=Vw(),n=n==null?jw:n,this.originalName=Ew(n),this.name=Cw(this.originalName),this.trainable_=a,this.constraint=r,this.val=Zb(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Dne(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function Dne(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function Z1(e){return e.map(t=>t.read())}function Y1(e){e.forEach(t=>{t[0].write(t[1])})}var Mt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Sa=class{constructor(e,t,n,a,r,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=a,this.callArgs=r,this.outputTensorIndex=i,this.id=Vw(),s!=null&&(this.originalName=Ew(s),this.name=Cw(this.originalName)),this.rank=t.length}},One=0,jh=class{constructor(e,t){this.callArgs=t,this.id=One++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},zne=0,Ge=class extends ae.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=zne++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=dr(n)+"_"+Wh(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let r=null;e.batchSize!=null&&(r=e.batchSize),n=[r].concat(e.inputShape)}this.batchInputShape=n;let a=e.dtype;a==null&&(a=e.inputDType),a==null&&(a="float32"),this.dtype=a}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new wa(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new W(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return Nn(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return Nn(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new ur(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new ur(`Layer ${this.name} is not connected, no input to return.`);return Nn(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new ur(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new ur(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Nn(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=ft(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=ft(this.inputSpec);if(e.length!==t.length)throw new W(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;nr.maxNDim)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(r.minNDim!=null&&s=0?i[l]:i[i.length+l];if(d!=null&&[d,null].indexOf(u)===-1)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected axis ${l} of input shape to have value ${d} but got shape ${i}.`)}}if(r.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of ft(e))s.push(i.shape);this.build(Nn(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t),i=ft(s),o=[];for(let l of i)n.indexOf(l)!==-1&&(l=l.clone()),o.push(l);if(s=Nn(o),this.activityRegularizer!=null)throw new Oe("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=_ne(e),i=this.computeOutputShape(s),o,l=Pne(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((d,u)=>new Sa(l,d,this,ft(e),t,this.name,u)):o=new Sa(l,i,this,ft(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new Oe("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,a)=>{n!=null&&e[a]!=null&&e[a]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new ur(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new ur(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new wa(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Vh(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Z1(e?this.trainableWeights:this.weights)}setWeights(e){L(()=>{let t=this.weights;if(t.length!==e.length)throw new W(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],a=Z1(t);for(let r=0;rr.apply(l.read())),s==null&&(s=!0),s?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=ft(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,a,r,s,i=null){let o=ft(e);t=ft(t),n=ft(n),a=ft(a),r=Bh(r),s=Bh(s);let l=[],d=[],u=[];for(let p of o)l.push(p.sourceLayer),d.push(p.nodeIndex),u.push(p.tensorIndex);new jh({outboundLayer:this,inboundLayers:l,nodeIndices:d,tensorIndices:u,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:a,inputShapes:r,outputShapes:s},i);for(let p=0;pe.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function _ne(e){e=ft(e);let t=[];for(let n of e)t.push(n.shape);return Nn(t)}function Pne(e){return"float32"}function Hw(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let a=t.inboundNodes[n];if(a.inboundLayers.length===0)return a.inputTensors;{let r=[];for(let s=0;s0){let r=await Promise.all(t);for(let s=0;sse(this.totals[a],B(r,n)));this.totals[a]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:L(()=>{let a=B(ge(1,this.seen),this.totals[n]);t[n]=a,this.totals[n].dispose(),jt(t[n])}))}},Zw=class extends Wl{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let r in this.history){let s=this.history[r];for(let i=0;inew Yw(n,t))}var ca=class{constructor(){}static registerCallbackConstructor(e,t){w.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),ca.checkForDuplicate(t),ca.constructors[e]==null&&(ca.constructors[e]=[]),ca.constructors[e].push(t)}static checkForDuplicate(e){for(let t in ca.constructors)ca.constructors[+t].forEach(n=>{if(n===e)throw new W("Duplicate callback constructor.")})}static clear(){ca.constructors={}}static createCallbacks(e){let t=[];for(let n in ca.constructors){let a=+n;e>=a&&t.push(...ca.constructors[a])}return t.map(n=>new n)}};ca.constructors={};function Qw(e,t,n,a,r,s,i,o,l){let d=new Zw,u=[new Wne,...ca.createCallbacks(t)];e!=null&&u.push(...e),u.push(d);let p=new Kw(u);return p.setParams({epochs:n,initialEpoch:a,samples:r,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:p,history:d}}function Na(e,t={},n=!1){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"layer",n)}function Uh(e,t){return L(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Te(Td(e),t,!0),a=Gu(n.shape,_t()),r=Jt(Pa(n,a));return ge(e,r)})}function Fi(e,t){return L(()=>kt(Td(ye(t,e)),-1))}function Hh(e,t){return L(()=>kt(Ot(ye(t,e)),-1))}function Bl(e,t){return L(()=>{let n=ye(e,t),a=kn(Ot(e),_t(),Number.MAX_VALUE),r=Ot(ge(n,a));return B(100,kt(r,-1))})}function Bne(e,t){return L(()=>{let n=kn(t,_t(),Number.MAX_VALUE),a=Fn(se(1,n)),r=kn(e,_t(),Number.MAX_VALUE),s=Fn(se(1,r));return kt(Td(ye(a,s)),-1)})}function Vne(e,t){return L(()=>{let n=Pa(0,ye(1,B(e,t)));return kt(Td(n),-1)})}function jne(e,t){return L(()=>{let n=Pa(0,ye(1,B(e,t)));return kt(n,-1)})}function Une(e,t){return L(()=>{let n=Te(B(e,t),-1),a=Xn(B(ye(1,e),t),-1);return Pa(0,se(1,ye(a,n)))})}function Hne(e,t){return L(()=>{let n=Math.log(2),a=ye(t,e),r=ye(se(a,fi(B(-2,a))),n);return kt(r,-1)})}function Rd(e,t,n=!1){return L(()=>{if(n)t=ed(t);else{let a=Te(t,t.shape.length-1,!0);t=ge(t,a)}return t=kn(t,_t(),1-_t()),wt(Te(B(e.toFloat(),Fn(t)),t.shape.length-1))})}function Gh(e,t,n=!1){return L(()=>{let a=ml(hte(e)).toInt();t=kn(t,_t(),1-_t());let r=t.shape,s=ol(a,r[r.length-1]).reshape(r);return Rd(s,t,n)})}function Gne(e,t){if(!w.arraysEqual(e.shape,t.shape))throw new W(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return L(()=>{let n=t.relu(),a=t.abs().neg();return n.sub(t.mul(e)).add(a.exp().log1p())})}function qh(e,t){return L(()=>{let n;return n=kn(t,_t(),1-_t()),n=Fn(ge(n,ye(1,n))),kt(Gne(e,n),-1)})}function qne(e,t){return L(()=>{let n=kn(e,_t(),1),a=kn(t,_t(),1);return Te(B(e,Fn(ge(n,a))),-1)})}function Xne(e,t){return L(()=>{let n=Fn(se(_t(),t));return kt(ye(t,B(e,n)),-1)})}function J1(e,t){return L(()=>{let n=Uh(e,-1),a=Uh(t,-1),r=B(n,a);return wt(Te(r,-1))})}var Xh={meanSquaredError:Fi,meanAbsoluteError:Hh,meanAbsolutePercentageError:Bl,meanSquaredLogarithmicError:Bne,squaredHinge:Vne,hinge:jne,categoricalHinge:Une,logcosh:Hne,categoricalCrossentropy:Rd,sparseCategoricalCrossentropy:Gh,binaryCrossentropy:qh,kullbackLeiblerDivergence:qne,poisson:Xne,cosineProximity:J1};function Q1(e){if(typeof e=="string"){if(e in Xh)return Xh[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new W(t)}else return e}function ey(e,t){return L(()=>{let n=B(.5,Dn(t)),a=Sd(oa(t,n),e.dtype);return kt(Fr(e,a),-1)})}function ty(e,t){return L(()=>Sd(Fr(Bu(e,-1),Bu(t,-1)),"float32"))}function e4(e,t){return L(()=>la(e.equal(1),t.equal(1)).sum().cast("float32"))}function Kne(e,t){return L(()=>la(e.equal(1),t.equal(0)).sum().cast("float32"))}function Zne(e,t){return L(()=>la(e.equal(0),t.equal(1)).sum().cast("float32"))}function t4(e,t){return L(()=>{let n=e4(e,t),a=Zne(e,t),r=n.add(a);return In(oa(r,0),n.div(r),0).cast("float32")})}function Yne(e,t){return L(()=>{let n=e4(e,t),a=Kne(e,t),r=n.add(a);return In(oa(r,0),n.div(r),0).cast("float32")})}function n4(e,t){return qh(e,t)}function a4(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),Fr(e,t).asType("float32")}var Jne=Fi,Qne=Fi,eae=Hh,tae=Hh,nae=Bl,aae=Bl,ny=Rd,rae=J1,r4=Gh,Kh={binaryAccuracy:ey,categoricalAccuracy:ty,precision:t4,categoricalCrossentropy:ny,sparseCategoricalCrossentropy:r4,mse:Jne,MSE:Qne,mae:eae,MAE:tae,mape:nae,MAPE:aae,cosine:rae};function sae(e){if(typeof e=="string"&&e in Kh)return Kh[e];if(typeof e!="string"&&e!=null)return e;throw new W(`Unknown metric ${e}`)}function Zh(e){if(ja(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(Xh))if(Xh[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(Kh))if(Kh[n]===e){t=n;break}return t!==void 0?t:e.name}}function iae(e){let t={Adagrad:()=>gi.adagrad(.01),Adadelta:()=>gi.adadelta(1,.95,_t()),Adam:()=>gi.adam(.001,.9,.999,_t()),Adamax:()=>gi.adamax(.002,.9,.999,_t(),0),RMSProp:()=>gi.rmsprop(.001,.9,0,_t()),SGD:()=>gi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new W(`Unknown Optimizer ${e}`)}var s4=1*1024*1024;function i4(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!ay(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let a=JSON.stringify(e);a.length>s4&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${a.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${s4}.`)}}function ay(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!ay(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!ay(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function pae(e,t,n,a=console.log){let r=lae(e),s=["Layer (type)","Output shape","Param #"];r?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(u=>Math.floor(t*u)));let i;if(!r){s.push("Receives inputs"),i=[];for(let u in e.nodesByDepth)i.push(...e.nodesByDepth[u])}a("_".repeat(t)),Yh(s,n,a),a("=".repeat(t));let o=e.layers;for(let u=0;u1||r.length===1&&r[0].inboundLayers.length>1){t=!1;break}a.push(...r)}if(t)for(let r of e.layers){let s=!1;for(let i of r.inboundNodes)if(a.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function Yh(e,t,n=console.log){let a="";for(let r=0;r0&&(a=a.slice(0,a.length-1)+" "),a+=e[r],a=a.slice(0,t[r]),a+=" ".repeat(t[r]-a.length);n(a)}function uae(e,t,n){let a;try{a=JSON.stringify(e.outputShape)}catch(o){a="multiple"}let r=e.name,s=e.getClassName(),i=[`${r} (${s})`,a,e.countParams().toString()];Yh(i,t,n)}function dae(e,t,n,a){let r;try{r=JSON.stringify(e.outputShape)}catch(u){r="multiple"}let s=[];for(let u of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(u)===-1))for(let p=0;pm.name),l=[],d=t.names();for(let m of o)d.indexOf(m)!==-1?l.push(t.getValue(m)):l.push(null);a!=null&&(a.maxNumTensors=-Infinity,a.minNumTensors=Infinity);let u=o.join(",")+"|"+t.names().join(","),p,c;if(iy[u]==null){let m=hae(i,t);p=m.sorted,c=m.recipientCounts,iy[u]=p,l4[u]=c}p=iy[u],c={},r||Object.assign(c,l4[u]);let h=new $i(t);for(let m=0;ma.maxNumTensors&&(a.maxNumTensors=R),R0,()=>"Expected at least one fetch, got none");let n=[],a={};if(e.length===1){let r=u4(e[0],t);n=r.sorted,a=r.recipientMap}else{let r=new Set;for(let s of e){let{sorted:i,recipientMap:o}=u4(s,t);for(let l of i)r.has(l.name)||(n.push(l),r.add(l.name));for(let l in o)a[l]==null&&(a[l]=new Set),o[l].forEach(d=>a[l].add(d))}}return{sorted:n,recipientCounts:mae(a)}}function mae(e){let t={};for(let n in e)t[n]=e[n].size;return t}function u4(e,t){let n=new Set,a=[],r={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let l=i[i.length-1]===s.length-1;if(o.inputs.length===0||l)s.pop(),a.push(o),n.add(o.name),l&&i.pop();else{i.push(s.length-1);for(let d of o.inputs)r[d.name]==null&&(r[d.name]=new Set),r[d.name].add(o.name),!n.has(d.name)&&s.push(d)}}return{sorted:a,recipientMap:r}}function fae(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let a=0;ay.name)}`);Br(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let g=y.sourceLayer,x=y.nodeIndex,k=y.tensorIndex;this.outputLayers.push(g),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(k)}for(let y of this.inputs){let g=y.sourceLayer,x=y.nodeIndex,k=y.tensorIndex;ja(x===0,"input layer has >1 nodes"),ja(k===0,"input layer has >1 tensors"),this.inputLayers.push(g),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(k)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},a={},r={},s={},i=[],o=(y,g,x,k,b,v)=>{(k==null||b==null||v==null)&&(k=y.sourceLayer,b=y.nodeIndex,v=y.tensorIndex);let I=k.inboundNodes[b];if(x.indexOf(I)!==-1)throw new wa(`The tensor ${y.name} at layer "${k.name}" is part of a cycle.`);if(g.indexOf(I)!==-1)return;this.containerNodes.add(Ga.nodeKey(k,b)),k.id in s||(s[k.id]=Object.keys(s).length),x.indexOf(I)===-1&&x.push(I);let T=I.inboundLayers.length;for(let R=0;R=0;)x.splice(x.indexOf(I),1);i.push(I)},l=[],d=[];for(let y of this.outputs)o(y,l,d);let u=i.slice().reverse();for(let y of u){n[y.id]=y,y.id in t||(t[y.id]=0);let g=t[y.id],x=a[y.outboundLayer.id]==null?0:a[y.outboundLayer.id];g=Math.max(g,x),a[y.outboundLayer.id]=g,r[y.outboundLayer.id]=y.outboundLayer,t[y.id]=g;for(let k=0;kparseInt(y,10)).sort(Ch);this.layers=[];for(let y of h){let g=c[y];g.sort((x,k)=>{let b=s[x.id],v=s[k.id];return bv?1:0});for(let x of g)x instanceof Ga&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=c,h=Object.keys(p).map(y=>parseInt(y,10)).sort(Ch);let m=this.inputs.slice(),f=[];for(let y of h)for(let g of p[y]){let x=g.outboundLayer;if(x!=null){for(let k of g.inputTensors)if(m.indexOf(k)===-1)throw new wa(`Graph disconnected: cannot obtain value for tensor ${k} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let k of g.outputTensors)m.push(k);f.push(x.name)}}this.nodesByDepth=p;let A=this.layers.map(y=>y.name);for(let y of A){let g=A.filter(x=>x===y).length;if(g!==1)throw new wa(`The name "${y}" is used ${g} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(A))}this.outboundNodes=[],this.inboundNodes=[],new jh({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new W("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},a=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new W(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,a++}let r=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)r.push([n[i],e[s]]);else if(t)throw new W(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new W(`${s.length} of ${a} weights are not set: ${s}`)}Y1(r)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${sy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=ry(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return L(()=>{e=ft(e);let n=new $i;for(let a=0;a{e=ft(e);let n;return t==null?n=Ti(null,e.length):n=ft(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=Bh(e);if(t.length!==this.inputLayers.length)throw new W(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(Ch);if(a.length>1)for(let i of a){let o=this.nodesByDepth[i];for(let l of o){let d=l.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(d.id)!==-1)continue;let u=[];for(let m=0;mparseInt(o,10)).sort(Ch);for(let o of a){let l=this.nodesByDepth[o];for(let d of l){let u=d.outboundLayer,p=d.inputTensors,c=d.outputTensors,h=new Array;for(let m of p)m.id in n&&h.push(n[m.id]);if(h.length===p.length){let m={},f,A,y,g;if(d.callArgs!=null&&(m=d.callArgs),h.length===1){let[x,k]=h[0];m.mask==null&&(m.mask=k),y=ft(u.call(x,m)),g=ft(u.computeMask(x,k)),f=[x],A=[k]}else f=h.map(x=>x[0]),A=h.map(x=>x[1]),m.mask==null&&(m.mask=A),y=ft(u.call(f,m)),g=ft(u.computeMask(f,A));if(u.activityRegularizer)throw new Oe("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply(Nn(y),g)}function l(f){let A=f.name,y=Na(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(a),r[A]=y,f.inboundNodes.forEach(g=>{if(!(g instanceof Array))throw new W(`Corrupted configuration, expected array for nodeData: ${g}`);i(y,g)})}let d=t.name,u=t.layers;for(let f of u)l(f);for(;!Wee(s);)for(let f of u){let A=r[f.name];if(A.name in s){let y=s[A.name];delete s[A.name];for(let g of y)o(A,g)}}let p=[],c=[],h=t.inputLayers;for(let f of h){let A=f[0],y=f[1],g=f[2];ja(A in r);let x=r[A].inboundNodes[y].outputTensors;p.push(x[g])}let m=t.outputLayers;for(let f of m){let A=f[0],y=f[1],g=f[2];ja(A in r);let x=r[A].inboundNodes[y].outputTensors;c.push(x[g])}return new e({inputs:p,outputs:c,name:d})}get stateful(){if(this._stateful)throw new W("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){L(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function Aae(e,t,n){let a=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(r=>null);if(a===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==a)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${a} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let r=[];return t.forEach(s=>{s in e?r.push(e[s]):r.push(null)}),r}else throw new Error(`The model has multiple (${a}) outputs, so ${n} must be either an array with ${a} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function d4(e,t){return Aae(e,t,"classWeight")}async function p4(e,t,n,a){if(t!=null||a!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let r=L(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await r.data());Ee(r);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),nn(i,"float32")}else return null}function yae(e,t){return B(e,t)}var gae=32;function h4(e,t){let n,a,r=t;n=r.xs,a=r.ys,w.assert(n!=null&&a!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=c4("input",e.inputNames,n),i=c4("output",e.outputNames,a),o=s[0].shape[0];w.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),w.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let l=0;l`Batch size mismatch: input ${e.inputNames[l]} has ${s[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let l=0;l`Batch size mismatch: output ${e.outputNames[l]} has ${i[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function c4(e,t,n){if(n instanceof Le)return[n];if(Array.isArray(n))return w.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let a=[];for(let r of t){if(n[r]==null)throw new W(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);a.push(n[r])}return a}}function xae(e){if(e.length===3)throw new Oe("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function vae(e,t,n){let a=n.batchesPerEpoch!=null;if(w.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),w.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),w.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),w.assert(!a||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),w.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let r=n.validationData!=null,s,i;if(r)if(f4(n.validationData))w.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let A=xae(n.validationData);s=A.xs,i=A.ys}let o=e.makeTrainFunction(),l=e.getDedupedMetricsNames(),d;r?d=l.slice().concat(l.map(A=>"val_"+A)):d=l.slice();let u=Jw(n.callbacks,n.yieldEvery),p=n.verbose==null?1:n.verbose,{callbackList:c,history:h}=Qw(u,p,n.epochs,null,null,bae(t,n),null,r,d);c.setModel(e),e.history=h,await c.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(r){let k;f4(n.validationData)?k=ft(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):k=ft(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?gae:n.validationBatchSize,verbose:0}));for(let b=0;b0)throw new Oe("Verbose mode is not implemented yet.");w.assert(!a||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=wae(t)?t:await t.iterator(),o=0,l=0;for(;a?l{if(d.value){let{xs:u,ys:p}=h4(e,d.value),c=u.concat(p),h=L(()=>r(c));if(Ee(c),l===0)for(let f=0;fse(s[f],B(m,A))),l>0&&Ee(y)}Ee(h),o+=m,++l}return s}),d.done){a&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let d=0;d0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function $d(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(a=>Mi(a,t,n-t)):Mi(e,t,n-t)}function ly(e,t){return L(()=>e==null?null:Array.isArray(e)?e.map(n=>ly(n,t)):Fw(e,t.dtype==="int32"?t:t.toInt()))}function uy(e,t){let n=[],a=0,r=null;for(;a=e&&(r=e),n.push([a,r]),a=r;return n}async function Iae(e,t,n,a,r,s,i,o,l,d,u,p,c,h,m){r==null&&(r=32),s==null&&(s=1),u==null&&(u=!0),c==null&&(c=0);let f=!1;if(l!=null&&d!=null&&(f=!0),m!=null&&(f=!0,h==null))throw new W("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let A=e.checkNumSamples(n,r,h,"steps_per_epoch"),y;A!=null&&(y=ka(0,A)),i==null&&(i=1);let{callbackList:g,history:x}=Qw(o,i,s,c,A,h,r,f,p);g.setModel(e),e.history=x,await g.onTrainBegin(),e.stopTraining_=!1;for(let k=c;k{let $=I[T][0],z=I[T][1],_=Mi(v,$,z-$);R.batch=T,R.size=z-$;let V=ly(n,_),j=t(V);for(let U=0;U0){if(m=!0,a.validationData.length===2)i=a.validationData[0],o=a.validationData[1];else throw a.validationData.length===3?new Oe("validationData including sample weights is not supported yet."):new W(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${a.validationData} is invalid.`);let v=!0,I=await e.standardizeUserData(i,o,null,null,v,p);l=I[0],d=I[1],f=l.concat(d)}else if(a.validationSplit!=null&&a.validationSplit>0&&a.validationSplit<1){m=!0;let v=Math.floor(r[0].shape[0]*(1-a.validationSplit)),I=r[0].shape[0];l=$d(r,v,I),r=$d(r,0,v),d=$d(s,v,I),s=$d(s,0,v),f=l.concat(d)}else a.validationSteps!=null&&(m=!0);let A=r.concat(s).concat(u);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),g=e.getDedupedMetricsNames(),x,k;m?(e.makeTestFunction(),x=e.testFunction,k=g.slice().concat(g.map(v=>"val_"+v))):(x=null,f=[],k=g.slice());let b=Jw(a.callbacks,a.yieldEvery);return await Iae(e,y,A,g,p,a.epochs,a.verbose,b,x,f,a.shuffle,k,a.initialEpoch,null,null)}finally{e.isTraining=!1,Di(r,t),Di(s,n),Di(l,i),Di(d,o),u!=null&&Ee(u)}}function m4(e){let t=[];e instanceof Le&&(e=[e]);for(let n=0;nn.push(r.id));else if(t!=null)for(let r in t){let s=t[r];n.push(s.id)}let a=[];if(e instanceof Le)n.indexOf(e.id)===-1&&a.push(e);else if(Array.isArray(e))e.forEach(r=>{n.indexOf(r.id)===-1&&a.push(r)});else if(e!=null)for(let r in e){let s=e[r];n.indexOf(s.id)===-1&&a.push(s)}a.forEach(r=>{r.isDisposed||r.dispose()})}function Nae(e){return e instanceof Le}function dy(e){return Array.isArray(e)}function A4(e){return!Nae(e)&&!dy(e)}function y4(e,t,n,a=!0,r=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(dy(e)&&e.length>0)i=!0;else if(A4(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new W(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(A4(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new W(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(dy(e)){if(e=e,e.length!==t.length)throw new W(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new W(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=m4(s),n!=null)for(let i=0;i=0&&d!==u)throw new W(`Error when checking ${r}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function Tae(e,t,n){let a=Br(e.map(s=>s.shape[0]));a.sort();let r=Br(t.map(s=>s.shape[0]));if(r.sort(),a.length>1)throw new W(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(r.length>1)throw new W(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(a.length>0&&r.length>0&&!w.arraysEqual(a,r))throw new W(`Input Tensors should have the same number of samples as target Tensors. Found ${a[0]} input sample(s) and ${r[0]} target sample(s).`)}function Eae(e,t,n){let a=[Fi,qh,Rd];for(let r=0;r1)throw new W(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(a=>n);{let a=[];for(let r of t){let s=n.hasOwnProperty(r)?n[r]:[];Array.isArray(s)||(s=[s]),a.push(s)}return a}}var Rae="layers-model",pr=class extends Ga{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new W("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");pae(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=iae(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof or))throw new W("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new W(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(Q1(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new W(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>Q1(s))}else{let s=Q1(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let a=Cae(e.metrics,this.outputNames),r=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ri("metric",()=>{for(let s=0;s{let l="",d,u,p;for(let c of o){if(typeof c=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(c)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===qh?["accuracy","acc"].indexOf(c)!==-1?u=ey:["crossentropy","ce"].indexOf(c)!==-1&&(u=n4):this.lossFunctions[s]===Gh?["accuracy","acc"].indexOf(c)!==-1?u=a4:["crossentropy","ce"].indexOf(c)!==-1&&(u=r4):["accuracy","acc"].indexOf(c)!==-1?u=ty:["crossentropy","ce"].indexOf(c)!==-1&&(u=ny);let f;["accuracy","acc"].indexOf(c)!==-1?f="acc":["crossentropy","ce"].indexOf(c)!==-1&&(f="ce"),p=u,d=l+f}else p=sae(c),d=l+Zh(c);let h;Ri(d,()=>{h=p}),r(s,d,h)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let a=n.batchSize==null?32:n.batchSize;oy(a);let r=!0,s=this.standardizeUserDataXY(e,t,r,a);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,l=this.testLoop(o,i,a,n.verbose,n.steps);return Nn(l)}finally{Di(s[0],e),Di(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),kae(this,e,t)}checkNumSamples(e,t,n,a="steps"){let r;if(n!=null){if(r=null,t!=null)throw new W(`If ${a} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?r=e[0].shape[0]:r=e.shape[0];else throw new W(`Either the input data should have a defined shape, or ${a} shoud be specified.`);return r}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new W("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),a=n?t:[t],r=this.retrieveSymbolicTensors(a),s=new $i;if(e instanceof Le&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new W(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let a=[];throw t.forEach((r,s)=>{r==null&&a.push(e[s])}),new W(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(a)}`)}return t}predictLoop(e,t=32,n=!1){return L(()=>{let a=this.checkNumSamples(e);if(n)throw new Oe("Verbose predictLoop() is not implemented yet.");let r=uy(a,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=r[i][0],l=r[i][1],d=$d(e,o,l),u=[];if(Array.isArray(d))for(let c=0;cs[l].push(o));return Nn(s.map(i=>ot(i,0)))})}predict(e,t={}){let n=m4(e);g4(n,this.inputNames,this.feedInputShapes,!1);try{let a=t.batchSize==null?32:t.batchSize;return oy(a),this.predictLoop(n,a)}finally{Di(n,e)}}predictOnBatch(e){g4(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,a){if(this.optimizer_==null)throw new wa("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let r=[];for(let s=0;s0&&e[0].shape[0]%a!=0)throw new W(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${a}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,a,r=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,r,s);if(n!=null)throw new Error("sample weight is not supported yet.");let l=null;if(a!=null){let d=d4(a,this.outputNames);l=[];for(let u=0;u{let s=this.checkNumSamples(t,n,r,"steps"),i=[];if(a>0)throw new Oe("Verbose mode is not implemented yet.");if(r!=null)throw new Oe("steps mode in testLoop() is not implemented yet");{let o=uy(s,n),l=nn(ka(0,s));for(let d=0;d1&&(r+=`_${xw(e.slice(0,n),a)}`),t.push(r)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let d=[];for(let h=0;h1&&h{c=se(c,h)}),c},o=this.collectedTrainableWeights.map(d=>d.read()),l=!0;return[this.optimizer_.minimize(i,l,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>L(()=>{let t=[],n,a=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let l=0;ldr(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let a of t)if(typeof n[a]=="string")e[a]=dr(n[a]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[dr(Zh(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>dr(Zh(e)));{let e={};for(let t in this.metrics)e[t]=dr(Zh(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Md(e.optimizer_config),n=Na(t),a;if(typeof e.loss=="string")a=Ei(e.loss);else if(Array.isArray(e.loss))a=e.loss.map(s=>Ei(s));else if(e.loss!=null){a={};for(let s in e.loss)a[s]=Ei(e.loss[s])}let r;if(Array.isArray(e.metrics))r=e.metrics.map(s=>Ei(s));else if(e.metrics!=null){r={};for(let s in e.metrics)r[s]=Ei(e.metrics[s])}this.compile({loss:a,metrics:r,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=vn.getSaveHandlers(e);if(i.length===0)throw new W(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new W(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new W("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await vn.encodeWeights(this.getNamedWeights(t)),a=!1,r=null,s={modelTopology:this.toJSON(r,a),format:Rae,generatedBy:`TensorFlow.js tfjs-layers v${sy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:l}=await vn.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...l),n.data=vn.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;i4(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){i4(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};pr.className="Model";ae.registerClass(pr);var x4=class extends pr{};x4.className="Functional";ae.registerClass(x4);async function Mae(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let a=Md(n),r=Na(a,t);if(e.weightsManifest!=null){let s=await vn.loadWeights(e.weightsManifest,e.pathPrefix,r.weights.map(o=>o.originalName)),i={};for(let o of r.weights)i[o.originalName]=s[o.originalName];r.loadWeights(i),Ee(s)}return r}async function $ae(e,t){if(t==null&&(t={}),typeof e=="string"){let n=vn.getLoadHandlers(e,t);if(n.length===0)n.push(vn.browserHTTPRequest(e,t));else if(n.length>1)throw new W(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return Fae(e,void 0,t)}async function Fae(e,t,n){if(n==null&&(n={}),e.load==null)throw new W("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let a=await e.load(),r=a.modelTopology;r.model_config!=null&&(r=r.model_config);let s=n.strict==null?!0:n.strict,i=a.weightData!=null&&a.weightSpecs!=null&&s,o=Na(Md(r),t,i),l=a.trainingConfig;if(l!=null&&o.loadTrainingConfig(l),a.userDefinedMetadata!=null&&o.setUserDefinedMetadata(a.userDefinedMetadata),a.weightData!=null){if(a.weightSpecs==null)throw new W("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:d,optimizerWeights:u}=Dae(a.weightData,a.weightSpecs);o.loadWeights(d,s),o.optimizer!=null&&u.length>0&&await o.optimizer.setWeights(u),Ee(d),Ee(u.map(p=>p.tensor))}return o}function Dae(e,t){let n=vn.decodeWeights(e,t),a={},r=[];return t.forEach(s=>{s.group==="optimizer"?r.push({name:s.name,tensor:n[s.name]}):a[s.name]=n[s.name]}),{modelWeights:a,optimizerWeights:r}}var Vl=class extends pr{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:Wh("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new W(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof Vl||e instanceof pr,n;if(t){if(n=e,n.outputs.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new W("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new W("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let a=Gw({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new W(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Hw(this.outputs[0])}this.inboundNodes=[],new jh({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Ti(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(a=>a.shape),outputShapes:this.outputs[0].shape})}else{let a=e.apply(this.outputs[0]);if(Array.isArray(a))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[a],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(at(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new pr({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new wa("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new wa("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new wa("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new wa("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},a=!1){let r,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new W("Legacy serialization format not supported yet.");r=t}else w.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof Vl))throw new Oe(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of r){let l=Na(o,void 0,a);a&&l.setFastWeightInitDuringBuild(!0),i.add(l)}return i}set stopTraining(e){if(this.model==null)throw new W("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new W("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};Vl.className="Sequential";ae.registerClass(Vl);function Oae(e){return new pr(e)}function zae(e){return new Vl(e)}function _ae(e,t){return t==null&&(t={}),$ae(e,t)}function _w(e){return Gw(e)}function Pae(e,t){ca.registerCallbackConstructor(e,t)}var En=class extends ae.Serializable{getConfig(){return{}}},b4=class extends En{apply(e,t=1){return mte(e,t)}};b4.className="elu";ae.registerClass(b4);var v4=class extends En{apply(e){return $c(e)}};v4.className="selu";ae.registerClass(v4);var w4=class extends En{apply(e){return La(e)}};w4.className="relu";ae.registerClass(w4);var k4=class extends En{apply(e){return L(()=>yl(6,La(e)))}};k4.className="relu6";ae.registerClass(k4);var I4=class extends En{apply(e){return e}};I4.className="linear";ae.registerClass(I4);var S4=class extends En{apply(e){return wn(e)}};S4.className="sigmoid";ae.registerClass(S4);var N4=class extends En{apply(e){return yte(e)}};N4.className="hardSigmoid";ae.registerClass(N4);var T4=class extends En{apply(e){return fi(e)}};T4.className="softplus";ae.registerClass(T4);var E4=class extends En{apply(e){return Ate(e)}};E4.className="softsign";ae.registerClass(E4);var C4=class extends En{apply(e){return di(e)}};C4.className="tanh";ae.registerClass(C4);var py=class extends En{apply(e,t=-1){return ed(e,t)}};py.className="softmax";ae.registerClass(py);var R4=class extends En{apply(e,t=-1){return Nc(e,t)}};R4.className="logSoftmax";ae.registerClass(R4);var M4=class extends En{apply(e,t=1){return L(()=>wn(e.mul(t)).mul(e))}};M4.className="swish";ae.registerClass(M4);var F4=class extends En{apply(e){return L(()=>B(e,di(fi(e))))}};F4.className="mish";ae.registerClass(F4);function Hr(e){return e.getClassName()}function cy(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"activation")}function Gr(e){if(e==null){let t={};return t.className="linear",t.config={},cy(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},cy(t)}else return e instanceof En?e:cy(e)}function hy(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var $4=class extends ae.Serializable{},Dd=class extends $4{constructor(e){super();hy(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return L(()=>{let t=Ct([1]);return this.hasL1&&(t=se(t,Te(B(this.l1,Ot(e))))),this.hasL2&&(t=se(t,Te(B(this.l2,Td(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};Dd.className="L1L2";ae.registerClass(Dd);function Lae(e){return hy(e),new Dd({l1:e!=null?e.l1:null,l2:0})}function Wae(e){return hy(e),new Dd({l2:e!=null?e.l2:null,l1:0})}var D4={l1l2:"L1L2"};function ut(e){return T1(e)}function O4(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"regularizer")}function yt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in D4?D4[e]:e,config:{}};return O4(t)}else return e instanceof $4?e:O4(e)}var fy=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=_e(e);let n=La(e);return this.maxValue!=null&&(n=kn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};fy.className="ReLU";ae.registerClass(fy);var my=class extends Ge{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=_e(e);return qu(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};my.className="LeakyReLU";ae.registerClass(my);var Ay=class extends Ge{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=At(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=yt(e.alphaRegularizer),this.alphaConstraint=Lt(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new W(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=at(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let a of this.sharedAxes)t[a-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let a=1;a(Et(t),t==="channelsFirst"?Ze(e,[0,2,3,1]):e))}function z4(e,t){return L(()=>(Et(t),t==="channelsFirst"?Ze(e,[0,2,3,4,1]):e))}function Bae(e,t,n,a=1,r="valid",s,i=1){return L(()=>{if(s==null&&(s=va()),Et(s),e.shape.length!==3)throw new W(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new W(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new W(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Ze(e,[0,2,1])),r==="causal")throw new Oe("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=gc(e,t,a,r==="same"?"same":"valid","NWC",i);return n!=null&&(o=Ia(o,n)),o})}function _4(e,t,n,a=[1,1],r="valid",s,i,o=null){return L(()=>{if(s==null&&(s=va()),Et(s),e.rank!==3&&e.rank!==4)throw new W(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new W(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=by(e,s);if(r==="causal")throw new Oe("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=zr.conv2d({x:l,filter:t,strides:a,pad:r==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(l=Ze(l,[0,3,1,2])),l})}function Vae(e,t,n,a=[1,1,1],r="valid",s,i){return L(()=>{if(s==null&&(s=va()),Et(s),e.rank!==4&&e.rank!==5)throw new W(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new W(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=z4(e,s);if(r==="causal")throw new Oe("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=oA(o,t,a,r==="same"?"same":"valid","NDHWC",i),n!=null&&(o=Ia(o,n)),s==="channelsFirst"&&(o=Ze(o,[0,4,1,2,3])),o})}var vy=class extends Ge{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",vy.verifyArgs(t),this.rank=e,Ht(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new Oe(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=jl(t.kernelSize,e,"kernelSize"),this.strides=jl(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,Qn(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Et(this.dataFormat),this.activation=Gr(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=At(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Lt(t.biasConstraint),this.biasRegularizer=yt(t.biasRegularizer),this.activityRegularizer=yt(t.activityRegularizer),this.dilationRate=jl(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new W(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new W(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new W(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(ja("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,3))throw new W(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Hr(this.activation),useBias:this.useBias,biasInitializer:It(this.biasInitializer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},Od=class extends vy{constructor(e,t){super(e,t);this.kernel=null,Od.verifyArgs(t),this.filters=t.filters,Ht(this.filters,"filters"),this.kernelInitializer=At(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Lt(t.kernelConstraint),this.kernelRegularizer=yt(t.kernelRegularizer)}build(e){e=at(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],a=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return L(()=>{e=_e(e);let n,a=this.bias==null?null:this.bias.read(),r=vw(this.activation.getClassName());if(r!=null&&this.rank===2)n=_4(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate,r);else{if(this.rank===1)n=Bae(e,this.kernel.read(),a,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=_4(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=Vae(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new Oe("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=at(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let r=0;r 0 but got ${JSON.stringify(e.filters)}`)}},zd=class extends Od{constructor(e){super(2,e);zd.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,2))throw new W(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};zd.className="Conv2D";ae.registerClass(zd);var _d=class extends Od{constructor(e){super(3,e);_d.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new W(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};_d.className="Conv3D";ae.registerClass(_d);var wy=class extends zd{constructor(e){super(e);if(this.inputSpec=[new Mt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=at(e),e.length!==4)throw new W("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Mt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=_e(e);if(n.shape.length!==4)throw new W(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=a[s],l=a[i],d=this.kernelSize[0],u=this.kernelSize[1],p=this.strides[0],c=this.strides[1],h=qa(o,p,d,this.padding),m=qa(l,c,u,this.padding),f=[r,h,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,1]));let A=xc(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(A=Ze(A,[0,3,1,2])),this.bias!=null&&(A=Ia(A,this.bias.read(),this.dataFormat)),this.activation!=null&&(A=this.activation.apply(A)),A})}computeOutputShape(e){e=at(e);let t=e.slice(),n,a,r;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3):(n=3,a=1,r=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[a]=qa(t[a],o,s,this.padding),t[r]=qa(t[r],l,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};wy.className="Conv2DTranspose";ae.registerClass(wy);var ky=class extends _d{constructor(e){super(e);if(this.inputSpec=[new Mt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=at(e),e.length!==5)throw new W("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Mt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=_e(e);if(n.shape.length!==5)throw new W(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let l=a[o],d=a[s],u=a[i],p=this.kernelSize[0],c=this.kernelSize[1],h=this.kernelSize[2],m=this.strides[0],f=this.strides[1],A=this.strides[2],y=qa(l,m,p,this.padding),g=qa(d,f,c,this.padding),x=qa(u,A,h,this.padding),k=[r,y,g,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,4,1]));let b=Fb(n,this.kernel.read(),k,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(b=Ze(b,[0,4,1,2,3])),this.bias!==null&&(b=Ia(b,this.bias.read(),this.dataFormat)),this.activation!==null&&(b=this.activation.apply(b)),b})}computeOutputShape(e){e=at(e);let t=e.slice(),n,a,r,s;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3,s=4):(n=4,a=1,r=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],d=this.strides[0],u=this.strides[1],p=this.strides[2];return t[n]=this.filters,t[a]=qa(t[a],d,i,this.padding),t[r]=qa(t[r],u,o,this.padding),t[s]=qa(t[s],p,l,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};ky.className="Conv3DTranspose";ae.registerClass(ky);var P4=class extends Od{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new W("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new W("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new W(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=yt(t.depthwiseRegularizer),this.depthwiseConstraint=Lt(t.depthwiseConstraint),this.pointwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=yt(t.pointwiseRegularizer),this.pointwiseConstraint=Lt(t.pointwiseConstraint)}build(e){if(e=at(e),e.length{e=_e(e);let n;if(this.rank===1)throw new Oe("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Ze(e,[0,2,3,1])),n=NA(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=Ia(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Ze(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=It(this.depthwiseInitializer),e.pointwiseInitializer=It(this.pointwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.pointwiseRegularizer=ut(this.pointwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseConstraint),e.pointwiseConstraint=Pt(this.pointwiseConstraint),e}};P4.className="SeparableConv";var Iy=class extends P4{constructor(e){super(2,e)}};Iy.className="SeparableConv2D";ae.registerClass(Iy);var Jh=class extends Od{constructor(e){super(1,e);Jh.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,1))throw new W(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};Jh.className="Conv1D";ae.registerClass(Jh);var Sy=class extends Ge{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return L(()=>{if(e=_e(e),this.dataFormat==="channelsLast"){let n=Rh(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Rh(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=Rh(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Rh(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Sy.className="Cropping2D";ae.registerClass(Sy);var Ny=class extends Ge{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,lte(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return L(()=>{let n=_e(e),a=n.shape;if(this.dataFormat==="channelsFirst"){n=Ze(n,[0,2,3,1]);let r=this.size[0]*a[2],s=this.size[1]*a[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s]);return Ze(i,[0,3,1,2])}else{let r=this.size[0]*a[1],s=this.size[1]*a[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Ny.className="UpSampling2D";ae.registerClass(Ny);function jae(e,t,n=[1,1],a="valid",r,s){return L(()=>{r==null&&(r=va()),Et(r);let i=by(e,r);if(e.rank!==4)throw new W(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new W(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=hl(i,t,n,a==="same"?"same":"valid","NHWC",s),r==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}var Ty=class extends vy{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=At(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Lt(e.depthwiseConstraint),this.depthwiseRegularizer=yt(e.depthwiseRegularizer)}build(e){if(e=at(e),e.length<4)throw new W(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new W(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],a=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",a,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{e=_e(e);let n=jae(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=Ia(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=Ta(t,this.kernelSize[0],this.padding,this.strides[0]),s=Ta(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],a,r,s]:[e[0],r,s,a]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=It(this.depthwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseRegularizer),e}};Ty.className="DepthwiseConv2D";ae.registerClass(Ty);function L4(e,t,n,a){if(Array.isArray(e)){if(t!=null||n!=null)throw new W("When inputs is an array, neither initialState or constants should be provided");a!=null&&(n=e.slice(e.length-a,e.length),e=e.slice(0,e.length-a)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(s){return s==null||Array.isArray(s)?s:[s]}return t=r(t),n=r(n),{inputs:e,initialState:t,constants:n}}function W4(e,t,n,a=!1,r,s,i=!1,o=!1){return L(()=>{let l=t.shape.length;if(l<3)throw new W(`Input should be at least 3D, but is ${l}D.`);let d=[1,0].concat(ka(2,l));if(t=Ze(t,d),s!=null)throw new Oe("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r!=null&&(r=r.asType("bool").asType("float32"),r.rank===l-1&&(r=on(r,-1)),r=Ze(r,d)),a&&(t=On(t,0),r!=null&&(r=On(r,0)));let u=[],p,c=n,h=t.shape[0],m=ua(t),f;r!=null&&(f=ua(r));for(let y=0;ye(g,c));if(r==null)p=x[0],c=x[1];else{let k=L(()=>{let b=f[y],v=Dn(b).sub(b),I=x[0].mul(b).add(c[0].mul(v)),T=c.map((R,$)=>x[1][$].mul(b).add(R.mul(v)));return{output:I,newStates:T}});p=k.output,c=k.newStates}o&&u.push(p)}let A;return o&&(A=zn(u,1)),[p,A,c]})}var Ha=class extends Ge{constructor(e){super(e);let t;if(e.cell==null)throw new W("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new Qh({cells:e.cell}):t=e.cell,t.stateSize==null)throw new W("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new Mt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return ka(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){K1(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],a;if(this.returnSequences?a=[e[0],e[1],n]:a=[e[0],n],this.returnState){let r=[];for(let s of t)r.push([e[0],s]);return[a].concat(r)}else return a}computeMask(e,t){return L(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let a=this.states.map(r=>null);return[n].concat(a)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new W(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new Mt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ur("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>Ct([n,a])):this.states_=[Ct([n,this.cell.stateSize])];else if(e==null)Ee(this.states_),this.keptStates!=null&&(Ee(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>Ct([n,a])):this.states_[0]=Ct([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):Ee(this.states_);for(let a=0;ajt(a.clone()))})}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=L4(e,n,a,this.numConstants);e=r.inputs,n=r.initialState,a=r.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new Mt({shape:o.shape}));i=i.concat(this.stateSpec)}if(a!=null&&(t.constants=a,s=s.concat(a),this.numConstants=a.length),s[0]instanceof Sa){let o=[e].concat(s),l=this.inputSpec.concat(i),d=this.inputSpec;this.inputSpec=l;let u=super.apply(o,t);return this.inputSpec=d,u}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;e=_e(e),r==null&&(this.stateful?r=this.states_:r=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new W(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:a},o=W4((c,h)=>{let m=this.cell.call([c].concat(h),i);return[m[0],m.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],d=o[1],u=o[2];this.stateful&&this.resetStates(u,a);let p=this.returnSequences?d:l;return this.returnState?[p].concat(u):p})}getInitialState(e){return L(()=>{let t=Ct(e.shape);return t=Te(t,[1,2]),t=Nd(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?O1(t,[1,n]):t):this.cell.stateSize>1?[O1(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===Ha.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let a=t.cell,r=Na(a,n);return new e(Object.assign(t,{cell:r}))}};Ha.className="RNN";ae.registerClass(Ha);var Cd=class extends Ge{},e0=class extends Cd{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=at(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let a=t.training==null?!1:t.training;0Dn(e),rate:this.dropout,training:a})),0Dn(n),rate:this.recurrentDropout,training:a}));let r,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?r=Ua(B(e,s),this.kernel.read()):r=Ua(e,this.kernel.read()),this.bias!=null&&(r=Ia(r,this.bias.read())),i!=null&&(n=B(n,i));let o=se(r,Ua(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:Hr(this.activation),useBias:this.useBias,kernelInitializer:It(this.kernelInitializer),recurrentInitializer:It(this.recurrentInitializer),biasInitializer:It(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),recurrentRegularizer:ut(this.recurrentRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),recurrentConstraint:Pt(this.recurrentConstraint),biasConstraint:Pt(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};e0.className="SimpleRNNCell";ae.registerClass(e0);var Ey=class extends Ha{constructor(e){e.cell=new e0(e),super(e)}call(e,t){return L(()=>{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return new e(t)}};Ey.className="SimpleRNN";ae.registerClass(Ey);var t0=class extends Cd{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new W("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Gr(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=at(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,a=e[1];e=e[0],0Dn(e),rate:this.dropout,training:n,count:3})),0Dn(a),rate:this.recurrentDropout,training:n,count:3}));let r=this.dropoutMask,s=this.recurrentDropoutMask,i,o,l;0{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Cy.className="GRU";ae.registerClass(Cy);var Pd=class extends Cd{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Gr(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=at(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let a;if(this.useBias){if(this.unitForgetBias){let r=this.biasInitializer,s=this.units;a=new(t=class extends pa{apply(i,o){let l=r.apply([s]),d=new Fh().apply([s]),u=r.apply([s*2]);return Mw(Mw(l,d),u)}},t.className="CustomInit",t)}else a=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,a,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new W(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let a=e[1],r=e[2];e=e[0],0Dn(e),rate:this.dropout,training:n,count:4})),0Dn(a),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,l,d,u;0{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Ry.className="LSTM";ae.registerClass(Ry);var Qh=class extends Cd{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return L(()=>{e=e;let n=e.slice(1),a=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?a.push(n.splice(0,i.stateSize.length)):a.push(n.splice(0,1));a.reverse();let r=[],s;for(let i=0;i{Ri(`RNNCell_${a}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=a=>({className:a.getClassName(),config:a.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let a=[];for(let r of t.cells)a.push(Na(r,n));return new e({cells:a})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return Z1(e)}setWeights(e){let t=[];for(let n of this.cells){let a=n.weights.length,r=e.splice(a);for(let s=0;s$w(t(),n),i=()=>Ed(s,t,a);return!r||r<=1?jt(i().clone()):Array(r).fill(void 0).map(i).map(o=>jt(o.clone()))}var Uae=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r{if(this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new W("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return L(()=>{let{stateSize:t}=this.cell,n=e.shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)],s=Ct(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ur("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)];if(n[0]==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Ct(r)):this.states_=[Ct(r)];else if(e==null)Ee(this.states_),this.keptStates!=null&&(Ee(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Ct(r)):this.states_[0]=Ct(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):Ee(this.states_);for(let s=0;sjt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:a,padding:r,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",l=e[o?3:2],d=e[o?4:3],u=Ta(l,a[0],r,s[0],i[0]),p=Ta(d,a[1],r,s[1],i[1]);return[...e.slice(0,2),...o?[n,u,p]:[u,p,n]]}};B4.className="ConvRNN2D";var n0=class extends Pd{constructor(e){let{filters:t,kernelSize:n,strides:a,padding:r,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Ht(this.filters,"filters"),this.kernelSize=jl(n,2,"kernelSize"),this.kernelSize.forEach(o=>Ht(o,"kernelSize")),this.strides=jl(a||1,2,"strides"),this.strides.forEach(o=>Ht(o,"strides")),this.padding=r||"valid",Qn(this.padding),this.dataFormat=s||"channelsLast",Et(this.dataFormat),this.dilationRate=jl(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Ht(o,"dilationRate"))}build(e){var t;e=at(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[n]}`);let a=e[n],r=4,s=this.kernelSize.concat([a,this.filters*r]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*r]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let l=this.biasInitializer,d=this.filters;o=new(t=class extends pa{apply(u,p){let c=l.apply([d]),h=$n([d]),m=l.apply([d*2]);return _1([c,h,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*r],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return L(()=>{if(e.length!==3)throw new W(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,a=e[0],r=e[1],s=e[2],i=4;0Dn(a),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,l=(Y,re,te)=>!re||!re[te]?Y:B(re[te],Y),d=l(a,o,0),u=l(a,o,1),p=l(a,o,2),c=l(a,o,3);0Dn(r),rate:this.recurrentDropout,training:n,count:i}));let h=this.recurrentDropoutMask,m=l(r,h,0),f=l(r,h,1),A=l(r,h,2),y=l(r,h,3),g=3,[x,k,b,v]=ln(this.kernel.read(),i,g),[I,T,R,$]=this.useBias?ln(this.bias.read(),i):[null,null,null,null];d=this.inputConv(d,x,I,this.padding),u=this.inputConv(u,k,T,this.padding),p=this.inputConv(p,b,R,this.padding),c=this.inputConv(c,v,$,this.padding);let[z,_,V,j]=ln(this.recurrentKernel.read(),i,g);m=this.recurrentConv(m,z),f=this.recurrentConv(f,_),A=this.recurrentConv(A,V),y=this.recurrentConv(y,j);let U=this.recurrentActivation.apply(se(d,m)),X=this.recurrentActivation.apply(se(u,f)),G=se(B(X,s),B(U,this.activation.apply(se(p,A)))),ee=B(this.recurrentActivation.apply(se(c,y)),this.activation.apply(G));return[ee,ee,G]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Uae(e,["units"]),a={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,a)}inputConv(e,t,n,a){let r=ar(e,t,this.strides,a||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?Ia(r,n,this.dataFormat):r}recurrentConv(e,t){return ar(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};n0.className="ConvLSTM2DCell";ae.registerClass(n0);var My=class extends B4{constructor(e){let t=new n0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};My.className="ConvLSTM2D";ae.registerClass(My);var a0=class extends Ge{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let a=0;a{this.invokeCallHook(e,t);let n=_e(e);if(0$w(n,this.rate,r,this.seed),()=>n,a)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};a0.className="Dropout";ae.registerClass(a0);var Fy=class extends a0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};Fy.className="SpatialDropout1D";ae.registerClass(Fy);var $y=class extends Ge{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Lt(e.kernelConstraint),this.biasConstraint=Lt(e.biasConstraint),this.kernelRegularizer=yt(e.kernelRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=at(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=at(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e),a=vw(this.activation.getClassName()),r;return a!=null?r=Ua(n,this.kernel.read(),a,this.bias?this.bias.read():null):(r=Ua(n,this.kernel.read()),this.bias!=null&&(r=Ia(r,this.bias.read())),this.activation!=null&&(r=this.activation.apply(r))),r})}getConfig(){let e={units:this.units,activation:Hr(this.activation),useBias:this.useBias,kernelInitializer:It(this.kernelInitializer),biasInitializer:It(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};$y.className="Dense";ae.registerClass($y);var Dy=class extends Ge{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=at(e);for(let t of e.slice(1))if(t==null)throw new W(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Vr(e,1)]}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let a=[0];for(let r=2;r{this.invokeCallHook(e,t);let n=_e(e);return this.activation.apply(n)})}getConfig(){let e={activation:Hr(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};Oy.className="Activation";ae.registerClass(Oy);var zy=class extends Ge{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return L(()=>(e=_e(e),cte(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};zy.className="RepeatVector";ae.registerClass(zy);var _y=class extends Ge{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=_e(e),a=n.shape,r=a.slice(0,1).concat(this.fixUnknownDimension(a.slice(1),this.targetShape));return n.reshape(r)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};_y.className="Reshape";ae.registerClass(_y);var Py=class extends Ge{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=ka(1,e.dims.length+1);if(!w.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Mt({ndim:this.dims.length+1})]}computeOutputShape(e){e=at(e);let t=e.slice();return this.dims.forEach((n,a)=>{t[a+1]=e[n]}),t}call(e,t){return Ze(_e(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};Py.className="Permute";ae.registerClass(Py);var Ly=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=_e(e),a=-1;return Wu(Ai(n,this.maskValue),a)}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e),a=-1,r=!0,s=Wu(Ai(n,this.maskValue),a,r);return n.mul(s.asType(n.dtype))})}};Ly.className="Masking";ae.registerClass(Ly);var Wy=class extends Ge{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ft(e.inputLength))}this.inputDim=e.inputDim,Ht(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Ht(this.outputDim,"outputDim"),this.embeddingsInitializer=At(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=yt(e.embeddingsRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.embeddingsConstraint=Lt(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return L(()=>this.maskZero?(e=_e(e),Ai(e,Ue(e))):null)}computeOutputShape(e){if(e=at(e),this.inputLength==null)return[...e,this.outputDim];let t=ft(this.inputLength);if(t.length!==e.length-1)throw new W(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let a=0;a{this.invokeCallHook(e,t);let n=_e(e);return n.dtype!=="int32"&&(n=Sd(n,"int32")),Fw(this.embeddings.read(),n.as1D()).reshape(at(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:It(this.embeddingsInitializer),embeddingsRegularizer:ut(this.embeddingsRegularizer),activityRegularizer:ut(this.activityRegularizer),embeddingsConstraint:Pt(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};Wy.className="Embedding";ae.registerClass(Wy);var Oi=class extends Ge{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new Oe}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new W(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let r=1;rr.length);e.indexOf(null)===-1&&Br(a).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return L(()=>{if(e=e,this.reshapeRequired){let n=[],a=e.map(r=>r.rank);if(a.indexOf(null)===-1){let r=jr(a);for(let s of e){let i=s.rank;for(let o=0;o1){let d=ka(1,l).concat([0]);n.push(Ze(o,d)),r=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(r){if(i==null){let o=s.shape,l=o.length,d=o[l-1],u=[d].concat(o.slice(0,o.length-1));s=Ze(s.reshape([-1,d]),[1,0]).reshape(u)}else if(i>1){let o=[i-1].concat(ka(0,i-1));s=Ze(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let a=1;a{if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an Array");if(!Array.isArray(e))throw new W("`inputs` should be an Array");if(t.length!==e.length)throw new W(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(a=>a==null))return null;t=t.map(a=>a==null?a:on(a,0));let n=t[0];for(let a=1;a{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new W("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return L(()=>_1(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new W("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),a=this.axis<0?n.length+this.axis:this.axis;for(let r of t.slice(1)){if(n[a]==null||r[a]==null){n[a]=null;break}n[a]+=r[a]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new W("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new W(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return L(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let a=[];for(let s=0;s3||t.shape.length>3)throw new Oe("batchDot is not implemented for tensors of 4D or higher rank yet");if(w.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),w.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new Oe("batchDot is not implemented for complex64-type Tensors yet.");let a=e.shape.length,r=t.shape.length;n==null&&(n=[a-1,r-2]);let s=n;return L(()=>{let i;if(a>r){i=a-r;let l=[];for(let d=0;da){i=r-a;let l=[];for(let d=0;d0){let l;a>r?l=a+r-3:l=a-1;let d=[];for(let u=l;u"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new Oe("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);if(t[a[0]]!==n[a[1]])throw new W(`Dimension incompatibility: ${t[a[0]]} !== ${n[a[1]]}`)}mergeFunction(e){if(e.length!==2)throw new W(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],a;return Array.isArray(this.axes)?a=this.axes.map((r,s)=>Ld(r,e[s].shape.length)):a=[Ld(this.axes,t.shape.length),Ld(this.axes,n.shape.length)],this.normalize&&(t=Uh(t,a[0]),n=Uh(n,a[1])),Hae(t,n,a)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[Ld(this.axes,e.length),Ld(this.axes,t.length)],n}computeOutputShape(e){w.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new Oe("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);t.splice(a[0],1),n.splice(a[1],1),n.splice(0,1);let r=t.concat(n);return r.length===1&&r.push(1),r}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};qy.className="Dot";ae.registerClass(qy);var Xy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);return Ed(()=>Mh(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};Xy.className="GaussianNoise";ae.registerClass(Xy);var Ky=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);return this.rate>0&&this.rate<1?Ed(()=>{let a=Math.sqrt(this.rate/(1-this.rate));return n.mul(Mh(n.shape,1,a))},()=>n,t.training||!1):n})}};Ky.className="GaussianDropout";ae.registerClass(Ky);var Zy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||_e(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Ed(()=>{let a=_e(e),r=1.6732632423543772,s=1.0507009873554805,i=-r*s,o=Dr(gl(n),this.rate);o=Sd(o,"float32");let l=((1-this.rate)*(1+this.rate*i**2))**-.5,d=-l*i*this.rate;return a.mul(o).add(o.add(-1).mul(i)).mul(l).add(d)},()=>_e(e),t.training||!1)}return e})}};Zy.className="AlphaDropout";ae.registerClass(Zy);function Wd(e,t,n,a,r,s=.001){let i;if(e.rank===2)i=Ib(e,t,n,a,r,s);else if(e.rank===3)i=Sb(e,t,n,a,r,s);else if(e.rank===4)i=Nb(e,t,n,a,r,s);else throw new Oe(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function Gae(e,t,n,a,r=.001){return L(()=>{let s=Ec(e,a),i=s.mean,o=s.variance;return[Wd(e,i,o,n,t,r),i,o]})}function qae(e,t,n,a,r=.001){return L(()=>{let s=Ec(e,a),i=s.mean,o=s.variance,l=[];for(let h of ka(0,e.rank))a.indexOf(h)!==-1?l.push(1):l.push(e.shape[h]);let d=i.reshape(l),u=o.reshape(l),p=t==null?null:t.reshape(l),c=n==null?null:n.reshape(l);return[Wd(e,d,u,c,p,r),i,o]})}function Xae(e,t,n,a,r=.001){return w.arraysEqual(a.slice().sort(),ka(0,e.rank-1))?Gae(e,t,n,a,r):qae(e,t,n,a,r)}var Yy=class extends Ge{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.movingMeanInitializer=At(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=At(e.movingVarianceInitializer||"ones"),this.betaConstraint=Lt(e.betaConstraint),this.gammaConstraint=Lt(e.gammaConstraint),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer)}build(e){e=at(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new W(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Mt({ndim:e.length,axes:{[t]:n}})];let a=[n];this.scale&&(this.gamma=this.addWeight("gamma",a,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",a,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",a,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",a,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training,a=_e(e),r=a.shape,s=r.length,i=ka(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let l=Ti(1,s);l[o]=r[o];let d=i.slice();d.sort();let u=!w.arraysEqual(d,ka(0,s).slice(0,s-1)),p=()=>{if(u){let A=this.movingMean.read().reshape(l),y=this.movingVariance.read().reshape(l),g=this.center?this.beta.read().reshape(l):null,x=this.scale?this.gamma.read().reshape(l):null;return Wd(a,A,y,g,x,this.epsilon)}else return Wd(a,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return p();let[c,h,m]=Xae(a,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(A,y,g)=>{L(()=>{let x=1-g,k=A.read(),b=k.sub(y).mul(x);A.write(k.sub(b))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,m,this.momentum)})(),c})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:It(this.betaInitializer),gammaInitializer:It(this.gammaInitializer),movingMeanInitializer:It(this.movingMeanInitializer),movingVarianceInitializer:It(this.movingVarianceInitializer),betaRegularizer:ut(this.betaRegularizer),gammaRegularizer:ut(this.gammaRegularizer),betaConstraint:Pt(this.betaConstraint),gammaConstraint:Pt(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Yy.className="BatchNormalization";ae.registerClass(Yy);var Jy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=at(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let r=0;r=t)throw new Error(`Invalid axis: ${r}`);if(this.axis.length!==Br(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(r=>e[r]),a=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,a):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,a):this.beta=null,this.built=!0}call(e,t){let n=_e(e),a=n.shape,r=a.length;return L(()=>{let s=!0,{mean:i,variance:o}=Ec(n,this.axis,s),l=Ti(1,r);for(let m of this.axis)l[m]=a[m];let d=m=>m!=null&&m.shape.length!==r&&this.axis!==[r-1]?m.reshape(l):m,u=d(this.gamma.read()),p=d(this.beta.read()),c=[],h=[];for(let m=0;m{if(e.rank!==4)throw new W(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new W("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=va()),n!=="channelsLast"&&n!=="channelsFirst")throw new W(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let a;return n==="channelsFirst"?a=[[0,0],[0,0],t[0],t[1]]:a=[[0,0],t[0],t[1],[0,0]],rr(e,a)})}var Qy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?va():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new W(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new W(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new W(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){e=at(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return L(()=>Kae(_e(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Qy.className="ZeroPadding2D";ae.registerClass(Qy);function r0(e,t,n,a,r,s){return L(()=>{Et(r),Sw(s),Qn(a),n==null&&(n=[1,1]),a==null&&(a="valid"),r==null&&(r=va()),s==null&&(s="max"),e=by(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=Ku(e,t,n,o):i=ju(e,t,n,o),r==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}function V4(e,t,n,a,r,s){return L(()=>{Et(r),Sw(s),Qn(a),n==null&&(n=[1,1,1]),a==null&&(a="valid"),r==null&&(r=va()),s==null&&(s="max"),e=z4(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=xA(e,t,n,o):i=rA(e,t,n,o),r==="channelsFirst"&&(i=Ze(i,[0,4,1,2,3])),i})}var j4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new W(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Ht(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new W(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,Qn(this.padding),this.inputSpec=[new Mt({ndim:3})]}computeOutputShape(e){e=at(e);let t=Ta(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return L(()=>{this.invokeCallHook(e,t),e=Nd(_e(e),2);let n=this.poolingFunction(_e(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Or(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},e2=class extends j4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"max")}};e2.className="MaxPooling1D";ae.registerClass(e2);var t2=class extends j4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"avg")}};t2.className="AveragePooling1D";ae.registerClass(t2);var U4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new W(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Ht(this.poolSize,"poolSize"),Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),Qn(this.padding),this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=Ta(t,this.poolSize[0],this.padding,this.strides[0]),n=Ta(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(_e(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},n2=class extends U4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"max")}};n2.className="MaxPooling2D";ae.registerClass(n2);var a2=class extends U4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"avg")}};a2.className="AveragePooling2D";ae.registerClass(a2);var H4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new W(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Ht(this.poolSize,"poolSize"),Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),Qn(this.padding),this.inputSpec=[new Mt({ndim:5})]}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=Ta(t,this.poolSize[0],this.padding,this.strides[0]),n=Ta(n,this.poolSize[1],this.padding,this.strides[1]),a=Ta(a,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,a]:[e[0],t,n,a,e[4]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(_e(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},r2=class extends H4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),V4(e,t,n,a,r,"max")}};r2.className="MaxPooling3D";ae.registerClass(r2);var s2=class extends H4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),V4(e,t,n,a,r,"avg")}};s2.className="AveragePooling3D";ae.registerClass(s2);var G4=class extends Ge{constructor(e){super(e);this.inputSpec=[new Mt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Oe}},i2=class extends G4{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=_e(e);return kt(n,1)})}};i2.className="GlobalAveragePooling1D";ae.registerClass(i2);var o2=class extends G4{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=_e(e);return Xn(n,1)})}};o2.className="GlobalMaxPooling1D";ae.registerClass(o2);var q4=class extends Ge{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Oe}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},l2=class extends q4{call(e,t){return L(()=>{let n=_e(e);return this.dataFormat==="channelsLast"?kt(n,[1,2]):kt(n,[2,3])})}};l2.className="GlobalAveragePooling2D";ae.registerClass(l2);var u2=class extends q4{call(e,t){return L(()=>{let n=_e(e);return this.dataFormat==="channelsLast"?Xn(n,[1,2]):Xn(n,[2,3])})}};u2.className="GlobalMaxPooling2D";ae.registerClass(u2);var X4=class extends Ge{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let a=t.layer,r=Na(a,n);delete t.layer;let s={layer:r};return Object.assign(s,t),new e(s)}},d2=class extends X4{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=at(e),e.length<3)throw new W(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=at(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),a=e[1];return[n[0],a].concat(n.slice(1))}call(e,t){return L(()=>(e=_e(e),W4((n,a)=>[_e(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};d2.className="TimeDistributed";ae.registerClass(d2);function Zae(e){Ci(ote,"BidirectionalMergeMode",e)}var Yae="concat",p2=class extends X4{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Na(n),t.goBackwards=t.goBackwards!==!0;let a={};if(a.className=e.layer.getClassName(),a.config=t,this.backwardLayer=Na(a),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Yae:e.mergeMode,Zae(this.mergeMode),e.weights)throw new Oe("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,a,r;return this.returnState&&(r=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,a=[n]):this.mergeMode==null?a=[n,n.slice()]:a=[n],this.returnState?this.mergeMode==null?a.concat(r).concat(r.slice()):[n].concat(r).concat(r.slice()):Nn(a)}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=L4(e,n,a,this.numConstants);if(e=r.inputs,n=r.initialState,a=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&a==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let l=n.length;if(l%2>0)throw new W("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let d=n.map(u=>new Mt({shape:u.shape}));this.forwardLayer.stateSpec=d.slice(0,l/2),this.backwardLayer.stateSpec=d.slice(l/2),i.push(...d)}if(a!=null)throw new Oe("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Sa;for(let l of s)if(l instanceof Sa!==o)throw new W("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let l=[e].concat(s),d=this.inputSpec.concat(i),u=this.inputSpec;this.inputSpec=d;let p=super.apply(l,t);return this.inputSpec=u,p}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t.initialState,a,r;if(n==null)a=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),l=n.slice(n.length/2);a=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:l}))}let s;this.returnState&&(Array.isArray(a)&&(s=a.slice(1).concat(r.slice(1))),a=a[0],r=r[0]),this.returnSequences&&(r=On(r,1));let i;return this.mergeMode==="concat"?i=_1([a,r]):this.mergeMode==="sum"?i=se(a,r):this.mergeMode==="ave"?i=B(.5,se(a,r)):this.mergeMode==="mul"?i=B(a,r):this.mergeMode==null&&(i=[a,r]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ri(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ri(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let a=this.forwardLayer.states.map(r=>null);return Array.isArray(n)?n.concat(a).concat(a):[n].concat(a).concat(a)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Na(t.layer);if(delete t.layer,t.numConstants!=null)throw new Oe("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let a=t;return a.layer=n,new e(a)}};p2.className="Bidirectional";ae.registerClass(p2);function kte(e){return new Ll(e)}function Ite(e){return new yy(e)}function Ste(e){return new fy(e)}function Nte(e){return new my(e)}function Tte(e){return new Ay(e)}function Ete(e){return new xy(e)}function Cte(e){return new gy(e)}function Rte(e){return new Jh(e)}function Mte(e){return new zd(e)}function Fte(e){return new wy(e)}function $te(e){return new _d(e)}function Dte(e){return new ky(e)}function Ote(e){return new Iy(e)}function zte(e){return new Sy(e)}function _te(e){return new Ny(e)}function Pte(e){return new Ty(e)}function Lte(e){return new Oy(e)}function Wte(e){return new $y(e)}function Bte(e){return new a0(e)}function Vte(e){return new Fy(e)}function jte(e){return new Dy(e)}function Ute(e){return new zy(e)}function Hte(e){return new _y(e)}function Gte(e){return new Py(e)}function qte(e){return new Wy(e)}function Xte(e){return new By(e)}function Kte(e){return new jy(e)}function Zte(e){return new Gy(e)}function Yte(e){return new Uy(e)}function Jte(e){return new Hy(e)}function Qte(e){return new Vy(e)}function ene(e){return new qy(e)}function tne(e){return new Yy(e)}function nne(e){return new Jy(e)}function ane(e){return new Qy(e)}function G1(e){return new t2(e)}function rne(e){return G1(e)}function sne(e){return G1(e)}function q1(e){return new a2(e)}function ine(e){return q1(e)}function one(e){return q1(e)}function X1(e){return new s2(e)}function lne(e){return X1(e)}function une(e){return X1(e)}function dne(e){return new i2(e)}function pne(e){return new l2(e)}function Pw(e){return new o2(e)}function Lw(e){return new u2(e)}function Ww(e){return new e2(e)}function Bw(e){return new n2(e)}function cne(e){return new r2(e)}function hne(e){return new Cy(e)}function fne(e){return new t0(e)}function mne(e){return new Ry(e)}function Ane(e){return new Pd(e)}function yne(e){return new Ey(e)}function gne(e){return new e0(e)}function xne(e){return new My(e)}function bne(e){return new n0(e)}function vne(e){return new Ha(e)}function wne(e){return new Qh(e)}function kne(e){return new p2(e)}function Ine(e){return new d2(e)}var Sne=Pw,Nne=Lw,Tne=Ww,Ene=Bw;function Cne(e){return new Xy(e)}function Rne(e){return new Ky(e)}function Mne(e){return new Zy(e)}function Fne(e){return new Ly(e)}var K4={};Fe(K4,{MAPE:()=>lre,MSE:()=>pre,binaryAccuracy:()=>Jae,binaryCrossentropy:()=>Qae,categoricalAccuracy:()=>tre,categoricalCrossentropy:()=>nre,cosineProximity:()=>sre,mape:()=>ure,meanAbsoluteError:()=>ire,meanAbsolutePercentageError:()=>ore,meanSquaredError:()=>dre,mse:()=>cre,precision:()=>are,recall:()=>rre,sparseCategoricalAccuracy:()=>ere});function Jae(e,t){return ey(e,t)}function Qae(e,t){return n4(e,t)}function ere(e,t){return a4(e,t)}function tre(e,t){return ty(e,t)}function nre(e,t){return ny(e,t)}function are(e,t){return t4(e,t)}function rre(e,t){return Yne(e,t)}function sre(e,t){return J1(e,t)}function ire(e,t){return Hh(e,t)}function ore(e,t){return Bl(e,t)}function lre(e,t){return Bl(e,t)}function ure(e,t){return Bl(e,t)}function dre(e,t){return Fi(e,t)}function pre(e,t){return Fi(e,t)}function cre(e,t){return Fi(e,t)}var Z4={};Fe(Z4,{modelFromJSON:()=>Mae});var Y4={};Fe(Y4,{l1:()=>fre,l1l2:()=>hre,l2:()=>mre});function hre(e){return new Dd(e)}function fre(e){return Lae(e)}function mre(e){return Wae(e)}var J4=class extends Wl{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof pr))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function s0(e,t){return et}var e8=class extends J4{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new Oe("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=s0:this.mode==="max"?this.monitorFunc=Q4:this.monitor.indexOf("acc")!==-1?this.monitorFunc=Q4:this.monitorFunc=s0,this.monitorFunc===s0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===s0?Infinity:-Infinity}async onEpochEnd(e,t){await Ur(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function Are(e){return new e8(e)}var yre={earlyStopping:Are},Ea;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(Ea||(Ea={}));var t8;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(t8||(t8={}));var c2={};function gre(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};c2[e]=n}function n8(e){return c2[e]}function xre(e){delete c2[e]}function S(e,t,n,a,r){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,l=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return mn(t.inputNames[s.inputIndexStart],n,a,r);if(s.type==="tensors")return t.inputNames.slice(o,l).map(p=>mn(p,n,a,r));let d=mn(t.inputNames.slice(o)[0],n,a,r),u=d.dataSync();return s.type==="number"?u[0]:w.toNestedArray(d.shape,u)}let i=t.attrParams[e];return i&&i.value}function mn(e,t,n,a){let[r,s]=Ln(e);if(a!=null){let o=a.getHashTableHandleByName(r);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[i0(r,o)]);return i!==void 0?t[i0(r,i)][s]:void 0}function bre(e,t,n){return t[i0(e,n.currentContextId)]}function cr(e,t){let[n,a]=Ln(e);return[i0(n,t&&t.currentContextId),a]}function i0(e,t){return t?`${e}-${t}`:e}function Ln(e){let t=e.split(":");return t.length===1?[e,0]:[t[0],Number(t[t.length-1])]}function o0(e,t,n){let a=S("pad",e,t,n);if(a==="explicit"){a=S("explicitPaddings",e,t,n);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=a[s*2],r[s][1]=a[s*2+1];return r}return a}function hr(e){return e.kept?e:Oa(e)}var a8={};Fe(a8,{json:()=>vre});var vre=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],r8={};Fe(r8,{json:()=>wre});var wre=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],s8={};Fe(s8,{json:()=>kre});var kre=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],i8={};Fe(i8,{json:()=>Ire});var Ire=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],o8={};Fe(o8,{json:()=>Sre});var Sre=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],l8={};Fe(l8,{json:()=>Nre});var Nre=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],u8={};Fe(u8,{json:()=>Tre});var Tre=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],d8={};Fe(d8,{json:()=>Ere});var Ere=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],p8={};Fe(p8,{json:()=>Cre});var Cre=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],c8={};Fe(c8,{json:()=>Rre});var Rre=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],h8={};Fe(h8,{json:()=>Mre});var Mre=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],f8={};Fe(f8,{json:()=>Fre});var Fre=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],m8={};Fe(m8,{json:()=>$re});var $re=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],A8={};Fe(A8,{json:()=>Dre});var Dre=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],y8={};Fe(y8,{json:()=>Ore});var Ore=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],g8={};Fe(g8,{json:()=>zre});var zre=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],x8={};Fe(x8,{json:()=>_re});var _re=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}],v8=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[a8,r8,s8,i8,o8,l8,u8,h8,c8,d8,f8,m8,A8,y8,g8,x8,p8],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,a)=>(n[a.tfOpName]=a,n),{})}transformGraph(e,t={}){let n=e.node,a=[],r=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?a.push(m[f.name]):f.op==="Const"?r.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],l=[],d={},u={};t!=null&&(d=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));let p=Object.keys(i);p.forEach(m=>{let f=i[m];f.inputNames.forEach(A=>{let[y]=cr(A);f.inputs.push(i[y]),i[y].children.push(f)})}),Object.keys(u).length===0?p.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(u).forEach(m=>{let[f]=cr(m),A=i[f];A!=null&&(A.signatureKey=u[m],l.push(A))}),Object.keys(d).length>0?Object.keys(d).forEach(m=>{let[f]=cr(m),A=i[f];A&&(A.signatureKey=d[m],o.push(A))}):o=a;let c={};e.library!=null&&e.library.function!=null&&(c=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let h={nodes:i,inputs:o,outputs:l,weights:r,placeholders:a,signature:t,functions:c};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=n8(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.substr(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((a,r)=>(a[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},a),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((a,r)=>{let s=r.type,i;switch(r.type){case"string":i=h2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=h2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=v2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=v2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=m2(e.attr,r.tfName,r.defaultValue||0),i===void 0&&!!r.tfDeprecatedName&&(i=m2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=b2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=b2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=f2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=f2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=k2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=k2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=x2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=x2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=w2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=w2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=y2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=y2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=g2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=g2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=b8(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=b8(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${r.type} for op: ${e.op}`)}return a[r.name]={value:i,type:s},a},{})),n}mapFunction(e){let t=e.nodeDef,n=[],a=[],r={};t!=null&&(r=t.reduce((d,u)=>(d[u.name]=this.mapNode(u),u.op==="Const"&&a.push(d[u.name]),d),{}));let s=[],i=[];e.signature.inputArg.forEach(d=>{let[u]=cr(d.name),p={name:u,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:A2(d.type),type:"dtype"}},children:[]};p.signatureKey=d.name,s.push(p),r[u]=p}),Object.keys(r).forEach(d=>{let u=r[d];u.inputNames.forEach(p=>{let[c]=cr(p);u.inputs.push(r[c]),r[c].children.push(u)})});let o=e.ret;e.signature.outputArg.forEach(d=>{let[u,p]=cr(o[d.name]),c=r[u];c!=null&&(c.defaultOutput=p,i.push(c))});let l=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:a,placeholders:n,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function Pre(e){let t=J().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function w8(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):Pre(e);return t?n:n.toLowerCase()}function h2(e,t,n,a=!1){let r=e[t];return r!=null?w8(r.s,a):n}function f2(e,t,n){let a=e[t];return a?a.b:n}function m2(e,t,n){let a=e[t]||{},r=a.i!=null?a.i:a.f!=null?a.f:n;return typeof r=="number"?r:parseInt(r,10)}function A2(e){switch(typeof e=="string"&&(e=Ea[e]),e){case Ea.DT_FLOAT:return"float32";case Ea.DT_INT32:case Ea.DT_INT64:case Ea.DT_INT8:case Ea.DT_UINT8:return"int32";case Ea.DT_BOOL:return"bool";case Ea.DT_DOUBLE:return"float32";case Ea.DT_STRING:return"string";default:return null}}function b8(e,t,n){let a=e[t];return a&&a.func?a.func.name:n}function y2(e,t,n){let a=e[t];return a&&a.type?A2(a.type):n}function g2(e,t,n){let a=e[t];return a&&a.list&&a.list.type?a.list.type.map(r=>A2(r)):n}function k8(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function x2(e,t,n){let a=e[t];return a&&a.shape?k8(a.shape):n}function b2(e,t,n){let a=e[t];return a?((a.list.f&&a.list.f.length?a.list.f:a.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):n}function v2(e,t,n,a=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>w8(s,a)):n}function w2(e,t,n){let a=e[t];return a&&a.list&&a.list.shape?a.list.shape.map(r=>k8(r)):n}function k2(e,t,n){let a=e[t];return a&&a.list&&a.list.b?a.list.b:n}var Lre=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(a=>this.getInput(a)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((a,r)=>(a[r]=this.getAttr(r),a),{}))}getInput(e){return mn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return mn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return m2(this.node.rawAttrs,e,t);if(n.s!=null)return h2(this.node.rawAttrs,e,t);if(n.b!=null)return f2(this.node.rawAttrs,e,t);if(n.shape!=null)return x2(this.node.rawAttrs,e,t);if(n.type!=null)return y2(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return b2(this.node.rawAttrs,e,t);if(n.list.s!=null)return v2(this.node.rawAttrs,e,t);if(n.list.shape!=null)return w2(this.node.rawAttrs,e,t);if(n.list.b!=null)return k2(this.node.rawAttrs,e,t);if(n.list.type!=null)return g2(this.node.rawAttrs,e,t)}return t}},Wre=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[se(S("a",e,t,n),S("b",e,t,n))];case"AddN":return[mc(S("tensors",e,t,n))];case"FloorMod":case"Mod":return[vA(S("a",e,t,n),S("b",e,t,n))];case"Mul":return[B(S("a",e,t,n),S("b",e,t,n))];case"RealDiv":case"Div":return[ge(S("a",e,t,n),S("b",e,t,n))];case"DivNoNan":return[dA(S("a",e,t,n),S("b",e,t,n))];case"FloorDiv":return[fc(S("a",e,t,n),S("b",e,t,n))];case"Sub":return[ye(S("a",e,t,n),S("b",e,t,n))];case"Minimum":return[yl(S("a",e,t,n),S("b",e,t,n))];case"Maximum":return[Pa(S("a",e,t,n),S("b",e,t,n))];case"Pow":return[sr(S("a",e,t,n),S("b",e,t,n))];case"SquaredDifference":return[Lc(S("a",e,t,n),S("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Bre=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Ot(S("x",e,t,n))];case"Acos":return[Xm(S("x",e,t,n))];case"Acosh":return[Km(S("x",e,t,n))];case"Asin":return[Ym(S("x",e,t,n))];case"Asinh":return[Jm(S("x",e,t,n))];case"Atan":return[Qm(S("x",e,t,n))];case"Atan2":return[eA(S("x",e,t,n),S("y",e,t,n))];case"Atanh":return[tA(S("x",e,t,n))];case"Ceil":return[sA(S("x",e,t,n))];case"Complex":return[Tr(S("real",e,t,n),S("imag",e,t,n))];case"Cos":return[Hu(S("x",e,t,n))];case"Cosh":return[bc(S("x",e,t,n))];case"Elu":return[fl(S("x",e,t,n))];case"Erf":return[pA(S("x",e,t,n))];case"Exp":return[qn(S("x",e,t,n))];case"Expm1":return[cA(S("x",e,t,n))];case"Floor":return[ml(S("x",e,t,n))];case"Log":return[Fn(S("x",e,t,n))];case"Log1p":return[Ic(S("x",e,t,n))];case"Imag":return[wc(S("x",e,t,n))];case"Neg":return[wt(S("x",e,t,n))];case"Reciprocal":return[IA(S("x",e,t,n))];case"Real":return[Ju(S("x",e,t,n))];case"Relu":return[La(S("x",e,t,n))];case"Round":return[SA(S("x",e,t,n))];case"Selu":return[$c(S("x",e,t,n))];case"Sigmoid":return[wn(S("x",e,t,n))];case"Sin":return[Dc(S("x",e,t,n))];case"Sign":return[TA(S("x",e,t,n))];case"Sinh":return[Oc(S("x",e,t,n))];case"Softplus":return[fi(S("x",e,t,n))];case"Sqrt":return[Jt(S("x",e,t,n))];case"Square":return[st(S("x",e,t,n))];case"Tanh":return[di(S("x",e,t,n))];case"Tan":return[RA(S("x",e,t,n))];case"ClipByValue":return[kn(S("x",e,t,n),S("clipValueMin",e,t,n),S("clipValueMax",e,t,n))];case"Relu6":return[Mc(S("x",e,t,n))];case"Rsqrt":return[Fc(mn(e.inputNames[0],t,n))];case"Prod":return[Cc(S("x",e,t,n),S("axes",e,t,n))];case"LeakyRelu":return[qu(S("x",e,t,n),S("alpha",e,t,n))];case"Prelu":return[Yu(S("x",e,t,n),S("alpha",e,t,n))];case"IsNan":return[fA(mn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function ha(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){w.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let a=0;an+` Shapes ${e} and ${t} must match`)}}}function I8(e){return!(typeof e=="number"||e.some(t=>t<0))}function Bd(e,t,n){let a=I2(e,n),r=!I8(a);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${a}`);if(r&&t.forEach(s=>{a=I2(s.shape,a)}),!I8(a))throw new Error(`Non-fully-defined elementShape: ${a}`);return a}function I2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let a=0;a=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[a]=r>=0?r:s}return n}var Vre=class{constructor(e,t,n,a,r,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Ie(0),jt(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.tensor.id))&&t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);let t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(t=>this.read(t))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, + because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),ha(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,jt(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((n,a)=>this.write(n,t[a]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let a=0;a=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,ua(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0,a=e.map(o=>(n+=o,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);let a=n===0?0:t.size/n,s=[];L(()=>{t=H(t,[1,n,a]);for(let o=0;o{if(n!==a.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${a.dtype}`);pr(t,a.shape,"TensorList shape mismatch: "),Vt(a)}),this.idTensor=ke(0),this.maxNumElements=r,Vt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new Vc([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.id))&&t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);pr(e,this.elementShape,"TensorList shape mismatch: ");let r=Bc(this.elementShape,this.tensors,e);return L(()=>{let a=this.tensors.map(s=>H(s,r));return On(a,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=Bc(this.elementShape,this.tensors,e),r=this.tensors.pop();return pr(r.shape,e,"TensorList shape mismatch: "),H(r,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(pr(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Vt(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);pr(this.tensors[e].shape,t,"TensorList shape mismatch: ");let r=Bc(this.elementShape,this.tensors,t);return H(this.tensors[e],r)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);pr(this.elementShape,t.shape,"TensorList shape mismatch: "),Vt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);pr(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let r=Bc(this.elementShape,this.tensors,n);return e.length===0?gr([],[0].concat(r)):L(()=>{let a=e.map(s=>H(this.tensors[s],r));return On(a,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);pr(this.elementShape,t,"TensorList shape mismatch: ");let n=Bc(this.elementShape,this.tensors,t);return this.size()===0?gr([],[0].concat(n)):L(()=>{let r=this.tensors.map(a=>H(a,n));return ot(r,0)})}};function Pae(e,t,n){let r=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let a=e.shape.slice(1);pr(a,t,"TensorList shape mismatch: ");let s=ur(e);return new Vc(s,t,r)}function Lae(e,t,n){return new Vc([],e,t,n)}function Wae(e,t,n,r){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let a=Math.max(...t);if(r!=null&&r!==-1&&a>=r)throw new Error(`Max index must be < array size (${a} vs. ${r})`);let s=new Vc([],n,e.dtype,r),i=ur(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function Bae(e,t,n){let r=0,a=t.map(u=>(r+=u,r));if(r!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);let r=n===0?0:t.size/n,s=[];L(()=>{t=H(t,[1,n,r]);for(let o=0;o{if(n!==r.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${r.dtype}`);ha(t,r.shape,"TensorList shape mismatch: "),jt(r)}),this.idTensor=Ie(0),this.maxNumElements=a,jt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new Vd([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.id))&&t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);ha(e,this.elementShape,"TensorList shape mismatch: ");let a=Bd(this.elementShape,this.tensors,e);return L(()=>{let r=this.tensors.map(s=>H(s,a));return zn(r,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=Bd(this.elementShape,this.tensors,e),a=this.tensors.pop();return ha(a.shape,e,"TensorList shape mismatch: "),H(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(ha(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");jt(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);ha(this.tensors[e].shape,t,"TensorList shape mismatch: ");let a=Bd(this.elementShape,this.tensors,t);return H(this.tensors[e],a)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);ha(this.elementShape,t.shape,"TensorList shape mismatch: "),jt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);ha(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let a=Bd(this.elementShape,this.tensors,n);return e.length===0?ga([],[0].concat(a)):L(()=>{let r=e.map(s=>H(this.tensors[s],a));return zn(r,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);ha(this.elementShape,t,"TensorList shape mismatch: ");let n=Bd(this.elementShape,this.tensors,t);return this.size()===0?ga([],[0].concat(n)):L(()=>{let a=this.tensors.map(r=>H(r,n));return ot(a,0)})}};function jre(e,t,n){let a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let r=e.shape.slice(1);ha(r,t,"TensorList shape mismatch: ");let s=ua(e);return new Vd(s,t,a)}function Ure(e,t,n){return new Vd([],e,t,n)}function Hre(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let r=Math.max(...t);if(a!=null&&a!==-1&&r>=a)throw new Error(`Max index must be < array size (${r} vs. ${a})`);let s=new Vd([],n,e.dtype,a),i=ua(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function Gre(e,t,n){let a=0,r=t.map(u=>(a+=u,a));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${r}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=k2(s,n),o=r===0?0:e.size/r,l=L(()=>{let u=[];e=H(e,[1,r,o]);for(let h=0;h{switch(e.op){case"If":case"StatelessIf":{let r=I("thenBranch",e,t,n),a=I("elseBranch",e,t,n),s=I("cond",e,t,n),i=I("args",e,t,n);return(await s.data())[0]?n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let r=I("body",e,t,n),a=I("cond",e,t,n),s=I("args",e,t,n),i=await n.functionMap[a].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(u=>u.id),l=await i[0].data();i.forEach(u=>{!u.kept&&o.indexOf(u.id)===-1&&u.dispose()});let c=s;for(;l[0];){let u=c;c=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);let h=c.map(p=>p.id);u.forEach(p=>{!p.kept&&o.indexOf(p.id)===-1&&h.indexOf(p.id)===-1&&p.dispose()});let d=await n.functionMap[a].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);l=await d[0].data(),d.forEach(p=>{!p.kept&&o.indexOf(p.id)===-1&&h.indexOf(p.id)===-1&&p.dispose()})}return c}case"LoopCond":{let r=I("pred",e,t,n);return[ma(r)]}case"Switch":{let r=I("pred",e,t,n),a=I("data",e,t,n);return a.kept||(a=ma(a)),(await r.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{let r=e.inputNames.find(a=>mn(a,t,n)!==void 0);if(r){let a=mn(r,t,n);return[ma(a)]}return}case"Enter":{let r=I("frameName",e,t,n),a=I("tensor",e,t,n);return n.enterFrame(r),[ma(a)]}case"Exit":{let r=I("tensor",e,t,n);return n.exitFrame(),[ma(r)]}case"NextIteration":{let r=I("tensor",e,t,n);return n.nextIteration(),[ma(r)]}case"TensorArrayV3":{let r=I("size",e,t,n),a=I("dtype",e,t,n),s=I("elementShape",e,t,n),i=I("dynamicSize",e,t,n),o=I("clearAfterRead",e,t,n),l=I("identicalElementShapes",e,t,n),c=I("name",e,t,n),u=new zae(c,a,r,s,l,i,o);return n.addTensorArray(u),[u.idTensor,ke(1)]}case"TensorArrayWriteV3":{let r=I("tensorArrayId",e,t,n),a=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(r.id);return i.write(a,s),[i.idTensor]}case"TensorArrayReadV3":{let r=I("tensorArrayId",e,t,n),a=I("index",e,t,n);return[n.getTensorArray(r.id).read(a)]}case"TensorArrayGatherV3":{let r=I("tensorArrayId",e,t,n),a=I("indices",e,t,n),s=I("dtype",e,t,n);return[n.getTensorArray(r.id).gather(a,s)]}case"TensorArrayScatterV3":{let r=I("tensorArrayId",e,t,n),a=I("indices",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(r.id);return i.scatter(a,s),[i.idTensor]}case"TensorArrayConcatV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id),s=I("dtype",e,t,n);return[a.concat(s)]}case"TensorArraySplitV3":{let r=I("tensorArrayId",e,t,n),a=I("tensor",e,t,n),s=I("lengths",e,t,n),i=n.getTensorArray(r.id);return i.split(s,a),[i.idTensor]}case"TensorArraySizeV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return[ke(a.size(),"int32")]}case"TensorArrayCloseV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{let r=I("tensorListId",e,t,n),a=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorList(r.id);return i.setItem(a,s),[i.idTensor]}case"TensorListGetItem":{let r=I("tensorListId",e,t,n),a=I("index",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(a,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let r=I("indices",e,t,n),a=I("tensor",e,t,n),s=I("elementShape",e,t,n),i=I("numElements",e,t,n),o=Wae(a,r,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let r=I("elementShape",e,t,n),a=I("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=I(s,e,t,n),o=Lae(r,a,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let r=I("tensorListId",e,t,n),a=I("indices",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(r.id).gather(a,i,s)]}case"TensorListStack":{let r=I("tensorListId",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=I("numElements",e,t,n);return[n.getTensorList(r.id).stack(a,s,i)]}case"TensorListFromTensor":{let r=I("tensor",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=Pae(r,a,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let r=I("tensorListId",e,t,n),a=n.getTensorList(r.id),s=I("dtype",e,t,n),i=I("elementShape",e,t,n);return[a.concat(s,i)]}case"TensorListPushBack":{let r=I("tensorListId",e,t,n),a=I("tensor",e,t,n),s=n.getTensorList(r.id);return s.pushBack(a),[s.idTensor]}case"TensorListPopBack":{let r=I("tensorListId",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(a,s)]}case"TensorListSplit":{let r=I("tensor",e,t,n),a=I("elementShape",e,t,n),s=I("lengths",e,t,n),i=Bae(r,s,a);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function k4(e,t,n){let[r,a]=I("fusedOps",e,t,n),s=r==="biasadd",i=a==="prelu",o=r==="fusedbatchnorm",l=I("numArgs",e,t,n);if(s){if(i&&l!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&l!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(o)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let c=I("strides",e,t,n),u=o0(e,t,n),h=I("dataFormat",e,t,n).toUpperCase(),d=I("dilations",e,t,n),[p,m]=I("args",e,t,n),f=I("leakyreluAlpha",e,t,n);return{stride:c,pad:u,dataFormat:h,dilations:d,biasArg:p,preluArg:m,activationFunc:a,leakyreluAlpha:f}}var jae=(e,t,n)=>{switch(e.op){case"Conv1D":{let r=I("stride",e,t,n),a=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilation",e,t,n);return[gd(I("x",e,t,n),I("filter",e,t,n),r,a,s,i)]}case"Conv2D":{let r=I("strides",e,t,n),a=o0(e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[sa(I("x",e,t,n),I("filter",e,t,n),[r[1],r[2]],a,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:r,pad:a,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:c,leakyreluAlpha:u}=k4(e,t,n);return[Pa.conv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{let{stride:r,pad:a,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:c,leakyreluAlpha:u}=k4(e,t,n);return[Pa.depthwiseConv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let r=I("outputShape",e,t,n),a=I("strides",e,t,n),s=o0(e,t,n);return[xd(I("x",e,t,n),I("filter",e,t,n),r,[a[1],a[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let r=I("strides",e,t,n),a=o0(e,t,n),s=I("dilations",e,t,n),i=I("dataFormat",e,t,n).toUpperCase();return[pl(I("input",e,t,n),I("filter",e,t,n),[r[1],r[2]],a,i,[s[1],s[2]])]}case"Conv3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[om(I("x",e,t,n),I("filter",e,t,n),[r[1],r[2],r[3]],a,s,[i[1],i[2],i[3]])]}case"AvgPool":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[ju(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPool":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[Ku(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPoolWithArgmax":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n),i=I("includeBatchInIndex",e,t,n),{result:o,indexes:l}=Uw(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a,i);return[o,l]}case"AvgPool3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[am(I("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"MaxPool3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[xm(I("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"Dilation2D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("dilations",e,t,n),i=r[1],o=r[2],l=s[1],c=s[2];return[um(I("x",e,t,n),I("filter",e,t,n),[i,o],a,[l,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Uae=(e,t,n)=>{switch(e.op){case"Fill":{let r=I("shape",e,t,n),a=I("dtype",e,t,n),s=I("value",e,t,n);return[Gu(r,s,a)]}case"LinSpace":{let r=I("start",e,t,n),a=I("stop",e,t,n),s=I("num",e,t,n);return[zw(r,a,s)]}case"Multinomial":{let r=I("logits",e,t,n),a=I("numSamples",e,t,n),s=I("seed",e,t,n);return[Hw(r,a,s)]}case"OneHot":{let r=I("indices",e,t,n),a=I("depth",e,t,n),s=I("onValue",e,t,n),i=I("offValue",e,t,n);return[ol(r,a,s,i)]}case"Ones":return[Fn(I("shape",e,t,n),I("dtype",e,t,n))];case"OnesLike":return[$n(I("x",e,t,n))];case"RandomUniform":return[gl(I("shape",e,t,n),I("minval",e,t,n),I("maxval",e,t,n),I("dtype",e,t,n))];case"Range":{let r=I("start",e,t,n),a=I("stop",e,t,n),s=I("step",e,t,n);return[Cd(r,a,s,I("dtype",e,t,n))]}case"TruncatedNormal":{let r=I("shape",e,t,n),a=I("mean",e,t,n),s=I("stdDev",e,t,n),i=I("seed",e,t,n);return[Wd(r,a,s,I("dtype",e,t,n),i)]}case"Zeros":return[Et(I("shape",e,t,n),I("dtype",e,t,n))];case"ZerosLike":return[Ue(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function I2(e,t,n){let r=I("boxes",e,t,n),a=I("scores",e,t,n),s=I("maxOutputSize",e,t,n),i=I("iouThreshold",e,t,n),o=I("scoreThreshold",e,t,n),l=I("softNmsSigma",e,t,n);return{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var Hae=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}=I2(e,t,n),c=await Ye.nonMaxSuppressionWithScoreAsync(r,a,s,i,o,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=I2(e,t,n),l=I("padToMaxOutputSize",e,t,n),c=await Ye.nonMaxSuppressionPaddedAsync(r,a,s,i,o,l);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=I2(e,t,n);return[await Ye.nonMaxSuppressionAsync(r,a,s,i,o)]}case"Where":{let r=Ae(I("condition",e,t,n),"bool"),a=[await Fm(r)];return r.dispose(),a}case"ListDiff":return Xw(I("x",e,t,n),I("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},Gae=(e,t,n)=>{switch(e.op){case"TopKV2":{let r=I("x",e,t,n),a=I("k",e,t,n),s=I("sorted",e,t,n),i=Rm(r,a,s);return[i.values,i.indices]}case"Unique":{let r=I("x",e,t,n),a=Bd(r);return[a.values,a.indices]}case"UniqueV2":{let r=I("x",e,t,n),a=I("axis",e,t,n),s=Bd(r,a);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},qae=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let r=I("default",e,t,n);return[mn(e.name,t,n)||r];case"Placeholder":return[mn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let c=I("x",e,t,n);return[ma(c)]}case"IdentityN":return I("x",e,t,n).map(c=>ma(c));case"Snapshot":let a=I("x",e,t,n);return[ma(a)];case"Shape":return[nn(I("x",e,t,n).shape,"int32")];case"ShapeN":return I("x",e,t,n).map(c=>nn(c.shape));case"Size":return[ke(I("x",e,t,n).size,"int32")];case"Rank":return[ke(I("x",e,t,n).rank,"int32")];case"NoOp":return[ke(1)];case"Print":let s=I("x",e,t,n),i=I("data",e,t,n),o=I("message",e,t,n),l=I("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let c=0;ce.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(r=>r.dispose()),this.tensorMap.clear(),L(()=>{let r=ur(t),a=n.length,s=r.length;_.assert(a===s,()=>`The number of elements doesn't match, keys has ${a} elements, the values has ${s} elements.`);for(let i=0;i{let r=[];for(let a=0;a{switch(e.op){case"HashTable":case"HashTableV2":{let a=I("keyDType",e,t,n),s=I("valueDType",e,t,n),i=new Xae(a,s);return r.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let a=I("tableHandle",e,t,n,r),s=I("keys",e,t,n),i=I("values",e,t,n);return[await r.getHashTableById(a.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let a=I("tableHandle",e,t,n,r),s=I("keys",e,t,n),i=I("defaultValue",e,t,n);return[await r.getHashTableById(a.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let a=I("tableHandle",e,t,n,r);return[r.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Zae=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let r=I("images",e,t,n),a=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[Ye.resizeBilinear(r,[a[0],a[1]],s,i)]}case"ResizeNearestNeighbor":{let r=I("images",e,t,n),a=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[Ye.resizeNearestNeighbor(r,[a[0],a[1]],s,i)]}case"CropAndResize":{let r=I("image",e,t,n),a=I("boxes",e,t,n),s=I("boxInd",e,t,n),i=I("cropSize",e,t,n),o=I("method",e,t,n),l=I("extrapolationValue",e,t,n);return[Ye.cropAndResize(r,a,s,i,o,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Yae=(e,t,n)=>{switch(e.op){case"Equal":return[$a(I("a",e,t,n),I("b",e,t,n))];case"NotEqual":return[Ai(I("a",e,t,n),I("b",e,t,n))];case"Greater":return[or(I("a",e,t,n),I("b",e,t,n))];case"GreaterEqual":return[Oa(I("a",e,t,n),I("b",e,t,n))];case"Less":return[vd(I("a",e,t,n),I("b",e,t,n))];case"LessEqual":return[pi(I("a",e,t,n),I("b",e,t,n))];case"LogicalAnd":return[lr(I("a",e,t,n),I("b",e,t,n))];case"LogicalNot":return[Xu(I("a",e,t,n))];case"LogicalOr":return[Nd(I("a",e,t,n),I("b",e,t,n))];case"Select":case"SelectV2":return[kn(I("condition",e,t,n),I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Jae=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[Be(I("a",e,t,n),I("b",e,t,n),I("transposeA",e,t,n),I("transposeB",e,t,n))];case"Einsum":return[$w(I("equation",e,t,n),...I("tensors",e,t,n))];case"Transpose":return[Ze(I("x",e,t,n),I("perm",e,t,n))];case"_FusedMatMul":let[r,a]=I("fusedOps",e,t,n),s=r==="biasadd",i=a==="prelu",o=I("numArgs",e,t,n),l=I("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[c,u]=I("args",e,t,n);return[Pa.matMul({a:I("a",e,t,n),b:I("b",e,t,n),transposeA:I("transposeA",e,t,n),transposeB:I("transposeB",e,t,n),bias:c,activation:a,preluActivationWeights:u,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Qae=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[hi(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"FusedBatchNormV3":return[hi(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"LRN":return[mm(I("x",e,t,n),I("radius",e,t,n),I("bias",e,t,n),I("alpha",e,t,n),I("beta",e,t,n))];case"Softmax":return[ec(I("x",e,t,n))];case"LogSoftmax":return[Sd(I("x",e,t,n))];case"SparseToDense":return[$m(I("sparseIndices",e,t,n),I("outputShape",e,t,n),I("sparseValues",e,t,n),I("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},ese=(e,t,n)=>{switch(e.op){case"Max":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Xn(I("x",e,t,n),i,o)]}case"Mean":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[vt(I("x",e,t,n),i,o)]}case"Min":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Al(I("x",e,t,n),i,o)]}case"Sum":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ne(I("x",e,t,n),i,o)]}case"All":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ad(I("x",e,t,n),i,o)]}case"Any":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Wu(I("x",e,t,n),i,o)]}case"ArgMax":{let i=I("axis",e,t,n);return[Bu(I("x",e,t,n),i)]}case"ArgMin":{let i=I("axis",e,t,n);return[Zf(I("x",e,t,n),i)]}case"Prod":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ed(I("x",e,t,n),i,o)]}case"Cumsum":{let i=I("axis",e,t,n),o=I("exclusive",e,t,n),l=I("reverse",e,t,n);return[bd(I("x",e,t,n),i,o,l)]}case"Bincount":let r=I("x",e,t,n),a=I("weights",e,t,n),s=I("size",e,t,n);return[Sw(r,a,s)];case"DenseBincount":{let i=I("x",e,t,n),o=I("weights",e,t,n),l=I("size",e,t,n),c=I("binaryOutput",e,t,n);return[Mw(i,o,l,c)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},tse=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let r=I("n",e,t,n),a=I("axis",e,t,n),s=I("tensors",e,t,n);return s=s.slice(0,r),[ot(s,a)]}case"Gather":{let r=I("x",e,t,n),a=I("indices",e,t,n);return[di(r,Ae(a,"int32"),0)]}case"GatherV2":{let r=I("axis",e,t,n),a=I("batchDims",e,t,n),s=I("x",e,t,n),i=I("indices",e,t,n);return[di(s,Ae(i,"int32"),r,a)]}case"Reverse":{let r=I("dims",e,t,n),a=[];for(let i=0;i{let r=I("axis",e,t,n),a=I("tensors",e,t,n),s=a[0].shape,i=za(a[0]).shape,o=a.map(l=>{let c=_.arraysEqual(l.shape,s);if(!c&&!_.arraysEqual(za(l).shape,i))throw new Error("the input tensors shape does not match");return c?l:H(l,s)});return[On(o,r)]});case"Unpack":{let r=I("axis",e,t,n),a=I("tensor",e,t,n);return ur(a,r)}case"Tile":{let r=I("reps",e,t,n);return[Da(I("x",e,t,n),r)]}case"Split":case"SplitV":{let r=I("axis",e,t,n),a=I("numOrSizeSplits",e,t,n),s=I("x",e,t,n);return ln(s,a,r)}case"ScatterNd":{let r=I("indices",e,t,n),a=I("values",e,t,n),s=I("shape",e,t,n);return[Jw(r,a,s)]}case"GatherNd":{let r=I("x",e,t,n),a=I("indices",e,t,n);return[Qw(r,a)]}case"SparseToDense":{let r=I("sparseIndices",e,t,n),a=I("outputShape",e,t,n),s=I("sparseValues",e,t,n),i=I("defaultValue",e,t,n);return[$m(r,s,a,s.dtype===i.dtype?i:Ae(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},nse=(e,t,n)=>{switch(e.op){case"SparseReshape":{let{outputIndices:r,outputShape:a}=fb.sparseReshape(I("inputIndices",e,t,n),I("inputShape",e,t,n),I("newShape",e,t,n));return[r,a]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},rse=(e,t,n)=>{switch(e.op){case"FFT":return[tc(I("x",e,t,n))];case"IFFT":return[xl(I("x",e,t,n))];case"RFFT":return[nc(I("x",e,t,n))];case"IRFFT":return[Pd(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},ase=(e,t,n)=>{switch(e.op){case"Cast":return[Ae(I("x",e,t,n),I("dtype",e,t,n))];case"ExpandDims":{let r=I("axis",e,t,n);return[on(I("x",e,t,n),r)]}case"Squeeze":{let r=I("axis",e,t,n);return[za(I("x",e,t,n),r)]}case"Reshape":return[H(I("x",e,t,n),I("shape",e,t,n))];case"MirrorPad":return[wm(I("x",e,t,n),I("padding",e,t,n),I("mode",e,t,n))];case"PadV2":case"Pad":return[ia(I("x",e,t,n),I("padding",e,t,n),I("constantValue",e,t,n))];case"SpaceToBatchND":{let r=I("blockShape",e,t,n),a=I("paddings",e,t,n);return[Zu(I("x",e,t,n),r,a)]}case"BatchToSpaceND":{let r=I("blockShape",e,t,n),a=I("crops",e,t,n);return[Uu(I("x",e,t,n),r,a)]}case"DepthToSpace":{let r=I("blockSize",e,t,n),a=I("dataFormat",e,t,n).toUpperCase();return[lm(I("x",e,t,n),r,a)]}case"BroadcastTo":return[hl(I("x",e,t,n),I("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function I4(e,t,n,r){let a=((s,i,o)=>{switch(s.category){case"arithmetic":return L(()=>Dae(s,i,o));case"basic_math":return L(()=>Oae(s,i,o));case"control":return Vae(s,i,o);case"convolution":return L(()=>jae(s,i,o));case"creation":return L(()=>Uae(s,i,o));case"dynamic":return Hae(s,i,o);case"evaluation":return L(()=>Gae(s,i,o));case"image":return L(()=>Zae(s,i,o));case"graph":return L(()=>qae(s,i,o));case"logical":return L(()=>Yae(s,i,o));case"matrices":return L(()=>Jae(s,i,o));case"normalization":return L(()=>Qae(s,i,o));case"reduction":return L(()=>ese(s,i,o));case"slice_join":return L(()=>tse(s,i,o));case"sparse":return L(()=>nse(s,i,o));case"spectral":return L(()=>rse(s,i,o));case"transformation":return L(()=>ase(s,i,o));case"hash_table":return Kae(s,i,o,r);case"custom":let l=t4(s.op);if(l&&l.customExecutor)return l.customExecutor(new $ae(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return _.isPromise(a)?a.then(s=>[].concat(s)):[].concat(a)}var S4=class{constructor(e={},t={},n={},r={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let e=[];for(let t=0;tt.id===0&&t.iterationId===0?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;let e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function T4(e,t,n,r){let a=new Set,s=[],i=null,o=null,l=new Set,c=Object.keys(e).map(d=>Ln(d)[0]),u=[];r!=null&&(u=r.map(d=>Ln(d.name)[0]));let h=[...t];for(;h.length>0;){let d=h.pop();if((N4(d)||sse(d)||ise(d))&&i==null&&(i=d,o=i.children.map(p=>p.name).filter(p=>a.has(p))),a.add(d.name),n[d.name]==null&&c.indexOf(d.name)===-1&&u.indexOf(d.name)===-1){if(d.inputs.length===0){s.push(d.name);continue}d.inputs.forEach(p=>{l.has(p.name)||(l.add(p.name),h.push(p))})}}return{inputs:e,outputs:t,usedNodes:a,missingInputs:s,dynamicNode:i,syncInputs:o}}function ose(e,t,n){let{usedNodes:r,inputs:a}=n,s=[],i=Object.keys(a).map(u=>Ln(u)[0]).map(u=>e.nodes[u]),o=e.initNodes;i.forEach(u=>{r.has(u.name)&&s.push(u)}),e.weights.forEach(u=>{r.has(u.name)&&s.push(u)}),o!=null&&o.forEach(u=>{r.has(u.name)&&s.push(u)});let l=new Set,c=[];for(;s.length>0;){let u=s.pop();l.add(u.name),t[u.name]||c.push(u),u.children.forEach(h=>{!l.has(h.name)&&r.has(h.name)&&h.inputs.every(d=>l.has(d.name))&&s.push(h)})}return c}var lse=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],use=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],cse=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function N4(e){return lse.indexOf(e.op)>=0}function sse(e){return use.indexOf(e.op)>=0}function ise(e){return cse.indexOf(e.op)>=0}var S2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(n=>{this._functionExecutorMap[n]=new S2(e.functions[n],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){let t=Object.keys(e).map(n=>e[n].map(r=>r.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(a=>a.name).sort(),r=t.map(a=>a.name).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(e,t){let n=T4(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:a,syncInputs:s}=n;if(a!=null)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(r.length>0){let i=t.map(l=>l.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${r}]`)}return ose(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let r=n.map(u=>this.graph.nodes[Ln(u)[0]]),a=t.map(u=>Ln(u)[0]),s=a.map(u=>this.graph.nodes[u]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(r,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let l={},c={};return L(()=>{let u=new S4(this.weightMap,l,c,this.functionExecutorMap),h=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,A]=Ln(m),y=[];y[A]=e[m],h[f]=y});let d=this.getFrozenTensorIds(h),p={};for(let m=0;mmn(m,h,u))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(r=>r.id)));return new Set(t)}checkTensorForDisposal(e,t,n,r,a,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let l=mae(o.name,n,r);l!=null&&l.forEach(c=>{if(c&&!c.kept&&!a.has(c.id)){let u=i[c.id];u===1?(c.dispose(),delete i[c.id]):u!=null&&i[c.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,r={},a={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new S4(this.weightMap,r,a,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(h=>mn(h,i,s)),l=o.map(h=>h.id),c=Object.keys(e).map(h=>e[h].id),u=new Set([...l,...c,...this.weightIds]);return Object.keys(i).forEach(h=>{i[h].forEach(d=>{d&&!d.kept&&!d.isDisposed&&!u.has(d.id)&&d.dispose()})}),this.parent==null&&s.dispose(u),o}async executeFunctionAsync(e,t,n){let r=e.reduce((a,s,i)=>(a[this.inputs[i].name]=s,a),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){let a=Object.keys(e),s=a.map(g=>this.graph.nodes[Ln(g)[0]]),i=n.map(g=>Ln(g)[0]),o=i.map(g=>this.graph.nodes[g]);o.length===0&&(o=this._outputs);let{usedNodes:l,missingInputs:c,dynamicNode:u,syncInputs:h}=T4(e,o,this.weightMap,this._initNodes),d=[...s,...this.graph.weights,...this._initNodes||[]].map(g=>({node:g,contexts:t.currentContext})),p=Object.assign({},this.weightMap);Object.keys(e).forEach(g=>{let[x,v]=Ln(g),w=[];w[v]=e[g],p[x]=w});let m={},f=this.getFrozenTensorIds(p),A={};for(;d.length>0;){let g=this.processStack(s,d,t,p,A,f,i,m,l);await Promise.all(g)}u==null&&!r&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(g=>!N4(g)&&!mn(g.name,p,t)).map(g=>g.name);if(y.length>0){let g="";throw u!=null&&(g=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${a}]. Consider providing the following inputs: [${c}]. ${g}`)}return p}processStack(e,t,n,r,a,s,i,o,l){let c=[];for(;t.length>0;){let u=t.pop();n.currentContext=u.contexts;let h="";if(u.node.op==="Enter"&&I("isConstant",u.node,r,n)&&([h]=fa(u.node.name,n)),r[u.node.name]==null){let d=I4(u.node,r,n,this._resourceManager);h||([h]=fa(u.node.name,n));let p=n.currentContext;_.isPromise(d)?c.push(d.then(m=>(r[h]=m,n.currentContext=p,this.checkTensorForDisposal(h,u.node,r,n,s,i,o),this.processChildNodes(u.node,t,n,r,a,l),m))):(r[h]=d,this.checkTensorForDisposal(h,u.node,r,n,s,i,o),this.processChildNodes(u.node,t,n,r,a,l))}else this.processChildNodes(u.node,t,n,r,a,l)}return c}processChildNodes(e,t,n,r,a,s){e.children.forEach(i=>{let[o]=fa(i.name,n);a[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(l=>!!mn(l,r,n))&&(a[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(l=>!!mn(l,r,n))&&(a[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[r]=Ln(t),a=this.graph.nodes[r];if(a.attrParams.shape&&a.attrParams.shape.value){let s=a.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,l)=>s[l]===-1||s[l]===o);_.assert(i,()=>`The shape of dict['${a.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}a.attrParams.dtype&&a.attrParams.dtype.value&&_.assert(n.dtype===a.attrParams.dtype.value,()=>`The dtype of dict['${a.name}'] provided in model.execute(dict) must be ${a.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let r=this._signature.inputs[n];t[r.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[r]=Ln(n);return this.graph.nodes[r]==null});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(t=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Ln(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},hse=class{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},dse="?tfjs-format=file",pse="model.json",E4=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new hse}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=bn.browserHTTPRequest(e,this.loadOptions);else{let t=bn.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(bn.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let r=bn.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new S2(w4.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let a=w4.Instance.transformGraph(e.modelInitializer);this.initializer=new S2(a),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=bn.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Le)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,r)=>(t[n]=e[r],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function Ht(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${pse}${dse}`);let n=new E4(e,t);return await n.load(),n}var fse="3.5.0",C4={};Me(C4,{CSVDataset:()=>M4,Dataset:()=>Ul,FileDataSource:()=>F4,TextLineDataset:()=>R4,URLDataSource:()=>$4,array:()=>mse,csv:()=>yse,func:()=>gse,generator:()=>xse,microphone:()=>bse,version_data:()=>_se,webcam:()=>wse,zip:()=>Ase});var vse=Yi(zg()),kse=Yi(zg());function Ise(e,t){return l0(e,t)}function l0(e,t,n=new Map,r=new Set){if(e==null)return null;if(r.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let a=t(e);if(a.recurse&&a.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(a.recurse)if(Hl(e)){let s=Array.isArray(e)?[]:{};r.add(e);for(let i in e){let o=e[i],l=l0(o,t,n,r);s[i]=l}return r.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,a.value),a.value}function Sse(e,t=O4){return D4(e,t)}function D4(e,t,n=new Set){let r=e[0];if(n.has(r))throw new Error("Circular references are not supported.");let a=t(e);if(a.recurse&&a.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(a.recurse)if(Hl(r)){let s=Array.isArray(r)?[]:{};n.add(r);for(let i in r){let o=e.map(c=>c[i]),l=D4(o,t,n);s[i]=l}return n.delete(r),s}else throw new Error(`Can't recurse into non-iterable type: ${r}`);else return a.value}function O4(e){return e===null?null:Hl(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function z4(e,t){let n=new Map;l0(e,t,n);for(let r of Array.from(n.keys())){let a=n.get(r);if(_.isPromise(a)){let s=await a;n.set(r,s)}}return l0(e,t,n)}function Hl(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Le))}function Tse(e){return e==null||Nse(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Le||_.isTypedArray(e)}function Nse(e){return e===null||typeof e!="object"&&typeof e!="function"}function Cse(e){return Ise(e,Ese)}function Ese(e){return e instanceof Le?{value:e.clone(),recurse:!1}:Hl(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var P4=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},N2=class extends P4{constructor(){super(N2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let r=0;rt===!0)}rowMajorBatch(e,t=!0){return new Lse(this,e,t)}columnMajorBatch(e,t=!0,n=O4){return this.rowMajorBatch(e,t).map(r=>Sse(r,n))}concatenate(e,t){return new W4(L4([this,e]),t)}take(e){return e<0||e==null?this:new Pse(this,e)}skip(e){return e<0||e==null?this:new zse(this,e)}prefetch(e){return new V4(this,e)}shuffle(e,t){return new Use(this,e,t)}serial(){return new Ose(this)}},Rse=class extends Gt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:Cse(e),done:!1}}},Mse=class extends Gt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},Ose=class extends Gt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},zse=class extends Gt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Lse=class extends Gt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Wse=class extends Gt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Te(e.value)}}},Bse=class extends Gt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Ar.getTensorsInContainer(e.value),n=this.transform(e.value),r=Ar.getTensorsInContainer(n);for(let a of t)Ar.isTensorInList(a,r)||a.dispose();return{value:n,done:!1}}},Vse=class extends Gt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},B4=class extends Gt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Ar.getTensorsInContainer(e.value),n=await this.transform(e.value),r=Ar.getTensorsInContainer(n);for(let a of t)Ar.isTensorInList(a,r)||a.dispose();return{value:n,done:!1}}},E2=class extends Gt{constructor(){super();this.outputQueue=new N2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},jse=class extends E2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=Ar.getTensorsInContainer(e.value),n=this.transform(e.value),r=Ar.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let a of t)Ar.isTensorInList(a,r)||a.dispose();return!0}},W4=class extends Gt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},Za;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(Za||(Za={}));var $se=class extends Gt{constructor(e,t=Za.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function r(s){return s instanceof Gt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let a=await z4(this.iterators,r);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case Za.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case Za.SHORTEST:return{value:null,done:!0};case Za.LONGEST:default:}return this.count++,{value:a,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},V4=class extends Gt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new P4(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},Use=class extends V4{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=kse.alea(n||_.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},Ul=class{constructor(){this.size=null}batch(e,t=!0){let n=this;_.assert(e>0,()=>`batchSize needs to be positive, but it is - ${e}`);let r;return this.size===Infinity||this.size==null?r=this.size:t?r=Math.ceil(this.size/e):r=Math.floor(this.size/e),Wn(async()=>(await n.iterator()).columnMajorBatch(e,t,Hse),r)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Wn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Wn(async()=>(await t.iterator()).filter(r=>L(()=>e(r))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Wn(async()=>(await t.iterator()).map(n=>L(()=>e(n))),this.size)}mapAsync(e){let t=this;return Wn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Wn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Wn(async()=>{let r=T2(async()=>({value:await t.iterator(),done:!1}));return Fse(r.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let r=this,a=vse.alea(t||_.now().toString());return Wn(async()=>{let s=a.int32();return n&&(s+=a.int32()),(await r.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Wn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};Ul.MAX_BUFFER_SIZE=1e4;function Wn(e,t=null){return new class extends Ul{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function mse(e){return Wn(async()=>L4(e),e.length)}function Ase(e){if(!Hl(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await z4(e,r=>{if(r instanceof Ul)return{value:r.iterator(),recurse:!1};if(Hl(r))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return Dse(n,Za.SHORTEST)},t)}function Hse(e){if(e===null)return null;let t=e[0];return Tse(t)?{value:Gse(e),recurse:!1}:{value:null,recurse:!0}}function Gse(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Le?On(e):gr(e)}var R4=class extends Ul{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` -`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},u0='"',jc=Symbol("out"),j4=Symbol("field"),c0=Symbol("quote"),C2=Symbol("quoteafterquote"),U4=Symbol("quoteinquote"),M4=class extends Ul{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new R4(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(_.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&_.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((r,a)=>(r[a]=r[a]+1||1,r),{}),n=Object.keys(t).filter(r=>t[r]>1);if(_.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let r of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(r)===-1)throw new Error('The key "'+r+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},r={};for(let a=0;a14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(J().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new H4(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let r=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(r,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let r=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(r,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(r=>{let a=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&r({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(a),r({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((r,a)=>n.set(r,a*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(_.sizeFromShape(t));return n.set(e,n.length-e.length),gr(n,t)}},G4=class extends Gt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=nn([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,r=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,a=(1-n)/2,s=(1-r)/2,i=a+n,o=r+s;this.cropBox=Kn([s,a,o,i],[1,4])}else this.cropBox=Kn([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(J().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new G4(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&_.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oi.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return L(()=>{let t=on(Ae(e,"float32"),0),n;n=Ye.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let r=n.shape;return H(n,r.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},q4=class{},X4=class extends Gt{split(e){return new qse(this,e)}},qse=class extends X4{constructor(e,t){super();this.upstream=e,this.impl=new Xse(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},Xse=class extends E2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},Zse=class extends Gt{decodeUTF8(){return new Kse(this)}},Kse=class extends X4{constructor(e){super();this.upstream=e,this.impl=new Yse(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},Yse=class extends E2{constructor(e){super();if(this.upstream=e,J().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=n9();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return J().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},K4=class extends Zse{constructor(e,t={}){super();this.file=e,this.options=t,_.assert(e instanceof Uint8Array||(J().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let r=new FileReader;r.onload=s=>{let i=r.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},r.onabort=s=>t(new Error("Aborted")),r.onerror=s=>t(new Error(s.type));let a=this.file.slice(this.offset,n);r.readAsArrayBuffer(a)}this.offset=n}),done:!1}}};async function Qse(e,t={}){let n,r;typeof e=="string"?n=e:(n=e.url,r=Jse(e));let a=await _.fetch(n,r);if(a.ok){let s=new Uint8Array(await a.arrayBuffer());return new K4(s,t)}else throw new Error(a.statusText)}var Jse=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Z4(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var F4=class extends q4{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Z4(this.input)&&J().get("IS_NODE")){let e=require("fs");this.input=e.readFileSync(this.input.substr(7))}return new K4(this.input,this.options)}},$4=class extends q4{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Z4(this.url)?new F4(this.url,this.fileOptions).iterator():Qse(this.url,this.fileOptions)}};function yse(e,t={}){return new M4(new $4(e),t)}function gse(e){let t=T2(e);return Wn(async()=>t)}function xse(e){return Wn(async()=>{let t=await e();return T2(()=>t.next())})}async function wse(e,t){return G4.create(e,t)}async function bse(e){return H4.create(e)}var _se="3.5.0",eie={tfjs:(of==null?void 0:of.version)||void 0,"tfjs-core":(lf==null?void 0:lf.version)||void 0,"tfjs-data":(uf==null?void 0:uf.version)||void 0,"tfjs-layers":(cf==null?void 0:cf.version)||void 0,"tfjs-converter":(hf==null?void 0:hf.version)||void 0,"tfjs-backend-cpu":qb||void 0,"tfjs-backend-webgl":A3||void 0,"tfjs-backend-wasm":ov||void 0};var Bn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Y4(){if(!qf(Bn.name)){pe("backend registration:",Bn.name);try{Bn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Bn.width,Bn.height):document.createElement("canvas")}catch(e){pe("error: cannot create canvas:",e);return}try{Bn.gl=Bn.canvas.getContext("webgl2",Bn.webGLattr)}catch(e){pe("error: cannot get WebGL2 context:",e);return}try{up(2,Bn.gl)}catch(e){pe("error: cannot set WebGL2 context:",e);return}try{let e=new pp(Bn.gl);ul(Bn.name,()=>new Fl(e),Bn.priority)}catch(e){pe("error: cannot register WebGL backend:",e);return}try{nl("webgl").forEach(t=>{let n={...t,backendName:Bn.name};ri(n)})}catch(e){pe("error: cannot update WebGL backend registration:",e);return}try{mr.set("WEBGL_VERSION",2)}catch(e){pe("error: cannot set WebGL backend flags:",e);return}pe("backend registered:",Bn.name)}}var R2={};Mr(R2,{load:()=>$2,predict:()=>d0});var tie=["angry","disgust","fear","happy","sad","surprise","neutral"],Er,M2=[],h0=Number.MAX_SAFE_INTEGER,F2=[.2989,.587,.114];async function $2(e){return Er?e.debug&&pe("cached model:",Er.modelUrl):(Er=await Ht(Yt(e.modelBasePath,e.face.emotion.modelPath)),!Er||!Er.modelUrl?pe("load model failed:",e.face.emotion.modelPath):e.debug&&pe("load model:",Er.modelUrl)),Er}async function d0(e,t){return Er?h00?(h0++,M2):(t.videoOptimized?h0=0:h0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=Ye.resizeBilinear(e,[Er.inputs[0].shape[2],Er.inputs[0].shape[1]],!1),[a,s,i]=ln(r,3,3);r.dispose();let o=B(a,F2[0]),l=B(s,F2[1]),c=B(i,F2[2]);a.dispose(),s.dispose(),i.dispose();let u=md([o,l,c]);o.dispose(),l.dispose(),c.dispose();let h=L(()=>u.sub(.5).mul(2));u.dispose();let d=[];if(t.face.emotion.enabled){let p=await Er.predict(h),m=p.dataSync();Te(p);for(let f=0;ft.face.emotion.minConfidence&&d.push({score:Math.min(.99,Math.trunc(100*m[f])/100),emotion:tie[f]});d.sort((f,A)=>A.score-f.score)}h.dispose(),M2=d,n(d)})):null}var D2={};Mr(D2,{enhance:()=>P2,load:()=>O2,match:()=>J4,predict:()=>m0,similarity:()=>z2});var er,p0={age:0},f0=Number.MAX_SAFE_INTEGER;async function O2(e){return er?e.debug&&pe("cached model:",er.modelUrl):(er=await Ht(Yt(e.modelBasePath,e.face.description.modelPath)),!er||!er.modelUrl?pe("load model failed:",e.face.description.modelPath):e.debug&&pe("load model:",er.modelUrl)),er}function z2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let r=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-r)/100}function J4(e,t,n=0){let r={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return r;for(let a of t)if(a.embedding&&a.name){let s=z2(e,a.embedding);s>n&&s>r.similarity&&(r={...a,similarity:s})}return r}function P2(e){return L(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Le))return null;let r=[[.05,.15,.85,.85]];return(n.shape.length===3?Ye.cropAndResize(on(n,0),r,[0],[er.inputs[0].shape[2],er.inputs[0].shape[1]]):Ye.cropAndResize(n,r,[0],[er.inputs[0].shape[2],er.inputs[0].shape[1]])).mul(255)})}async function m0(e,t){return er?f00?(f0++,p0):(t.videoOptimized?f0=0:f0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=P2(e),a,s={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};t.face.description.enabled&&(a=await er.predict(r)),Te(r),a&&(L(()=>{let i=a.find(h=>h.shape[1]===1).dataSync(),o=Math.trunc(200*Math.abs(i[0]-.5))/100;o>t.face.description.minConfidence&&(s.gender=i[0]<=.5?"female":"male",s.genderConfidence=Math.min(.99,o));let l=a.find(h=>h.shape[1]===100).argMax(1).dataSync()[0],c=a.find(h=>h.shape[1]===100).dataSync();s.age=Math.round(c[l-1]>c[l+1]?10*l-100*c[l-1]:10*l+100*c[l+1])/10;let u=a.find(h=>h.shape[1]===1024);s.descriptor=[...u.dataSync()]}),a.forEach(i=>Te(i))),p0=s,n(s)})):null}var nie=(e,t)=>{let n=A=>A*180/Math.PI,r=A=>{let y=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);return A[0]/=y,A[1]/=y,A[2]/=y,A},a=(A,y)=>{let g=A[0]-y[0],x=A[1]-y[1],v=A[2]-y[2];return[g,x,v]},s=(A,y)=>{let g=A[1]*y[2]-A[2]*y[1],x=A[2]*y[0]-A[0]*y[2],v=A[0]*y[1]-A[1]*y[0];return[g,x,v]},i=A=>{let[y,g,x,v,w,b,k,N,C]=A,F,O,z;return v<1?v>-1?(z=Math.asin(v),O=Math.atan2(-k,y),F=Math.atan2(-b,w)):(z=-Math.PI/2,O=-Math.atan2(N,C),F=0):(z=Math.PI/2,O=Math.atan2(N,C),F=0),{pitch:2*-F,yaw:2*-O,roll:2*-z}},o=A=>{let y=(x,v,w,b)=>Math.atan2(b-v,w-x);return{pitch:y(A[10][1],A[10][2],A[152][1],A[152][2]),yaw:y(A[33][0],A[33][2],A[263][0],A[263][2]),roll:y(A[33][0],A[33][1],A[263][0],A[263][1])}},l=e.meshRaw;if(!l||l.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let c=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,u=[l[10],l[152],l[234],l[454]].map(A=>[A[0]*t[0]/c,A[1]*t[1]/c,A[2]]),h=r(a(u[1],u[0])),d=r(a(u[3],u[2])),p=r(s(d,h));d=s(h,p);let m=[d[0],d[1],d[2],h[0],h[1],h[2],p[0],p[1],p[2]];return{angle:i(m),matrix:m}},L2=async(e,t)=>{var u,h,d,p,m,f,A;let n,r,a,s,i,o,l=[];e.state="run:face",n=it();let c=await((u=e.models.face)==null?void 0:u.estimateFaces(t,e.config));if(e.perf.face=Math.trunc(it()-n),!c)return[];for(let y of c){if(e.analyze("Get Face"),!y.image||y.image.isDisposedInternal){pe("Face object is disposed:",y.image);continue}let g=nie(y,[t.shape[2],t.shape[1]]);e.analyze("Start Emotion:"),e.config.async?s=e.config.face.emotion.enabled?d0(y.image,e.config):{}:(e.state="run:emotion",n=it(),s=e.config.face.emotion.enabled?await d0(y.image,e.config):{},e.perf.emotion=Math.trunc(it()-n)),e.analyze("End Emotion:"),e.analyze("Start Description:"),e.config.async?o=e.config.face.description.enabled?m0(y,e.config):[]:(e.state="run:description",n=it(),o=e.config.face.description.enabled?await m0(y.image,e.config):[],e.perf.embedding=Math.trunc(it()-n)),e.analyze("End Description:"),e.config.async&&([r,a,s,i,o]=await Promise.all([r,a,s,i,o])),e.analyze("Finish Face:"),!e.config.face.iris.enabled&&((h=y==null?void 0:y.annotations)==null?void 0:h.leftEyeIris)&&((d=y==null?void 0:y.annotations)==null?void 0:d.rightEyeIris)&&(delete y.annotations.leftEyeIris,delete y.annotations.rightEyeIris);let x=((p=y.annotations)==null?void 0:p.leftEyeIris)&&((m=y.annotations)==null?void 0:m.rightEyeIris)?11.7*Math.max(Math.abs(y.annotations.leftEyeIris[3][0]-y.annotations.leftEyeIris[1][0]),Math.abs(y.annotations.rightEyeIris[4][1]-y.annotations.rightEyeIris[2][1])):0;l.push({...y,age:o.age,gender:o.gender,genderConfidence:o.genderConfidence,embedding:o.descriptor,emotion:s,iris:x!==0?Math.trunc(x)/100:0,rotation:g,tensor:e.config.face.detector.return?(f=y.image)==null?void 0:f.squeeze():null}),(A=y.image)==null||A.dispose(),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.perf.face&&delete e.perf.face,e.perf.age&&delete e.perf.age,e.perf.gender&&delete e.perf.gender,e.perf.emotion&&delete e.perf.emotion),l};var H2={};Mr(H2,{MediaPipeFaceMesh:()=>G2,load:()=>q2,triangulation:()=>l8,uvmap:()=>u8});var Q4=6;function rie(e){let t={strides:[e/16,e/8],anchors:[2,6]},n=[];for(let r=0;r({startEndTensor:e,startPoint:Re(e,[0,0],[-1,2]),endPoint:Re(e,[0,2],[-1,2])});function sie(e,t,n){let r=Re(e,[0,1],[-1,2]),a=se(r,t),s=Re(e,[0,3],[-1,2]),i=ge(s,n),o=ge(a,n),l=ge(i,2),c=ye(o,l),u=se(o,l),h=B(c,n),d=B(u,n);return dl([h,d],1)}var e8=class{constructor(t,n){this.model=t,this.anchorsData=rie(t.inputs[0].shape[1]),this.anchors=Kn(this.anchorsData),this.inputSize=t.inputs[0].shape[2],this.config=n}async getBoundingBoxes(t){if(!t||t.isDisposedInternal||t.shape.length!==4||t.shape[1]<1||t.shape[2]<1)return null;let[n,r,a]=L(()=>{let d=t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),p=this.model.predict(d),m;if(Array.isArray(p)){let g=p.sort((b,k)=>b.size-k.size),x=ot([g[0],g[2]],2),v=ot([g[1],g[3]],2);m=ot([v,x],1).squeeze(0)}else m=p.squeeze();let f=sie(m,this.anchors,[this.inputSize,this.inputSize]),A=Re(m,[0,0],[-1,1]),y=_n(A).squeeze();return[m,f,y]}),s=await Ye.nonMaxSuppressionAsync(r,a,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let l=i.map(h=>Re(r,[h,0],[1,-1])).map(h=>{let d=h.arraySync();return h.dispose(),d}),c=a.dataSync(),u=[];for(let h=0;hthis.config.face.detector.minConfidence){let m=aie(l[h]),f=this.anchorsData[d],A=L(()=>Re(n,[d,Q4-1],[1,-1]).squeeze().reshape([Q4,-1]));u.push({box:m,landmarks:A,anchor:f,confidence:p})}}return n.dispose(),r.dispose(),a.dispose(),{boxes:u,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function t8(e){let t=await Ht(Yt(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new e8(t,e);return!t||!t.modelUrl?pe("load model failed:",e.face.detector.modelPath):e.debug&&pe("load model:",t.modelUrl),n}function n8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:r}}function Uc(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gl(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ql(e,t,n){let r=t.shape[1],a=t.shape[2],s=[[e.startPoint[1]/r,e.startPoint[0]/a,e.endPoint[1]/r,e.endPoint[0]/a]];return Ye.cropAndResize(t,s,[0],n)}function A0(e,t=1.5){let n=Gl(e),r=Uc(e),a=[t*r[0]/2,t*r[1]/2],s=[n[0]-a[0],n[1]-a[1]],i=[n[0]+a[0],n[1]+a[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function y0(e){let t=Gl(e),n=Uc(e),a=Math.max(...n)/2,s=[t[0]-a,t[1]-a],i=[t[0]+a,t[1]+a];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}var g0=[[1,0,0],[0,1,0],[0,0,1]];function iie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function W2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return iie(n)}function r8(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function Ya(e,t){let n=0;for(let r=0;rHc[e]),Jie=uie.map(e=>Hc[e]),Qie=cie.map(e=>Hc[e]);var V2=Xr.leftEyeLower0,j2=Xr.rightEyeLower0,Xl={leftBounds:[V2[0],V2[V2.length-1]],rightBounds:[j2[0],j2[j2.length-1]]},w0={count:468,mouth:13,symmetryLine:[13,Xr.midwayBetweenEyes[0]]},o8={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},Kl={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function b0(e,t,n,r){for(let a=0;a[s[0]/this.meshSize*(h[0]-this.meshSize/2),s[1]/this.meshSize*(h[1]-this.meshSize/2),h[2]]),o=r!==0?x0(r,[0,0]):g0,l=r!==0?i.map(h=>[...i8(h,o),h[2]]):i,c=r!==0?s8(a):g0,u=[...Gl({startPoint:n.startPoint,endPoint:n.endPoint}),1];return l.map(h=>[h[0]+Ya(u,c[0]),h[1]+Ya(u,c[1]),h[2]])}getLeftToRightEyeDepthDifference(t){let n=t[Xl.leftBounds[0]][2],r=t[Xl.rightBounds[0]][2];return n-r}getEyeBox(t,n,r,a,s=!1){let i=y0(A0(this.calculateLandmarksBoundingBox([t[r],t[a]]),this.irisEnlarge)),o=Uc(i),l=Ye.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&mr.flags.IS_BROWSER&&(l=Ye.flipLeftRight(l)),{box:i,boxSize:o,crop:l}}getEyeCoords(t,n,r,a=!1){let s=[];for(let i=0;i{let c=i;return l===2?c=a:l===4&&(c=s),[o[0],o[1],c]})}async predict(t,n){let r=!1,a;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.videoOptimized)&&(a=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.videoOptimized&&this.skipped++,!n.videoOptimized||a&&a.boxes&&(!n.face.mesh.enabled||a.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of a.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks,confidence:i.confidence});this.storedBoxes.length>0&&(r=!0)}if(n.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),r){if(!a||!a.boxes||a.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=L(()=>this.storedBoxes.map((i,o)=>{let l=i.confidence,c,u=0,h;if(n.face.detector.rotation&&n.face.mesh.enabled&&mr.flags.IS_BROWSER){let[w,b]=i.landmarks.length>=w0.count?w0.symmetryLine:o8.symmetryLine;u=W2(i.landmarks[w],i.landmarks[b]);let k=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),N=[k[0]/t.shape[2],k[1]/t.shape[1]],C=Ye.rotateWithOffset(t,u,0,N);h=x0(-u,k),n.face.mesh.enabled?c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.meshSize,this.meshSize]).div(255):c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.boxSize,this.boxSize]).div(255)}else{h=g0;let w=t.clone();n.face.mesh.enabled?c=ql({startPoint:i.startPoint,endPoint:i.endPoint},w,[this.meshSize,this.meshSize]).div(255):c=ql({startPoint:i.startPoint,endPoint:i.endPoint},w,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{coords:null,box:i,faceConfidence:null,boxConfidence:l,confidence:i.confidence,image:c};let[,d,p]=this.meshDetector.predict(c),m=d.dataSync()[0];if(m=w0.count?w0.symmetryLine:o8.symmetryLine;u=W2(i.landmarks[w],i.landmarks[b]);let k=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),N=[k[0]/t.shape[2],k[1]/t.shape[1]],C=Ye.rotateWithOffset(t.toFloat(),u,0,N);h=x0(-u,k),c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.meshSize,this.meshSize]).div(255)}let x={coords:g,box:i,faceConfidence:m,boxConfidence:l,image:c,rawCoords:A},v=y0(i);return this.storedBoxes[o]={...v,landmarks:y,confidence:i.confidence,faceConfidence:m},x}));return s=s.filter(i=>i!==null),n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.faceConfidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),r=t.map(i=>i[1]),a=[Math.min(...n),Math.min(...r)],s=[Math.max(...n),Math.max(...r)];return{startPoint:a,endPoint:s,landmarks:t}}};var G2=class{constructor(t,n,r,a){this.facePipeline=new U2(t,n,r),this.config=a}async estimateFaces(t,n){let r=await this.facePipeline.predict(t,n),a=[];for(let s of r||[]){if(s.isDisposedInternal)continue;let i=s.coords?s.coords.arraySync():[],o=i.map(h=>[h[0]/t.shape[2],h[1]/t.shape[1],h[2]/this.facePipeline.meshSize]),l={};if(i&&i.length>0)for(let h of Object.keys(Xr))l[h]=Xr[h].map(d=>i[d]);let c=s.box?[Math.max(0,s.box.startPoint[0]),Math.max(0,s.box.startPoint[1]),Math.min(t.shape[2],s.box.endPoint[0])-Math.max(0,s.box.startPoint[0]),Math.min(t.shape[1],s.box.endPoint[1])-Math.max(0,s.box.startPoint[1])]:0,u=s.box?[s.box.startPoint[0]/t.shape[2],s.box.startPoint[1]/t.shape[1],(s.box.endPoint[0]-s.box.startPoint[0])/t.shape[2],(s.box.endPoint[1]-s.box.startPoint[1])/t.shape[1]]:[];a.push({confidence:Math.round(100*s.faceConfidence||100*s.boxConfidence||0)/100,boxConfidence:Math.round(100*s.boxConfidence)/100,faceConfidence:Math.round(100*s.faceConfidence)/100,box:c,boxRaw:u,mesh:i,meshRaw:o,annotations:l,image:s.image?s.image.clone():null}),s.coords&&s.coords.dispose(),s.image&&s.image.dispose()}return a}},qt=[null,null,null];async function q2(e){return!qt[0]&&e.face.enabled||!qt[1]&&e.face.mesh.enabled||!qt[2]&&e.face.iris.enabled?(qt=await Promise.all([!qt[0]&&e.face.enabled?t8(e):null,!qt[1]&&e.face.mesh.enabled?Ht(Yt(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!qt[2]&&e.face.iris.enabled?Ht(Yt(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!qt[1]||!qt[1].modelUrl?pe("load model failed:",e.face.mesh.modelPath):e.debug&&pe("load model:",qt[1].modelUrl)),e.face.iris.enabled&&(!qt[2]||!qt[1].modelUrl?pe("load model failed:",e.face.iris.modelPath):e.debug&&pe("load model:",qt[2].modelUrl))):e.debug&&(pe("cached model:",qt[0].model.modelUrl),pe("cached model:",qt[1].modelUrl),pe("cached model:",qt[2].modelUrl)),new G2(qt[0],qt[1],qt[2],e)}var l8=Oi,u8=Hc;var Q2={};Mr(Q2,{load:()=>tg,predict:()=>eg});var Gc=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],c8=Gc.length,qc=Gc.reduce((e,t,n)=>(e[t]=n,e),{}),hie=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],die=hie.map(([e,t])=>[qc[e],qc[t]]),h8=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function d8(e){let t=e.reduce(({maxX:n,maxY:r,minX:a,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(r,o),minX:Math.min(a,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function p8(e,[t,n],[r,a]){let s=(o,l,c)=>({score:o.score,box:[Math.trunc(o.box[0]*c),Math.trunc(o.box[1]*l),Math.trunc(o.box[2]*c),Math.trunc(o.box[3]*l)],keypoints:o.keypoints.map(({score:u,part:h,position:d})=>({score:u,part:h,position:{x:Math.trunc(d.x*c),y:Math.trunc(d.y*l)}}))});return e.map(o=>s(o,t/r,n/a))}var X2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function f8(e,t,n,r){let a=n-e,s=r-t;return a*a+s*s}function J2(e,t){return{x:e.x+t.x,y:e.y+t.y}}var _0=1,m8=16,pie=20**2;function A8(e,t,n,r,a,s,i,o=2){let l=g=>({y:i.get(g.y,g.x,e),x:i.get(g.y,g.x,i.shape[2]/2+e)}),c=(g,x,v)=>({y:Y2(Math.round(g.y/s),0,x-1),x:Y2(Math.round(g.x/s),0,v-1)}),[u,h]=r.shape,d=c(t.position,u,h),p=l(d),f=J2(t.position,p);for(let g=0;g[qc[f],qc[A]]),o=i.map(([,f])=>f),l=i.map(([f])=>f),c=t.shape[2],u=o.length,h=new Array(c),{part:d,score:p}=e,m=Z2(d,r,n);h[d.id]={score:p,part:Gc[d.id],position:m};for(let f=u-1;f>=0;--f){let A=o[f],y=l[f];h[A]&&!h[y]&&(h[y]=A8(f,h[A],y,t,n,r,s))}for(let f=0;ft){o=!1;break}if(!o)break}return o}function Aie(e,t){let[n,r,a]=t.shape,s=new X2(n*r*a,({score:i})=>i);for(let i=0;i{let s=a[r].position;return f8(n,t,s.y,s.x)<=pie})}function yie(e,t){return t.reduce((r,{position:a,score:s},i)=>(y8(e,a,i)||(r+=s),r),0)/t.length}function g8(e,t,n,r,a,s){let i=[],o=Aie(s,t);for(;i.lengthm.score>s),d=yie(i,h),p=d8(h);d>s&&i.push({keypoints:h,box:p,score:Math.round(100*d)/100})}return i}var fr,gie=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function eg(e,t){let n=L(()=>{let o=e.resizeBilinear([fr.inputs[0].shape[2],fr.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),c=fr.execute(o,gie).map(u=>u.squeeze([0]));return c[1]=c[1].sigmoid(),c}),r=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let a=await g8(r[0],r[1],r[2],r[3],t.body.maxDetected,t.body.minConfidence);return p8(a,[e.shape[1],e.shape[2]],[fr.inputs[0].shape[2],fr.inputs[0].shape[1]])}async function tg(e){return fr?e.debug&&pe("cached model:",fr.modelUrl):(fr=await Ht(Yt(e.modelBasePath,e.body.modelPath)),!fr||!fr.modelUrl?pe("load model failed:",e.body.modelPath):e.debug&&pe("load model:",fr.modelUrl)),fr}var ig={};Mr(ig,{HandPose:()=>lg,load:()=>ug});function v0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Xc(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function x8(e,t,n){let r=t.shape[1],a=t.shape[2],s=[[e.startPoint[1]/r,e.startPoint[0]/a,e.endPoint[1]/r,e.endPoint[0]/a]];return Ye.cropAndResize(t,s,[0],n)}function w8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],a=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:r,palmLandmarks:a,confidence:e.confidence}}function k0(e,t=1.5){let n=Xc(e),r=v0(e),a=[t*r[0]/2,t*r[1]/2],s=[n[0]-a[0],n[1]-a[1]],i=[n[0]+a[0],n[1]+a[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function I0(e){let t=Xc(e),n=v0(e),a=Math.max(...n)/2,s=[t[0]-a,t[1]-a],i=[t[0]+a,t[1]+a];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var ng=class{constructor(t,n,r){this.model=t,this.anchors=r.map(a=>[a.x_center,a.y_center]),this.anchorsTensor=Kn(this.anchors),this.inputSize=n,this.inputSizeTensor=nn([n,n]),this.doubleInputSizeTensor=nn([n*2,n*2])}normalizeBoxes(t){return L(()=>{let n=Re(t,[0,0],[-1,2]),r=Re(t,[0,2],[-1,2]),a=se(ge(n,this.inputSizeTensor),this.anchorsTensor),s=ge(r,this.doubleInputSizeTensor),i=B(ye(a,s),this.inputSizeTensor),o=B(se(a,s),this.inputSizeTensor);return dl([i,o],1)})}normalizeLandmarks(t,n){return L(()=>{let r=se(ge(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(r,this.inputSizeTensor)})}async getBoxes(t,n){let r=this.model.predict(t),a=r.squeeze();r.dispose();let s=L(()=>_n(Re(a,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Re(a,[0,1],[-1,4]),l=this.normalizeBoxes(o);o.dispose();let c=await Ye.nonMaxSuppressionAsync(l,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),u=c.arraySync();s.dispose(),c.dispose();let h=[];for(let d of u)if(i[d]>=n.hand.minConfidence){let p=Re(l,[d,0],[1,-1]),m=Re(a,[d,5],[1,14]),f=L(()=>this.normalizeLandmarks(m,d).reshape([-1,2]));m.dispose(),h.push({box:p,palmLandmarks:f,confidence:i[d]})}return a.dispose(),l.dispose(),h}async estimateHandBounds(t,n){let r=t.shape[1],a=t.shape[2],s=L(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let l of i){let c=l.box.dataSync(),u=c.slice(0,2),h=c.slice(2,4),d=l.palmLandmarks.arraySync();l.box.dispose(),l.palmLandmarks.dispose(),o.push(w8({startPoint:u,endPoint:h,palmLandmarks:d,confidence:l.confidence},[a/this.inputSize,r/this.inputSize]))}return o}};function xie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function b8(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return xie(n)}var _8=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Ja(e,t){let n=0;for(let r=0;rag([...s,1],n)),a=this.calculateLandmarksBoundingBox(r);return k0(I0(a),bie)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),r=k0(I0(n),I8);r.palmLandmarks=[];for(let a=0;a[i[0]*(p[0]-this.inputSize/2),i[1]*(p[1]-this.inputSize/2),i[2]*p[2]]),l=rg(r,[0,0]),c=o.map(p=>[...ag(p,l),p[2]]),u=k8(a),h=[...Xc(n),1],d=[Ja(h,u[0]),Ja(h,u[1])];return c.map(p=>[p[0]+d[0],p[1]+d[1],p[2]])}async estimateHands(t,n){let r=!1,a;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.videoOptimized)&&(a=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.videoOptimized&&this.skipped++,a&&a.length>0&&(a.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...a],this.storedBoxes.length>0&&(r=!0));let s=[];n.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let i=0;i=n.hand.minConfidence){let x=H(y,[-1,3]),v=x.arraySync();y.dispose(),x.dispose();let w=this.transformRawCoords(v,p,l,d),b=this.getBoxForHandLandmarks(w);this.storedBoxes[i]=b;let k={landmarks:w,confidence:g,box:{topLeft:b.startPoint,bottomRight:b.endPoint}};s.push(k)}else this.storedBoxes[i]=null;y.dispose()}else{let l=k0(I0(o),I8),c={confidence:o.confidence,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};s.push(c)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),r=t.map(i=>i[1]),a=[Math.min(...n),Math.min(...r)],s=[Math.max(...n),Math.max(...r)];return{startPoint:a,endPoint:s}}};var N8=[{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375}];var og={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},lg=class{constructor(t){this.handPipeline=t}static getAnnotations(){return og}async estimateHands(t,n){let r=await this.handPipeline.estimateHands(t,n);if(!r)return[];let a=[];for(let s of r){let i={};if(s.landmarks)for(let c of Object.keys(og))i[c]=og[c].map(u=>s.landmarks[u]);let o=s.box?[Math.max(0,s.box.topLeft[0]),Math.max(0,s.box.topLeft[1]),Math.min(t.shape[2],s.box.bottomRight[0])-Math.max(0,s.box.topLeft[0]),Math.min(t.shape[1],s.box.bottomRight[1])-Math.max(0,s.box.topLeft[1])]:[],l=[s.box.topLeft[0]/t.shape[2],s.box.topLeft[1]/t.shape[1],(s.box.bottomRight[0]-s.box.topLeft[0])/t.shape[2],(s.box.bottomRight[1]-s.box.topLeft[1])/t.shape[1]];a.push({confidence:Math.round(100*s.confidence)/100,box:o,boxRaw:l,landmarks:s.landmarks,annotations:i})}return a}},Kr,Zr;async function ug(e){!Kr||!Zr?([Kr,Zr]=await Promise.all([e.hand.enabled?Ht(Yt(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?Ht(Yt(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!Kr||!Kr.modelUrl?pe("load model failed:",e.hand.detector.modelPath):e.debug&&pe("load model:",Kr.modelUrl),!Zr||!Zr.modelUrl?pe("load model failed:",e.hand.skeleton.modelPath):e.debug&&pe("load model:",Zr.modelUrl))):(e.debug&&pe("cached model:",Kr.modelUrl),e.debug&&pe("cached model:",Zr.modelUrl));let t=new ng(Kr,Kr==null?void 0:Kr.inputs[0].shape[2],N8),n=new sg(t,Zr,Zr==null?void 0:Zr.inputs[0].shape[2]);return new lg(n)}var cg={};Mr(cg,{load:()=>hg,predict:()=>dg});var T8=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],E8=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var En;async function hg(e){return En?e.debug&&pe("cached model:",En.modelUrl):(En=await Ht(Yt(e.modelBasePath,e.body.modelPath)),En.width=parseInt(En.signature.inputs["input_1:0"].tensorShape.dim[2].size),En.height=parseInt(En.signature.inputs["input_1:0"].tensorShape.dim[1].size),!En||!En.modelUrl?pe("load model failed:",e.body.modelPath):e.debug&&pe("load model:",En.modelUrl)),En}async function dg(e,t){if(!En||!t.body.enabled)return null;let n={width:e.shape[2],height:e.shape[1]},r=Ye.resizeBilinear(e,[En.width,En.height],!1),a=ge(r,[255]);r.dispose();let s=await En.predict(a),i=s.find(h=>h.size===195||h.size===155).dataSync();s.forEach(h=>h.dispose()),a.dispose();let o=[],l=i.length===195?T8:E8,c=5;for(let h=0;hd.score>h?d.score:h,0),keypoints:o}]}var pg={};Mr(pg,{load:()=>mg,predict:()=>Ag});var S0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Cn,fg=[],N0=Number.MAX_SAFE_INTEGER,T0=2.5;async function mg(e){if(Cn)e.debug&&pe("cached model:",Cn.modelUrl);else{Cn=await Ht(Yt(e.modelBasePath,e.object.modelPath));let t=Object.values(Cn.modelSignature.inputs);if(Cn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Cn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Cn||!Cn.modelUrl?pe("load model failed:",e.object.modelPath):e.debug&&pe("load model:",Cn.modelUrl)}return Cn}async function kie(e,t,n,r){let a=0,s=[];for(let c of[1,2,4])L(()=>{var A,y;let u=c*13,h=(A=e.find(g=>g.shape[1]===u**2&&g.shape[2]===S0.length))==null?void 0:A.squeeze(),d=(y=e.find(g=>g.shape[1]===u**2&&g.shape[2]r.object.minConfidence&&x!==61){let w=(.5+Math.trunc(g%u))/u,b=(.5+Math.trunc(g/u))/u,k=m[g].map(U=>U*(u/c/t)),[N,C]=[w-T0/c*k[0],b-T0/c*k[1]],[F,O]=[w+T0/c*k[2]-N,b+T0/c*k[3]-C],z=[N,C,F,O];z=z.map(U=>Math.max(0,Math.min(U,1)));let V=[z[0]*n[0],z[1]*n[1],z[2]*n[0],z[3]*n[1]],j={id:a++,strideSize:c,score:Math.round(100*v)/100,class:x+1,label:S0[x].label,center:[Math.trunc(n[0]*w),Math.trunc(n[1]*b)],centerRaw:[w,b],box:V.map(U=>Math.trunc(U)),boxRaw:z};s.push(j)}}});e.forEach(c=>Te(c));let i=s.map(c=>c.boxRaw),o=s.map(c=>c.score),l=[];if(i&&i.length>0){let c=await Ye.nonMaxSuppressionAsync(i,o,r.object.maxDetected,r.object.iouThreshold,r.object.minConfidence);l=c.dataSync(),Te(c)}return s=s.filter((c,u)=>l.includes(u)).sort((c,u)=>u.score-c.score),s}async function Ag(e,t){return Cn?N00?(N0++,fg):(t.videoOptimized?N0=0:N0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=[e.shape[2],e.shape[1]],a=Ye.resizeBilinear(e,[Cn.inputSize,Cn.inputSize],!1),s=a.div(255),i=s.transpose([0,3,1,2]);s.dispose(),a.dispose();let o;t.object.enabled&&(o=await Cn.predict(i)),i.dispose();let l=await kie(o,Cn.inputSize,r,t);fg=l,n(l)})):null}var C8=e=>{if(!e)return[];let t=[];for(let n=0;nl.part==="leftWrist"),a=e[n].keypoints.find(l=>l.part==="rightWrist"),s=e[n].keypoints.find(l=>l.part==="nose");s&&r&&a&&r.position.yl.part==="leftShoulder"),o=e[n].keypoints.find(l=>l.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},R8=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(r)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${r<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},M8=e=>{if(!e)return[];let t=[];for(let n=0;n.033||h>.033)&&(c=!1),d>.033&&t.push({iris:n,gesture:"looking right"}),h>.033&&t.push({iris:n,gesture:"looking left"});let p=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].annotations.rightEyeIris[0][1],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].annotations.leftEyeIris[0][1];(m<.015||p<.015||m>.03||p>.03)&&(c=!1),(m<.015||p<.015)&&t.push({iris:n,gesture:"looking down"}),(m>.03||p>.03)&&t.push({iris:n,gesture:"looking up"}),c&&t.push({iris:n,gesture:"looking center"})}return t},F8=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=r.reduce((i,o)=>i.position[2]i.position[1]gg});function Iie(e,t,n){let r=function(o,l,c){let u=new RegExp("\\b"+l+" \\w+ (\\w+)","ig");o.replace(u,(h,d)=>(c[d]=0,h))},a=function(o,l){let c=e.createShader(l);if(e.shaderSource(c,o),e.compileShader(c),!e.getShaderParameter(c,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(c));return c};this.uniform={},this.attribute={};let s=a(t,e.VERTEX_SHADER),i=a(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),r(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);r(t,"uniform",this.uniform),r(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function $8(e){e||(e={});let t=0,n=null,r=!1,a=-1,s=[null,null],i=[],o=-1,l=-1,c=null,u=null,h={},d=e.canvas||document.createElement("canvas"),p={},m={INTERMEDIATE:1},f=d.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(w){let b=Array.prototype.slice.call(arguments,1),k=h[w];i.push({func:k,args:b})},this.reset=function(){i=[]};let A=function(w,b){if(!(w===o&&b===l)){if(d.width=w,o=w,d.height=b,l=b,!c){let k=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);c=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,c),f.bufferData(f.ARRAY_BUFFER,k,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,l),s=[null,null]}},y=function(w,b){let k=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,k);let N=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,N);let C=f.createTexture();return f.bindTexture(f.TEXTURE_2D,C),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,w,b,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,C,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:k,texture:C}},g=function(w){return s[w]=s[w]||y(o,l),s[w]},x=function(w=null){var C,F;let b=null,k=null,N=!1;t===0?b=n:b=(C=g(a))==null?void 0:C.texture,t++,r&&!(w&m.INTERMEDIATE)?(k=null,N=t%2==0):(a=(a+1)%2,k=(F=g(a))==null?void 0:F.fbo),f.bindTexture(f.TEXTURE_2D,b),f.bindFramebuffer(f.FRAMEBUFFER,k),f.uniform1f(u.uniform.flipY,N?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(w){if(A(w.width,w.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,w),i.length===0)return x(),d;for(let b=0;b0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0,i=a,o=s;if(i>E0&&(i=E0,o=i*s/a),o>E0&&(o=E0,i=o*a/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=a*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/a)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ee||(Ee==null?void 0:Ee.width)!==i||(Ee==null?void 0:Ee.height)!==o)&&(Ee=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ee==null?void 0:Ee.width)!==i&&(Ee.width=i),(Ee==null?void 0:Ee.height)!==o&&(Ee.height=o));let l=Ee.getContext("2d");if(e instanceof ImageData?l.putImageData(e,0,0):t.filter.flip&&typeof l.translate!="undefined"?(l.translate(a,0),l.scale(-1,1),l.drawImage(e,0,0,a,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),l.setTransform(1,0,0,1,0,0)):l.drawImage(e,0,0,a,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),t.filter.enabled){if((!Mt||!gt||Ee.width!==gt.width||(Ee==null?void 0:Ee.height)!==(gt==null?void 0:gt.height))&&(gt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height):document.createElement("canvas"),(gt==null?void 0:gt.width)!==(Ee==null?void 0:Ee.width)&&(gt.width=Ee==null?void 0:Ee.width),(gt==null?void 0:gt.height)!==(Ee==null?void 0:Ee.height)&&(gt.height=Ee==null?void 0:Ee.height),Mt=mr.flags.IS_BROWSER?new $8({canvas:gt}):null),!Mt)return{tensor:null,canvas:Ee};Mt.reset(),Mt.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&Mt.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&Mt.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&Mt.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&Mt.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&Mt.addFilter("hue",t.filter.hue),t.filter.negative&&Mt.addFilter("negative"),t.filter.sepia&&Mt.addFilter("sepia"),t.filter.vintage&&Mt.addFilter("brownie"),t.filter.sepia&&Mt.addFilter("sepia"),t.filter.kodachrome&&Mt.addFilter("kodachrome"),t.filter.technicolor&&Mt.addFilter("technicolor"),t.filter.polaroid&&Mt.addFilter("polaroid"),t.filter.pixelate!==0&&Mt.addFilter("pixelate",t.filter.pixelate),Mt.apply(Ee)}else gt=Ee,Mt&&(Mt=null);let c;if(gt.data){let h=[gt.height,gt.width,3];c=hd(gt.data,h,"int32")}else if(gt instanceof ImageData)c=oi.fromPixels(gt);else if(t.backend==="webgl"||t.backend==="humangl"){let h=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");h.width=i,h.height=o;let d=h.getContext("2d");d==null||d.drawImage(gt,0,0),c=oi.fromPixels(h)}else{let h=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");h.width=i,h.height=o;let d=h.getContext("2d");d==null||d.drawImage(gt,0,0);let p=d==null?void 0:d.getImageData(0,0,i,o);c=oi.fromPixels(p)}let u=c.toFloat();n=u.expandDims(0),c.dispose(),u.dispose()}let r=t.filter.return?gt:null;return{tensor:n,canvas:r}}var xg={};Mr(xg,{all:()=>Nie,body:()=>z8,canvas:()=>Sie,face:()=>O8,gesture:()=>D8,hand:()=>P8,object:()=>L8,options:()=>zi});var ct={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var zi={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function C0(e,t,n,r=0,a){e.fillStyle=a.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:a.color,e.beginPath(),e.arc(t,n,a.pointSize,0,2*Math.PI),e.fill()}function Pi(e,t,n,r,a,s){if(e.beginPath(),s.useCurves){let i=(t+t+r)/2,o=(n+n+a)/2;e.ellipse(i,o,r/2,a/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+r-s.roundRect,n),e.quadraticCurveTo(t+r,n,t+r,n+s.roundRect),e.lineTo(t+r,n+a-s.roundRect),e.quadraticCurveTo(t+r,n+a,t+r-s.roundRect,n+a),e.lineTo(t+s.roundRect,n+a),e.quadraticCurveTo(t,n+a,t,n+a-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function wg(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let r of t)e.strokeStyle=n.useDepth&&r[2]?`rgba(${127.5+2*r[2]}, ${127.5-2*r[2]}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r[2]?`rgba(${127.5+2*r[2]}, ${127.5-2*r[2]}, 255, 0.3)`:n.color,e.lineTo(r[0],parseInt(r[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Kc(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){wg(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let r=0;r1&&l[1].length>0){let c=o[1]>0?`#${o[1]}`:"",u=`${o[0]} ${c}: ${l[1]}`;r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(u,8,2+s*r.lineHeight)),a.fillStyle=r.labelColor,a.fillText(u,6,0+s*r.lineHeight),s+=1}}}async function O8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a)for(let s of t){a.font=r.font,a.strokeStyle=r.color,a.fillStyle=r.color,r.drawBoxes&&(r.useRawBoxes?Pi(a,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],r):Pi(a,s.box[0],s.box[1],s.box[2],s.box[3],r));let i=[];if(i.push(`face confidence: ${Math.trunc(100*s.confidence)}%`),s.genderConfidence&&i.push(`${s.gender||""} ${Math.trunc(100*s.genderConfidence)}% confident`),s.age&&i.push(`age: ${s.age||""}`),s.iris&&i.push(`iris distance: ${s.iris}`),s.emotion&&s.emotion.length>0){let o=s.emotion.map(l=>`${Math.trunc(100*l.score)}% ${l.emotion}`);i.push(o.join(" "))}s.rotation&&s.rotation.angle&&s.rotation.angle.roll&&i.push(`roll: ${Math.trunc(100*s.rotation.angle.roll)/100} yaw:${Math.trunc(100*s.rotation.angle.yaw)/100} pitch:${Math.trunc(100*s.rotation.angle.pitch)/100}`),i.length===0&&i.push("face"),a.fillStyle=r.color;for(let o=i.length-1;o>=0;o--){let l=Math.max(s.box[0],0),c=o*r.lineHeight+s.box[1];r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(i[o],l+5,c+16)),a.fillStyle=r.labelColor,a.fillText(i[o],l+4,c+15)}if(a.lineWidth=1,s.mesh&&s.mesh.length>0){if(r.drawPoints)for(let o of s.mesh)C0(a,o[0],o[1],o[2],r);if(r.drawPolygons){a.lineWidth=1;for(let o=0;os.mesh[c]);wg(a,l,r)}if(s.annotations&&s.annotations.leftEyeIris){a.strokeStyle=r.useDepth?"rgba(255, 200, 255, 0.3)":r.color,a.beginPath();let o=Math.abs(s.annotations.leftEyeIris[3][0]-s.annotations.leftEyeIris[1][0])/2,l=Math.abs(s.annotations.leftEyeIris[4][1]-s.annotations.leftEyeIris[2][1])/2;a.ellipse(s.annotations.leftEyeIris[0][0],s.annotations.leftEyeIris[0][1],o,l,0,0,2*Math.PI),a.stroke(),r.fillPolygons&&(a.fillStyle=r.useDepth?"rgba(255, 255, 200, 0.3)":r.color,a.fill())}if(s.annotations&&s.annotations.rightEyeIris){a.strokeStyle=r.useDepth?"rgba(255, 200, 255, 0.3)":r.color,a.beginPath();let o=Math.abs(s.annotations.rightEyeIris[3][0]-s.annotations.rightEyeIris[1][0])/2,l=Math.abs(s.annotations.rightEyeIris[4][1]-s.annotations.rightEyeIris[2][1])/2;a.ellipse(s.annotations.rightEyeIris[0][0],s.annotations.rightEyeIris[0][1],o,l,0,0,2*Math.PI),a.stroke(),r.fillPolygons&&(a.fillStyle=r.useDepth?"rgba(255, 255, 200, 0.3)":r.color,a.fill())}}}}}var Qa=[];async function z8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round";for(let s=0;sl.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),o.length===4&&wg(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftKnee"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftAnkle"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHeel"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftFoot"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightKnee"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightAnkle"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHeel"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightFoot"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftElbow"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftWrist"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftPalm"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightElbow"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightWrist"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightPalm"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r)}}}}async function P8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round",a.font=r.font;for(let s of t){if(r.drawBoxes){a.strokeStyle=r.color,a.fillStyle=r.color;let i;if(!r.calculateHandBox)i=r.useRawBoxes?s.boxRaw:s.box;else if(i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],s.landmarks&&s.landmarks.length>0){for(let o of s.landmarks)o[0]i[2]&&(i[2]=o[0]),o[1]>i[3]&&(i[3]=o[1]);i[2]-=i[0],i[3]-=i[1]}r.useRawBoxes?Pi(a,e.width*i[0],e.height*i[1],e.width*i[2],e.height*i[3],r):Pi(a,i[0],i[1],i[2],i[3],r),r.drawLabels&&(r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText("hand",i[0]+3,1+i[1]+r.lineHeight,i[2])),a.fillStyle=r.labelColor,a.fillText("hand",i[0]+2,0+i[1]+r.lineHeight,i[2])),a.stroke()}if(r.drawPoints&&s.landmarks&&s.landmarks.length>0)for(let i of s.landmarks)a.fillStyle=r.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:r.color,C0(a,i[0],i[1],0,r);if(r.drawPolygons){let i=o=>{if(!!o)for(let l=0;l0?l-1:0][0],o[l>0?l-1:0][1]),a.lineTo(o[l][0],o[l][1]),a.stroke()};i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function L8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round",a.font=r.font;for(let s of t)if(r.drawBoxes){if(a.strokeStyle=r.color,a.fillStyle=r.color,r.useRawBoxes?Pi(a,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],r):Pi(a,s.box[0],s.box[1],s.box[2],s.box[3],r),r.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(i,s.box[0]+3,1+s.box[1]+r.lineHeight,s.box[2])),a.fillStyle=r.labelColor,a.fillText(i,s.box[0]+2,0+s.box[1]+r.lineHeight,s.box[2])}a.stroke()}}}async function Sie(e,t){if(!e||!t||!(e instanceof HTMLCanvasElement)||!(t instanceof HTMLCanvasElement))return;let n=e.getContext("2d");n==null||n.drawImage(e,0,0)}async function Nie(e,t,n){let r=Hn(zi,n);!t||!e||e instanceof HTMLCanvasElement&&(O8(e,t.face,r),z8(e,t.body,r),P8(e,t.hand,r),D8(e,t.gesture,r),L8(e,t.object,r))}var R0=` + ${a}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=I2(s,n),o=a===0?0:e.size/a,l=L(()=>{let u=[];e=H(e,[1,a,o]);for(let p=0;p{switch(e.op){case"If":case"StatelessIf":{let a=S("thenBranch",e,t,n),r=S("elseBranch",e,t,n),s=S("cond",e,t,n),i=S("args",e,t,n);return(await s.data())[0]?n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let a=S("body",e,t,n),r=S("cond",e,t,n),s=S("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(u=>u.id),l=await i[0].data();i.forEach(u=>{!u.kept&&o.indexOf(u.id)===-1&&u.dispose()});let d=s;for(;l[0];){let u=d;d=await n.functionMap[a].executeFunctionAsync(d,n.tensorArrayMap,n.tensorListMap);let p=d.map(h=>h.id);u.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()});let c=await n.functionMap[r].executeFunctionAsync(d,n.tensorArrayMap,n.tensorListMap);l=await c[0].data(),c.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()})}return d}case"LoopCond":{let a=S("pred",e,t,n);return[hr(a)]}case"Switch":{let a=S("pred",e,t,n),r=S("data",e,t,n);return r.kept||(r=hr(r)),(await a.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let a=e.inputNames.find(r=>mn(r,t,n)!==void 0);if(a){let r=mn(a,t,n);return[hr(r)]}return}case"Enter":{let a=S("frameName",e,t,n),r=S("tensor",e,t,n);return n.enterFrame(a),[hr(r)]}case"Exit":{let a=S("tensor",e,t,n);return n.exitFrame(),[hr(a)]}case"NextIteration":{let a=S("tensor",e,t,n);return n.nextIteration(),[hr(a)]}case"TensorArrayV3":{let a=S("size",e,t,n),r=S("dtype",e,t,n),s=S("elementShape",e,t,n),i=S("dynamicSize",e,t,n),o=S("clearAfterRead",e,t,n),l=S("identicalElementShapes",e,t,n),d=S("name",e,t,n),u=new Vre(d,r,a,s,l,i,o);return n.addTensorArray(u),[u.idTensor,Ie(1)]}case"TensorArrayWriteV3":{let a=S("tensorArrayId",e,t,n),r=S("index",e,t,n),s=S("tensor",e,t,n),i=n.getTensorArray(a.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let a=S("tensorArrayId",e,t,n),r=S("index",e,t,n);return[n.getTensorArray(a.id).read(r)]}case"TensorArrayGatherV3":{let a=S("tensorArrayId",e,t,n),r=S("indices",e,t,n),s=S("dtype",e,t,n);return[n.getTensorArray(a.id).gather(r,s)]}case"TensorArrayScatterV3":{let a=S("tensorArrayId",e,t,n),r=S("indices",e,t,n),s=S("tensor",e,t,n),i=n.getTensorArray(a.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id),s=S("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{let a=S("tensorArrayId",e,t,n),r=S("tensor",e,t,n),s=S("lengths",e,t,n),i=n.getTensorArray(a.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return[Ie(r.size(),"int32")]}case"TensorArrayCloseV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let a=S("tensorListId",e,t,n),r=S("index",e,t,n),s=S("tensor",e,t,n),i=n.getTensorList(a.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let a=S("tensorListId",e,t,n),r=S("index",e,t,n),s=S("elementShape",e,t,n),i=S("elementDType",e,t,n);return[n.getTensorList(a.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let a=S("indices",e,t,n),r=S("tensor",e,t,n),s=S("elementShape",e,t,n),i=S("numElements",e,t,n),o=Hre(r,a,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let a=S("elementShape",e,t,n),r=S("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=S(s,e,t,n),o=Ure(a,r,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let a=S("tensorListId",e,t,n),r=S("indices",e,t,n),s=S("elementShape",e,t,n),i=S("elementDType",e,t,n);return[n.getTensorList(a.id).gather(r,i,s)]}case"TensorListStack":{let a=S("tensorListId",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n),i=S("numElements",e,t,n);return[n.getTensorList(a.id).stack(r,s,i)]}case"TensorListFromTensor":{let a=S("tensor",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n),i=jre(a,r,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let a=S("tensorListId",e,t,n),r=n.getTensorList(a.id),s=S("dtype",e,t,n),i=S("elementShape",e,t,n);return[r.concat(s,i)]}case"TensorListPushBack":{let a=S("tensorListId",e,t,n),r=S("tensor",e,t,n),s=n.getTensorList(a.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let a=S("tensorListId",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n);return[n.getTensorList(a.id).popBack(r,s)]}case"TensorListSplit":{let a=S("tensor",e,t,n),r=S("elementShape",e,t,n),s=S("lengths",e,t,n),i=Gre(a,s,r);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function S8(e,t,n){let[a,r]=S("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=a==="fusedbatchnorm",l=S("numArgs",e,t,n);if(s){if(i&&l!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&l!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(o)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let d=S("strides",e,t,n),u=o0(e,t,n),p=S("dataFormat",e,t,n).toUpperCase(),c=S("dilations",e,t,n),[h,m]=S("args",e,t,n),f=S("leakyreluAlpha",e,t,n);return{stride:d,pad:u,dataFormat:p,dilations:c,biasArg:h,preluArg:m,activationFunc:r,leakyreluAlpha:f}}var Xre=(e,t,n)=>{switch(e.op){case"Conv1D":{let a=S("stride",e,t,n),r=S("pad",e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilation",e,t,n);return[gc(S("x",e,t,n),S("filter",e,t,n),a,r,s,i)]}case"Conv2D":{let a=S("strides",e,t,n),r=o0(e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilations",e,t,n);return[ar(S("x",e,t,n),S("filter",e,t,n),[a[1],a[2]],r,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:d,leakyreluAlpha:u}=S8(e,t,n);return[zr.conv2d({x:S("x",e,t,n),filter:S("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:d,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:d,leakyreluAlpha:u}=S8(e,t,n);return[zr.depthwiseConv2d({x:S("x",e,t,n),filter:S("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:d,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let a=S("outputShape",e,t,n),r=S("strides",e,t,n),s=o0(e,t,n);return[xc(S("x",e,t,n),S("filter",e,t,n),a,[r[1],r[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let a=S("strides",e,t,n),r=o0(e,t,n),s=S("dilations",e,t,n),i=S("dataFormat",e,t,n).toUpperCase();return[hl(S("input",e,t,n),S("filter",e,t,n),[a[1],a[2]],r,i,[s[1],s[2]])]}case"Conv3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilations",e,t,n);return[oA(S("x",e,t,n),S("filter",e,t,n),[a[1],a[2],a[3]],r,s,[i[1],i[2],i[3]])]}case"AvgPool":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[ju(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPool":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[Ku(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPoolWithArgmax":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n),i=S("includeBatchInIndex",e,t,n),{result:o,indexes:l}=Hb(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r,i);return[o,l]}case"AvgPool3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[rA(S("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"MaxPool3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[xA(S("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"Dilation2D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("dilations",e,t,n),i=a[1],o=a[2],l=s[1],d=s[2];return[uA(S("x",e,t,n),S("filter",e,t,n),[i,o],r,[l,d],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Kre=(e,t,n)=>{switch(e.op){case"Fill":{let a=S("shape",e,t,n),r=S("dtype",e,t,n),s=S("value",e,t,n);return[Gu(a,s,r)]}case"LinSpace":{let a=S("start",e,t,n),r=S("stop",e,t,n),s=S("num",e,t,n);return[Pb(a,r,s)]}case"Multinomial":{let a=S("logits",e,t,n),r=S("numSamples",e,t,n),s=S("seed",e,t,n);return[Gb(a,r,s)]}case"OneHot":{let a=S("indices",e,t,n),r=S("depth",e,t,n),s=S("onValue",e,t,n),i=S("offValue",e,t,n);return[ol(a,r,s,i)]}case"Ones":return[$n(S("shape",e,t,n),S("dtype",e,t,n))];case"OnesLike":return[Dn(S("x",e,t,n))];case"RandomUniform":return[gl(S("shape",e,t,n),S("minval",e,t,n),S("maxval",e,t,n),S("dtype",e,t,n))];case"Range":{let a=S("start",e,t,n),r=S("stop",e,t,n),s=S("step",e,t,n);return[Rc(a,r,s,S("dtype",e,t,n))]}case"TruncatedNormal":{let a=S("shape",e,t,n),r=S("mean",e,t,n),s=S("stdDev",e,t,n),i=S("seed",e,t,n);return[Wc(a,r,s,S("dtype",e,t,n),i)]}case"Zeros":return[Ct(S("shape",e,t,n),S("dtype",e,t,n))];case"ZerosLike":return[Ue(S("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function S2(e,t,n){let a=S("boxes",e,t,n),r=S("scores",e,t,n),s=S("maxOutputSize",e,t,n),i=S("iouThreshold",e,t,n),o=S("scoreThreshold",e,t,n),l=S("softNmsSigma",e,t,n);return{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var Zre=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}=S2(e,t,n),d=await Ye.nonMaxSuppressionWithScoreAsync(a,r,s,i,o,l);return[d.selectedIndices,d.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=S2(e,t,n),l=S("padToMaxOutputSize",e,t,n),d=await Ye.nonMaxSuppressionPaddedAsync(a,r,s,i,o,l);return[d.selectedIndices,d.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=S2(e,t,n);return[await Ye.nonMaxSuppressionAsync(a,r,s,i,o)]}case"Where":{let a=Ae(S("condition",e,t,n),"bool"),r=[await $A(a)];return a.dispose(),r}case"ListDiff":return Kb(S("x",e,t,n),S("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},Yre=(e,t,n)=>{switch(e.op){case"TopKV2":{let a=S("x",e,t,n),r=S("k",e,t,n),s=S("sorted",e,t,n),i=MA(a,r,s);return[i.values,i.indices]}case"Unique":{let a=S("x",e,t,n),r=Bc(a);return[r.values,r.indices]}case"UniqueV2":{let a=S("x",e,t,n),r=S("axis",e,t,n),s=Bc(a,r);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Jre=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let a=S("default",e,t,n);return[mn(e.name,t,n)||a];case"Placeholder":return[mn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let d=S("x",e,t,n);return[hr(d)]}case"IdentityN":return S("x",e,t,n).map(d=>hr(d));case"Snapshot":let r=S("x",e,t,n);return[hr(r)];case"Shape":return[nn(S("x",e,t,n).shape,"int32")];case"ShapeN":return S("x",e,t,n).map(d=>nn(d.shape));case"Size":return[Ie(S("x",e,t,n).size,"int32")];case"Rank":return[Ie(S("x",e,t,n).rank,"int32")];case"NoOp":return[Ie(1)];case"Print":let s=S("x",e,t,n),i=S("data",e,t,n),o=S("message",e,t,n),l=S("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let d=0;de.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Ie(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),L(()=>{let a=ua(t),r=n.length,s=a.length;w.assert(r===s,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${s} elements.`);for(let i=0;i{let a=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=S("keyDType",e,t,n),s=S("valueDType",e,t,n),i=new Qre(r,s);return a.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let r=S("tableHandle",e,t,n,a),s=S("keys",e,t,n),i=S("values",e,t,n);return[await a.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=S("tableHandle",e,t,n,a),s=S("keys",e,t,n),i=S("defaultValue",e,t,n);return[await a.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=S("tableHandle",e,t,n,a);return[a.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},tse=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let a=S("images",e,t,n),r=S("size",e,t,n),s=S("alignCorners",e,t,n),i=S("halfPixelCenters",e,t,n);return[Ye.resizeBilinear(a,[r[0],r[1]],s,i)]}case"ResizeNearestNeighbor":{let a=S("images",e,t,n),r=S("size",e,t,n),s=S("alignCorners",e,t,n),i=S("halfPixelCenters",e,t,n);return[Ye.resizeNearestNeighbor(a,[r[0],r[1]],s,i)]}case"CropAndResize":{let a=S("image",e,t,n),r=S("boxes",e,t,n),s=S("boxInd",e,t,n),i=S("cropSize",e,t,n),o=S("method",e,t,n),l=S("extrapolationValue",e,t,n);return[Ye.cropAndResize(a,r,s,i,o,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},nse=(e,t,n)=>{switch(e.op){case"Equal":return[Fr(S("a",e,t,n),S("b",e,t,n))];case"NotEqual":return[Ai(S("a",e,t,n),S("b",e,t,n))];case"Greater":return[oa(S("a",e,t,n),S("b",e,t,n))];case"GreaterEqual":return[Dr(S("a",e,t,n),S("b",e,t,n))];case"Less":return[kc(S("a",e,t,n),S("b",e,t,n))];case"LessEqual":return[hi(S("a",e,t,n),S("b",e,t,n))];case"LogicalAnd":return[la(S("a",e,t,n),S("b",e,t,n))];case"LogicalNot":return[Xu(S("a",e,t,n))];case"LogicalOr":return[Tc(S("a",e,t,n),S("b",e,t,n))];case"Select":case"SelectV2":return[In(S("condition",e,t,n),S("a",e,t,n),S("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},ase=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[Be(S("a",e,t,n),S("b",e,t,n),S("transposeA",e,t,n),S("transposeB",e,t,n))];case"Einsum":return[Ob(S("equation",e,t,n),...S("tensors",e,t,n))];case"Transpose":return[Ze(S("x",e,t,n),S("perm",e,t,n))];case"_FusedMatMul":let[a,r]=S("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=S("numArgs",e,t,n),l=S("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[d,u]=S("args",e,t,n);return[zr.matMul({a:S("a",e,t,n),b:S("b",e,t,n),transposeA:S("transposeA",e,t,n),transposeB:S("transposeB",e,t,n),bias:d,activation:r,preluActivationWeights:u,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},rse=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[pi(S("x",e,t,n),S("mean",e,t,n),S("variance",e,t,n),S("offset",e,t,n),S("scale",e,t,n),S("epsilon",e,t,n))];case"FusedBatchNormV3":return[pi(S("x",e,t,n),S("mean",e,t,n),S("variance",e,t,n),S("offset",e,t,n),S("scale",e,t,n),S("epsilon",e,t,n))];case"LRN":return[mA(S("x",e,t,n),S("radius",e,t,n),S("bias",e,t,n),S("alpha",e,t,n),S("beta",e,t,n))];case"Softmax":return[ed(S("x",e,t,n))];case"LogSoftmax":return[Nc(S("x",e,t,n))];case"SparseToDense":return[DA(S("sparseIndices",e,t,n),S("outputShape",e,t,n),S("sparseValues",e,t,n),S("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},sse=(e,t,n)=>{switch(e.op){case"Max":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Xn(S("x",e,t,n),i,o)]}case"Mean":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[kt(S("x",e,t,n),i,o)]}case"Min":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Al(S("x",e,t,n),i,o)]}case"Sum":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Te(S("x",e,t,n),i,o)]}case"All":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Ac(S("x",e,t,n),i,o)]}case"Any":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Wu(S("x",e,t,n),i,o)]}case"ArgMax":{let i=S("axis",e,t,n);return[Bu(S("x",e,t,n),i)]}case"ArgMin":{let i=S("axis",e,t,n);return[Zm(S("x",e,t,n),i)]}case"Prod":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Cc(S("x",e,t,n),i,o)]}case"Cumsum":{let i=S("axis",e,t,n),o=S("exclusive",e,t,n),l=S("reverse",e,t,n);return[vc(S("x",e,t,n),i,o,l)]}case"Bincount":let a=S("x",e,t,n),r=S("weights",e,t,n),s=S("size",e,t,n);return[Tb(a,r,s)];case"DenseBincount":{let i=S("x",e,t,n),o=S("weights",e,t,n),l=S("size",e,t,n),d=S("binaryOutput",e,t,n);return[$b(i,o,l,d)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ise=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let a=S("n",e,t,n),r=S("axis",e,t,n),s=S("tensors",e,t,n);return s=s.slice(0,a),[ot(s,r)]}case"Gather":{let a=S("x",e,t,n),r=S("indices",e,t,n);return[ci(a,Ae(r,"int32"),0)]}case"GatherV2":{let a=S("axis",e,t,n),r=S("batchDims",e,t,n),s=S("x",e,t,n),i=S("indices",e,t,n);return[ci(s,Ae(i,"int32"),a,r)]}case"Reverse":{let a=S("dims",e,t,n),r=[];for(let i=0;i{let a=S("axis",e,t,n),r=S("tensors",e,t,n),s=r[0].shape,i=Or(r[0]).shape,o=r.map(l=>{let d=w.arraysEqual(l.shape,s);if(!d&&!w.arraysEqual(Or(l).shape,i))throw new Error("the input tensors shape does not match");return d?l:H(l,s)});return[zn(o,a)]});case"Unpack":{let a=S("axis",e,t,n),r=S("tensor",e,t,n);return ua(r,a)}case"Tile":{let a=S("reps",e,t,n);return[$r(S("x",e,t,n),a)]}case"Split":case"SplitV":{let a=S("axis",e,t,n),r=S("numOrSizeSplits",e,t,n),s=S("x",e,t,n);return ln(s,r,a)}case"ScatterNd":{let a=S("indices",e,t,n),r=S("values",e,t,n),s=S("shape",e,t,n);return[Qb(a,r,s)]}case"GatherNd":{let a=S("x",e,t,n),r=S("indices",e,t,n);return[e3(a,r)]}case"SparseToDense":{let a=S("sparseIndices",e,t,n),r=S("outputShape",e,t,n),s=S("sparseValues",e,t,n),i=S("defaultValue",e,t,n);return[DA(a,s,r,s.dtype===i.dtype?i:Ae(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ose=(e,t,n)=>{switch(e.op){case"SparseReshape":{let{outputIndices:a,outputShape:r}=m3.sparseReshape(S("inputIndices",e,t,n),S("inputShape",e,t,n),S("newShape",e,t,n));return[a,r]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},lse=(e,t,n)=>{switch(e.op){case"FFT":return[td(S("x",e,t,n))];case"IFFT":return[xl(S("x",e,t,n))];case"RFFT":return[nd(S("x",e,t,n))];case"IRFFT":return[Pc(S("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},use=(e,t,n)=>{switch(e.op){case"Cast":return[Ae(S("x",e,t,n),S("dtype",e,t,n))];case"ExpandDims":{let a=S("axis",e,t,n);return[on(S("x",e,t,n),a)]}case"Squeeze":{let a=S("axis",e,t,n);return[Or(S("x",e,t,n),a)]}case"Reshape":return[H(S("x",e,t,n),S("shape",e,t,n))];case"MirrorPad":return[bA(S("x",e,t,n),S("padding",e,t,n),S("mode",e,t,n))];case"PadV2":case"Pad":return[rr(S("x",e,t,n),S("padding",e,t,n),S("constantValue",e,t,n))];case"SpaceToBatchND":{let a=S("blockShape",e,t,n),r=S("paddings",e,t,n);return[Zu(S("x",e,t,n),a,r)]}case"BatchToSpaceND":{let a=S("blockShape",e,t,n),r=S("crops",e,t,n);return[Uu(S("x",e,t,n),a,r)]}case"DepthToSpace":{let a=S("blockSize",e,t,n),r=S("dataFormat",e,t,n).toUpperCase();return[lA(S("x",e,t,n),a,r)]}case"BroadcastTo":return[pl(S("x",e,t,n),S("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function N8(e,t,n,a){let r=((s,i,o)=>{switch(s.category){case"arithmetic":return L(()=>Wre(s,i,o));case"basic_math":return L(()=>Bre(s,i,o));case"control":return qre(s,i,o);case"convolution":return L(()=>Xre(s,i,o));case"creation":return L(()=>Kre(s,i,o));case"dynamic":return Zre(s,i,o);case"evaluation":return L(()=>Yre(s,i,o));case"image":return L(()=>tse(s,i,o));case"graph":return L(()=>Jre(s,i,o));case"logical":return L(()=>nse(s,i,o));case"matrices":return L(()=>ase(s,i,o));case"normalization":return L(()=>rse(s,i,o));case"reduction":return L(()=>sse(s,i,o));case"slice_join":return L(()=>ise(s,i,o));case"sparse":return L(()=>ose(s,i,o));case"spectral":return L(()=>lse(s,i,o));case"transformation":return L(()=>use(s,i,o));case"hash_table":return ese(s,i,o,a);case"custom":let l=n8(s.op);if(l&&l.customExecutor)return l.customExecutor(new Lre(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return w.isPromise(r)?r.then(s=>[].concat(s)):[].concat(r)}var T8=class{constructor(e={},t={},n={},a={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let e=[];for(let t=0;tt.id===0&&t.iterationId===0?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;let e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function C8(e,t,n,a){let r=new Set,s=[],i=null,o=null,l=new Set,d=Object.keys(e).map(c=>Ln(c)[0]),u=[];a!=null&&(u=a.map(c=>Ln(c.name)[0]));let p=[...t];for(;p.length>0;){let c=p.pop();if((E8(c)||dse(c)||pse(c))&&i==null&&(i=c,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(c.name),n[c.name]==null&&d.indexOf(c.name)===-1&&u.indexOf(c.name)===-1){if(c.inputs.length===0){s.push(c.name);continue}c.inputs.forEach(h=>{l.has(h.name)||(l.add(h.name),p.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function cse(e,t,n){let{usedNodes:a,inputs:r}=n,s=[],i=Object.keys(r).map(u=>Ln(u)[0]).map(u=>e.nodes[u]),o=e.initNodes;i.forEach(u=>{a.has(u.name)&&s.push(u)}),e.weights.forEach(u=>{a.has(u.name)&&s.push(u)}),o!=null&&o.forEach(u=>{a.has(u.name)&&s.push(u)});let l=new Set,d=[];for(;s.length>0;){let u=s.pop();l.add(u.name),t[u.name]||d.push(u),u.children.forEach(p=>{!l.has(p.name)&&a.has(p.name)&&p.inputs.every(c=>l.has(c.name))&&s.push(p)})}return d}var hse=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],fse=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],mse=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function E8(e){return hse.indexOf(e.op)>=0}function dse(e){return fse.indexOf(e.op)>=0}function pse(e){return mse.indexOf(e.op)>=0}var N2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(n=>{this._functionExecutorMap[n]=new N2(e.functions[n],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){let t=Object.keys(e).map(n=>e[n].map(a=>a.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(r=>r.name).sort(),a=t.map(r=>r.name).sort();return n.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,t){let n=C8(e,t,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:r,syncInputs:s}=n;if(r!=null)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(a.length>0){let i=t.map(l=>l.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${a}]`)}return cse(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let a=n.map(u=>this.graph.nodes[Ln(u)[0]]),r=t.map(u=>Ln(u)[0]),s=r.map(u=>this.graph.nodes[u]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(a,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let l={},d={};return L(()=>{let u=new T8(this.weightMap,l,d,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,A]=Ln(m),y=[];y[A]=e[m],p[f]=y});let c=this.getFrozenTensorIds(p),h={};for(let m=0;mmn(m,p,u))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(a=>a.id)));return new Set(t)}checkTensorForDisposal(e,t,n,a,r,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let l=bre(o.name,n,a);l!=null&&l.forEach(d=>{if(d&&!d.kept&&!r.has(d.id)){let u=i[d.id];u===1?(d.dispose(),delete i[d.id]):u!=null&&i[d.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,a={},r={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new T8(this.weightMap,a,r,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(p=>mn(p,i,s)),l=o.map(p=>p.id),d=Object.keys(e).map(p=>e[p].id),u=new Set([...l,...d,...this.weightIds]);return Object.keys(i).forEach(p=>{i[p].forEach(c=>{c&&!c.kept&&!c.isDisposed&&!u.has(c.id)&&c.dispose()})}),this.parent==null&&s.dispose(u),o}async executeFunctionAsync(e,t,n){let a=e.reduce((r,s,i)=>(r[this.inputs[i].name]=s,r),{});return this._executeAsync(a,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,a){let r=Object.keys(e),s=r.map(g=>this.graph.nodes[Ln(g)[0]]),i=n.map(g=>Ln(g)[0]),o=i.map(g=>this.graph.nodes[g]);o.length===0&&(o=this._outputs);let{usedNodes:l,missingInputs:d,dynamicNode:u,syncInputs:p}=C8(e,o,this.weightMap,this._initNodes),c=[...s,...this.graph.weights,...this._initNodes||[]].map(g=>({node:g,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(g=>{let[x,k]=Ln(g),b=[];b[k]=e[g],h[x]=b});let m={},f=this.getFrozenTensorIds(h),A={};for(;c.length>0;){let g=this.processStack(s,c,t,h,A,f,i,m,l);await Promise.all(g)}u==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(g=>!E8(g)&&!mn(g.name,h,t)).map(g=>g.name);if(y.length>0){let g="";throw u!=null&&(g=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${d}]. ${g}`)}return h}processStack(e,t,n,a,r,s,i,o,l){let d=[];for(;t.length>0;){let u=t.pop();n.currentContext=u.contexts;let p="";if(u.node.op==="Enter"&&S("isConstant",u.node,a,n)&&([p]=cr(u.node.name,n)),a[u.node.name]==null){let c=N8(u.node,a,n,this._resourceManager);p||([p]=cr(u.node.name,n));let h=n.currentContext;w.isPromise(c)?d.push(c.then(m=>(a[p]=m,n.currentContext=h,this.checkTensorForDisposal(p,u.node,a,n,s,i,o),this.processChildNodes(u.node,t,n,a,r,l),m))):(a[p]=c,this.checkTensorForDisposal(p,u.node,a,n,s,i,o),this.processChildNodes(u.node,t,n,a,r,l))}else this.processChildNodes(u.node,t,n,a,r,l)}return d}processChildNodes(e,t,n,a,r,s){e.children.forEach(i=>{let[o]=cr(i.name,n);r[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(l=>!!mn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(l=>!!mn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[a]=Ln(t),r=this.graph.nodes[a];if(r.attrParams.shape&&r.attrParams.shape.value){let s=r.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,l)=>s[l]===-1||s[l]===o);w.assert(i,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&w.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let a=this._signature.inputs[n];t[a.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[a]=Ln(n);return this.graph.nodes[a]==null});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(t=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Ln(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},Ase=class{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},yse="?tfjs-format=file",gse="model.json",R8=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new Ase}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=vn.browserHTTPRequest(e,this.loadOptions);else{let t=vn.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(vn.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let a=vn.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new N2(v8.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=v8.Instance.transformGraph(e.modelInitializer);this.initializer=new N2(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=vn.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Le)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,a)=>(t[n]=e[a],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function Gt(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${gse}${yse}`);let n=new R8(e,t);return await n.load(),n}var xse="3.5.0",M8={};Fe(M8,{CSVDataset:()=>$8,Dataset:()=>Ul,FileDataSource:()=>D8,TextLineDataset:()=>F8,URLDataSource:()=>O8,array:()=>bse,csv:()=>wse,func:()=>kse,generator:()=>Ise,microphone:()=>Nse,version_data:()=>Tse,webcam:()=>Sse,zip:()=>vse});var Ese=Yi(Pg()),Cse=Yi(Pg());function Rse(e,t){return l0(e,t)}function l0(e,t,n=new Map,a=new Set){if(e==null)return null;if(a.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse)if(Hl(e)){let s=Array.isArray(e)?[]:{};a.add(e);for(let i in e){let o=e[i],l=l0(o,t,n,a);s[i]=l}return a.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,r.value),r.value}function Mse(e,t=_8){return z8(e,t)}function z8(e,t,n=new Set){let a=e[0];if(n.has(a))throw new Error("Circular references are not supported.");let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse)if(Hl(a)){let s=Array.isArray(a)?[]:{};n.add(a);for(let i in a){let o=e.map(d=>d[i]),l=z8(o,t,n);s[i]=l}return n.delete(a),s}else throw new Error(`Can't recurse into non-iterable type: ${a}`);else return r.value}function _8(e){return e===null?null:Hl(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function P8(e,t){let n=new Map;l0(e,t,n);for(let a of Array.from(n.keys())){let r=n.get(a);if(w.isPromise(r)){let s=await r;n.set(a,s)}}return l0(e,t,n)}function Hl(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Le))}function $se(e){return e==null||Fse(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Le||w.isTypedArray(e)}function Fse(e){return e===null||typeof e!="object"&&typeof e!="function"}function Ose(e){return Rse(e,Dse)}function Dse(e){return e instanceof Le?{value:e.clone(),recurse:!1}:Hl(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var L8=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},T2=class extends L8{constructor(){super(T2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let a=0;at===!0)}rowMajorBatch(e,t=!0){return new Use(this,e,t)}columnMajorBatch(e,t=!0,n=_8){return this.rowMajorBatch(e,t).map(a=>Mse(a,n))}concatenate(e,t){return new B8(W8([this,e]),t)}take(e){return e<0||e==null?this:new jse(this,e)}skip(e){return e<0||e==null?this:new Vse(this,e)}prefetch(e){return new j8(this,e)}shuffle(e,t){return new Kse(this,e,t)}serial(){return new Bse(this)}},zse=class extends qt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:Ose(e),done:!1}}},_se=class extends qt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},Bse=class extends qt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},Vse=class extends qt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Use=class extends qt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Hse=class extends qt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Ee(e.value)}}},Gse=class extends qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Aa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Aa.getTensorsInContainer(n);for(let r of t)Aa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},qse=class extends qt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},V8=class extends qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=Aa.getTensorsInContainer(e.value),n=await this.transform(e.value),a=Aa.getTensorsInContainer(n);for(let r of t)Aa.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},C2=class extends qt{constructor(){super();this.outputQueue=new T2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},Xse=class extends C2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=Aa.getTensorsInContainer(e.value),n=this.transform(e.value),a=Aa.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let r of t)Aa.isTensorInList(r,a)||r.dispose();return!0}},B8=class extends qt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},Xr;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(Xr||(Xr={}));var Lse=class extends qt{constructor(e,t=Xr.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function a(s){return s instanceof qt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let r=await P8(this.iterators,a);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case Xr.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case Xr.SHORTEST:return{value:null,done:!0};case Xr.LONGEST:default:}return this.count++,{value:r,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},j8=class extends qt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new L8(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},Kse=class extends j8{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Cse.alea(n||w.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},Ul=class{constructor(){this.size=null}batch(e,t=!0){let n=this;w.assert(e>0,()=>`batchSize needs to be positive, but it is + ${e}`);let a;return this.size===Infinity||this.size==null?a=this.size:t?a=Math.ceil(this.size/e):a=Math.floor(this.size/e),Wn(async()=>(await n.iterator()).columnMajorBatch(e,t,Zse),a)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Wn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Wn(async()=>(await t.iterator()).filter(a=>L(()=>e(a))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Wn(async()=>(await t.iterator()).map(n=>L(()=>e(n))),this.size)}mapAsync(e){let t=this;return Wn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Wn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Wn(async()=>{let a=E2(async()=>({value:await t.iterator(),done:!1}));return Pse(a.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let a=this,r=Ese.alea(t||w.now().toString());return Wn(async()=>{let s=r.int32();return n&&(s+=r.int32()),(await a.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Wn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};Ul.MAX_BUFFER_SIZE=1e4;function Wn(e,t=null){return new class extends Ul{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function bse(e){return Wn(async()=>W8(e),e.length)}function vse(e){if(!Hl(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await P8(e,a=>{if(a instanceof Ul)return{value:a.iterator(),recurse:!1};if(Hl(a))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return Wse(n,Xr.SHORTEST)},t)}function Zse(e){if(e===null)return null;let t=e[0];return $se(t)?{value:Yse(e),recurse:!1}:{value:null,recurse:!0}}function Yse(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Le?zn(e):ga(e)}var F8=class extends Ul{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` +`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},u0='"',jd=Symbol("out"),U8=Symbol("field"),d0=Symbol("quote"),R2=Symbol("quoteafterquote"),H8=Symbol("quoteinquote"),$8=class extends Ul{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new F8(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(w.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&w.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((a,r)=>(a[r]=a[r]+1||1,a),{}),n=Object.keys(t).filter(a=>t[a]>1);if(w.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let a of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(a)===-1)throw new Error('The key "'+a+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},a={};for(let r=0;r14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(J().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new G8(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let a=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(a,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let a=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(a,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(a=>{let r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&a({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),a({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((a,r)=>n.set(a,r*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(w.sizeFromShape(t));return n.set(e,n.length-e.length),ga(n,t)}},q8=class extends qt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=nn([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,a=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,r=(1-n)/2,s=(1-a)/2,i=r+n,o=a+s;this.cropBox=Kn([s,r,o,i],[1,4])}else this.cropBox=Kn([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(J().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new q8(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&w.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oi.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return L(()=>{let t=on(Ae(e,"float32"),0),n;n=Ye.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let a=n.shape;return H(n,a.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},X8=class{},K8=class extends qt{split(e){return new Jse(this,e)}},Jse=class extends K8{constructor(e,t){super();this.upstream=e,this.impl=new Qse(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},Qse=class extends C2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},tie=class extends qt{decodeUTF8(){return new eie(this)}},eie=class extends K8{constructor(e){super();this.upstream=e,this.impl=new nie(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},nie=class extends C2{constructor(e){super();if(this.upstream=e,J().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=oI();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return J().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},Z8=class extends tie{constructor(e,t={}){super();this.file=e,this.options=t,w.assert(e instanceof Uint8Array||(J().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let a=new FileReader;a.onload=s=>{let i=a.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},a.onabort=s=>t(new Error("Aborted")),a.onerror=s=>t(new Error(s.type));let r=this.file.slice(this.offset,n);a.readAsArrayBuffer(r)}this.offset=n}),done:!1}}};async function rie(e,t={}){let n,a;typeof e=="string"?n=e:(n=e.url,a=aie(e));let r=await w.fetch(n,a);if(r.ok){let s=new Uint8Array(await r.arrayBuffer());return new Z8(s,t)}else throw new Error(r.statusText)}var aie=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Y8(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var D8=class extends X8{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Y8(this.input)&&J().get("IS_NODE")){let e=require("fs");this.input=e.readFileSync(this.input.substr(7))}return new Z8(this.input,this.options)}},O8=class extends X8{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Y8(this.url)?new D8(this.url,this.fileOptions).iterator():rie(this.url,this.fileOptions)}};function wse(e,t={}){return new $8(new O8(e),t)}function kse(e){let t=E2(e);return Wn(async()=>t)}function Ise(e){return Wn(async()=>{let t=await e();return E2(()=>t.next())})}async function Sse(e,t){return q8.create(e,t)}async function Nse(e){return G8.create(e)}var Tse="3.5.0",sie={tfjs:(om==null?void 0:om.version)||void 0,"tfjs-core":(lm==null?void 0:lm.version)||void 0,"tfjs-data":(um==null?void 0:um.version)||void 0,"tfjs-layers":(dm==null?void 0:dm.version)||void 0,"tfjs-converter":(pm==null?void 0:pm.version)||void 0,"tfjs-backend-cpu":X3||void 0,"tfjs-backend-webgl":yv||void 0,"tfjs-backend-wasm":lw||void 0};var Bn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function J8(){if(!qm(Bn.name)){he("backend registration:",Bn.name);try{Bn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Bn.width,Bn.height):document.createElement("canvas")}catch(e){he("error: cannot create canvas:",e);return}try{Bn.gl=Bn.canvas.getContext("webgl2",Bn.webGLattr)}catch(e){he("error: cannot get WebGL2 context:",e);return}try{uh(2,Bn.gl)}catch(e){he("error: cannot set WebGL2 context:",e);return}try{let e=new hh(Bn.gl);ul(Bn.name,()=>new $l(e),Bn.priority)}catch(e){he("error: cannot register WebGL backend:",e);return}try{nl("webgl").forEach(t=>{let n={...t,backendName:Bn.name};ai(n)})}catch(e){he("error: cannot update WebGL backend registration:",e);return}try{ma.set("WEBGL_VERSION",2)}catch(e){he("error: cannot set WebGL backend flags:",e);return}he("backend registered:",Bn.name)}}var _2={};Fa(_2,{load:()=>W2,predict:()=>L2,triangulation:()=>dk,uvmap:()=>pk});function Q8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:a}}function Ud(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gl(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ql(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return Ye.cropAndResize(t,s,[0],n)}function p0(e,t=1.5){let n=Gl(e),a=Ud(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function c0(e){let t=Gl(e),n=Ud(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function M2(e){let t=e.map(s=>s[0]),n=e.map(s=>s[1]),a=[Math.min(...t),Math.min(...n)],r=[Math.max(...t),Math.max(...n)];return{startPoint:a,endPoint:r,landmarks:e}}var ek=e=>({startEndTensor:e,startPoint:Me(e,[0,0],[-1,2]),endPoint:Me(e,[0,2],[-1,2])});var h0=[[1,0,0],[0,1,0],[0,0,1]];function iie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function F2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return iie(n)}function tk(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function Kr(e,t){let n=0;for(let a=0;a{let c=t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),h=this.model.predict(c),m;if(Array.isArray(h)){let g=h.sort((v,I)=>v.size-I.size),x=ot([g[0],g[2]],2),k=ot([g[1],g[3]],2);m=ot([k,x],1).squeeze(0)}else m=h.squeeze();let f=lie(m,this.anchors,[this.inputSize,this.inputSize]),A=Me(m,[0,0],[-1,1]),y=wn(A).squeeze();return[m,f,y]}),s=await Ye.nonMaxSuppressionAsync(a,r,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let l=i.map(p=>Me(a,[p,0],[1,-1])).map(p=>{let c=p.arraySync();return p.dispose(),c}),d=r.dataSync(),u=[];for(let p=0;pthis.config.face.detector.minConfidence){let m=ek(l[p]),f=this.anchorsData[c],A=L(()=>Me(n,[c,ik-1],[1,-1]).squeeze().reshape([ik,-1]));u.push({box:m,landmarks:A,anchor:f,confidence:h})}}return n.dispose(),a.dispose(),r.dispose(),{boxes:u,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function lk(e){let t=await Gt(Yt(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new ok(t,e);return!t||!t.modelUrl?he("load model failed:",e.face.detector.modelPath):e.debug&&he("load model:",t.modelUrl),n}var Xa={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},$2=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],Hd=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],zi=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];var uie=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],die=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],pie=[33,133,362,263,1,78,308],Xie=uie.map(e=>Hd[e]),Kie=die.map(e=>Hd[e]),Zie=pie.map(e=>Hd[e]);var D2=Xa.leftEyeLower0,O2=Xa.rightEyeLower0,Xl={leftBounds:[D2[0],D2[D2.length-1]],rightBounds:[O2[0],O2[O2.length-1]]},m0={count:468,mouth:13,symmetryLine:[13,Xa.midwayBetweenEyes[0]]},uk={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},Kl={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function A0(e,t,n,a){for(let r=0;r<$2.length;r++){let{key:s,indices:i}=$2[r],o=Xa[`${n}${s}`];if(!a||a.includes(s))for(let l=0;l[s[0]/this.meshSize*(p[0]-this.meshSize/2),s[1]/this.meshSize*(p[1]-this.meshSize/2),p[2]]),o=a!==0?f0(a,[0,0]):h0,l=a!==0?i.map(p=>[...rk(p,o),p[2]]):i,d=a!==0?ak(r):h0,u=[...Gl({startPoint:n.startPoint,endPoint:n.endPoint}),1];return l.map(p=>[p[0]+Kr(u,d[0]),p[1]+Kr(u,d[1]),p[2]])}getLeftToRightEyeDepthDifference(t){let n=t[Xl.leftBounds[0]][2],a=t[Xl.rightBounds[0]][2];return n-a}getEyeBox(t,n,a,r,s=!1){let i=c0(p0(M2([t[a],t[r]]),this.irisEnlarge)),o=Ud(i),l=Ye.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&ma.flags.IS_BROWSER&&(l=Ye.flipLeftRight(l)),{box:i,boxSize:o,crop:l}}getEyeCoords(t,n,a,r=!1){let s=[];for(let i=0;i{let d=i;return l===2?d=r:l===4&&(d=s),[o[0],o[1],d]})}async predict(t,n){let a=!1,r;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.videoOptimized)&&(r=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.videoOptimized&&this.skipped++,!n.videoOptimized||r&&r.boxes&&(!n.face.mesh.enabled||r.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of r.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks,confidence:i.confidence});this.storedBoxes.length>0&&(a=!0)}if(n.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),a){if(!r||!r.boxes||r.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=L(()=>this.storedBoxes.map((i,o)=>{let l=i.confidence,d,u=0,p;if(n.face.detector.rotation&&n.face.mesh.enabled&&ma.flags.IS_BROWSER){let[b,v]=i.landmarks.length>=m0.count?m0.symmetryLine:uk.symmetryLine;u=F2(i.landmarks[b],i.landmarks[v]);let I=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),T=[I[0]/t.shape[2],I[1]/t.shape[1]],R=Ye.rotateWithOffset(t,u,0,T);p=f0(-u,I),n.face.mesh.enabled?d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.meshSize,this.meshSize]).div(255):d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.boxSize,this.boxSize]).div(255)}else{p=h0;let b=t.clone();n.face.mesh.enabled?d=ql({startPoint:i.startPoint,endPoint:i.endPoint},b,[this.meshSize,this.meshSize]).div(255):d=ql({startPoint:i.startPoint,endPoint:i.endPoint},b,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{coords:null,box:i,faceConfidence:null,boxConfidence:l,confidence:i.confidence,image:d};let[,c,h]=this.meshDetector.predict(d),m=c.dataSync()[0];if(m=m0.count?m0.symmetryLine:uk.symmetryLine;u=F2(i.landmarks[b],i.landmarks[v]);let I=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),T=[I[0]/t.shape[2],I[1]/t.shape[1]],R=Ye.rotateWithOffset(t.toFloat(),u,0,T);p=f0(-u,I),d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.meshSize,this.meshSize]).div(255)}let x={coords:g,box:i,faceConfidence:m,boxConfidence:l,image:d,rawCoords:A},k=c0(i);return this.storedBoxes[o]={...k,landmarks:y,confidence:i.confidence,faceConfidence:m},x}));return s=s.filter(i=>i!==null),n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.faceConfidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}};var Wt=[null,null,null],P2;async function L2(e,t){let n=await P2.predict(e,t),a=[];for(let r of n||[]){if(r.isDisposedInternal)continue;let s=r.coords?r.coords.arraySync():[],i=s.map(u=>[u[0]/e.shape[2],u[1]/e.shape[1],u[2]/P2.meshSize]),o={};if(s&&s.length>0)for(let u of Object.keys(Xa))o[u]=Xa[u].map(p=>s[p]);let l=r.box?[Math.max(0,r.box.startPoint[0]),Math.max(0,r.box.startPoint[1]),Math.min(e.shape[2],r.box.endPoint[0])-Math.max(0,r.box.startPoint[0]),Math.min(e.shape[1],r.box.endPoint[1])-Math.max(0,r.box.startPoint[1])]:0,d=r.box?[r.box.startPoint[0]/e.shape[2],r.box.startPoint[1]/e.shape[1],(r.box.endPoint[0]-r.box.startPoint[0])/e.shape[2],(r.box.endPoint[1]-r.box.startPoint[1])/e.shape[1]]:[];a.push({confidence:Math.round(100*r.faceConfidence||100*r.boxConfidence||0)/100,boxConfidence:Math.round(100*r.boxConfidence)/100,faceConfidence:Math.round(100*r.faceConfidence)/100,box:l,boxRaw:d,mesh:s,meshRaw:i,annotations:o,image:r.image?r.image.clone():null}),r.coords&&r.coords.dispose(),r.image&&r.image.dispose()}return a}async function W2(e){return!Wt[0]&&e.face.enabled||!Wt[1]&&e.face.mesh.enabled||!Wt[2]&&e.face.iris.enabled?(Wt=await Promise.all([!Wt[0]&&e.face.enabled?lk(e):null,!Wt[1]&&e.face.mesh.enabled?Gt(Yt(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!Wt[2]&&e.face.iris.enabled?Gt(Yt(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!Wt[1]||!Wt[1].modelUrl?he("load model failed:",e.face.mesh.modelPath):e.debug&&he("load model:",Wt[1].modelUrl)),e.face.iris.enabled&&(!Wt[2]||!Wt[1].modelUrl?he("load model failed:",e.face.iris.modelPath):e.debug&&he("load model:",Wt[2].modelUrl))):e.debug&&(he("cached model:",Wt[0].model.modelUrl),he("cached model:",Wt[1].modelUrl),he("cached model:",Wt[2].modelUrl)),P2=new z2(Wt[0],Wt[1],Wt[2]),Wt}var dk=zi,pk=Hd;var B2={};Fa(B2,{load:()=>U2,predict:()=>g0});var cie=["angry","disgust","fear","happy","sad","surprise","neutral"],Ca,V2=[],y0=Number.MAX_SAFE_INTEGER,j2=[.2989,.587,.114];async function U2(e){return Ca?e.debug&&he("cached model:",Ca.modelUrl):(Ca=await Gt(Yt(e.modelBasePath,e.face.emotion.modelPath)),!Ca||!Ca.modelUrl?he("load model failed:",e.face.emotion.modelPath):e.debug&&he("load model:",Ca.modelUrl)),Ca}async function g0(e,t){return Ca?y00?(y0++,V2):(t.videoOptimized?y0=0:y0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=Ye.resizeBilinear(e,[Ca.inputs[0].shape[2],Ca.inputs[0].shape[1]],!1),[r,s,i]=ln(a,3,3);a.dispose();let o=B(r,j2[0]),l=B(s,j2[1]),d=B(i,j2[2]);r.dispose(),s.dispose(),i.dispose();let u=mc([o,l,d]);o.dispose(),l.dispose(),d.dispose();let p=L(()=>u.sub(.5).mul(2));u.dispose();let c=[];if(t.face.emotion.enabled){let h=await Ca.predict(p),m=h.dataSync();Ee(h);for(let f=0;ft.face.emotion.minConfidence&&c.push({score:Math.min(.99,Math.trunc(100*m[f])/100),emotion:cie[f]});c.sort((f,A)=>A.score-f.score)}p.dispose(),V2=c,n(c)})):null}var H2={};Fa(H2,{enhance:()=>X2,load:()=>G2,match:()=>ck,predict:()=>v0,similarity:()=>q2});var ea,x0={age:0},b0=Number.MAX_SAFE_INTEGER;async function G2(e){return ea?e.debug&&he("cached model:",ea.modelUrl):(ea=await Gt(Yt(e.modelBasePath,e.face.description.modelPath)),!ea||!ea.modelUrl?he("load model failed:",e.face.description.modelPath):e.debug&&he("load model:",ea.modelUrl)),ea}function q2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let a=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-a)/100}function ck(e,t,n=0){let a={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return a;for(let r of t)if(r.embedding&&r.name){let s=q2(e,r.embedding);s>n&&s>a.similarity&&(a={...r,similarity:s})}return a}function X2(e){return L(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Le))return null;let a=[[.05,.15,.85,.85]];return(n.shape.length===3?Ye.cropAndResize(on(n,0),a,[0],[ea.inputs[0].shape[2],ea.inputs[0].shape[1]]):Ye.cropAndResize(n,a,[0],[ea.inputs[0].shape[2],ea.inputs[0].shape[1]])).mul(255)})}async function v0(e,t){return ea?b00?(b0++,x0):(t.videoOptimized?b0=0:b0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=X2(e),r,s={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};t.face.description.enabled&&(r=await ea.predict(a)),Ee(a),r&&(L(()=>{let i=r.find(p=>p.shape[1]===1).dataSync(),o=Math.trunc(200*Math.abs(i[0]-.5))/100;o>t.face.description.minConfidence&&(s.gender=i[0]<=.5?"female":"male",s.genderConfidence=Math.min(.99,o));let l=r.find(p=>p.shape[1]===100).argMax(1).dataSync()[0],d=r.find(p=>p.shape[1]===100).dataSync();s.age=Math.round(d[l-1]>d[l+1]?10*l-100*d[l-1]:10*l+100*d[l+1])/10;let u=r.find(p=>p.shape[1]===1024);s.descriptor=[...u.dataSync()]}),r.forEach(i=>Ee(i))),x0=s,n(s)})):null}var hie=(e,t)=>{let n=A=>A*180/Math.PI,a=A=>{let y=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);return A[0]/=y,A[1]/=y,A[2]/=y,A},r=(A,y)=>{let g=A[0]-y[0],x=A[1]-y[1],k=A[2]-y[2];return[g,x,k]},s=(A,y)=>{let g=A[1]*y[2]-A[2]*y[1],x=A[2]*y[0]-A[0]*y[2],k=A[0]*y[1]-A[1]*y[0];return[g,x,k]},i=A=>{let[y,g,x,k,b,v,I,T,R]=A,$,z,_;return k<1?k>-1?(_=Math.asin(k),z=Math.atan2(-I,y),$=Math.atan2(-v,b)):(_=-Math.PI/2,z=-Math.atan2(T,R),$=0):(_=Math.PI/2,z=Math.atan2(T,R),$=0),{pitch:2*-$,yaw:2*-z,roll:2*-_}},o=A=>{let y=(x,k,b,v)=>Math.atan2(v-k,b-x);return{pitch:y(A[10][1],A[10][2],A[152][1],A[152][2]),yaw:y(A[33][0],A[33][2],A[263][0],A[263][2]),roll:y(A[33][0],A[33][1],A[263][0],A[263][1])}},l=e.meshRaw;if(!l||l.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let d=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,u=[l[10],l[152],l[234],l[454]].map(A=>[A[0]*t[0]/d,A[1]*t[1]/d,A[2]]),p=a(r(u[1],u[0])),c=a(r(u[3],u[2])),h=a(s(c,p));c=s(p,h);let m=[c[0],c[1],c[2],p[0],p[1],p[2],h[0],h[1],h[2]];return{angle:i(m),matrix:m}},K2=async(e,t)=>{var u,p,c,h,m,f;let n,a,r,s,i,o,l=[];e.state="run:face",n=it();let d=await L2(t,e.config);if(e.perf.face=Math.trunc(it()-n),!d)return[];for(let A of d){if(e.analyze("Get Face"),!A.image||A.image.isDisposedInternal){he("Face object is disposed:",A.image);continue}let y=hie(A,[t.shape[2],t.shape[1]]);e.analyze("Start Emotion:"),e.config.async?s=e.config.face.emotion.enabled?g0(A.image,e.config):{}:(e.state="run:emotion",n=it(),s=e.config.face.emotion.enabled?await g0(A.image,e.config):{},e.perf.emotion=Math.trunc(it()-n)),e.analyze("End Emotion:"),e.analyze("Start Description:"),e.config.async?o=e.config.face.description.enabled?v0(A,e.config):[]:(e.state="run:description",n=it(),o=e.config.face.description.enabled?await v0(A.image,e.config):[],e.perf.embedding=Math.trunc(it()-n)),e.analyze("End Description:"),e.config.async&&([a,r,s,i,o]=await Promise.all([a,r,s,i,o])),e.analyze("Finish Face:"),!e.config.face.iris.enabled&&((u=A==null?void 0:A.annotations)==null?void 0:u.leftEyeIris)&&((p=A==null?void 0:A.annotations)==null?void 0:p.rightEyeIris)&&(delete A.annotations.leftEyeIris,delete A.annotations.rightEyeIris);let g=((c=A.annotations)==null?void 0:c.leftEyeIris)&&((h=A.annotations)==null?void 0:h.rightEyeIris)?11.7*Math.max(Math.abs(A.annotations.leftEyeIris[3][0]-A.annotations.leftEyeIris[1][0]),Math.abs(A.annotations.rightEyeIris[4][1]-A.annotations.rightEyeIris[2][1])):0;l.push({...A,age:o.age,gender:o.gender,genderConfidence:o.genderConfidence,embedding:o.descriptor,emotion:s,iris:g!==0?Math.trunc(g)/100:0,rotation:y,tensor:e.config.face.detector.return?(m=A.image)==null?void 0:m.squeeze():null}),(f=A.image)==null||f.dispose(),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.perf.face&&delete e.perf.face,e.perf.age&&delete e.perf.age,e.perf.gender&&delete e.perf.gender,e.perf.emotion&&delete e.perf.emotion),l};var tg={};Fa(tg,{load:()=>ag,predict:()=>ng});var Gd=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],hk=Gd.length,qd=Gd.reduce((e,t,n)=>(e[t]=n,e),{}),fie=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],mie=fie.map(([e,t])=>[qd[e],qd[t]]),fk=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function mk(e){let t=e.reduce(({maxX:n,maxY:a,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(a,o),minX:Math.min(r,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function Ak(e,[t,n],[a,r]){let s=(o,l,d)=>({score:o.score,box:[Math.trunc(o.box[0]*d),Math.trunc(o.box[1]*l),Math.trunc(o.box[2]*d),Math.trunc(o.box[3]*l)],keypoints:o.keypoints.map(({score:u,part:p,position:c})=>({score:u,part:p,position:{x:Math.trunc(c.x*d),y:Math.trunc(c.y*l)}}))});return e.map(o=>s(o,t/a,n/r))}var Z2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function yk(e,t,n,a){let r=n-e,s=a-t;return r*r+s*s}function eg(e,t){return{x:e.x+t.x,y:e.y+t.y}}var w0=1,gk=16,Aie=20**2;function xk(e,t,n,a,r,s,i,o=2){let l=g=>({y:i.get(g.y,g.x,e),x:i.get(g.y,g.x,i.shape[2]/2+e)}),d=(g,x,k)=>({y:Q2(Math.round(g.y/s),0,x-1),x:Q2(Math.round(g.x/s),0,k-1)}),[u,p]=a.shape,c=d(t.position,u,p),h=l(c),f=eg(t.position,h);for(let g=0;g[qd[f],qd[A]]),o=i.map(([,f])=>f),l=i.map(([f])=>f),d=t.shape[2],u=o.length,p=new Array(d),{part:c,score:h}=e,m=J2(c,a,n);p[c.id]={score:h,part:Gd[c.id],position:m};for(let f=u-1;f>=0;--f){let A=o[f],y=l[f];p[A]&&!p[y]&&(p[y]=xk(f,p[A],y,t,n,a,s))}for(let f=0;ft){o=!1;break}if(!o)break}return o}function xie(e,t){let[n,a,r]=t.shape,s=new Z2(n*a*r,({score:i})=>i);for(let i=0;i{let s=r[a].position;return yk(n,t,s.y,s.x)<=Aie})}function bie(e,t){return t.reduce((a,{position:r,score:s},i)=>(bk(e,r,i)||(a+=s),a),0)/t.length}function vk(e,t,n,a,r,s){let i=[],o=xie(s,t);for(;i.lengthm.score>s),c=bie(i,p),h=mk(p);c>s&&i.push({keypoints:p,box:h,score:Math.round(100*c)/100})}return i}var fa,vie=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function ng(e,t){let n=L(()=>{let o=e.resizeBilinear([fa.inputs[0].shape[2],fa.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),d=fa.execute(o,vie).map(u=>u.squeeze([0]));return d[1]=d[1].sigmoid(),d}),a=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let r=await vk(a[0],a[1],a[2],a[3],t.body.maxDetected,t.body.minConfidence);return Ak(r,[e.shape[1],e.shape[2]],[fa.inputs[0].shape[2],fa.inputs[0].shape[1]])}async function ag(e){return fa?e.debug&&he("cached model:",fa.modelUrl):(fa=await Gt(Yt(e.modelBasePath,e.body.modelPath)),!fa||!fa.modelUrl?he("load model failed:",e.body.modelPath):e.debug&&he("load model:",fa.modelUrl)),fa}var lg={};Fa(lg,{load:()=>dg,predict:()=>ug});function k0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Xd(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function wk(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return Ye.cropAndResize(t,s,[0],n)}function kk(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:a,palmLandmarks:r,confidence:e.confidence}}function I0(e,t=1.5){let n=Xd(e),a=k0(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function S0(e){let t=Xd(e),n=k0(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var Ik=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var rg=class{constructor(t){var n;this.model=t,this.anchors=Ik.map(a=>[a.x,a.y]),this.anchorsTensor=Kn(this.anchors),this.inputSize=(n=this.model)==null?void 0:n.inputs[0].shape[2],this.inputSizeTensor=nn([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=nn([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){return L(()=>{let n=Me(t,[0,0],[-1,2]),a=Me(t,[0,2],[-1,2]),r=se(ge(n,this.inputSizeTensor),this.anchorsTensor),s=ge(a,this.doubleInputSizeTensor),i=B(ye(r,s),this.inputSizeTensor),o=B(se(r,s),this.inputSizeTensor);return cl([i,o],1)})}normalizeLandmarks(t,n){return L(()=>{let a=se(ge(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(a,this.inputSizeTensor)})}async getBoxes(t,n){let a=this.model.predict(t),r=a.squeeze();a.dispose();let s=L(()=>wn(Me(r,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Me(r,[0,1],[-1,4]),l=this.normalizeBoxes(o);o.dispose();let d=await Ye.nonMaxSuppressionAsync(l,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),u=d.arraySync();s.dispose(),d.dispose();let p=[];for(let c of u)if(i[c]>=n.hand.minConfidence){let h=Me(l,[c,0],[1,-1]),m=Me(r,[c,5],[1,14]),f=L(()=>this.normalizeLandmarks(m,c).reshape([-1,2]));m.dispose(),p.push({box:h,palmLandmarks:f,confidence:i[c]})}return r.dispose(),l.dispose(),p}async estimateHandBounds(t,n){let a=t.shape[1],r=t.shape[2],s=L(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let l of i){let d=l.box.dataSync(),u=d.slice(0,2),p=d.slice(2,4),c=l.palmLandmarks.arraySync();l.box.dispose(),l.palmLandmarks.dispose(),o.push(kk({startPoint:u,endPoint:p,palmLandmarks:c,confidence:l.confidence},[r/this.inputSize,a/this.inputSize]))}return o}};function wie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Sk(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return wie(n)}var Nk=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Zr(e,t){let n=0;for(let a=0;aig([...s,1],n)),r=this.calculateLandmarksBoundingBox(a);return I0(S0(r),Iie)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),a=I0(S0(n),Ck);a.palmLandmarks=[];for(let r=0;r[i[0]*(h[0]-this.inputSize/2),i[1]*(h[1]-this.inputSize/2),i[2]*h[2]]),l=sg(a,[0,0]),d=o.map(h=>[...ig(h,l),h[2]]),u=Ek(r),p=[...Xd(n),1],c=[Zr(p,u[0]),Zr(p,u[1])];return d.map(h=>[h[0]+c[0],h[1]+c[1],h[2]])}async estimateHands(t,n){let a=!1,r;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.videoOptimized)&&(r=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.videoOptimized&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(a=!0));let s=[];n.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let i=0;i=n.hand.minConfidence){let x=H(y,[-1,3]),k=x.arraySync();y.dispose(),x.dispose();let b=this.transformRawCoords(k,h,l,c),v=this.getBoxForHandLandmarks(b);this.storedBoxes[i]=v;let I={landmarks:b,confidence:g,box:{topLeft:v.startPoint,bottomRight:v.endPoint}};s.push(I)}else this.storedBoxes[i]=null;y.dispose()}else{let l=I0(S0(o),Ck),d={confidence:o.confidence,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};s.push(d)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),a=t.map(i=>i[1]),r=[Math.min(...n),Math.min(...a)],s=[Math.max(...n),Math.max(...a)];return{startPoint:r,endPoint:s}}};var Mk={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},Yr,Jr,Fk;async function ug(e,t){let n=await Fk.estimateHands(e,t);if(!n)return[];let a=[];for(let r of n){let s={};if(r.landmarks)for(let l of Object.keys(Mk))s[l]=Mk[l].map(d=>r.landmarks[d]);let i=r.box?[Math.max(0,r.box.topLeft[0]),Math.max(0,r.box.topLeft[1]),Math.min(e.shape[2],r.box.bottomRight[0])-Math.max(0,r.box.topLeft[0]),Math.min(e.shape[1],r.box.bottomRight[1])-Math.max(0,r.box.topLeft[1])]:[],o=[r.box.topLeft[0]/e.shape[2],r.box.topLeft[1]/e.shape[1],(r.box.bottomRight[0]-r.box.topLeft[0])/e.shape[2],(r.box.bottomRight[1]-r.box.topLeft[1])/e.shape[1]];a.push({confidence:Math.round(100*r.confidence)/100,box:i,boxRaw:o,landmarks:r.landmarks,annotations:s})}return a}async function dg(e){!Yr||!Jr?([Yr,Jr]=await Promise.all([e.hand.enabled?Gt(Yt(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?Gt(Yt(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!Yr||!Yr.modelUrl?he("load model failed:",e.hand.detector.modelPath):e.debug&&he("load model:",Yr.modelUrl),!Jr||!Jr.modelUrl?he("load model failed:",e.hand.skeleton.modelPath):e.debug&&he("load model:",Jr.modelUrl))):(e.debug&&he("cached model:",Yr.modelUrl),e.debug&&he("cached model:",Jr.modelUrl));let t=new rg(Yr);return Fk=new og(t,Jr),[Yr,Jr]}var pg={};Fa(pg,{load:()=>cg,predict:()=>hg});var $k=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],Dk=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var Cn;async function cg(e){return Cn?e.debug&&he("cached model:",Cn.modelUrl):(Cn=await Gt(Yt(e.modelBasePath,e.body.modelPath)),Cn.width=parseInt(Cn.signature.inputs["input_1:0"].tensorShape.dim[2].size),Cn.height=parseInt(Cn.signature.inputs["input_1:0"].tensorShape.dim[1].size),!Cn||!Cn.modelUrl?he("load model failed:",e.body.modelPath):e.debug&&he("load model:",Cn.modelUrl)),Cn}async function hg(e,t){if(!Cn||!t.body.enabled)return null;let n={width:e.shape[2],height:e.shape[1]},a=Ye.resizeBilinear(e,[Cn.width,Cn.height],!1),r=ge(a,[255]);a.dispose();let s=await Cn.predict(r),i=s.find(p=>p.size===195||p.size===155).dataSync();s.forEach(p=>p.dispose()),r.dispose();let o=[],l=i.length===195?$k:Dk,d=5;for(let p=0;pc.score>p?c.score:p,0),keypoints:o}]}var fg={};Fa(fg,{load:()=>Ag,predict:()=>yg});var N0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Rn,mg=[],T0=Number.MAX_SAFE_INTEGER,E0=2.5;async function Ag(e){if(Rn)e.debug&&he("cached model:",Rn.modelUrl);else{Rn=await Gt(Yt(e.modelBasePath,e.object.modelPath));let t=Object.values(Rn.modelSignature.inputs);if(Rn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Rn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Rn||!Rn.modelUrl?he("load model failed:",e.object.modelPath):e.debug&&he("load model:",Rn.modelUrl)}return Rn}async function Tie(e,t,n,a){let r=0,s=[];for(let d of[1,2,4])L(()=>{var A,y;let u=d*13,p=(A=e.find(g=>g.shape[1]===u**2&&g.shape[2]===N0.length))==null?void 0:A.squeeze(),c=(y=e.find(g=>g.shape[1]===u**2&&g.shape[2]a.object.minConfidence&&x!==61){let b=(.5+Math.trunc(g%u))/u,v=(.5+Math.trunc(g/u))/u,I=m[g].map(U=>U*(u/d/t)),[T,R]=[b-E0/d*I[0],v-E0/d*I[1]],[$,z]=[b+E0/d*I[2]-T,v+E0/d*I[3]-R],_=[T,R,$,z];_=_.map(U=>Math.max(0,Math.min(U,1)));let V=[_[0]*n[0],_[1]*n[1],_[2]*n[0],_[3]*n[1]],j={id:r++,strideSize:d,score:Math.round(100*k)/100,class:x+1,label:N0[x].label,center:[Math.trunc(n[0]*b),Math.trunc(n[1]*v)],centerRaw:[b,v],box:V.map(U=>Math.trunc(U)),boxRaw:_};s.push(j)}}});e.forEach(d=>Ee(d));let i=s.map(d=>d.boxRaw),o=s.map(d=>d.score),l=[];if(i&&i.length>0){let d=await Ye.nonMaxSuppressionAsync(i,o,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);l=d.dataSync(),Ee(d)}return s=s.filter((d,u)=>l.includes(u)).sort((d,u)=>u.score-d.score),s}async function yg(e,t){return Rn?T00?(T0++,mg):(t.videoOptimized?T0=0:T0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=Ye.resizeBilinear(e,[Rn.inputSize,Rn.inputSize],!1),s=r.div(255),i=s.transpose([0,3,1,2]);s.dispose(),r.dispose();let o;t.object.enabled&&(o=await Rn.predict(i)),i.dispose();let l=await Tie(o,Rn.inputSize,a,t);mg=l,n(l)})):null}var Ok=e=>{if(!e)return[];let t=[];for(let n=0;nl.part==="leftWrist"),r=e[n].keypoints.find(l=>l.part==="rightWrist"),s=e[n].keypoints.find(l=>l.part==="nose");s&&a&&r&&a.position.yl.part==="leftShoulder"),o=e[n].keypoints.find(l=>l.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},zk=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(a)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${a<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},_k=e=>{if(!e)return[];let t=[];for(let n=0;n.033||p>.033)&&(d=!1),c>.033&&t.push({iris:n,gesture:"looking right"}),p>.033&&t.push({iris:n,gesture:"looking left"});let h=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].annotations.rightEyeIris[0][1],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].annotations.leftEyeIris[0][1];(m<.015||h<.015||m>.03||h>.03)&&(d=!1),(m<.015||h<.015)&&t.push({iris:n,gesture:"looking down"}),(m>.03||h>.03)&&t.push({iris:n,gesture:"looking up"}),d&&t.push({iris:n,gesture:"looking center"})}return t},Pk=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=a.reduce((i,o)=>i.position[2]i.position[1]xg});function Eie(e,t,n){let a=function(o,l,d){let u=new RegExp("\\b"+l+" \\w+ (\\w+)","ig");o.replace(u,(p,c)=>(d[c]=0,p))},r=function(o,l){let d=e.createShader(l);if(e.shaderSource(d,o),e.compileShader(d),!e.getShaderParameter(d,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(d));return d};this.uniform={},this.attribute={};let s=r(t,e.VERTEX_SHADER),i=r(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),a(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);a(t,"uniform",this.uniform),a(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function Lk(e){e||(e={});let t=0,n=null,a=!1,r=-1,s=[null,null],i=[],o=-1,l=-1,d=null,u=null,p={},c=e.canvas||document.createElement("canvas"),h={},m={INTERMEDIATE:1},f=c.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(b){let v=Array.prototype.slice.call(arguments,1),I=p[b];i.push({func:I,args:v})},this.reset=function(){i=[]};let A=function(b,v){if(!(b===o&&v===l)){if(c.width=b,o=b,c.height=v,l=v,!d){let I=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);d=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,d),f.bufferData(f.ARRAY_BUFFER,I,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,l),s=[null,null]}},y=function(b,v){let I=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,I);let T=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,T);let R=f.createTexture();return f.bindTexture(f.TEXTURE_2D,R),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,b,v,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,R,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:I,texture:R}},g=function(b){return s[b]=s[b]||y(o,l),s[b]},x=function(b=null){var R,$;let v=null,I=null,T=!1;t===0?v=n:v=(R=g(r))==null?void 0:R.texture,t++,a&&!(b&m.INTERMEDIATE)?(I=null,T=t%2==0):(r=(r+1)%2,I=($=g(r))==null?void 0:$.fbo),f.bindTexture(f.TEXTURE_2D,v),f.bindFramebuffer(f.FRAMEBUFFER,I),f.uniform1f(u.uniform.flipY,T?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(b){if(A(b.width,b.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b),i.length===0)return x(),c;for(let v=0;v0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0,i=r,o=s;if(i>C0&&(i=C0,o=i*s/r),o>C0&&(o=C0,i=o*r/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=r*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/r)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ce||(Ce==null?void 0:Ce.width)!==i||(Ce==null?void 0:Ce.height)!==o)&&(Ce=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ce==null?void 0:Ce.width)!==i&&(Ce.width=i),(Ce==null?void 0:Ce.height)!==o&&(Ce.height=o));let l=Ce.getContext("2d");if(e instanceof ImageData?l.putImageData(e,0,0):t.filter.flip&&typeof l.translate!="undefined"?(l.translate(r,0),l.scale(-1,1),l.drawImage(e,0,0,r,s,0,0,Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height),l.setTransform(1,0,0,1,0,0)):l.drawImage(e,0,0,r,s,0,0,Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height),t.filter.enabled){if((!Ft||!gt||Ce.width!==gt.width||(Ce==null?void 0:Ce.height)!==(gt==null?void 0:gt.height))&&(gt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height):document.createElement("canvas"),(gt==null?void 0:gt.width)!==(Ce==null?void 0:Ce.width)&&(gt.width=Ce==null?void 0:Ce.width),(gt==null?void 0:gt.height)!==(Ce==null?void 0:Ce.height)&&(gt.height=Ce==null?void 0:Ce.height),Ft=ma.flags.IS_BROWSER?new Lk({canvas:gt}):null),!Ft)return{tensor:null,canvas:Ce};Ft.reset(),Ft.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&Ft.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&Ft.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&Ft.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&Ft.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&Ft.addFilter("hue",t.filter.hue),t.filter.negative&&Ft.addFilter("negative"),t.filter.sepia&&Ft.addFilter("sepia"),t.filter.vintage&&Ft.addFilter("brownie"),t.filter.sepia&&Ft.addFilter("sepia"),t.filter.kodachrome&&Ft.addFilter("kodachrome"),t.filter.technicolor&&Ft.addFilter("technicolor"),t.filter.polaroid&&Ft.addFilter("polaroid"),t.filter.pixelate!==0&&Ft.addFilter("pixelate",t.filter.pixelate),Ft.apply(Ce)}else gt=Ce,Ft&&(Ft=null);let d;if(gt.data){let p=[gt.height,gt.width,3];d=pc(gt.data,p,"int32")}else if(gt instanceof ImageData)d=oi.fromPixels(gt);else if(t.backend==="webgl"||t.backend==="humangl"){let p=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");p.width=i,p.height=o;let c=p.getContext("2d");c==null||c.drawImage(gt,0,0),d=oi.fromPixels(p)}else{let p=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");p.width=i,p.height=o;let c=p.getContext("2d");c==null||c.drawImage(gt,0,0);let h=c==null?void 0:c.getImageData(0,0,i,o);d=oi.fromPixels(h)}let u=d.toFloat();n=u.expandDims(0),d.dispose(),u.dispose()}let a=t.filter.return?gt:null;return{tensor:n,canvas:a}}var bg={};Fa(bg,{all:()=>Rie,body:()=>Vk,canvas:()=>Cie,face:()=>Bk,gesture:()=>Wk,hand:()=>jk,object:()=>Uk,options:()=>_i});var dt={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var _i={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function R0(e,t,n,a=0,r){e.fillStyle=r.useDepth&&a?`rgba(${127.5+2*a}, ${127.5-2*a}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function Pi(e,t,n,a,r,s){if(e.beginPath(),s.useCurves){let i=(t+t+a)/2,o=(n+n+r)/2;e.ellipse(i,o,a/2,r/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+a-s.roundRect,n),e.quadraticCurveTo(t+a,n,t+a,n+s.roundRect),e.lineTo(t+a,n+r-s.roundRect),e.quadraticCurveTo(t+a,n+r,t+a-s.roundRect,n+r),e.lineTo(t+s.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function vg(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let a of t)e.strokeStyle=n.useDepth&&a[2]?`rgba(${127.5+2*a[2]}, ${127.5-2*a[2]}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&a[2]?`rgba(${127.5+2*a[2]}, ${127.5-2*a[2]}, 255, 0.3)`:n.color,e.lineTo(a[0],parseInt(a[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Kd(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){vg(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let a=0;a1&&l[1].length>0){let d=o[1]>0?`#${o[1]}`:"",u=`${o[0]} ${d}: ${l[1]}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(u,8,2+s*a.lineHeight)),r.fillStyle=a.labelColor,r.fillText(u,6,0+s*a.lineHeight),s+=1}}}async function Bk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r)for(let s of t){r.font=a.font,r.strokeStyle=a.color,r.fillStyle=a.color,a.drawBoxes&&(a.useRawBoxes?Pi(r,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],a):Pi(r,s.box[0],s.box[1],s.box[2],s.box[3],a));let i=[];if(i.push(`face confidence: ${Math.trunc(100*s.confidence)}%`),s.genderConfidence&&i.push(`${s.gender||""} ${Math.trunc(100*s.genderConfidence)}% confident`),s.age&&i.push(`age: ${s.age||""}`),s.iris&&i.push(`iris distance: ${s.iris}`),s.emotion&&s.emotion.length>0){let o=s.emotion.map(l=>`${Math.trunc(100*l.score)}% ${l.emotion}`);i.push(o.join(" "))}s.rotation&&s.rotation.angle&&s.rotation.angle.roll&&i.push(`roll: ${Math.trunc(100*s.rotation.angle.roll)/100} yaw:${Math.trunc(100*s.rotation.angle.yaw)/100} pitch:${Math.trunc(100*s.rotation.angle.pitch)/100}`),i.length===0&&i.push("face"),r.fillStyle=a.color;for(let o=i.length-1;o>=0;o--){let l=Math.max(s.box[0],0),d=o*a.lineHeight+s.box[1];a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i[o],l+5,d+16)),r.fillStyle=a.labelColor,r.fillText(i[o],l+4,d+15)}if(r.lineWidth=1,s.mesh&&s.mesh.length>0){if(a.drawPoints)for(let o of s.mesh)R0(r,o[0],o[1],o[2],a);if(a.drawPolygons){r.lineWidth=1;for(let o=0;os.mesh[d]);vg(r,l,a)}if(s.annotations&&s.annotations.leftEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let o=Math.abs(s.annotations.leftEyeIris[3][0]-s.annotations.leftEyeIris[1][0])/2,l=Math.abs(s.annotations.leftEyeIris[4][1]-s.annotations.leftEyeIris[2][1])/2;r.ellipse(s.annotations.leftEyeIris[0][0],s.annotations.leftEyeIris[0][1],o,l,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(s.annotations&&s.annotations.rightEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let o=Math.abs(s.annotations.rightEyeIris[3][0]-s.annotations.rightEyeIris[1][0])/2,l=Math.abs(s.annotations.rightEyeIris[4][1]-s.annotations.rightEyeIris[2][1])/2;r.ellipse(s.annotations.rightEyeIris[0][0],s.annotations.rightEyeIris[0][1],o,l,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}}}}}var Qr=[];async function Vk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round";for(let s=0;sl.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),o.length===4&&vg(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftKnee"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftAnkle"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHeel"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftFoot"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightKnee"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightAnkle"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHeel"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightFoot"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftElbow"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftWrist"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftPalm"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightElbow"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightWrist"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightPalm"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a)}}}}async function jk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t){if(a.drawBoxes){r.strokeStyle=a.color,r.fillStyle=a.color;let i;if(!a.calculateHandBox)i=a.useRawBoxes?s.boxRaw:s.box;else if(i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],s.landmarks&&s.landmarks.length>0){for(let o of s.landmarks)o[0]i[2]&&(i[2]=o[0]),o[1]>i[3]&&(i[3]=o[1]);i[2]-=i[0],i[3]-=i[1]}a.useRawBoxes?Pi(r,e.width*i[0],e.height*i[1],e.width*i[2],e.height*i[3],a):Pi(r,i[0],i[1],i[2],i[3],a),a.drawLabels&&(a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText("hand",i[0]+3,1+i[1]+a.lineHeight,i[2])),r.fillStyle=a.labelColor,r.fillText("hand",i[0]+2,0+i[1]+a.lineHeight,i[2])),r.stroke()}if(a.drawPoints&&s.landmarks&&s.landmarks.length>0)for(let i of s.landmarks)r.fillStyle=a.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:a.color,R0(r,i[0],i[1],0,a);if(a.drawPolygons){let i=o=>{if(!!o)for(let l=0;l0?l-1:0][0],o[l>0?l-1:0][1]),r.lineTo(o[l][0],o[l][1]),r.stroke()};i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function Uk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t)if(a.drawBoxes){if(r.strokeStyle=a.color,r.fillStyle=a.color,a.useRawBoxes?Pi(r,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],a):Pi(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i,s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText(i,s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])}r.stroke()}}}async function Cie(e,t){if(!e||!t||!(e instanceof HTMLCanvasElement)||!(t instanceof HTMLCanvasElement))return;let n=e.getContext("2d");n==null||n.drawImage(e,0,0)}async function Rie(e,t,n){let a=Hn(_i,n);!t||!e||e instanceof HTMLCanvasElement&&(Bk(e,t.face,a),Vk(e,t.body,a),jk(e,t.hand,a),Wk(e,t.gesture,a),Uk(e,t.object,a))}var M0=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -4344,7 +4344,7 @@ PQ4GJ+ashuK0MhWaoWcA0AaOmASMK7jRNPWYBmHyiuepO2x10qfcv6vYxCzYqoGK4HVYVTJrmb5l c6oaM5TUJ8EgGsG4kLNUHT0M64OaqMMikSRsuKbnFMRLG3zVehOaGNE445NNlnVFpDMu6uie9Vo1 8z5mOAOST2pDK91cNN+5tsrH3PrW54a06KxT7fdrlh/q1Pc+tJ6IUdZGvHPLezMcnBOWbsPap5r3 ylFtbdT1xUWNWzU0/Zbwlgfmx8zGsHWtRHmMqE59aAMyNifvHPc1f0gtPdqkY5JosJHeNci2tktY -euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,M0=` +euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,F0=` /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAsICAoIBwsKCQoNDAsNERwSEQ8PESIZGhQcKSQrKigk JyctMkA3LTA9MCcnOEw5PUNFSElIKzZPVU5GVEBHSEX/2wBDAQwNDREPESESEiFFLicuRUVFRUVF RUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUX/wAARCASwBLADASIA @@ -4912,7 +4912,7 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var W8="1.8.0";var Zl,Zc,Yc,Li,F0,Jc,$0,D0,O0,Eie=class{constructor(t={}){Zl.set(this,void 0);Zc.set(this,void 0);Yc.set(this,void 0);Li.set(this,void 0);this.analyze=(...t)=>{if(!rr(this,Zc))return;let n=this.tf.engine().state.numTensors,r=rr(this,Zl);rs(this,Zl,n);let a=n-r;a!==0&&pe(...t,a)};F0.set(this,t=>{if(!rr(this,Yc))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});Jc.set(this,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let r=it();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&pe("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&pe("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&pe("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let a=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&pe(`wasm execution: ${a?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!a&&pe("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&Y4();try{await this.tf.setBackend(this.config.backend)}catch(a){pe("error: cannot set backend:",this.config.backend,a)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(pe("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let a=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&pe(`gl version:${a.getParameter(a.VERSION)} renderer:${a.getParameter(a.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(it()-r)}});$0.set(this,async()=>{let t=(a,s="application/octet-stream")=>fetch(`data:${s};base64,${a}`).then(i=>i.blob()),n,r;switch(this.config.warmup){case"face":n=await t(R0);break;case"full":n=await t(M0);break;default:n=null}if(n){let a=await createImageBitmap(n);r=await this.detect(a,this.config),a.close()}return r});D0.set(this,async()=>new Promise(t=>{let n,r=0;switch(this.config.warmup){case"face":r=256,n="data:image/jpeg;base64,"+R0;break;case"full":case"body":r=1200,n="data:image/jpeg;base64,"+M0;break;default:n=null}let a=new Image;a.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(r,r):document.createElement("canvas");s.width=a.naturalWidth,s.height=a.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(a,0,0);let o=await this.detect(s,this.config);t(o)},n?a.src=n:t(null)}));O0.set(this,async()=>{let t=a=>Buffer.from(a,"base64"),n;if(this.config.warmup==="face"&&(n=t(R0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(M0)),!n)return null;let r;if(typeof void 0!="undefined"){let a=(void 0).decodeJpeg(n),s=a.expandDims(0);this.tf.dispose(a),r=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&pe("Warmup tfjs-node not loaded");return r});this.tf=lu,this.draw=xg,this.version=W8,this.config=Hn(ct,t),this.state="idle",rs(this,Zl,0),rs(this,Zc,!1),rs(this,Yc,!1),rs(this,Li,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=n=>gg(n,this.config),this.classes={facemesh:H2,emotion:R2,faceres:D2,body:this.config.body.modelPath.includes("posenet")?Q2:cg,hand:ig,nanodet:pg},this.faceTriangulation=l8,this.faceUVMap=u8,this.sysinfo=$g()}similarity(t,n){return z2(t,n)}enhance(t){return P2(t)}match(t,n,r=0){return J4(t,n,r)}async load(t={}){this.state="load";let n=it();t&&(this.config=Hn(this.config,t)),rr(this,Li)&&(this.config.debug&&pe(`version: ${this.version}`),this.config.debug&&pe(`tfjs version: ${this.tf.version_core}`),this.config.debug&&pe("platform:",this.sysinfo.platform),this.config.debug&&pe("agent:",this.sysinfo.agent),await rr(this,Jc).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&pe("configuration:",this.config),this.config.debug&&pe("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?$2(this.config):null),this.models.handpose||(this.config.hand.enabled?ug(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?tg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?hg(this.config):null),this.models.nanodet||(this.config.object.enabled?mg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?O2(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await $2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await ug(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await tg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await hg(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await mg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await O2(this.config))),rr(this,Li)&&(this.config.debug&&pe("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),rs(this,Li,!1));let r=Math.trunc(it()-n);r>(this.perf.load||0)&&(this.perf.load=r)}async detect(t,n={}){return new Promise(async r=>{var A,y;this.state="config";let a;this.config=Hn(this.config,n),this.state="check";let s=rr(this,F0).call(this,t);s&&(pe(s,t),r({error:s}));let i=it();await rr(this,Jc).call(this),await this.load();let o;t&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof Image!="undefined"&&t instanceof Image||typeof ImageData!="undefined"&&t instanceof ImageData||typeof ImageBitmap!="undefined"&&yg instanceof ImageBitmap)&&(pe("disabling video optimization"),o=this.config.videoOptimized,this.config.videoOptimized=!1),a=it();let l=gg(t,this.config);if(!l||!l.tensor){pe("could not convert input to tensor"),r({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(it()-a),this.analyze("Get Image:");let c,u,h,d,p;this.config.async?(h=this.config.face.enabled?L2(this,l.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",a=it(),h=this.config.face.enabled?await L2(this,l.tensor):[],p=Math.trunc(it()-a),p>0&&(this.perf.face=p)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?eg(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(c=this.config.body.enabled?dg(l.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",a=it(),this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?await eg(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(c=this.config.body.enabled?await dg(l.tensor,this.config):[]),p=Math.trunc(it()-a),p>0&&(this.perf.body=p)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?(A=this.models.handpose)==null?void 0:A.estimateHands(l.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",a=it(),u=this.config.hand.enabled?await((y=this.models.handpose)==null?void 0:y.estimateHands(l.tensor,this.config)):[],p=Math.trunc(it()-a),p>0&&(this.perf.hand=p)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(d=this.config.object.enabled?Ag(l.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",a=it(),d=this.config.object.enabled?await Ag(l.tensor,this.config):[],p=Math.trunc(it()-a),p>0&&(this.perf.object=p)),this.analyze("End Object:"),this.config.async&&([h,c,u,d]=await Promise.all([h,c,u,d])),Te(l.tensor);let m=[];this.config.gesture.enabled&&(a=it(),m=[...R8(h),...C8(c),...F8(u),...M8(h)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(it()-a)),o&&(this.config.videoOptimized=o),this.perf.total=Math.trunc(it()-i),this.state="idle";let f={face:h,body:c,hand:u,gesture:m,object:d,performance:this.perf,canvas:l.canvas};r(f)})}async warmup(t={}){let n=it();if(t&&(this.config=Hn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let r=this.config.videoOptimized;this.config.videoOptimized=!1;let a;typeof createImageBitmap=="function"?a=await rr(this,$0).call(this):typeof Image!="undefined"?a=await rr(this,D0).call(this):a=await rr(this,O0).call(this),this.config.videoOptimized=r;let s=it();return this.config.debug&&pe("Warmup",this.config.warmup,Math.round(s-n),"ms",a),a}};Zl=new WeakMap,Zc=new WeakMap,Yc=new WeakMap,Li=new WeakMap,F0=new WeakMap,Jc=new WeakMap,$0=new WeakMap,D0=new WeakMap,O0=new WeakMap;export{Eie as Human,Eie as default}; +2Q==`;var Hk="1.8.0";var Zl,Zd,Yd,Li,$0,Jd,D0,O0,z0,Fie=class{constructor(t={}){Zl.set(this,void 0);Zd.set(this,void 0);Yd.set(this,void 0);Li.set(this,void 0);this.analyze=(...t)=>{if(!aa(this,Zd))return;let n=this.tf.engine().state.numTensors,a=aa(this,Zl);as(this,Zl,n);let r=n-a;r!==0&&he(...t,r)};$0.set(this,t=>{if(!aa(this,Yd))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});Jd.set(this,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=it();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&he("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&he("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&he("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&he(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&he("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&J8();try{await this.tf.setBackend(this.config.backend)}catch(r){he("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(he("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&he(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(it()-a)}});D0.set(this,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(M0);break;case"full":n=await t(F0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});O0.set(this,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+M0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+F0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));z0.set(this,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(M0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(F0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&he("Warmup tfjs-node not loaded");return a});this.tf=lu,this.draw=bg,this.version=Hk,this.config=Hn(dt,t),this.state="idle",as(this,Zl,0),as(this,Zd,!1),as(this,Yd,!1),as(this,Li,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=n=>xg(n,this.config),this.classes={facemesh:_2,emotion:B2,faceres:H2,body:this.config.body.modelPath.includes("posenet")?tg:pg,hand:lg,nanodet:fg},this.faceTriangulation=dk,this.faceUVMap=pk,this.sysinfo=Og()}similarity(t,n){return q2(t,n)}enhance(t){return X2(t)}match(t,n,a=0){return ck(t,n,a)}async load(t={}){this.state="load";let n=it();t&&(this.config=Hn(this.config,t)),aa(this,Li)&&(this.config.debug&&he(`version: ${this.version}`),this.config.debug&&he(`tfjs version: ${this.tf.version_core}`),this.config.debug&&he("platform:",this.sysinfo.platform),this.config.debug&&he("agent:",this.sysinfo.agent),await aa(this,Jd).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&he("configuration:",this.config),this.config.debug&&he("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?W2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?U2(this.config):null),this.models.handpose||(this.config.hand.enabled?dg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?ag(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?cg(this.config):null),this.models.nanodet||(this.config.object.enabled?Ag(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?G2(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await W2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await U2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await dg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await ag(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await cg(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await Ag(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await G2(this.config))),aa(this,Li)&&(this.config.debug&&he("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),as(this,Li,!1));let a=Math.trunc(it()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Hn(this.config,n),this.state="check";let s=aa(this,$0).call(this,t);s&&(he(s,t),a({error:s}));let i=it();await aa(this,Jd).call(this),await this.load();let o;t&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof Image!="undefined"&&t instanceof Image||typeof ImageData!="undefined"&&t instanceof ImageData||typeof ImageBitmap!="undefined"&&gg instanceof ImageBitmap)&&(he("disabling video optimization"),o=this.config.videoOptimized,this.config.videoOptimized=!1),r=it();let l=xg(t,this.config);if(!l||!l.tensor){he("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(it()-r),this.analyze("Get Image:");let d,u,p,c,h;this.config.async?(p=this.config.face.enabled?K2(this,l.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=it(),p=this.config.face.enabled?await K2(this,l.tensor):[],h=Math.trunc(it()-r),h>0&&(this.perf.face=h)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?ng(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(d=this.config.body.enabled?hg(l.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=it(),this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?await ng(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(d=this.config.body.enabled?await hg(l.tensor,this.config):[]),h=Math.trunc(it()-r),h>0&&(this.perf.body=h)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?ug(l.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=it(),u=this.config.hand.enabled?await ug(l.tensor,this.config):[],h=Math.trunc(it()-r),h>0&&(this.perf.hand=h)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(c=this.config.object.enabled?yg(l.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",r=it(),c=this.config.object.enabled?await yg(l.tensor,this.config):[],h=Math.trunc(it()-r),h>0&&(this.perf.object=h)),this.analyze("End Object:"),this.config.async&&([p,d,u,c]=await Promise.all([p,d,u,c])),Ee(l.tensor);let m=[];this.config.gesture.enabled&&(r=it(),m=[...zk(p),...Ok(d),...Pk(u),..._k(p)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(it()-r)),o&&(this.config.videoOptimized=o),this.perf.total=Math.trunc(it()-i),this.state="idle";let f={face:p,body:d,hand:u,gesture:m,object:c,performance:this.perf,canvas:l.canvas};a(f)})}async warmup(t={}){let n=it();if(t&&(this.config=Hn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a=this.config.videoOptimized;this.config.videoOptimized=!1;let r;typeof createImageBitmap=="function"?r=await aa(this,D0).call(this):typeof Image!="undefined"?r=await aa(this,O0).call(this):r=await aa(this,z0).call(this),this.config.videoOptimized=a;let s=it();return this.config.debug&&he("Warmup",this.config.warmup,Math.round(s-n),"ms",r),r}};Zl=new WeakMap,Zd=new WeakMap,Yd=new WeakMap,Li=new WeakMap,$0=new WeakMap,Jd=new WeakMap,D0=new WeakMap,O0=new WeakMap,z0=new WeakMap;export{Fie as Human,Fie as default}; /** * @license * Copyright 2017 Google LLC. All Rights Reserved. diff --git a/dist/human.esm.js.map b/dist/human.esm.js.map index eb317876..b846ab8d 100644 --- a/dist/human.esm.js.map +++ b/dist/human.esm.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/helpers.ts", "../src/sysinfo.ts", "../node_modules/.pnpm/node-fetch@2.6.1/node_modules/node-fetch/browser.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js", "(disabled):crypto", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js", "(disabled):path", "(disabled):worker_threads", "(disabled):perf_hooks", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js", "../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/util_base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/environment.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/global_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/kernel_names.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/kernel_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/profiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_format.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/engine.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/device_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/flags.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_util_env.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/operation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/router_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/indexed_db.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/local_storage.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/model_management.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/print.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/base_side_effects.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/io.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/browser_files.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/progress.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/weights_loader.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/http.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/passthrough.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/confusion_matrix.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/test_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/globals.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/add_n.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/basic_lstm_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dense_bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/eye.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linspace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/axis_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_with_argmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ones.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/moments.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/multi_rnn_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/outer_product.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rand_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_gamma.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_uniform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/setdiff1d_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor6d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/truncated_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/variable.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/where_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/where_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/boolean_mask.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/moving_average.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/in_top_k.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hamming_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hann_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/frame.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/crop_and_resize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/flip_left_right.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/rotate_with_offset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/nonmax_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/band_part.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/gram_schmidt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/qr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/loss_ops_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/compute_weighted_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/absolute_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/cosine_distance.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/hinge_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/huber_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/log_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/mean_squared_error.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/sigmoid_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/softmax_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/train.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/browser_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/backend_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reduce_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rotate_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/array_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/selu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/erf_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/complex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/split_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/segment_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/kernel_impls.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/cpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/backend_cpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/zeros_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fused_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/pool_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Clip.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fft_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Scatter_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/canvas_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flags_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/glsl_version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/packing_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reshape_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/texture_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unpack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/backend_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/kernel_funcs_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mulmat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_complex_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mean_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reduce_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reduce.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/arg_min_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pool_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/avg_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/complex_abs_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/im2col_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/crop_and_resize_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/cumsum_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/depth_to_space_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_packed_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/diag_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/dilation_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fft_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fill_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flip_left_right_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_nd_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_grad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/max_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/multinomial_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/onehot_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/rotate_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/scatter_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/select_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/strided_slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tile_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transform_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/segment_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/unary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/binary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/kernel_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedBatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/flags_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/backend_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Abs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Add_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AddN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchMatMul_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchToSpaceND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BroadcastTo_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cast_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Ceil_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ClipByValue_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ComplexAbs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Concat_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2DBackpropInput_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cumsum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/DepthwiseConv2dNative_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Dilation2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Elu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Erf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Exp_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ExpandDims_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Expm1_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Floor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/FloorDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/FusedBatchNorm_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/GatherV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/GreaterEqual_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Identity_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsFinite_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsInf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsNan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LeakyRelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log1p_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LogSoftmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization_backprop.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LRN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/min_max_grad_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Max_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Maximum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mean_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Min_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Minimum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MirrorPad_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mod_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Multiply_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Neg_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/OneHot_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/OnesLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/PadV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pow_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Prelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/RealDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reciprocal_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu6_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reshape_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeBilinear_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeNearestNeighbor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reverse_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Round_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Rsqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Select_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Selu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sigmoid_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sign_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Slice_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softplus_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SpaceToBatchND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SplitV_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Square_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SquaredDifference_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Step_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sub_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tile_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Transpose_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Unpack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/UnsortedSegmentSum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ZerosLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/register_all_gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/errors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/variables.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/logs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/losses.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/data/compiled_api.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/register.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/arithmetic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/basic_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/control.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/convolution.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/creation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/dynamic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/evaluation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/graph.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/image.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/logical.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/matrices.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/reduction.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/slice_join.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/spectral.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/transformation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_mapper.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/node_value_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/arithmetic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/basic_math_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_array.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_list.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/control_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/convolution_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/creation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/dynamic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/evaluation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/hash_table_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/image_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/logical_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/matrices_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/normalization_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/reduction_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/slice_join_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/sparse_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/spectral_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/transformation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/execution_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/model_analysis.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/resource_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_model.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasource.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/readers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/version.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/faceall.ts", "../src/blazeface/facemesh.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/posenet/posenet.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/handpose/handpose.ts", "../src/handpose/box.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/handpose/anchors.ts", "../src/blazepose/blazepose.ts", "../src/blazepose/annotations.ts", "../src/nanodet/nanodet.ts", "../src/nanodet/labels.ts", "../src/gesture/gesture.ts", "../src/image/image.ts", "../src/image/imagefx.js", "../src/draw/draw.ts", "../src/config.ts", "../src/sample.ts", "../src/human.ts"], - "sourcesContent": ["// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg) {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n", "export function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "", "/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "", "", "\nvar WasmBackendModuleThreadedSimd = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModuleThreadedSimd) {\n WasmBackendModuleThreadedSimd = WasmBackendModuleThreadedSimd || {};\n\nfunction GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModuleThreadedSimd!==\"undefined\"?WasmBackendModuleThreadedSimd:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module[\"ENVIRONMENT_IS_PTHREAD\"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module[\"buffer\"]}var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"};var nodeWorkerThreads;try{nodeWorkerThreads=require(\"worker_threads\")}catch(e){console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(typeof _scriptDir !== \"undefined\" && _scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance===\"undefined\"){global.performance=require(\"perf_hooks\").performance}}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){GROWABLE_HEAP_I8().set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module[\"wasmMemory\"];buffer=Module[\"buffer\"]}else{if(Module[\"wasmMemory\"]){wasmMemory=Module[\"wasmMemory\"]}else{wasmMemory=new WebAssembly.Memory({\"initial\":INITIAL_MEMORY/65536,\"maximum\":2147483648/65536,\"shared\":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\");if(ENVIRONMENT_IS_NODE){console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\")}throw Error(\"bad memory\")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,\"addRunDependency cannot be used in a pthread worker\");runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error(\"Pthread aborting at \"+(new Error).stack);what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm-threaded-simd.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmTable=Module[\"asm\"][\"F\"];wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency(\"wasm-instantiate\")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency(\"wasm-instantiate\")}function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"],output[\"module\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var ASM_CONSTS={9816:function(){throw\"Canceled!\"},9834:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw\"Atomics.notify returned an unexpected value \"+ret}Module[\"_emscripten_futex_wake\"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! killThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in killThread!\";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cancelThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cancelThread!\";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({\"cmd\":\"cancel\"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cleanupThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cleanupThread!\";var pthread=PThread.pthreads[pthread_ptr];if(pthread){GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){var pthreadPoolSize=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2));for(var i=0;i>2]=tb;var headPtr=tb+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),tb+100>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(GROWABLE_HEAP_U32(),tb+56>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,0);PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exit\"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({\"cmd\":\"cancelDone\"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e[\"data\"];var cmd=d[\"cmd\"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d[\"targetThread\"]&&d[\"targetThread\"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d[\"transferList\"])}else{console.error('Internal error! Worker sent a message \"'+cmd+'\" to target pthread '+d[\"targetThread\"]+\", but that thread no longer exists!\")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd===\"processQueuedMainThreadWork\"){_emscripten_main_thread_process_queued_calls()}else if(cmd===\"spawnThread\"){spawnThread(e.data)}else if(cmd===\"cleanupThread\"){cleanupThread(d[\"thread\"])}else if(cmd===\"killThread\"){killThread(d[\"thread\"])}else if(cmd===\"cancelThread\"){cancelThread(d[\"thread\"])}else if(cmd===\"loaded\"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd===\"print\"){out(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"printErr\"){err(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"alert\"){alert(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"exit\"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd===\"exitProcess\"){try{exit(d[\"returnCode\"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd===\"cancelDone\"){PThread.returnWorkerToPool(worker)}else if(cmd===\"objectTransfer\"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target===\"setimmediate\"){worker.postMessage(e.data)}else{err(\"worker sent an unknown command \"+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err(\"pthread sent an error! \"+e.filename+\":\"+e.lineno+\": \"+e.message)};if(ENVIRONMENT_IS_NODE){worker.on(\"message\",function(data){worker.onmessage({data:data})});worker.on(\"error\",function(data){worker.onerror(data)});worker.on(\"exit\",function(data){})}worker.postMessage({\"cmd\":\"load\",\"urlOrBlob\":Module[\"mainScriptUrlOrBlob\"]||_scriptDir,\"wasmMemory\":wasmMemory,\"wasmModule\":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile(\"tfjs-backend-wasm-threaded-simd.worker.js\");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({\"cmd\":\"processQueuedMainThreadWork\"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({\"targetThread\":targetThreadId,\"cmd\":\"processThreadQueue\"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({\"cmd\":\"processThreadQueue\"})}return 1}function _abort(){abort()}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret===\"timed-out\")return-73;if(ret===\"not-equal\")return-6;if(ret===\"ok\")return 0;throw\"Atomics.wait returned an unexpected value \"+ret}else{if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_num_logical_cores(){if(ENVIRONMENT_IS_NODE)return require(\"os\").cpus().length;return navigator[\"hardwareConcurrency\"]}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?GROWABLE_HEAP_F64()[buf++>>1]:GROWABLE_HEAP_I32()[buf]);++buf}return readAsmConstArgsArray}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return\"\";if(target==window)return\"#window\";if(target==screen)return\"#screen\";return target&&target.nodeName?target.nodeName:\"\"},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):\"\";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!==\"undefined\"?document:0,typeof window!==\"undefined\"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!==\"undefined\"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension(\"ANGLE_instanced_arrays\");if(ext){ctx[\"vertexAttribDivisor\"]=function(index,divisor){ext[\"vertexAttribDivisorANGLE\"](index,divisor)};ctx[\"drawArraysInstanced\"]=function(mode,first,count,primcount){ext[\"drawArraysInstancedANGLE\"](mode,first,count,primcount)};ctx[\"drawElementsInstanced\"]=function(mode,count,type,indices,primcount){ext[\"drawElementsInstancedANGLE\"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension(\"OES_vertex_array_object\");if(ext){ctx[\"createVertexArray\"]=function(){return ext[\"createVertexArrayOES\"]()};ctx[\"deleteVertexArray\"]=function(vao){ext[\"deleteVertexArrayOES\"](vao)};ctx[\"bindVertexArray\"]=function(vao){ext[\"bindVertexArrayOES\"](vao)};ctx[\"isVertexArray\"]=function(vao){return ext[\"isVertexArrayOES\"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension(\"WEBGL_draw_buffers\");if(ext){ctx[\"drawBuffers\"]=function(n,bufs){ext[\"drawBuffersWEBGL\"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension(\"WEBGL_multi_draw\"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext(\"webgl\",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault===\"undefined\"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents===\"object\")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);GLctx.disjointTimerQueryExt=GLctx.getExtension(\"EXT_disjoint_timer_query\");__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(ext.indexOf(\"lose_context\")<0&&ext.indexOf(\"debug\")<0){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];var contextAttributes={\"alpha\":!!GROWABLE_HEAP_I32()[a+(0>>2)],\"depth\":!!GROWABLE_HEAP_I32()[a+(4>>2)],\"stencil\":!!GROWABLE_HEAP_I32()[a+(8>>2)],\"antialias\":!!GROWABLE_HEAP_I32()[a+(12>>2)],\"premultipliedAlpha\":!!GROWABLE_HEAP_I32()[a+(16>>2)],\"preserveDrawingBuffer\":!!GROWABLE_HEAP_I32()[a+(20>>2)],\"powerPreference\":__emscripten_webgl_power_preferences[powerPreference],\"failIfMajorPerformanceCaveat\":!!GROWABLE_HEAP_I32()[a+(28>>2)],majorVersion:GROWABLE_HEAP_I32()[a+(32>>2)],minorVersion:GROWABLE_HEAP_I32()[a+(36>>2)],enableExtensionsByDefault:GROWABLE_HEAP_I32()[a+(40>>2)],explicitSwapControl:GROWABLE_HEAP_I32()[a+(44>>2)],proxyContextToMainThread:GROWABLE_HEAP_I32()[a+(48>>2)],renderViaOffscreenBackBuffer:GROWABLE_HEAP_I32()[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset)}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.threadExitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! spawnThread() can only ever be called from main application thread!\";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw\"Internal error!\";if(!threadParams.pthread_ptr)throw\"Internal error, no pthread ptr!\";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(64>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(100>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(76>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(172>>2),global_locale);worker.pthread=pthread;var msg={\"cmd\":\"run\",\"start_routine\":threadParams.startRoutine,\"arg\":threadParams.arg,\"threadInfoStruct\":threadParams.pthread_ptr,\"stackBase\":threadParams.stackBase,\"stackSize\":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer===\"undefined\"){err(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\");return 6}if(!pthread_ptr){err(\"pthread_create called with a null thread pointer!\");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd=\"spawnThread\";postMessage(threadParams,transferList)}else{spawnThread(threadParams)}return 0}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={\"e\":___assert_fail,\"r\":___call_main,\"x\":__emscripten_notify_thread_queue,\"b\":_abort,\"y\":_emscripten_asm_const_int,\"j\":_emscripten_conditional_set_current_thread_status,\"c\":_emscripten_futex_wait,\"d\":_emscripten_futex_wake,\"f\":_emscripten_get_now,\"p\":_emscripten_memcpy_big,\"z\":_emscripten_num_logical_cores,\"u\":_emscripten_receive_on_main_thread_js,\"q\":_emscripten_resize_heap,\"v\":_emscripten_set_canvas_element_size,\"i\":_emscripten_set_current_thread_status,\"t\":_emscripten_set_thread_name,\"w\":_emscripten_webgl_create_context,\"m\":_fd_close,\"n\":_fd_seek,\"g\":_fd_write,\"o\":initPthreadsJS,\"a\":wasmMemory||Module[\"wasmMemory\"],\"k\":_pthread_cleanup_pop,\"l\":_pthread_cleanup_push,\"h\":_pthread_create,\"s\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Ua\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Va\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Wa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Xa\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ya\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Za\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"_a\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"$a\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"ab\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"bb\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"cb\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"db\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"eb\"]).apply(null,arguments)};var _emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=function(){return(_emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=Module[\"asm\"][\"fb\"]).apply(null,arguments)};var _pthread_self=Module[\"_pthread_self\"]=function(){return(_pthread_self=Module[\"_pthread_self\"]=Module[\"asm\"][\"gb\"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=function(){return(___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=Module[\"asm\"][\"hb\"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=function(){return(_emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=Module[\"asm\"][\"ib\"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=function(){return(_emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=Module[\"asm\"][\"jb\"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=function(){return(_emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=Module[\"asm\"][\"kb\"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=function(){return(__emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=Module[\"asm\"][\"lb\"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=Module[\"asm\"][\"mb\"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=Module[\"asm\"][\"nb\"]).apply(null,arguments)};var __emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=function(){return(__emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=Module[\"asm\"][\"ob\"]).apply(null,arguments)};var _emscripten_tls_init=Module[\"_emscripten_tls_init\"]=function(){return(_emscripten_tls_init=Module[\"_emscripten_tls_init\"]=Module[\"asm\"][\"pb\"]).apply(null,arguments)};var __emscripten_thread_init=Module[\"__emscripten_thread_init\"]=function(){return(__emscripten_thread_init=Module[\"__emscripten_thread_init\"]=Module[\"asm\"][\"qb\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"rb\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"sb\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"tb\"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=function(){return(_emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=Module[\"asm\"][\"ub\"]).apply(null,arguments)};var _memalign=Module[\"_memalign\"]=function(){return(_memalign=Module[\"_memalign\"]=Module[\"asm\"][\"vb\"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module[\"__emscripten_allow_main_runtime_queued_calls\"]=9808;var __emscripten_main_thread_futex=Module[\"__emscripten_main_thread_futex\"]=11432;Module[\"cwrap\"]=cwrap;Module[\"PThread\"]=PThread;Module[\"PThread\"]=PThread;Module[\"wasmMemory\"]=wasmMemory;Module[\"ExitStatus\"]=ExitStatus;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({\"cmd\":\"loaded\"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exitProcess\",\"returnCode\":status});throw new ExitStatus(status)}else{}}if(noExitRuntime){}else{PThread.terminateAllThreads();EXITSTATUS=status;exitRuntime();if(Module[\"onExit\"])Module[\"onExit\"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run();\n\n\n return WasmBackendModuleThreadedSimd.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModuleThreadedSimd;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModuleThreadedSimd; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModuleThreadedSimd\"] = WasmBackendModuleThreadedSimd;\n", "\nvar WasmBackendModule = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModule) {\n WasmBackendModule = WasmBackendModule || {};\n\nvar Module=typeof WasmBackendModule!==\"undefined\"?WasmBackendModule:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str=\"\";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmMemory=Module[\"asm\"][\"i\"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module[\"asm\"][\"o\"];removeRunDependency(\"wasm-instantiate\")}addRunDependency(\"wasm-instantiate\");function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _abort(){abort()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_create(){return 6}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _sysconf(name){switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}var asmLibraryArg={\"a\":_abort,\"d\":_emscripten_memcpy_big,\"e\":_emscripten_resize_heap,\"f\":_fd_close,\"c\":_fd_seek,\"b\":_fd_write,\"g\":_pthread_create,\"h\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"j\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"k\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"l\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"m\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"n\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"p\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"q\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"r\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"s\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"t\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"u\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"v\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"w\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"x\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"y\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"z\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"F\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};Module[\"cwrap\"]=cwrap;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();\n\n\n return WasmBackendModule.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModule;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModule; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModule\"] = WasmBackendModule;\n", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Backend, DataId} from '../tensor';\nimport {BackendValues, DataType} from '../types';\n\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n\n// Required information for all backends.\nexport interface BackendTimingInfo {\n kernelMs: number|{error: string};\n getExtraProfileInfo?(): string; // a field for additional timing information\n // e.g. packing / unpacking for WebGL backend\n}\n\nexport interface TensorStorage {\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n disposeData(dataId: DataId, force?: boolean): boolean;\n write(values: BackendValues, shape: number[], dtype: DataType): DataId;\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void;\n memory(): {unreliable: boolean;}; // Backend-specific information.\n /** Returns number of data ids currently in the storage. */\n numDataIds(): number;\n refCount(dataId: DataId): number;\n}\n\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n private data = new WeakMap();\n private dataIdsCount = 0;\n\n constructor(private backend: KernelBackend, private dataMover: DataMover) {}\n\n get(dataId: DataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n\n set(dataId: DataId, value: T): void {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n\n has(dataId: DataId): boolean {\n return this.data.has(dataId);\n }\n\n delete(dataId: DataId): boolean {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n\n numDataIds(): number {\n return this.dataIdsCount;\n }\n}\n\nexport interface DataMover {\n /**\n * To be called by backends whenever they see a dataId that they don't own.\n * Upon calling this method, the mover will fetch the tensor from another\n * backend and register it with the current active backend.\n */\n moveData(backend: KernelBackend, dataId: DataId): void;\n}\n\nexport interface BackendTimer {\n // check if backend timer is available\n timerAvailable(): boolean;\n time(f: () => void): Promise;\n}\n\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend implements TensorStorage, Backend, BackendTimer {\n refCount(dataId: DataId): number {\n return notYetImplemented('refCount');\n }\n incRef(dataId: DataId): void {\n return notYetImplemented('incRef');\n }\n timerAvailable(): boolean {\n return true;\n }\n time(f: () => void): Promise {\n return notYetImplemented('time');\n }\n read(dataId: object): Promise {\n return notYetImplemented('read');\n }\n readSync(dataId: object): BackendValues {\n return notYetImplemented('readSync');\n }\n numDataIds(): number {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId: object, force?: boolean): boolean {\n return notYetImplemented('disposeData');\n }\n write(values: BackendValues, shape: number[], dtype: DataType): DataId {\n return notYetImplemented('write');\n }\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void {\n return notYetImplemented('move');\n }\n memory(): {unreliable: boolean; reasons?: string[]} {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision(): 16|32 {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon(): number {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose(): void {\n return notYetImplemented('dispose');\n }\n}\n\nfunction notYetImplemented(kernelName: string): never {\n throw new Error(\n `'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap, FlatVector, NumericDataType, RecursiveArray, TensorLike, TypedArray} from './types';\n\n/**\n * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n // tslint:disable-next-line:no-any\n array: any[]|Uint32Array|Int32Array|Float32Array,\n // tslint:disable-next-line:no-any\n array2: any[]|Uint32Array|Int32Array|Float32Array): void {\n if (array.length !== array2.length) {\n throw new Error(\n `Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\nexport function nearestLargerEven(val: number): number {\n return val % 2 === 0 ? val : val + 1;\n}\n\nexport function sum(arr: number[]): number {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a: number, b: number) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n () => `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function\nflatten|TypedArray>(\n arr: T|RecursiveArray, result: T[] = [], skipTypedArray = false): T[] {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n } else {\n result.push(arr as T);\n }\n return result;\n}\n\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (shapeProd === 0) {\n throw Error(\n `Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () =>\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(ax => isInt(ax)),\n () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function getArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else if (dtype === 'string') {\n values = new Array<'string'>(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function checkConversionForErrors(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype: DataType): boolean {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nexport function isTypedArray(a: {}): a is Float32Array|Int32Array|Uint8Array {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'complex64') {\n return 8;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr: Uint8Array[]): number {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n\n/** Returns true if the value is a string. */\nexport function isString(value: {}): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport function isBoolean(value: {}): boolean {\n return typeof value === 'boolean';\n}\n\nexport function isNumber(value: {}): boolean {\n return typeof value === 'number';\n}\n\nexport function inferDtype(values: TensorLike): DataType {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n } else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n } else if (isNumber(values)) {\n return 'float32';\n } else if (isString(values)) {\n return 'string';\n } else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nfunction createNestedArray(\n offset: number, shape: number[], a: TypedArray, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n } else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(\n shape: number[], a: TypedArray, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${\n isComplex ? ' for a complex tensor' : ''}.`);\n }\n\n return createNestedArray(0, shape, a, isComplex);\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size) as DataTypeMap[D];\n } else if (dtype === 'int32') {\n return new Int32Array(size) as DataTypeMap[D];\n } else if (dtype === 'bool') {\n return new Uint8Array(size) as DataTypeMap[D];\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(\n shape: number[], dtype: D) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n } else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n } else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function assertNonNegativeIntegerDimensions(shape: number[]) {\n shape.forEach(dimSize => {\n assert(\n Number.isInteger(dimSize) && dimSize >= 0,\n () =>\n `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(\n locs: number[], rank: number, strides: number[]): number {\n if (rank === 0) {\n return 0;\n } else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(\n index: number, rank: number, strides: number[]): number[] {\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object: any) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Platform} from './platforms/platform';\nimport {isPromise} from './util_base';\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n\ntype FlagValue = number|boolean;\ntype FlagEvaluationFn = (() => FlagValue)|(() => Promise);\nexport type Flags = {\n [featureName: string]: FlagValue\n};\nexport type FlagRegistryEntry = {\n evaluationFn: FlagEvaluationFn;\n setHook?: (value: FlagValue) => void;\n};\n\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n private flags: Flags = {};\n private flagRegistry: {[flagName: string]: FlagRegistryEntry} = {};\n\n private urlFlags: Flags = {};\n\n platformName: string;\n platform: Platform;\n\n // Jasmine spies on this in 'environment_test.ts'\n getQueryParams = getQueryParams;\n\n // tslint:disable-next-line: no-any\n constructor(public global: any) {\n this.populateURLFlags();\n }\n\n setPlatform(platformName: string, platform: Platform) {\n if (this.platform != null) {\n console.warn(\n `Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n\n registerFlag(\n flagName: string, evaluationFn: FlagEvaluationFn,\n setHook?: (value: FlagValue) => void) {\n this.flagRegistry[flagName] = {evaluationFn, setHook};\n\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(\n `Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n\n async getAsync(flagName: string): Promise {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n\n get(flagName: string): FlagValue {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(\n `Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n\n this.flags[flagName] = flagValue as number | boolean;\n\n return this.flags[flagName];\n }\n\n getNumber(flagName: string): number {\n return this.get(flagName) as number;\n }\n\n getBool(flagName: string): boolean {\n return this.get(flagName) as boolean;\n }\n\n getFlags(): Flags {\n return this.flags;\n }\n // For backwards compatibility.\n get features(): Flags {\n return this.flags;\n }\n\n set(flagName: string, value: FlagValue): void {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n\n private evaluateFlag(flagName: string): FlagValue|Promise {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n\n setFlags(flags: Flags) {\n this.flags = Object.assign({}, flags);\n }\n\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n\n private populateURLFlags(): void {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n\nfunction parseValue(flagName: string, value: string): FlagValue {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n } else if (`${+ value}` === value) {\n return +value;\n }\n throw new Error(\n `Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\n\nexport let ENV: Environment = null;\nexport function setEnvironmentGlobal(environment: Environment) {\n ENV = environment;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace: {_tfGlobals: Map};\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace(): {_tfGlobals: Map} {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (global) !== 'undefined') {\n ns = global;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else if (typeof (self) !== 'undefined') {\n ns = self;\n } else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n\n// tslint:disable-next-line:no-any\nfunction getGlobalMap(): Map {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key: string, init: () => T): T {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n } else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Allow UpperCamelCase variable names\n// tslint:disable: variable-name\n// Unfortunately just enabling PascalCase per file (tslint:enable:\n// allow-pascal-case) doesn't work.\nimport {NamedTensorInfoMap, TensorInfo} from './kernel_registry';\nimport {ExplicitPadding} from './ops/conv_util';\nimport {Activation} from './ops/fused_types';\nimport {DataType, PixelData} from './types';\n\nexport const Abs = 'Abs';\nexport type AbsInputs = UnaryInputs;\n\nexport const Acos = 'Acos';\nexport type AcosInputs = UnaryInputs;\n\nexport const Acosh = 'Acosh';\nexport type AcoshInputs = UnaryInputs;\n\nexport const Add = 'Add';\nexport type AddInputs = BinaryInputs;\n\nexport const AddN = 'AddN';\nexport type AddNInputs = TensorInfo[];\n\nexport const All = 'All';\nexport type AllInputs = Pick;\nexport interface AllAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Any = 'Any';\nexport type AnyInputs = Pick;\nexport interface AnyAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const ArgMax = 'ArgMax';\nexport type ArgMaxInputs = Pick;\nexport interface ArgMaxAttrs {\n axis: number;\n}\n\nexport const ArgMin = 'ArgMin';\nexport type ArgMinInputs = Pick;\nexport interface ArgMinAttrs {\n axis: number;\n}\n\nexport const Asin = 'Asin';\nexport type AsinInputs = UnaryInputs;\n\nexport const Asinh = 'Asinh';\nexport type AsinhInputs = UnaryInputs;\n\nexport const Atan = 'Atan';\nexport type AtanInputs = UnaryInputs;\n\nexport const Atanh = 'Atanh';\nexport type AtanhInputs = UnaryInputs;\n\nexport const Atan2 = 'Atan2';\nexport type Atan2Inputs = BinaryInputs;\n\nexport const AvgPool = 'AvgPool';\nexport type AvgPoolInputs = Pick;\nexport interface AvgPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport type AvgPoolGradInputs = Pick;\nexport interface AvgPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n}\n\nexport const AvgPool3D = 'AvgPool3D';\nexport type AvgPool3DInputs = Pick;\nexport interface AvgPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n dataFormat: 'NDHWC'|'NCDHW';\n}\n\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport type AvgPool3DGradInputs = Pick;\nexport interface AvgPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const BatchMatMul = 'BatchMatMul';\nexport type BatchMatMulInputs = Pick;\nexport interface BatchMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n}\n\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport type BatchToSpaceNDInputs = Pick;\nexport interface BatchToSpaceNDAttrs {\n blockShape: number[];\n crops: number[][];\n}\n\nexport type BinaryInputs = Pick;\n\nexport const Bincount = 'Bincount';\nexport type BincountInputs = Pick;\nexport interface BincountAttrs {\n size: number;\n}\n\nexport const BroadcastTo = 'BroadcastTo';\nexport type BroadcastToInputs = Pick;\nexport interface BroadCastToAttrs {\n shape: number[];\n inputShape: number[]; // for gradient\n}\n\nexport const Cast = 'Cast';\nexport type CastInputs = UnaryInputs;\nexport interface CastAttrs {\n dtype: DataType;\n}\n\nexport const Ceil = 'Ceil';\nexport type CeilInputs = UnaryInputs;\n\nexport const ClipByValue = 'ClipByValue';\nexport type ClipByValueInputs = UnaryInputs;\nexport interface ClipByValueAttrs {\n clipValueMin: number;\n clipValueMax: number;\n}\n\nexport const Complex = 'Complex';\nexport type ComplexInputs = Pick;\n\nexport const ComplexAbs = 'ComplexAbs';\nexport type ComplexAbsInputs = UnaryInputs;\n\nexport const Concat = 'Concat';\nexport type ConcatInputs = TensorInfo[];\nexport interface ConcatAttrs {\n axis: number;\n}\n\nexport const Conv2D = 'Conv2D';\nexport type Conv2DInputs = Pick;\nexport interface Conv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport type Conv2DBackpropFilterInputs = Pick;\nexport interface Conv2DBackpropFilterAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport type Conv2DBackpropInputInputs = Pick;\nexport interface Conv2DBackpropInputAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Conv3D = 'Conv3D';\nexport type Conv3DInputs = Pick;\nexport interface Conv3DAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations: [number, number, number]|number;\n}\n\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport type Conv3DBackpropFilterV2Inputs = Pick;\n\nexport interface Conv3DBackpropFilterV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n filterShape: [number, number, number, number, number];\n}\n\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport type Conv3DBackpropInputV2Inputs =\n Pick;\nexport interface Conv3DBackpropInputV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n inputShape: [number, number, number, number, number];\n}\n\nexport const Cos = 'Cos';\nexport type CosInputs = UnaryInputs;\n\nexport const Cosh = 'Cosh';\nexport type CoshInputs = UnaryInputs;\n\nexport const Cumsum = 'Cumsum';\nexport type CumsumInputs = Pick;\nexport interface CumsumAttrs {\n axis: number;\n exclusive: boolean;\n reverse: boolean;\n}\n\nexport const CropAndResize = 'CropAndResize';\nexport type CropAndResizeInputs =\n Pick;\nexport interface CropAndResizeAttrs {\n cropSize: [number, number];\n method: 'bilinear'|'nearest';\n extrapolationValue: number;\n}\n\nexport const DenseBincount = 'DenseBincount';\nexport type DenseBincountInputs = Pick;\nexport interface DenseBincountAttrs {\n size: number;\n binaryOutput?: boolean;\n}\n\nexport const DepthToSpace = 'DepthToSpace';\nexport type DepthToSpaceInputs = Pick;\nexport interface DepthToSpaceAttrs {\n blockSize: number;\n dataFormat: 'NHWC'|'NCHW';\n}\n\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport type DepthwiseConv2dNativeInputs =\n Pick;\nexport interface DepthwiseConv2dNativeAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const DepthwiseConv2dNativeBackpropFilter =\n 'DepthwiseConv2dNativeBackpropFilter';\nexport type DepthwiseConv2dNativeBackpropFilterInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropFilterAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const DepthwiseConv2dNativeBackpropInput =\n 'DepthwiseConv2dNativeBackpropInput';\nexport type DepthwiseConv2dNativeBackpropInputInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropInputAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Diag = 'Diag';\nexport type DiagInputs = Pick;\n\nexport const Dilation2D = 'Dilation2D';\nexport type Dilation2DInputs = Pick;\nexport interface Dilation2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number]|number;\n}\n\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport type Dilation2DBackpropInputInputs =\n Pick;\n\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport type Dilation2DBackpropFilterInputs =\n Pick;\n\nexport const RealDiv = 'RealDiv';\nexport type RealDivInputs = BinaryInputs;\n\nexport const Einsum = 'Einsum';\nexport type EinsumInputs = TensorInfo[];\nexport interface EinsumAttrs {\n equation: string;\n}\n\nexport const Elu = 'Elu';\nexport type EluInputs = Pick;\n\nexport const EluGrad = 'EluGrad';\nexport type EluGradInputs = Pick;\n\nexport const Erf = 'Erf';\nexport type ErfInputs = UnaryInputs;\n\nexport const Equal = 'Equal';\nexport type EqualInputs = BinaryInputs;\n\nexport const Exp = 'Exp';\nexport type ExpInputs = UnaryInputs;\n\nexport const ExpandDims = 'ExpandDims';\nexport type ExpandDimsInputs = Pick;\nexport interface ExpandDimsAttrs {\n dim: number;\n}\n\nexport const Expm1 = 'Expm1';\nexport type Expm1Inputs = UnaryInputs;\n\nexport const FFT = 'FFT';\nexport type FFTInputs = Pick;\n\nexport const Fill = 'Fill';\nexport interface FillAttrs {\n shape: number[];\n value: number|string;\n dtype: DataType;\n}\n\nexport const FlipLeftRight = 'FlipLeftRight';\nexport type FlipLeftRightInputs = Pick;\n\nexport const Floor = 'Floor';\nexport type FloorInputs = UnaryInputs;\n\nexport const FloorDiv = 'FloorDiv';\nexport type FloorDivInputs = BinaryInputs;\n\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport type FusedBatchNormInputs =\n Pick;\nexport interface FusedBatchNormAttrs {\n varianceEpsilon: number;\n}\n\nexport const GatherV2 = 'GatherV2';\nexport type GatherV2Inputs = Pick;\nexport interface GatherV2Attrs {\n axis: number;\n batchDims: number;\n}\n\nexport const GatherNd = 'GatherNd';\nexport type GatherNdInputs = Pick;\n\nexport const Greater = 'Greater';\nexport type GreaterInputs = BinaryInputs;\n\nexport const GreaterEqual = 'GreaterEqual';\nexport type GreaterEqualInputs = BinaryInputs;\n\nexport const Identity = 'Identity';\nexport type IdentityInputs = Pick;\n\nexport const IFFT = 'IFFT';\nexport type IFFTInputs = Pick;\n\nexport const Imag = 'Imag';\nexport type ImagInputs = Pick;\n\nexport const IsFinite = 'IsFinite';\nexport type IsFiniteInputs = UnaryInputs;\n\nexport const IsInf = 'IsInf';\nexport type IsInfInputs = UnaryInputs;\n\nexport const IsNan = 'IsNan';\nexport type IsNanInputs = UnaryInputs;\n\nexport const LeakyRelu = 'LeakyRelu';\nexport type LeakyReluInputs = Pick;\nexport interface LeakyReluAttrs {\n alpha: number;\n}\n\nexport const Less = 'Less';\nexport type LessInputs = BinaryInputs;\n\nexport const LessEqual = 'LessEqual';\nexport type LessEqualInputs = BinaryInputs;\n\nexport const LinSpace = 'LinSpace';\nexport interface LinSpaceAttrs {\n start: number;\n stop: number;\n num: number;\n}\nexport const Log = 'Log';\nexport type LogInputs = UnaryInputs;\n\nexport const Log1p = 'Log1p';\nexport type Log1pInputs = UnaryInputs;\n\nexport const LogicalAnd = 'LogicalAnd';\nexport type LogicalAndInputs = BinaryInputs;\n\nexport const LogicalNot = 'LogicalNot';\nexport type LogicalNotInputs = Pick;\n\nexport const LogicalOr = 'LogicalOr';\nexport type LogicalOrInputs = BinaryInputs;\n\nexport const LogSoftmax = 'LogSoftmax';\nexport type LogSoftmaxInputs = Pick;\nexport interface LogSoftmaxAttrs {\n axis: number;\n}\n\nexport const LRN = 'LRN';\nexport type LRNInputs = Pick;\nexport interface LRNAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const LRNGrad = 'LRNGrad';\nexport type LRNGradInputs = Pick;\nexport interface LRNGradAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const Max = 'Max';\nexport type MaxInputs = Pick;\nexport interface MaxAttrs {\n reductionIndices: number|number[];\n keepDims: boolean;\n}\n\nexport const Maximum = 'Maximum';\nexport type MaximumInputs = BinaryInputs;\n\nexport const MaxPool = 'MaxPool';\nexport type MaxPoolInputs = Pick;\nexport interface MaxPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport type MaxPoolGradInputs = Pick;\nexport interface MaxPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3D = 'MaxPool3D';\nexport type MaxPool3DInputs = Pick;\nexport interface MaxPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NDHWC'|'NCDHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport type MaxPool3DGradInputs =\n Pick;\nexport interface MaxPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport type MaxPoolWithArgmaxInputs = Pick;\nexport interface MaxPoolWithArgmaxAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n includeBatchInIndex: boolean;\n}\n\nexport const Mean = 'Mean';\nexport type MeanInputs = Pick;\nexport interface MeanAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Min = 'Min';\nexport type MinInputs = Pick;\nexport interface MinAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Minimum = 'Minimum';\nexport type MinimumInputs = BinaryInputs;\n\nexport const MirrorPad = 'MirrorPad';\nexport type MirrorPadInputs = Pick;\nexport interface MirrorPadAttrs {\n paddings: Array<[number, number]>;\n mode: 'reflect'|'symmetric';\n}\n\nexport const Mod = 'Mod';\nexport type ModInputs = BinaryInputs;\n\nexport const Multinomial = 'Multinomial';\nexport type MultinomialInputs = Pick;\nexport interface MultinomialAttrs {\n numSamples: number;\n seed: number;\n normalized: boolean;\n}\n\nexport const Multiply = 'Multiply';\nexport type MultiplyInputs = BinaryInputs;\n\nexport const Neg = 'Neg';\nexport type NegInputs = UnaryInputs;\n\nexport const NotEqual = 'NotEqual';\nexport type NotEqualInputs = BinaryInputs;\n\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport type NonMaxSuppressionV3Inputs =\n Pick;\nexport interface NonMaxSuppressionV3Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n}\n\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport type NonMaxSuppressionV4Inputs =\n Pick;\nexport interface NonMaxSuppressionV4Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n padToMaxOutputSize: boolean;\n}\n\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport type NonMaxSuppressionV5Inputs =\n Pick;\nexport interface NonMaxSuppressionV5Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n softNmsSigma: number;\n}\n\nexport const OnesLike = 'OnesLike';\nexport type OnesLikeInputs = UnaryInputs;\n\nexport const OneHot = 'OneHot';\nexport type OneHotInputs = Pick;\nexport interface OneHotAttrs {\n depth: number;\n onValue: number;\n offValue: number;\n}\n\nexport const Pack = 'Pack';\nexport type PackInputs = TensorInfo[];\nexport interface PackAttrs {\n axis: number;\n}\n\nexport const PadV2 = 'PadV2';\nexport type PadV2Inputs = Pick;\nexport interface PadV2Attrs {\n paddings: Array<[number, number]>;\n constantValue: number;\n}\n\nexport const Pool = 'Pool';\nexport type PoolInputs = Pick;\n\nexport const Pow = 'Pow';\nexport type PowInputs = BinaryInputs;\n\nexport const Prelu = 'Prelu';\nexport type PreluInputs = Pick;\n\nexport const Prod = 'Prod';\nexport type ProdInputs = Pick;\nexport interface ProdAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Range = 'Range';\nexport interface RangeAttrs {\n start: number;\n stop: number;\n step: number;\n dtype: 'float32'|'int32';\n}\n\nexport const Real = 'Real';\nexport type RealInputs = Pick;\n\nexport const Reciprocal = 'Reciprocal';\nexport type ReciprocalInputs = UnaryInputs;\n\nexport const Relu = 'Relu';\nexport type ReluInputs = Pick;\n\nexport const Reshape = 'Reshape';\nexport type ReshapeInputs = Pick;\nexport interface ReshapeAttrs {\n shape: number[];\n}\n\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport type ResizeNearestNeighborInputs = Pick;\nexport interface ResizeNearestNeighborAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport type ResizeNearestNeighborGradInputs =\n Pick;\nexport type ResizeNearestNeighborGradAttrs = ResizeNearestNeighborAttrs;\n\nexport const ResizeBilinear = 'ResizeBilinear';\nexport type ResizeBilinearInputs = Pick;\nexport interface ResizeBilinearAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport type ResizeBilinearGradInputs = Pick;\nexport type ResizeBilinearGradAttrs = ResizeBilinearAttrs;\n\nexport const Relu6 = 'Relu6';\nexport type Relu6Inputs = Pick;\n\nexport const Reverse = 'Reverse';\nexport type ReverseInputs = Pick;\nexport interface ReverseAttrs {\n dims: number|number[];\n}\n\nexport const Round = 'Round';\nexport type RoundInputs = UnaryInputs;\n\nexport const Rsqrt = 'Rsqrt';\nexport type RsqrtInputs = UnaryInputs;\n\nexport const ScatterNd = 'ScatterNd';\nexport type ScatterNdInputs = Pick;\nexport interface ScatterNdAttrs {\n shape: number[];\n}\n\nexport const Select = 'Select';\nexport type SelectInputs = Pick;\n\nexport const Selu = 'Selu';\nexport type SeluInputs = Pick;\n\nexport const Slice = 'Slice';\nexport type SliceInputs = Pick;\nexport interface SliceAttrs {\n begin: number|number[];\n size: number|number[];\n}\nexport const Sin = 'Sin';\nexport type SinInputs = UnaryInputs;\n\nexport const Sinh = 'Sinh';\nexport type SinhInputs = UnaryInputs;\n\nexport const Sign = 'Sign';\nexport type SignInputs = UnaryInputs;\n\nexport const Sigmoid = 'Sigmoid';\nexport type SigmoidInputs = UnaryInputs;\n\nexport const Softplus = 'Softplus';\nexport type SoftplusInputs = UnaryInputs;\n\nexport const Sqrt = 'Sqrt';\nexport type SqrtInputs = UnaryInputs;\n\nexport const Sum = 'Sum';\nexport type SumInputs = Pick;\nexport interface SumAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport type SpaceToBatchNDInputs = Pick;\nexport interface SpaceToBatchNDAttrs {\n blockShape: number[];\n paddings: number[][];\n}\n\nexport const SplitV = 'SplitV';\nexport type SplitVInputs = Pick;\nexport interface SplitVAttrs {\n numOrSizeSplits: number[]|number;\n axis: number;\n}\n\nexport const Softmax = 'Softmax';\nexport type SoftmaxInputs = Pick;\nexport interface SoftmaxAttrs {\n dim: number;\n}\n\nexport const SparseReshape = 'SparseReshape';\nexport type SparseReshapeInputs =\n Pick;\n\nexport const SparseToDense = 'SparseToDense';\nexport type SparseToDenseInputs =\n Pick;\nexport interface SparseToDenseAttrs {\n outputShape: number[];\n}\n\nexport const SquaredDifference = 'SquaredDifference';\nexport type SquaredDifferenceInputs = BinaryInputs;\n\nexport const Square = 'Square';\nexport type SquareInputs = Pick;\n\nexport const StridedSlice = 'StridedSlice';\nexport type StridedSliceInputs = Pick;\nexport interface StridedSliceAttrs {\n begin: number[];\n end: number[];\n strides: number[];\n beginMask: number;\n endMask: number;\n ellipsisMask: number;\n newAxisMask: number;\n shrinkAxisMask: number;\n}\n\nexport const Sub = 'Sub';\nexport type SubInputs = BinaryInputs;\n\nexport const Tan = 'Tan';\nexport type TanInputs = UnaryInputs;\n\nexport const Tanh = 'Tanh';\nexport type TanhInputs = UnaryInputs;\n\nexport const Tile = 'Tile';\nexport type TileInputs = Pick;\nexport interface TileAttrs {\n reps: number[];\n}\n\nexport const TopK = 'TopK';\nexport type TopKInputs = Pick;\nexport interface TopKAttrs {\n k: number;\n sorted: boolean;\n}\n\nexport const Transform = 'Transform';\nexport type TransformInputs = Pick;\nexport interface TransformAttrs {\n interpolation: 'nearest'|'bilinear';\n fillMode: 'constant'|'reflect'|'wrap'|'nearest';\n fillValue: number;\n outputShape?: [number, number];\n}\n\nexport const Transpose = 'Transpose';\nexport type TransposeInputs = Pick;\nexport interface TransposeAttrs {\n perm: number[];\n}\n\nexport const Unique = 'Unique';\nexport type UniqueInputs = Pick;\nexport interface UniqueAttrs {\n axis: number;\n}\n\nexport type UnaryInputs = Pick;\n\nexport const Unpack = 'Unpack';\nexport type UnpackInputs = Pick;\nexport interface UnpackAttrs {\n axis: number;\n}\n\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport type UnsortedSegmentSumInputs =\n Pick;\nexport interface UnsortedSegmentSumAttrs {\n numSegments: number;\n}\n\nexport const ZerosLike = 'ZerosLike';\nexport type ZerosLikeInputs = UnaryInputs;\n\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport type StepInputs = UnaryInputs;\nexport interface StepAttrs {\n alpha: number;\n}\n\nexport const FromPixels = 'FromPixels';\nexport interface FromPixelsInputs {\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap;\n}\nexport interface FromPixelsAttrs {\n numChannels: number;\n}\n\nexport const RotateWithOffset = 'RotateWithOffset';\nexport type RotateWithOffsetInputs = Pick;\nexport interface RotateWithOffsetAttrs {\n radians: number;\n fillValue: number|[number, number, number];\n center: number|[number, number];\n}\n\nexport const _FusedMatMul = '_FusedMatMul';\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulInputs extends NamedTensorInfoMap {\n a: TensorInfo;\n b: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedConv2D = 'FusedConv2D';\nexport interface FusedConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\nexport interface FusedDepthwiseConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedDepthwiseConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from './environment';\n\nimport {getGlobal} from './global_util';\nimport {NamedGradientMap} from './tape';\nimport {Tensor} from './tensor';\nimport {DataType, RecursiveArray} from './types';\n\nconst kernelRegistry =\n getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry =\n getGlobal('gradRegistry', () => new Map());\n\nexport type DataId = object;\n\ntype AttributeValue =\n number|number[]|boolean|boolean[]|string|string[]|NamedAttrMap;\n\n/** These are extra non-tensor/primitive params passed to kernel functions. */\nexport type Attribute = AttributeValue|RecursiveArray;\n\n/** Specifies the code to run when executing a kernel. */\nexport type KernelFunc = (params: {\n inputs: NamedTensorInfoMap,\n backend: {},\n attrs?: NamedAttrMap,\n}) => TensorInfo|TensorInfo[];\n\n/** The function to run when computing a gradient during backprop. */\nexport type GradFunc =\n (dy: Tensor|Tensor[], saved: Tensor[], attrs: NamedAttrMap) =>\n NamedGradientMap;\n\n/** Function that gets called after the backend initializes. */\nexport type KernelSetupFunc = (backend: {}) => void;\n/** Function that gets called right before the backend is disposed. */\nexport type KernelDisposeFunc = KernelSetupFunc;\n\n/** Config object for registering a kernel in the global registry. */\nexport interface KernelConfig {\n kernelName: string;\n backendName: string;\n kernelFunc: KernelFunc;\n setupFunc?: KernelSetupFunc;\n disposeFunc?: KernelDisposeFunc;\n}\n\n/** Config object for registering a gradient in the global registry. */\nexport interface GradConfig {\n kernelName: string;\n inputsToSave?: string[];\n // When saveAllInputs is true, all inputs will be saved. Only use this flag\n // if inputs is an array of Tensors.\n saveAllInputs?: boolean;\n outputsToSave?: boolean[];\n gradFunc: GradFunc;\n}\n\n/** Holds metadata for a given tensor. */\nexport interface TensorInfo {\n dataId: DataId;\n shape: number[];\n dtype: DataType;\n}\n\nexport interface NamedTensorInfoMap {\n [name: string]: TensorInfo;\n}\n\nexport interface NamedAttrMap {\n [name: string]: Attribute;\n}\n\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(\n kernelName: string, backendName: string): KernelConfig {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName: string): GradConfig {\n return gradRegistry.get(kernelName);\n}\n\nexport function getKernelsForBackend(backendName: string): KernelConfig[] {\n const it = kernelRegistry.entries();\n const result: KernelConfig[] = [];\n\n while (true) {\n const {done, value} = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend, ] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config: KernelConfig) {\n const {kernelName, backendName} = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config: GradConfig) {\n const {kernelName} = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(\n kernelName: string, backendName: string): void {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName: string): void {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(\n `The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(\n registeredBackendName: string, newBackendName: string): void {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig =\n Object.assign({}, kernelConfig, {backendName: newBackendName});\n registerKernel(newKernelConfig);\n });\n}\n\nfunction makeKey(kernelName: string, backendName: string) {\n return `${backendName}_${kernelName}`;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\nimport {BackendValues, DataType, TensorLike, TypedArray} from './types';\nimport * as base from './util_base';\nexport * from './util_base';\n\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(\n value: DataType, dtype: DataType): BackendValues {\n if (dtype === 'string') {\n return encodeString(value);\n }\n\n return toTypedArray([value], dtype);\n}\n\nfunction noConversionNeeded(a: TensorLike, dtype: DataType): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function toTypedArray(a: TensorLike, dtype: DataType): TypedArray {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a as number[], dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a as TypedArray;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a as number[]);\n } else if (dtype === 'int32') {\n return new Int32Array(a as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array((a as number[]).length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round((a as number[])[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now(): number {\n return env().platform.now();\n}\n\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(\n path: string, requestInits?: RequestInit): Promise {\n return env().platform.fetch(path, requestInits);\n}\n\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s: string, encoding = 'utf-8'): Uint8Array {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes: Uint8Array, encoding = 'utf-8'): string {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer, BackendTimingInfo} from './backends/backend';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport {DataType, DataTypeMap, TypedArray} from './types';\nimport * as util from './util';\n\nexport type KernelProfile = {\n kernelName: string,\n outputs: Tensor[],\n inputs: NamedTensorMap,\n timeMs: Promise,\n extraInfo: Promise\n};\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(kernelName: string, inputs: NamedTensorMap, f: () => Tensor[]):\n KernelProfile {\n let outputs: Tensor[];\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer: Promise;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n } else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({kernelMs: util.now() - start});\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(\n timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n\n logKernelProfile(kernelProfile: KernelProfile): void {\n const {kernelName, outputs, timeMs, inputs, extraInfo} = kernelProfile;\n\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(\n kernelName, result, valueContainer[0], valueContainer[1], inputs,\n valueContainer[2]);\n });\n });\n }\n}\n\nexport function checkComputationForErrors(\n vals: DataTypeMap[D], dtype: D, kernelName: string): boolean {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray,\n timeMs: number|{error: string}, inputs: NamedTensorMap,\n extraInfo?: string) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${\n inputShapesDescription}\\t%c${extraInfo}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange',\n 'color: green', 'color: steelblue');\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n kernelName: string;\n outputs: Tensor[];\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dys: Tensor[]) => NamedGradientMap;\n saved?: Tensor[];\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[], tidy: (f: Function) => Tensor,\n add: (a: Tensor, b: Tensor) => Tensor) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dys: Tensor[] = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n } else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, isString, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples =\n dtype === 'complex64' ? createComplexTuples(vals) : vals;\n\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(\n padPerCol[j],\n valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(\n val: number|string|[number, number], pad: number, dtype: DataType) {\n let valStr: string;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n } else if (isString(val)) {\n valStr = `'${val}'`;\n } else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n } else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n\n return rightPad(valStr, pad);\n}\n\nfunction boolNumToString(v: number): string {\n return v === 0 ? 'false' : 'true';\n}\n\nfunction subTensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[], padPerCol: number[], isLast = true): string[] {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0] as number)];\n }\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n\n let firstVals = Array.from(\n vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice(\n (size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement,\n size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals: Array =\n dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n\nfunction createComplexTuples(vals: Array<{}>|\n TypedArray): Array<[number, number]> {\n const complexTuples: Array<[number, number]> = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]] as [number, number]);\n }\n return complexTuples;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {getGlobal} from './global_util';\nimport {tensorToString} from './tensor_format';\nimport {ArrayMap, BackendValues, DataType, DataTypeMap, DataValues, NumericDataType, Rank, ShapeMap, SingleValueMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides, toNestedArray} from './util';\n\nexport interface TensorData {\n dataId?: DataId;\n values?: DataTypeMap[D];\n}\n\n// This interface mimics KernelBackend (in backend.ts), which would create a\n// circular dependency if imported.\nexport interface Backend {}\n\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: DataTypeMap[D];\n\n constructor(shape: ShapeMap[R], public dtype: D, values?: DataTypeMap[D]) {\n this.shape = shape.slice() as ShapeMap[R];\n this.size = util.sizeFromShape(shape);\n\n if (values != null) {\n const n = values.length;\n util.assert(\n n === this.size,\n () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value: SingleValueMap[D], ...locs: number[]): void {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n\n const index = this.locToIndex(locs);\n this.values[index] = value as number;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs: number[]): SingleValueMap[D] {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index] as SingleValueMap[D];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor(): Tensor {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype) as\n Tensor;\n }\n}\n\nexport interface TensorTracker {\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: Backend): Tensor;\n makeVariable(\n initialValue: Tensor, trainable?: boolean, name?: string,\n dtype?: DataType): Variable;\n incRef(a: Tensor, backend: Backend): void;\n disposeTensor(t: Tensor): void;\n disposeVariable(v: Variable): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: D,\n values?: DataTypeMap[D]): TensorBuffer;\n print(x: T, verbose: boolean): void;\n clone(x: T): T;\n // TODO(yassogba) bring reshape back?\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn: (msg: string) => void = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn: (msg: string) => void) {\n deprecationWarningFn = fn;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n// Declare this namespace to make Tensor class augmentation work in google3.\nexport declare namespace Tensor {}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /** Whether this tensor has been globally kept. */\n kept = false;\n /** The id of the scope this tensor is being tracked in. */\n scopeId: number;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {\n this.shape = shape.slice() as ShapeMap[R];\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer(): Promise> {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype as D, vals);\n }\n\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype as D, this.dataSync());\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array(): Promise {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync(): ArrayMap[R] {\n return toNestedArray(\n this.shape, this.dataSync(), this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data(): Promise {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data as Uint8Array[];\n try {\n return bytes.map(b => util.decodeString(b)) as DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as Promise;\n }\n\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync(): DataTypeMap[D] {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return (data as Uint8Array[]).map(b => util.decodeString(b)) as\n DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as DataTypeMap[D];\n }\n\n /** Returns the underlying bytes of the tensor's data. */\n async bytes(): Promise {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data as Uint8Array[];\n } else {\n return new Uint8Array((data as TypedArray).buffer);\n }\n }\n\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n protected isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype);\n }\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype) as\n Variable;\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\n\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n\nexport interface NumericTensor extends Tensor {\n dtype: NumericDataType;\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\nexport interface StringTensor extends Tensor {\n dtype: 'string';\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n name: string;\n\n constructor(\n initialValue: Tensor, public trainable: boolean, name: string,\n tensorId: number) {\n super(\n initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.name = name;\n }\n\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n\n dispose(): void {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\n\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {TensorContainer, TensorContainerArray} from './tensor_types';\nimport {upcastType} from './types';\nimport {assert} from './util';\n\nexport function makeTypesMatch(a: T, b: T): [T, T] {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n return tensorList.some(x => x.id === tensor.id);\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @docalias number[] */\nexport interface ArrayMap {\n R0: number;\n R1: number[];\n R2: number[][];\n R3: number[][][];\n R4: number[][][][];\n R5: number[][][][][];\n R6: number[][][][][][];\n}\n\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n complex64: Float32Array;\n string: string[];\n}\n\nexport interface SingleValueMap {\n bool: boolean;\n int32: number;\n float32: number;\n complex64: number;\n string: string;\n}\n\n/** @docalias 'float32'|'int32'|'bool'|'complex64'|'string' */\nexport type DataType = keyof DataTypeMap;\nexport type NumericDataType = 'float32'|'int32'|'bool'|'complex64';\nexport type TypedArray = Float32Array|Int32Array|Uint8Array;\n/** Tensor data used in tensor creation and user-facing API. */\nexport type DataValues = DataTypeMap[DataType];\n/** The underlying tensor data that gets stored in a backend. */\nexport type BackendValues = Float32Array|Int32Array|Uint8Array|Uint8Array[];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool',\n 'complex64' = 'complex64'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastComplex64AndMap {\n 'float32' = 'complex64',\n 'int32' = 'complex64',\n 'bool' = 'complex64',\n 'complex64' = 'complex64'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType): DataType {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|string|RecursiveArray|\n RecursiveArray|RecursiveArray|Uint8Array[];\nexport type ScalarLike = number|boolean|string|Uint8Array;\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[]|string[]|Uint8Array[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][]|\n string[]|string[][]|Uint8Array[]|Uint8Array[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D = TypedArray|number[]|number[][][]|boolean[]|\n boolean[][][]|string[]|string[][][]|Uint8Array[]|Uint8Array[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D = TypedArray|number[]|number[][][][]|boolean[]|\n boolean[][][][]|string[]|string[][][][]|Uint8Array[]|Uint8Array[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][]|string[]|\n string[][][][][]|Uint8Array[]|Uint8Array[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][]|\n string[]|string[][][][][][]|Uint8Array[]|Uint8Array[][][][][];\n\n/** Type for representing image data in Uint8Array type. */\nexport interface PixelData {\n width: number;\n height: number;\n data: Uint8Array;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, DataMover, KernelBackend} from './backends/backend';\nimport {Environment, setEnvironmentGlobal} from './environment';\nimport {getGlobalNamespace} from './global_util';\nimport {Add, Cast, Identity} from './kernel_names';\nimport {getGradient, getKernel, getKernelsForBackend, GradFunc, NamedAttrMap, TensorInfo} from './kernel_registry';\nimport {KernelProfile, Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, TapeNode} from './tape';\nimport {DataId, setTensorTracker, Tensor, TensorTracker, Variable} from './tensor';\nimport {GradSaveFunc, NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\nimport {BackendValues, DataType, DataValues} from './types';\nimport * as util from './util';\nimport {bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backward pass.\n */\nexport type ForwardFunc = (backend: KernelBackend, save?: GradSaveFunc) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,..., save?: Function) => {\n * value: Tensor,\n * gradFunc: (dy: Tensor, saved?: NamedTensorMap) => Tensor | Tensor[]\n * }\n */\nexport type CustomGradientFunc =\n (...inputs: Array) => {\n value: T;\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[];\n };\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean; reasons: string[];\n};\n\ntype KernelInfo = {\n name: string; bytesAdded: number; totalBytesSnapshot: number;\n tensorsAdded: number;\n totalTensorsSnapshot: number;\n inputShapes: number[][];\n outputShapes: number[][];\n kernelTimeMs: number | {error: string} | Promise;\n extraInfo: string | Promise;\n};\n\nexport type ProfileInfo = {\n newBytes: number; newTensors: number; peakBytes: number;\n kernels: KernelInfo[];\n result: TensorContainer;\n kernelNames: string[];\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n id: number;\n}\n\ninterface RegisteredKernelInvocation {\n kernelName: string;\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\ninterface CustomGradKernelInvocation {\n forwardFunc: ForwardFunc;\n backwardsFunc: (dy: T, saved: Tensor[]) => {\n [P in keyof I]: () => I[P]\n };\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\nfunction isRegisteredKernelInvocation(\n kernelInvocation: RegisteredKernelInvocation|\n CustomGradKernelInvocation):\n kernelInvocation is RegisteredKernelInvocation {\n return (kernelInvocation as RegisteredKernelInvocation).kernelName != null;\n}\n\nclass EngineState {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n nextTapeNodeId = 0;\n numBytes = 0;\n numTensors = 0;\n numStringTensors = 0;\n numDataBuffers = 0;\n\n activeTape: TapeNode[];\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n kernelDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n activeScope: ScopeState;\n scopeStack: ScopeState[] = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n numDataMovesStack: number[] = [];\n nextScopeId = 0;\n\n tensorInfo = new WeakMap();\n\n profiling = false;\n activeProfile: ProfileInfo = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames():\n string[] {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\n\nexport class Engine implements TensorTracker, DataMover {\n state: EngineState;\n backendName: string;\n registry: {[id: string]: KernelBackend} = {};\n registryFactory: {\n [id: string]: {\n factory: () => KernelBackend | Promise,\n priority: number\n }\n } = {};\n\n private profiler: Profiler;\n private backendInstance: KernelBackend;\n private pendingBackendInit: Promise;\n private pendingBackendInitId = 0;\n\n constructor(public ENV: Environment) {\n this.state = new EngineState();\n }\n\n async ready(): Promise {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => {});\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n get backend(): KernelBackend {\n if (this.pendingBackendInit != null) {\n throw new Error(\n `Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const {name, asyncInit} = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(\n `The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n\n backendNames(): string[] {\n return Object.keys(this.registryFactory);\n }\n\n findBackend(backendName: string): KernelBackend {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const {asyncInit} = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n } else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n\n findBackendFactory(backendName: string):\n () => KernelBackend | Promise {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n\n registerBackend(\n backendName: string,\n factory: () => KernelBackend | Promise,\n priority = 1): boolean {\n if (backendName in this.registryFactory) {\n console.warn(\n `${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = {factory, priority};\n return true;\n }\n\n async setBackend(backendName: string): Promise {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const {success, asyncInit} = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n\n return true;\n }\n\n private setupRegisteredKernels(): void {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n\n private disposeRegisteredKernels(backendName: string): void {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n private initializeBackend(backendName: string):\n {success: boolean|Promise, asyncInit: boolean} {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(\n `Cannot initialize backend ${backendName}, no registration found.`);\n }\n\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success =\n backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(\n `Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return {success, asyncInit: true};\n } else {\n this.registry[backendName] = backend as KernelBackend;\n return {success: true, asyncInit: false};\n }\n } catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return {success: false, asyncInit: false};\n }\n }\n\n removeBackend(backendName: string): void {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n\n delete this.registryFactory[backendName];\n\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n\n private getSortedBackends(): string[] {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a: string, b: string) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n\n private initializeBackendsAndReturnBest():\n {name: string, asyncInit: boolean} {\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const {success, asyncInit} = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return {name: backendName, asyncInit};\n }\n }\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n moveData(backend: KernelBackend, dataId: DataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n\n tidy(nameOrFn: string|ScopeFn, fn?: ScopeFn):\n T {\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n private static nextTensorId = 0;\n private nextTensorId(): number {\n return Engine.nextTensorId++;\n }\n\n private static nextVariableId = 0;\n private nextVariableId(): number {\n return Engine.nextVariableId++;\n }\n\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n private clone(x: Tensor): Tensor {\n const y: Tensor = ENGINE.runKernel(Identity, {x} as {} as NamedTensorMap);\n const inputs = {x};\n const grad = (dy: Tensor) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {x: dy};\n const attrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, gradInputs as {} as NamedTensorMap,\n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs as {} as NamedAttrMap) as Tensor;\n }\n });\n const saved: Tensor[] = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(\n kernelName: string, inputs: NamedTensorMap, attrs?: NamedAttrMap): T {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${\n this.backendName}'`);\n }\n return this.runKernelFunc({kernelName, inputs, attrs});\n }\n\n private shouldCheckForMemLeaks(): boolean {\n return this.ENV.getBool('IS_TEST');\n }\n\n private checkKernelForMemLeak(\n kernelName: string, numDataIdsBefore: number,\n outInfos: TensorInfo[]): void {\n const numDataIdsAfter = this.backend.numDataIds();\n\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves =\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked =\n numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(\n `Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n private runKernelFunc(\n kernelParams: RegisteredKernelInvocation|\n CustomGradKernelInvocation): T {\n let outputs: Tensor[];\n let saved: Tensor[] = [];\n const isTapeOn = this.isTapeOn();\n\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n\n let kernelFunc: () => Tensor[];\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n\n let out: TensorInfo|TensorInfo[];\n\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n\n if (isRegisteredKernelInvocation(kernelParams)) {\n const {kernelName, inputs, attrs} = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(\n kernel != null,\n () => `Cannot find registered kernel '${kernelName}' for backend '${\n this.backendName}'`);\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({inputs, attrs, backend: this.backend});\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n\n const outTensors = outInfos.map((outInfo: TensorInfo|Tensor) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if ((outInfo as Tensor).rank != null) {\n return outInfo as Tensor;\n }\n const {dataId, shape, dtype} = outInfo as TensorInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n\n // Save any required inputs and outputs.\n\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave =\n this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n } else {\n const {forwardFunc} = kernelParams;\n // Running a customGrad op.\n const saveFunc: GradSaveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]) as Tensor[];\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const {inputs, attrs} = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n\n let kernelProfile: KernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n } else {\n kernelProfile = this.profiler.profileKernel(\n kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n\n if (isTapeOn) {\n this.addTapeNode(\n kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(\n key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]) as T;\n }\n\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n private saveTensorsForBackwardMode(tensors: Tensor[]): Tensor[] {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n private getTensorsForGradient(\n kernelName: string, inputs: NamedTensorMap,\n outputs: Tensor[]): Tensor[]|null {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave: string[] = gradConfig.inputsToSave || [];\n const outputsToSave: boolean[] = gradConfig.outputsToSave || [];\n\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave: Tensor[];\n if (gradConfig.saveAllInputs) {\n util.assert(\n Array.isArray(inputs),\n () => 'saveAllInputs is true, expected inputs to be an array.');\n\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n } else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n\n const outputTensorsToSave: Tensor[] =\n outputs.filter((_, i) => outputsToSave[i]);\n\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values as BackendValues;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = (values as string[]).map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals as Uint8Array[]);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(\n dataId: DataId, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n\n makeVariable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n\n trackTensor(a: Tensor, backend: KernelBackend): void {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a: Tensor, backend: KernelBackend): void {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n\n removeDataId(dataId: DataId, backend: KernelBackend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a: Tensor): void {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n\n disposeVariable(v: Variable): void {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push(\n 'Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n\n async profile(query: () => (TensorContainer | Promise)):\n Promise {\n this.state.profiling = true;\n\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n\n this.state.profiling = false;\n\n this.state.activeProfile.peakBytes = Math.max(\n ...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n\n isTapeOn(): boolean {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n\n private addTapeNode(\n kernelName: string, inputs: NamedTensorMap, outputs: Tensor[],\n gradientsFunc: GradFunc, saved: Tensor[], attrs: NamedAttrMap): void {\n const tapeNode: TapeNode =\n {id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved};\n\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys: Tensor[]) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n result.kept = true;\n return result;\n }\n\n private startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n\n private endTape() {\n this.state.gradientDepth--;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string) {\n const scopeInfo: ScopeState = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet =\n new Set(tensorsToTrackInParent.map(t => t.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(\n xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(\n () => this.startTape(), () => this.endTape(),\n () => this.tidy('forward', f));\n\n util.assert(\n y instanceof Tensor,\n () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(\n accumulatedGradientMap, filteredTape,\n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f as ScopeFn),\n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return {value: y, grads};\n });\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Array) => T {\n util.assert(\n util.isFunction(f),\n () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n\n let res: {\n value: T,\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[],\n };\n const inputMap: NamedTensorMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n\n const forwardFunc: ForwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(\n res.value instanceof Tensor,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(res.gradFunc),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n\n const backwardsFunc = (dy: T, saved: Tensor[]) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads: Tensor[] = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(\n grads.length === inputs.length,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap: {[key: string]: () => Tensor} = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n\n readSync(dataId: DataId): BackendValues {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n\n return result;\n }\n\n get registeredVariables(): NamedVariableMap {\n return this.state.registeredVariables;\n }\n\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset(): void {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\n\nexport function getOrMakeEngine(): Engine {\n const ns = getGlobalNamespace() as {} as {_tfengine: Engine};\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\n\nexport const ENGINE = getOrMakeEngine();\n\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a: Tensor, b: Tensor): Tensor {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = {a, b};\n return ENGINE.runKernel(Add, inputs as {} as NamedTensorMap);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// tslint:disable-next-line:no-any\nfunction _isNavigatorDefined(): boolean {\n return typeof navigator !== 'undefined' && navigator != null;\n}\n\nexport function isMobile(nav?: Navigator): boolean {\n if (nav || _isNavigatorDefined()) {\n if (!nav) {\n nav = navigator;\n }\n if (nav.product === 'ReactNative') {\n return true;\n }\n\n // tslint:disable-next-line:no-any\n const a = nav.userAgent || nav.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n }\n return false;\n}\n\nexport function isBrowser(): boolean {\n return (typeof window !== 'undefined' && window.document != null) ||\n //@ts-ignore\n (typeof WorkerGlobalScope !== 'undefined');\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport './engine';\n\nimport * as device_util from './device_util';\nimport {env} from './environment';\n\nconst ENV = env();\n\n/**\n * This file contains environment-related flag registrations.\n */\n\n/** Whether to enable debug mode. */\nENV.registerFlag('DEBUG', () => false, debugValue => {\n if (debugValue) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n});\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag('IS_BROWSER', () => device_util.isBrowser());\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag(\n 'IS_NODE',\n () => (typeof process !== 'undefined') &&\n (typeof process.versions !== 'undefined') &&\n (typeof process.versions.node !== 'undefined'));\n\n/** Whether this browser is Chrome. */\nENV.registerFlag(\n 'IS_CHROME',\n () => typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor));\n\n/**\n * True when the environment is \"production\" where we disable safety checks\n * to gain performance.\n */\nENV.registerFlag('PROD', () => false);\n\n/**\n * Whether to do sanity checks when inferring a shape from user-provided\n * values, used when creating a new tensor.\n */\nENV.registerFlag(\n 'TENSORLIKE_CHECK_SHAPE_CONSISTENCY', () => ENV.getBool('DEBUG'));\n\n/** Whether deprecation warnings are enabled. */\nENV.registerFlag('DEPRECATION_WARNINGS_ENABLED', () => true);\n\n/** True if running unit tests. */\nENV.registerFlag('IS_TEST', () => false);\n\n/** Whether to check computation result for errors. */\nENV.registerFlag('CHECK_COMPUTATION_FOR_ERRORS', () => true);\n\n/** Whether the backend needs to wrap input to imageBitmap. */\nENV.registerFlag('WRAP_TO_IMAGEBITMAP', () => false);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from './engine';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {DataType, TensorLike} from './types';\nimport {assert, flatten, inferDtype, isTypedArray, toTypedArray} from './util';\n\nexport function inferShape(val: TensorLike, dtype?: DataType): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: TensorLike, shape: number[], indices: number[]) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nfunction assertDtype(\n expectedDtype: DataType|'numeric'|'string_or_numeric',\n actualDType: DataType, argName: string, functionName: string) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype as DataType;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : (x as {}).constructor.name;\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype as DataType) :\n flatten(x as string[], [], skipTypedArray) as string[];\n return ENGINE.makeTensor(values, inferredShape, inferredDtype) as T;\n}\n\nexport function convertToTensorArray(\n arg: Array, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) =>\n convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {isPromise} from '../util';\n\nexport const OP_SCOPE_SUFFIX = '__op';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n } catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Complex, ComplexInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real: T|TensorLike, imag: T|TensorLike): T {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch(\n $real.shape, $imag.shape,\n `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n\n const inputs: ComplexInputs = {real: $real, imag: $imag};\n return ENGINE.runKernel(Complex, inputs as {} as NamedTensorMap);\n}\n\nexport const complex = op({complex_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Tensor} from '../tensor';\nimport {TensorLike, TypedArray} from '../types';\nimport {DataType} from '../types';\nimport {assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray} from '../util';\n\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(\n values: TensorLike, shape: number[], inferredShape: number[],\n dtype?: DataType): Tensor {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error(\n 'values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(\n providedSize === inferredSize,\n () =>\n `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(\n inferredShape[i] === shape[i] || !flatDimsDontMatch,\n () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values as string[], [], true) as string[];\n return ENGINE.makeTensor(values as TypedArray, shape, dtype);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {inferShape} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {DataType, Rank, ShapeMap} from '../types';\n\nimport {makeTensor} from './tensor_ops_util';\n\n/**\n * Creates a `tf.Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`. If the values are strings,\n * they will be encoded as utf-8 and kept as `Uint8Array[]`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function tensor(\n values: TensorLike, shape?: ShapeMap[R], dtype?: DataType): Tensor {\n const inferredShape = inferShape(values, dtype);\n return makeTensor(values, shape, inferredShape, dtype) as Tensor;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'float16': 2,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n 'complex64': 8\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * Group to which the weight belongs.\n *\n * - 'optimizer': Weight from a stateful optimizer.\n */\nexport type WeightGroup = 'model'|'optimizer';\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool'|'string'|'complex64';\n\n /**\n * Type of the weight.\n *\n * Optional.\n *\n * The value 'optimizer' indicates the weight belongs to an optimizer\n * (i.e., used only during model training and not during inference).\n */\n group?: WeightGroup;\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale?: number, // The scaling constant to multiply by.\n min?: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8'|'float16' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n * @innamespace io\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * non-trainable ones.\n */\n trainableOnly?: boolean;\n\n /**\n * Whether the optimizer will be saved (if exists).\n *\n * Default: `false`.\n */\n includeOptimizer?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * TODO (cais,yassogba) consider removing GraphDef as GraphDefs now\n * come in a JSON format and none of our IOHandlers support a non json\n * format. We could conder replacing this with 'Binary' if we want to\n * allow future handlers to save to non json formats (though they will\n * probably want more information than 'Binary').\n * Type of the model topology\n *\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocol buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/** Model training configuration. */\nexport declare interface TrainingConfig {\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n // See\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tfjs-layers/blob/master/src/keras_format/training_config.ts\n /** Optimizer used for the model training. */\n optimizer_config: {};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Loss function(s) for the model's output(s). */\n loss: string|string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Metric function(s) for the model's output(s). */\n metrics?: string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n weighted_metrics?: string[];\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n sample_weight_mode?: string;\n\n loss_weights?: number[]|{[key: string]: number};\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `trainingConfig`, `weightSpecs` and `weightData` fields\n * of this interface are optional, in order to support topology- or weights-only\n * saving and loading.\n *\n * Note this interface is used internally in IOHandlers. For the file format\n * written to disk as `model.json`, see `ModelJSON`.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Serialized configuration for the model's training.\n */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * The on-disk format of the `model.json` file.\n *\n * TF.js 1.0 always populates the optional fields when writing model.json.\n * Prior versions did not provide those fields.\n */\nexport declare interface ModelJSON {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology: {};\n\n /** Model training configuration. */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weights manifest.\n *\n * The weights manifest consists of an ordered list of weight-manifest\n * groups. Each weight-manifest group consists of a number of weight values\n * stored in a number of paths. See the documentation of\n * `WeightsManifestConfig` for more details.\n */\n weightsManifest: WeightsManifestConfig;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n\n/**\n * Callback for the progress of a long-running action such as an HTTP\n * request for a large binary object.\n *\n * `fraction` should be a number in the [0, 1] interval, indicating how\n * much of the action has completed.\n */\nexport type OnProgressCallback = (fraction: number) => void;\n\n/** @innamespace io */\nexport interface LoadOptions {\n /**\n * RequestInit (options) for HTTP requests.\n *\n * For detailed information on the supported fields, see\n * [https://developer.mozilla.org/en-US/docs/Web/API/Request/Request](\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)\n */\n requestInit?: RequestInit;\n\n /**\n * Progress callback.\n */\n onProgress?: OnProgressCallback;\n\n /**\n * A function used to override the `window.fetch` function.\n */\n fetchFunc?: Function;\n\n /**\n * Strict loading model: whether extraneous weights or missing\n * weights should trigger an `Error`.\n *\n * If `true`, require that the provided weights exactly match those\n * required by the layers. `false` means that both extra weights\n * and missing weights will be silently ignored.\n *\n * Default: `true`.\n */\n strict?: boolean;\n\n /**\n * Path prefix for weight files, by default this is calculated from the\n * path of the model JSON file.\n *\n * For instance, if the path to the model JSON file is\n * `http://localhost/foo/model.json`, then the default path prefix will be\n * `http://localhost/foo/`. If a weight file has the path value\n * `group1-shard1of2` in the weight manifest, then the weight file will be\n * loaded from `http://localhost/foo/group1-shard1of2` by default. However,\n * if you provide a `weightPathPrefix` value of\n * `http://localhost/foo/alt-weights`, then the weight file will be loaded\n * from the path `http://localhost/foo/alt-weights/group1-shard1of2` instead.\n */\n weightPathPrefix?: string;\n\n /**\n * Whether the module or model is to be loaded from TF Hub.\n *\n * Setting this to `true` allows passing a TF-Hub module URL, omitting the\n * standard model file name and the query parameters.\n *\n * Default: `false`.\n */\n fromTFHub?: boolean;\n\n /**\n * An async function to convert weight file name to URL. The weight file\n * names are stored in model.json's weightsManifest.paths field. By default we\n * consider weight files are colocated with the model.json file. For example:\n * model.json URL: https://www.google.com/models/1/model.json\n * group1-shard1of1.bin url:\n * https://www.google.com/models/1/group1-shard1of1.bin\n *\n * With this func you can convert the weight file name to any URL.\n */\n weightUrlConverter?: (weightFileName: string) => Promise;\n}\n\n/**\n * Additional options for Platform.fetch\n */\nexport interface RequestDetails {\n /**\n * Is this request for a binary file (as opposed to a json file)\n */\n isBinary?: boolean;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {complex} from '../ops/complex';\n\nimport {tensor} from '../ops/tensor';\nimport {NamedTensor, NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\n\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightGroup, WeightsManifestEntry} from './types';\n\n/** Number of bytes reserved for the length of the string. (32bit integer). */\nconst NUM_BYTES_STRING_LENGTH = 4;\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @param group Group to which the weights belong (optional).\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(\n tensors: NamedTensorMap|NamedTensor[], group?: WeightGroup):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n\n const names: string[] = Array.isArray(tensors) ?\n tensors.map(tensor => tensor.name) :\n Object.keys(tensors);\n\n for (let i = 0; i < names.length; ++i) {\n const name = names[i];\n const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name];\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool' &&\n t.dtype !== 'string' && t.dtype !== 'complex64') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n const spec: WeightsManifestEntry = {name, shape: t.shape, dtype: t.dtype};\n if (t.dtype === 'string') {\n const utf8bytes = new Promise(async resolve => {\n const vals = await t.bytes() as Uint8Array[];\n const totalNumBytes = vals.reduce((p, c) => p + c.length, 0) +\n NUM_BYTES_STRING_LENGTH * vals.length;\n const bytes = new Uint8Array(totalNumBytes);\n let offset = 0;\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n const bytesOfLength =\n new Uint8Array(new Uint32Array([val.length]).buffer);\n bytes.set(bytesOfLength, offset);\n offset += NUM_BYTES_STRING_LENGTH;\n bytes.set(val, offset);\n offset += val.length;\n }\n resolve(bytes);\n });\n dataPromises.push(utf8bytes);\n } else {\n dataPromises.push(t.data());\n }\n if (group != null) {\n spec.group = group;\n }\n specs.push(spec);\n }\n\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let float16Decode: (buffer: Uint16Array) => Float32Array | undefined;\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n const size = sizeFromShape(shape);\n let values: TypedArray|string[]|Uint8Array[];\n\n if ('quantization' in spec) {\n const quantization = spec.quantization;\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n if (!('min' in quantization && 'scale' in quantization)) {\n throw new Error(\n `Weight ${spec.name} with quantization ${quantization.dtype} ` +\n `doesn't have corresponding metadata min and scale.`);\n }\n } else if (quantization.dtype === 'float16') {\n if (dtype !== 'float32') {\n throw new Error(\n `Weight ${spec.name} is quantized with ${quantization.dtype} ` +\n `which only supports weights of type float32 not ${dtype}.`);\n }\n } else {\n throw new Error(\n `Weight ${spec.name} has unknown ` +\n `quantization dtype ${quantization.dtype}. ` +\n `Supported quantization dtypes are: ` +\n `'uint8', 'uint16', and 'float16'.`);\n }\n const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype];\n const byteBuffer =\n buffer.slice(offset, offset + size * quantizationSizeFactor);\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n values = new Float32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = v * quantization.scale + quantization.min;\n }\n } else if (quantization.dtype === 'float16') {\n if (float16Decode === undefined) {\n float16Decode = getFloat16Decoder();\n }\n values = float16Decode(quantizedArray as Uint16Array);\n } else {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type float32.`);\n }\n } else if (dtype === 'int32') {\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type int32.`);\n }\n values = new Int32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = Math.round(v * quantization.scale + quantization.min);\n }\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * quantizationSizeFactor;\n } else if (dtype === 'string') {\n const size = sizeFromShape(spec.shape);\n values = [];\n for (let i = 0; i < size; i++) {\n const byteLength = new Uint32Array(\n buffer.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0];\n offset += NUM_BYTES_STRING_LENGTH;\n const bytes = new Uint8Array(buffer.slice(offset, offset + byteLength));\n (values as Uint8Array[]).push(bytes);\n offset += byteLength;\n }\n } else {\n const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype];\n const byteBuffer = buffer.slice(offset, offset + size * dtypeFactor);\n\n if (dtype === 'float32') {\n values = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n values = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n values = new Uint8Array(byteBuffer);\n } else if (dtype === 'complex64') {\n values = new Float32Array(byteBuffer);\n const real = new Float32Array(values.length / 2);\n const image = new Float32Array(values.length / 2);\n for (let i = 0; i < real.length; i++) {\n real[i] = values[i * 2];\n image[i] = values[i * 2 + 1];\n }\n const realTensor = tensor(real, shape, 'float32');\n const imageTensor = tensor(image, shape, 'float32');\n out[name] = complex(realTensor, imageTensor);\n realTensor.dispose();\n imageTensor.dispose();\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * dtypeFactor;\n }\n if (dtype !== 'complex64') {\n out[name] = tensor(values, shape, dtype);\n }\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n const buf = new Uint8Array(buffer);\n let s = '';\n for (let i = 0, l = buf.length; i < l; i++) {\n s += String.fromCharCode(buf[i]);\n }\n return btoa(s);\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n if (buffers.length === 1) {\n return buffers[0];\n }\n\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n\n/**\n * Computes mantisa table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 2048 mantissa lookup values.\n */\nfunction computeFloat16MantisaTable(): Uint32Array {\n const convertMantissa = (i: number): number => {\n let m = i << 13;\n let e = 0;\n\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n\n return m | e;\n };\n\n const mantisaTable = new Uint32Array(2048);\n\n mantisaTable[0] = 0;\n for (let i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (let i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + ((i - 1024) << 13);\n }\n\n return mantisaTable;\n}\n\n/**\n * Computes exponent table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 64 exponent lookup values.\n */\nfunction computeFloat16ExponentTable(): Uint32Array {\n const exponentTable = new Uint32Array(64);\n\n exponentTable[0] = 0;\n exponentTable[31] = 0x47800000;\n exponentTable[32] = 0x80000000;\n exponentTable[63] = 0xc7800000;\n for (let i = 1; i < 31; i++) {\n exponentTable[i] = i << 23;\n }\n for (let i = 33; i < 63; i++) {\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\n }\n\n return exponentTable;\n}\n\n/**\n * Computes offset table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 6d offset values.\n */\nfunction computeFloat16OffsetTable(): Uint32Array {\n const offsetTable = new Uint32Array(64);\n\n for (let i = 0; i < 64; i++) {\n offsetTable[i] = 1024;\n }\n offsetTable[0] = offsetTable[32] = 0;\n\n return offsetTable;\n}\n\n/**\n * Retrieve a Float16 decoder which will decode a ByteArray of Float16 values\n * to a Float32Array.\n *\n * @returns Function (buffer: Uint16Array) => Float32Array which decodes\n * the Uint16Array of Float16 bytes to a Float32Array.\n */\nexport function getFloat16Decoder(): (buffer: Uint16Array) => Float32Array {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n\n return (quantizedArray: Uint16Array) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits =\n mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler, LoadOptions} from './types';\n\nexport type IORouter = (url: string|string[], loadOptions?: LoadOptions) =>\n IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string|string[]): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @param loadOptions Optional, custom load options.\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string|string[], loadOptions?: LoadOptions):\n IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load', loadOptions);\n }\n\n private static getHandlers(\n url: string|string[], handlerType: 'save'|'load',\n loadOptions?: LoadOptions): IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ?\n IORouterRegistry.getInstance().loadRouters :\n IORouterRegistry.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url, loadOptions);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n\nexport const registerSaveRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerSaveRouter(loudRouter);\nexport const registerLoadRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerLoadRouter(loudRouter);\nexport const getSaveHandlers = (url: string|string[]) =>\n IORouterRegistry.getSaveHandlers(url);\nexport const getLoadHandlers =\n (url: string|string[], loadOptions?: LoadOptions) =>\n IORouterRegistry.getLoadHandlers(url, loadOptions);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\n\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = typeof window === 'undefined' ? self : window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\nconst MODEL_METADATA_SUFFIX = 'model_metadata';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string): {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR),\n modelMetadata:\n [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\ndeclare type LocalStorageKeys = {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n};\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: LocalStorageKeys;\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n const result: ModelArtifacts = {\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy\n };\n if (modelArtifacts.signature != null) {\n result.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n result.modelInitializer = modelArtifacts.modelInitializer;\n }\n this.LS.setItem(this.keys.modelMetadata, JSON.stringify(result));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n this.LS.removeItem(this.keys.info);\n this.LS.removeItem(this.keys.topology);\n this.LS.removeItem(this.keys.weightSpecs);\n this.LS.removeItem(this.keys.weightData);\n this.LS.removeItem(this.keys.modelMetadata);\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load meta-data fields.\n const metadataString = this.LS.getItem(this.keys.modelMetadata);\n if (metadataString != null) {\n const metadata = JSON.parse(metadataString) as ModelArtifacts;\n out.format = metadata['format'];\n out.generatedBy = metadata['generatedBy'];\n out.convertedBy = metadata['convertedBy'];\n if (metadata['signature'] != null) {\n out.signature = metadata['signature'];\n }\n if (metadata['userDefinedMetadata'] != null) {\n out.userDefinedMetadata = metadata['userDefinedMetadata'];\n }\n if (metadata['modelInitializer'] != null) {\n out.modelInitializer = metadata['modelInitializer'];\n }\n }\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(\n env().getBool('IS_BROWSER'),\n () => 'Current environment is not a web browser');\n assert(\n typeof window === 'undefined' ||\n typeof window.localStorage !== 'undefined',\n () => 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, () => 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, () => 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n () => `A model store manager is already registered for scheme '${\n scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n () => `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n () => `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n () => `Copying failed because no save handler is found for destination ` +\n `URL ${destURL}.`);\n assert(\n saveHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\nimport {BrowserIndexedDB, BrowserIndexedDBManager} from '../io/indexed_db';\nimport {BrowserLocalStorage, BrowserLocalStorageManager} from '../io/local_storage';\nimport {ModelStoreManagerRegistry} from '../io/model_management';\n\nimport {Platform} from './platform';\n\nexport class PlatformBrowser implements Platform {\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n private textEncoder: TextEncoder;\n\n fetch(path: string, init?: RequestInit): Promise {\n return fetch(path, init);\n }\n\n now(): number {\n return performance.now();\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Browser's encoder only supports utf-8, but got ${encoding}`);\n }\n if (this.textEncoder == null) {\n this.textEncoder = new TextEncoder();\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n return new TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_BROWSER')) {\n env().setPlatform('browser', new PlatformBrowser());\n\n // Register LocalStorage IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n\n // Register IndexedDB IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from '../environment';\n\nimport {Platform} from './platform';\n\n// We are wrapping this within an object so it can be stubbed by Jasmine.\nexport const getNodeFetch = {\n // tslint:disable-next-line:no-require-imports\n importFetch: () => require('node-fetch')\n};\n\ntype FetchFn = (url: string, init?: RequestInit) => Promise;\nlet systemFetch: FetchFn;\n// These getters and setters are for testing so we don't export a mutable\n// variable.\nexport function resetSystemFetch() {\n systemFetch = null;\n}\nexport function setSystemFetch(fetchFn: FetchFn) {\n systemFetch = fetchFn;\n}\nexport function getSystemFetch(): FetchFn {\n return systemFetch;\n}\n\nexport class PlatformNode implements Platform {\n private textEncoder: TextEncoder;\n // tslint:disable-next-line:no-any\n util: any;\n\n constructor() {\n // tslint:disable-next-line:no-require-imports\n this.util = require('util');\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n this.textEncoder = new this.util.TextEncoder();\n }\n\n fetch(path: string, requestInits?: RequestInit): Promise {\n if (env().global.fetch != null) {\n return env().global.fetch(path, requestInits);\n }\n\n if (systemFetch == null) {\n systemFetch = getNodeFetch.importFetch();\n }\n return systemFetch(path, requestInits);\n }\n\n now(): number {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Node built-in encoder only supports utf-8, but got ${encoding}`);\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n if (bytes.length === 0) {\n return '';\n }\n return new this.util.TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_NODE')) {\n env().setPlatform('node', new PlatformNode());\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {TensorBuffer} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap} from '../types';\nimport * as util from '../util';\n\n/**\n * Creates an empty `tf.TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in CPU as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `tf.Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function buffer(\n shape: ShapeMap[R], dtype: D = 'float32' as D,\n values?: DataTypeMap[D]): TensorBuffer {\n dtype = dtype || 'float32' as D;\n util.assertNonNegativeIntegerDimensions(shape);\n return new TensorBuffer(shape, dtype, values);\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Cast, CastAttrs, CastInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {DataType, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n\n const inputs: CastInputs = {x: $x};\n const attrs: CastAttrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const cast = op({cast_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Identity, IdentityInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs: IdentityInputs = {x: $x};\n\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs as {} as NamedTensorMap);\n}\n\nexport const clone = op({clone_});\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\n\n/**\n * Prints information about the `tf.Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Required side effectful code for tfjs-core\n\n// Set up Engine and ENV\nimport {getOrMakeEngine} from './engine';\ngetOrMakeEngine();\n\n// Register backend-agnostic flags.\nimport './flags';\n// Register platforms\nimport './platforms/platform_browser';\nimport './platforms/platform_node';\n\n// Set up OpHandler\nimport {buffer} from './ops/buffer';\nimport {cast} from './ops/cast';\nimport {clone} from './ops/clone';\nimport {print} from './ops/print';\nimport {OpHandler, setOpHandler} from './tensor';\nconst opHandler: OpHandler = {\n buffer,\n cast,\n clone,\n print\n};\nsetOpHandler(opHandler);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest, http, isHTTPScheme} from './http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {getLoadHandlers, getSaveHandlers, registerLoadRouter, registerSaveRouter} from './router_registry';\nimport {IOHandler, LoadHandler, LoadOptions, ModelArtifacts, ModelArtifactsInfo, ModelJSON, ModelStoreManager, OnProgressCallback, RequestDetails, SaveConfig, SaveHandler, SaveResult, WeightGroup, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights, weightsLoaderFactory} from './weights_loader';\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n http,\n IOHandler,\n isHTTPScheme,\n LoadHandler,\n LoadOptions,\n loadWeights,\n ModelArtifacts,\n ModelArtifactsInfo,\n ModelJSON,\n ModelStoreManager,\n OnProgressCallback,\n registerLoadRouter,\n registerSaveRouter,\n RequestDetails,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightGroup,\n weightsLoaderFactory,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelJSON, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nfunction defer(f: () => T): Promise {\n return new Promise(resolve => setTimeout(resolve)).then(f);\n}\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'browserDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (typeof (document) === 'undefined') {\n throw new Error(\n 'Browser downloads are not supported in ' +\n 'this environment since `document` is not present');\n }\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserDownloads.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by evoking a click event on the download anchors.\n // When multiple downloads are started synchronously, Firefox will only\n // save the last one.\n await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click')));\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n await defer(\n () => weightDataAnchor.dispatchEvent(new MouseEvent('click')));\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result) as ModelJSON;\n const modelTopology = modelJSON.modelTopology;\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest = modelJSON.weightsManifest;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n const result: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n format: modelJSON.format,\n generatedBy: modelJSON.generatedBy,\n convertedBy: modelJSON.convertedBy\n };\n if (modelJSON.signature != null) {\n result.signature = modelJSON.signature;\n }\n if (modelJSON.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelJSON.userDefinedMetadata;\n }\n if (modelJSON.modelInitializer != null) {\n result.modelInitializer = modelJSON.modelInitializer;\n }\n resolve(result);\n }\n };\n weightFileReader.onerror = error =>\n reject(`Failed to weights data from file of path '${path}'.`);\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = error => reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel');\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `BrowserDownloads` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tf.loadLayersModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {assert} from '../util';\n\nimport {OnProgressCallback} from './types';\n\n/**\n * Monitor Promise.all progress, fire onProgress callback function.\n *\n * @param promises Promise list going to be monitored\n * @param onProgress Callback function. Fired when a promise resolved.\n * @param startFraction Optional fraction start. Default to 0.\n * @param endFraction Optional fraction end. Default to 1.\n */\nexport function monitorPromisesProgress(\n promises: Array>, onProgress: OnProgressCallback,\n startFraction?: number, endFraction?: number) {\n checkPromises(promises);\n startFraction = startFraction == null ? 0 : startFraction;\n endFraction = endFraction == null ? 1 : endFraction;\n checkFraction(startFraction, endFraction);\n let resolvedPromise = 0;\n\n const registerMonitor = (promise: Promise<{}>) => {\n promise.then(value => {\n const fraction = startFraction +\n ++resolvedPromise / promises.length * (endFraction - startFraction);\n // pass fraction as parameter to callback function.\n onProgress(fraction);\n return value;\n });\n return promise;\n };\n\n function checkPromises(promises: Array>): void {\n assert(\n promises != null && Array.isArray(promises) && promises.length > 0,\n () => 'promises must be a none empty array');\n }\n\n function checkFraction(startFraction: number, endFraction: number): void {\n assert(\n startFraction >= 0 && startFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got startFraction ${startFraction}`);\n assert(\n endFraction >= 0 && endFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got endFraction ${endFraction}`);\n assert(\n endFraction >= startFraction,\n () => `startFraction must be no more than endFraction, but ` +\n `got startFraction ${startFraction} and endFraction ` +\n `${endFraction}`);\n }\n\n return Promise.all(promises.map(registerMonitor));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from '../environment';\n\nimport {NamedTensorMap} from '../tensor_types';\nimport * as util from '../util';\nimport {decodeWeights} from './io_utils';\nimport {monitorPromisesProgress} from './progress';\nimport {DTYPE_VALUE_SIZE_MAP, LoadOptions, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @param fetchFunc Optional overriding value for the `window.fetch` function.\n * @param onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], loadOptions?: LoadOptions): Promise {\n if (loadOptions == null) {\n loadOptions = {};\n }\n\n const fetchFunc = loadOptions.fetchFunc == null ? env().platform.fetch :\n loadOptions.fetchFunc;\n\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(\n fetchURL =>\n fetchFunc(fetchURL, loadOptions.requestInit, {isBinary: true}));\n\n const fetchStartFraction = 0;\n const fetchEndFraction = 0.5;\n\n const responses = loadOptions.onProgress == null ?\n await Promise.all(requests) :\n await monitorPromisesProgress(\n requests, loadOptions.onProgress, fetchStartFraction,\n fetchEndFraction);\n\n const bufferPromises = responses.map(response => response.arrayBuffer());\n\n const bufferStartFraction = 0.5;\n const bufferEndFraction = 1;\n\n const buffers = loadOptions.onProgress == null ?\n await Promise.all(bufferPromises) :\n await monitorPromisesProgress(\n bufferPromises, loadOptions.onProgress, bufferStartFraction,\n bufferEndFraction);\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestInit?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n const fetchWeights = (fetchUrls: string[]) =>\n loadWeightsAsArrayBuffer(fetchUrls, {requestInit});\n const loadWeights = weightsLoaderFactory(fetchWeights);\n\n return loadWeights(manifest, filePathPrefix, weightNames);\n}\n\n/**\n * Creates a function, which reads a weights manifest JSON configuration,\n * fetches the weight files using the specified function and returns them as\n * `Tensor`s.\n *\n * ```js\n * // example for creating a nodejs weight loader, which reads the weight files\n * // from disk using fs.readFileSync\n *\n * import * as fs from 'fs'\n *\n * const fetchWeightsFromDisk = (filePaths: string[]) =>\n * filePaths.map(filePath => fs.readFileSync(filePath).buffer)\n *\n * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk)\n *\n * const manifest = JSON.parse(\n * fs.readFileSync('./my_model-weights_manifest').toString()\n * )\n * const weightMap = await loadWeights(manifest, './')\n * ```\n * @param fetchWeightsFunction The function used for fetching the weight files.\n * @returns Weight loading function.\n */\nexport function weightsLoaderFactory(\n fetchWeightsFunction: (fetchUrls: string[]) => Promise):\n (manifest: WeightsManifestConfig, filePathPrefix?: string,\n weightNames?: string[]) => Promise {\n return async(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[]): Promise => {\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound =\n weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await fetchWeightsFunction(fetchUrls);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n const nameToTensorMap =\n decodeWeights(byteBuffer, [weightsEntry.manifestEntry]);\n for (const name in nameToTensorMap) {\n weightsTensorMap[name] = nameToTensorMap[name];\n }\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadOptions, ModelArtifacts, ModelJSON, OnProgressCallback, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nconst OCTET_STREAM_MIME_TYPE = 'application/octet-stream';\nconst JSON_TYPE = 'application/json';\nexport class HTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n private readonly fetch: Function;\n private readonly weightUrlConverter: (weightName: string) => Promise;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEME_REGEX = /^https?:\\/\\//;\n\n private readonly weightPathPrefix: string;\n private readonly onProgress: OnProgressCallback;\n\n constructor(path: string, loadOptions?: LoadOptions) {\n if (loadOptions == null) {\n loadOptions = {};\n }\n this.weightPathPrefix = loadOptions.weightPathPrefix;\n this.onProgress = loadOptions.onProgress;\n this.weightUrlConverter = loadOptions.weightUrlConverter;\n\n if (loadOptions.fetchFunc != null) {\n assert(\n typeof loadOptions.fetchFunc === 'function',\n () => 'Must pass a function that matches the signature of ' +\n '`fetch` (see ' +\n 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)');\n this.fetch = loadOptions.fetchFunc;\n } else {\n this.fetch = env().platform.fetch;\n }\n\n assert(\n path != null && path.length > 0,\n () => 'URL path for http must not be null, undefined or ' +\n 'empty.');\n\n if (Array.isArray(path)) {\n assert(\n path.length === 2,\n () => 'URL paths for http must have a length of 2, ' +\n `(actual length is ${path.length}).`);\n }\n this.path = path;\n\n if (loadOptions.requestInit != null &&\n loadOptions.requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = loadOptions.requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: JSON_TYPE}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob([modelArtifacts.weightData], {type: OCTET_STREAM_MIME_TYPE}),\n 'model.weights.bin');\n }\n\n const response = await this.fetch(this.path, init);\n\n if (response.ok) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `tf.io.http` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await this.fetch(this.path, this.requestInit);\n\n if (!modelConfigRequest.ok) {\n throw new Error(\n `Request to ${this.path} failed with status code ` +\n `${modelConfigRequest.status}. Please verify this URL points to ` +\n `the model JSON of the model to load.`);\n }\n let modelConfig: ModelJSON;\n try {\n modelConfig = await modelConfigRequest.json();\n } catch (e) {\n let message = `Failed to parse model JSON of response from ${this.path}.`;\n // TODO(nsthorat): Remove this after some time when we're comfortable that\n // .pb files are mostly gone.\n if (this.path.endsWith('.pb')) {\n message += ' Your path contains a .pb file extension. ' +\n 'Support for .pb models have been removed in TensorFlow.js 1.0 ' +\n 'in favor of .json models. You can re-convert your Python ' +\n 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' +\n 'or you can convert your.pb models with the \\'pb2json\\'' +\n 'NPM script in the tensorflow/tfjs-converter repository.';\n } else {\n message += ' Please make sure the server is serving valid ' +\n 'JSON for this request.';\n }\n throw new Error(message);\n }\n const modelTopology = modelConfig.modelTopology;\n const weightsManifest = modelConfig.weightsManifest;\n const generatedBy = modelConfig.generatedBy;\n const convertedBy = modelConfig.convertedBy;\n const format = modelConfig.format;\n const signature = modelConfig.signature;\n const userDefinedMetadata = modelConfig.userDefinedMetadata;\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const results = await this.loadWeights(weightsManifest);\n [weightSpecs, weightData] = results;\n }\n\n const artifacts: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData,\n generatedBy,\n convertedBy,\n format\n };\n\n if (signature != null) {\n artifacts.signature = signature;\n }\n if (userDefinedMetadata != null) {\n artifacts.userDefinedMetadata = userDefinedMetadata;\n }\n\n const initializer = modelConfig.modelInitializer;\n if (initializer) {\n artifacts.modelInitializer = initializer;\n }\n\n return artifacts;\n }\n\n private async loadWeights(weightsManifest: WeightsManifestConfig):\n Promise<[WeightsManifestEntry[], ArrayBuffer]> {\n const weightPath = Array.isArray(this.path) ? this.path[1] : this.path;\n const [prefix, suffix] = parseUrl(weightPath);\n const pathPrefix = this.weightPathPrefix || prefix;\n\n const weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n const fetchURLs: string[] = [];\n const urlPromises: Array> = [];\n for (const weightsGroup of weightsManifest) {\n for (const path of weightsGroup.paths) {\n if (this.weightUrlConverter != null) {\n urlPromises.push(this.weightUrlConverter(path));\n } else {\n fetchURLs.push(pathPrefix + path + suffix);\n }\n }\n }\n\n if (this.weightUrlConverter) {\n fetchURLs.push(...await Promise.all(urlPromises));\n }\n\n const buffers = await loadWeightsAsArrayBuffer(fetchURLs, {\n requestInit: this.requestInit,\n fetchFunc: this.fetch,\n onProgress: this.onProgress\n });\n return [weightSpecs, concatenateArrayBuffers(buffers)];\n }\n}\n\n/**\n * Extract the prefix and suffix of the url, where the prefix is the path before\n * the last file, and suffix is the search params after the last file.\n * ```\n * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file'\n * [prefix, suffix] = parseUrl(url)\n * // prefix = 'http://tfhub.dev/model/1/'\n * // suffix = '?tfjs-format=file'\n * ```\n * @param url the model url to be parsed.\n */\nexport function parseUrl(url: string): [string, string] {\n const lastSlash = url.lastIndexOf('/');\n const lastSearchParam = url.lastIndexOf('?');\n const prefix = url.substring(0, lastSlash);\n const suffix =\n lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}\n\nexport function isHTTPScheme(url: string): boolean {\n return url.match(HTTPRequest.URL_SCHEME_REGEX) != null;\n}\n\nexport const httpRouter: IORouter =\n (url: string, loadOptions?: LoadOptions) => {\n if (typeof fetch === 'undefined' &&\n (loadOptions == null || loadOptions.fetchFunc == null)) {\n // `http` uses `fetch` or `node-fetch`, if one wants to use it in\n // an environment that is not the browser or node they have to setup a\n // global fetch polyfill.\n return null;\n } else {\n let isHTTP = true;\n if (Array.isArray(url)) {\n isHTTP = url.every(urlItem => isHTTPScheme(urlItem));\n } else {\n isHTTP = isHTTPScheme(url);\n }\n if (isHTTP) {\n return http(url, loadOptions);\n }\n }\n return null;\n };\nIORouterRegistry.registerSaveRouter(httpRouter);\nIORouterRegistry.registerLoadRouter(httpRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.http(\n * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following GitHub Gist\n * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864\n * implements a server based on [flask](https://github.com/pallets/flask) that\n * can receive the request. Upon receiving the model artifacts via the requst,\n * this particular server reconsistutes instances of [Keras\n * Models](https://keras.io/models/model/) in memory.\n *\n *\n * @param path A URL path to the model.\n * Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the\n * body will be set by TensorFlow.js. File blobs representing the model\n * topology (filename: 'model.json') and the weights of the model (filename:\n * 'model.weights.bin') will be appended to the body. If `requestInit` has a\n * `body`, an Error will be thrown.\n * @param loadOptions Optional configuration for the loading. It includes the\n * following fields:\n * - weightPathPrefix Optional, this specifies the path prefix for weight\n * files, by default this is calculated from the path param.\n * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js,\n * the `fetch` from node-fetch can be used here.\n * - onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns An instance of `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function http(path: string, loadOptions?: LoadOptions): IOHandler {\n return new HTTPRequest(path, loadOptions);\n}\n\n/**\n * Deprecated. Use `tf.io.http`.\n * @param path\n * @param loadOptions\n */\nexport function browserHTTPRequest(\n path: string, loadOptions?: LoadOptions): IOHandler {\n return http(path, loadOptions);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, TrainingConfig, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(private readonly modelArtifacts?: ModelArtifacts) {}\n\n async load(): Promise {\n return this.modelArtifacts;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler:\n (artifacts: ModelArtifacts) => Promise) {}\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadLayersModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelArtifacts a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n * @param trainingConfig Model training configuration. Optional.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelArtifacts: {}|ModelArtifacts, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer, trainingConfig?: TrainingConfig): IOHandler {\n if (arguments.length === 1) {\n const isModelArtifacts =\n (modelArtifacts as ModelArtifacts).modelTopology != null ||\n (modelArtifacts as ModelArtifacts).weightSpecs != null;\n if (isModelArtifacts) {\n return new PassthroughLoader(modelArtifacts as ModelArtifacts);\n } else {\n // Legacy support: with only modelTopology.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({modelTopology: modelArtifacts as {}});\n }\n } else {\n // Legacy support.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({\n modelTopology: modelArtifacts as {},\n weightSpecs,\n weightData,\n trainingConfig\n });\n }\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) =>\n Promise): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Exports under the tf.math.* namespace.\n */\n\nimport {confusionMatrix} from './ops/confusion_matrix';\n\nexport {confusionMatrix};\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {makeTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(\n a: Tensor|TensorLike, b: Tensor|TensorLike, transposeA = false,\n transposeB = false): T {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n\n const inputs: BatchMatMulInputs = {a: $a, b: $b};\n const attrs: BatchMatMulAttrs = {transposeA, transposeB};\n\n return ENGINE.runKernel(\n BatchMatMul, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const matMul = op({matMul_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {OneHot, OneHotAttrs, OneHotInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(\n indices: Tensor|TensorLike, depth: number, onValue = 1,\n offValue = 0): Tensor {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n\n const inputs: OneHotInputs = {indices: $indices};\n const attrs: OneHotAttrs = {depth, onValue, offValue};\n\n return ENGINE.runKernel(\n OneHot, inputs as unknown as NamedTensorMap,\n attrs as unknown as NamedAttrMap);\n}\n\nexport const oneHot = op({oneHot_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Transpose, TransposeAttrs, TransposeInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const inputs: TransposeInputs = {x: $x};\n const attrs: TransposeAttrs = {perm};\n\n return ENGINE.runKernel(\n Transpose, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const transpose = op({transpose_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {cast} from './cast';\nimport {matMul} from './mat_mul';\nimport {oneHot} from './one_hot';\nimport {op} from './operation';\nimport {transpose} from './transpose';\n\n/**\n * Computes the confusion matrix from true labels and predicted labels.\n *\n * ```js\n * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32');\n * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32');\n * const numClasses = 3;\n * const out = tf.math.confusionMatrix(labels, predictions, numClasses);\n * out.print();\n * // Expected output matrix:\n * // [[2, 0, 0],\n * // [0, 1, 1],\n * // [0, 0, 1]]\n * ```\n *\n * @param labels The target labels, assumed to be 0-based integers\n * for the classes. The shape is `[numExamples]`, where\n * `numExamples` is the number of examples included.\n * @param predictions The predicted classes, assumed to be\n * 0-based integers for the classes. Must have the same shape as `labels`.\n * @param numClasses Number of all classes, as an integer.\n * Its value must be larger than the largest element in `labels` and\n * `predictions`.\n * @returns The confusion matrix as a int32-type 2D tensor. The value at\n * row `r` and column `c` is the number of times examples of actual class\n * `r` were predicted as class `c`.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nexport function confusionMatrix_(\n labels: Tensor1D|TensorLike, predictions: Tensor1D|TensorLike,\n numClasses: number): Tensor2D {\n const $labels = convertToTensor(labels, 'labels', 'confusionMatrix');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'confusionMatrix');\n\n util.assert(\n numClasses == null || numClasses > 0 && Number.isInteger(numClasses),\n () => `If provided, numClasses must be a positive integer, ` +\n `but got ${numClasses}`);\n util.assert(\n $labels.rank === 1,\n () => `Expected the rank of labels to be 1, but got ${$labels.rank}`);\n util.assert(\n $predictions.rank === 1,\n () => `Expected the rank of predictions to be 1, ` +\n `but got ${$predictions.rank}`);\n util.assert(\n $labels.shape[0] === $predictions.shape[0],\n () => `Mismatch in the number of examples: ` +\n `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` +\n `Labels and predictions should have the same number of elements.`);\n util.assert(\n numClasses > 0 && Number.isInteger(numClasses),\n () => `numClasses is required to be a positive integer, but got ` +\n `${numClasses}`);\n // TODO(cais): In the future, if oneHot supports tensors inputs for\n // `numClasses`, `confusionMatrix` can make `numClasses` optional.\n\n const oneHotLabels = oneHot(cast($labels, 'int32'), numClasses) as Tensor2D;\n const oneHotPredictions =\n oneHot(cast($predictions, 'int32'), numClasses) as Tensor2D;\n const oneHotLabelsT: Tensor2D = transpose(oneHotLabels);\n const product: Tensor2D = matMul(oneHotLabelsT, oneHotPredictions);\n return cast(product, 'int32');\n}\n\nexport const confusionMatrix = op({confusionMatrix_});\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {env} from '../environment';\nimport {FromPixels, FromPixelsAttrs, FromPixelsInputs} from '../kernel_names';\nimport {getKernel, NamedAttrMap} from '../kernel_registry';\nimport {Tensor, Tensor2D, Tensor3D} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {PixelData, TensorLike} from '../types';\n\nimport {cast} from './cast';\nimport {op} from './operation';\nimport {tensor3d} from './tensor3d';\n\nlet fromPixels2DContext: CanvasRenderingContext2D;\n\n/**\n * Creates a `tf.Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.browser.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel. You can also pass in an image\n * object with following attributes:\n * `{data: Uint8Array; width: number; height: number}`\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n *\n * @returns A Tensor3D with the shape `[height, width, numChannels]`.\n *\n * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true}\n */\nfunction fromPixels_(\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap,\n numChannels = 3): Tensor3D {\n // Sanity checks.\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n if (pixels == null) {\n throw new Error('pixels passed to tf.browser.fromPixels() can not be null');\n }\n let isPixelData = false;\n let isImageData = false;\n let isVideo = false;\n let isImage = false;\n let isCanvasLike = false;\n let isImageBitmap = false;\n if ((pixels as PixelData).data instanceof Uint8Array) {\n isPixelData = true;\n } else if (\n typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) {\n isImageData = true;\n } else if (\n typeof (HTMLVideoElement) !== 'undefined' &&\n pixels instanceof HTMLVideoElement) {\n isVideo = true;\n } else if (\n typeof (HTMLImageElement) !== 'undefined' &&\n pixels instanceof HTMLImageElement) {\n isImage = true;\n // tslint:disable-next-line: no-any\n } else if ((pixels as any).getContext != null) {\n isCanvasLike = true;\n } else if (\n typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) {\n isImageBitmap = true;\n } else {\n throw new Error(\n 'pixels passed to tf.browser.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` +\n `in browser, or OffscreenCanvas, ImageData in webworker` +\n ` or {data: Uint32Array, width: number, height: number}, ` +\n `but was ${(pixels as {}).constructor.name}`);\n }\n if (isVideo) {\n const HAVE_CURRENT_DATA_READY_STATE = 2;\n if (isVideo &&\n (pixels as HTMLVideoElement).readyState <\n HAVE_CURRENT_DATA_READY_STATE) {\n throw new Error(\n 'The video element has not loaded data yet. Please wait for ' +\n '`loadeddata` event on the Ex){let A=Mu*i,y=Array.from(e.slice(0,A)),g=Array.from(e.slice((o-Mu)*i,o*i));return n==="complex64"&&(y=$u(y),g=$u(g)),["["+y.map((x,v)=>Fu(x,a[v],n)).join(", ")+", ..., "+g.map((x,v)=>Fu(x,a[o-Mu+v],n)).join(", ")+"]"]}let f=n==="complex64"?$u(e):Array.from(e);return["["+f.map((A,y)=>Fu(A,a[y],n)).join(", ")+"]"]}let c=t.slice(1),u=r.slice(1),h=r[0]*i,d=[];if(o>Ex){for(let f=0;f1)for(let d=0;dRx){let A=Fu*i,y=Array.from(e.slice(0,A)),g=Array.from(e.slice((o-Fu)*i,o*i));return n==="complex64"&&(y=Du(y),g=Du(g)),["["+y.map((x,k)=>$u(x,r[k],n)).join(", ")+", ..., "+g.map((x,k)=>$u(x,r[o-Fu+k],n)).join(", ")+"]"]}let f=n==="complex64"?Du(e):Array.from(e);return["["+f.map((A,y)=>$u(A,r[y],n)).join(", ")+"]"]}let d=t.slice(1),u=a.slice(1),p=a[0]*i,c=[];if(o>Rx){for(let f=0;f`Length of values '${r}' does not match the size inferred by the shape '${this.size}'.`)}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||Ax(t,this.size),this.strides=Ji(e)}set(e,...t){t.length===0&&(t=[0]),M(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let r of e){if(r<0||r>=this.shape[t]){let a=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(a)}t++}let n=e[e.length-1];for(let r=0;rid(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=Fr().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>id(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();let e=await Fr().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(Fr().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return rl.print(this,e)}clone(){return this.throwIfDisposed(),rl.clone(this)}toString(e=!1){let t=this.dataSync();return U9(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),rl.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Fr().makeVariable(this,e,t,n)}};Object.defineProperty(Le,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function Z(){return yf("Tensor",()=>Le)}Z();var Du=class extends Le{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r);this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!na(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Fr().disposeTensor(this),this.dataId=e.dataId,Fr().incRef(this,null)}dispose(){Fr().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Du,Symbol.hasInstance,{value:e=>e instanceof Le&&e.assign!=null&&e.assign instanceof Function});var yr={};Me(yr,{assertTypesMatch:()=>Rx,getTensorsInContainer:()=>bf,isTensorInList:()=>K9,makeTypesMatch:()=>bt});var _f;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(_f||(_f={}));var vf;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(vf||(vf={}));var kf;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(kf||(kf={}));var If;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(If||(If={}));var Sf;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(Sf||(Sf={}));var Z9={float32:If,int32:vf,bool:kf,complex64:Sf};function ir(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Z9[e][t]}function ld(e){return ir(e,"int32")}function bt(e,t){if(e.dtype===t.dtype)return[e,t];let n=ir(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Rx(e,t){M(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function K9(e,t){return t.some(n=>n.id===e.id)}function bf(e){let t=[],n=new Set;return Mx(e,t,n),t}function Mx(e,t,n){if(e==null)return;if(e instanceof Le){t.push(e);return}if(!Y9(e))return;let r=e;for(let a in r){let s=r[a];n.has(s)||(n.add(s),Mx(s,t,n))}}function Y9(e){return Array.isArray(e)||typeof e=="object"}function Nf(e){return e.kernelName!=null}var Fx=class{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},Ou=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Fx}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){nl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof cu)&&typeof n.then=="function"){let r=++this.pendingBackendInitId,a=n.then(s=>r(rthis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(r),()=>(r=t(),r instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r))}scopedRun(e,t,n){e();try{let r=n();return t(),r}catch(r){throw t(),r}}nextTensorId(){return Ou.nextTensorId++}nextVariableId(){return Ou.nextVariableId++}clone(e){let t=$.runKernel(vs,{x:e}),n={x:e},r=s=>({x:()=>{let i="float32",o={x:s},l={dtype:i};return $.runKernel(cs,o,l)}}),a=[];return this.addTapeNode(this.state.activeScope.name,n,[t],r,a,{}),t}runKernel(e,t,n){if(ad(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let r=this.backend.numDataIds(),a=0;n.forEach(o=>{a+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=r-t-a-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],r=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,l=Nf(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Nf(e)){let{kernelName:p,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let A=ad(p,this.backendName);M(A!=null,()=>`Cannot find registered kernel '${p}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=A.kernelFunc({inputs:m,attrs:f,backend:this.backend});let g=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(p,y,g);let x=g.map(v=>{if(v.rank!=null)return v;let{dataId:w,shape:b,dtype:k}=v;return this.makeTensorFromDataId(w,b,k)});if(r){let v=this.getTensorsForGradient(p,m,x);n=this.saveTensorsForBackwardMode(v)}return x}}else{let{forwardFunc:p}=e,m=f=>{!r||(n=f.map(A=>this.keep(this.clone(A))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>p(this.backend,m));let A=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,f,A),A}}let{inputs:c,attrs:u}=e,h=Nf(e)?null:e.backwardsFunc,d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(d=this.profiler.profileKernel(l,c,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs)}),r&&this.addTapeNode(l,c,t,h,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(p=>c[p]!=null?c[p].shape:null),outputShapes:t.map(p=>p.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let r=xf(e);if(r!=null){let a=r.inputsToSave||[],s=r.outputsToSave||[],i;r.saveAllInputs?(M(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(l=>t[l])):i=a.map(l=>t[l]);let o=n.filter((l,c)=>s[c]);return i.concat(o)}return[]}makeTensor(e,t,n,r){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let a=e;n==="string"&&va(e[0])&&(a=e.map(o=>Ru(o)));let s=r.write(a,t,n),i=new Le(t,n,s,this.nextTensorId());if(this.trackTensor(i,r),n==="string"){let o=this.state.tensorInfo.get(s),l=xx(a);this.state.numBytes+=l-o.bytes,o.bytes=l}return i}makeTensorFromDataId(e,t,n,r){n=n||"float32";let a=new Le(t,n,e,this.nextTensorId());return this.trackTensor(a,r),a}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),r!=null&&r!==e.dtype&&(e=e.cast(r));let a=new Du(e,t,n,this.nextTensorId());if(this.state.registeredVariables[a.name]!=null)throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*df(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Du||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;let t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){let n=e.size*df(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){let e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;let t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(r=>r.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let r of this.state.activeProfile.kernels)r.kernelTimeMs=await r.kernelTimeMs,r.extraInfo=await r.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,r,a,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},o=xf(e);o!=null&&(r=o.gradFunc),r!=null&&(i.gradient=l=>(l=l.map((c,u)=>{if(c==null){let h=n[u],d=Ih(h.size,h.dtype);return this.makeTensor(d,h.shape,h.dtype)}return c}),r(l.length>1?l:l[0],a,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=bf(e),n=new Set(t.map(a=>a.id));for(let a=0;a{!a.kept&&a.scopeId===r.id&&this.track(a)})}gradients(e,t,n,r=!1){if(M(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let a=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));M(a instanceof Le,()=>"The result y returned by f() must be a tensor.");let s=B9(this.state.activeTape,t,a);if(!r&&s.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{let i={};i[a.id]=n==null?J9(a.shape):n,V9(i,s,l=>this.tidy(l),Q9);let o=t.map(l=>i[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(let c of l.saved)c.dispose()}),this.state.activeTape=null),{value:a,grads:o}})}customGrad(e){return M(ka(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{M(t.every(i=>i instanceof Le),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,r={};t.forEach((i,o)=>{r[o]=i});let a=(i,o)=>(n=e(...t,o),M(n.value instanceof Le,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),M(ka(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let l=n.gradFunc(i,o),c=Array.isArray(l)?l:[l];M(c.length===t.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),M(c.every(h=>h instanceof Le),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let u={};return c.forEach((h,d)=>{u[d]=()=>h}),u};return this.runKernelFunc({forwardFunc:a,backwardsFunc:s,inputs:r})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Cu(),n=await this.backend.time(e);return n.wallMs=Cu()-t,n}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Fx;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};Ou.nextTensorId=0;Ou.nextVariableId=0;function J9(e){let t=pf(Nt(e),"float32");return $.makeTensor(t,e,"float32")}function $x(){let e=Ix();if(e._tfengine==null){let t=new kx(e);e._tfengine=new Ou(t)}return E9(e._tfengine.ENV),G9(()=>e._tfengine),e._tfengine}var $=$x();function Q9(e,t){let n={a:e,b:t};return $.runKernel(Ia,n)}var zu={};Me(zu,{isBrowser:()=>Dx,isMobile:()=>eI});function tI(){return typeof navigator!="undefined"&&navigator!=null}function eI(e){if(e||tI()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function Dx(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var gr=J();gr.registerFlag("DEBUG",()=>!1,e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});gr.registerFlag("IS_BROWSER",()=>Dx());gr.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");gr.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));gr.registerFlag("PROD",()=>!1);gr.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>gr.getBool("DEBUG"));gr.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);gr.registerFlag("IS_TEST",()=>!1);gr.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);gr.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function $r(e,t){let n=e;if(tn(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let r=[];for(;Array.isArray(n)||tn(n)&&t!=="string";)r.push(n.length),n=n[0];return Array.isArray(e)&&J().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Ox(e,r,[]),r}function Ox(e,t,n){if(n=n||[],!Array.isArray(e)&&!tn(e)){M(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}M(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),M(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let r=t.slice(1);for(let a=0;a=0&&(a=r),zx(r,a,t,n),e==null||!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=$r(e,a);!tn(e)&&!Array.isArray(e)&&(e=[e]);let i=a!=="string"?sd(e,a):ss(e,[],!0);return $.makeTensor(i,s,a)}function Pu(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((a,s)=>R(a,`${t}[${s}]`,n,r))}var Px="__op";function D(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Px;let a=(...s)=>{$.startScope(n);try{let i=r(...s);return mf(i)&&console.error("Cannot return a Promise inside of tidy."),$.endScope(i),i}catch(i){throw $.endScope(null),i}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}function nI(e,t){let n=R(e,"real","complex"),r=R(t,"imag","complex");an(n.shape,r.shape,`real and imag shapes, ${n.shape} and ${r.shape}, must match in call to tf.complex().`);let a={real:n,imag:r};return $.runKernel(Eh,a)}var Ea=D({complex_:nI});function Ca(e,t,n,r){if(r==null&&(r=vh(e)),r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(t!=null){ff(t);let a=Nt(t),s=Nt(n);M(a===s,()=>`Based on the provided shape, [${t}], the tensor should have ${a} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!tn(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=r!=="string"?sd(e,r):ss(e,[],!0),$.makeTensor(e,t,r)}function xr(e,t,n){let r=$r(e,n);return Ca(e,t,r,n)}var Tf={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},ud=4;async function aI(e,t){let n=[],r=[],a=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let d=await l.bytes(),p=d.reduce((A,y)=>A+y.length,0)+ud*d.length,m=new Uint8Array(p),f=0;for(let A=0;A{if(t+=s.byteLength,n.push(s.byteLength===s.buffer.byteLength?s:new s.constructor(s)),!(s instanceof Float32Array||s instanceof Int32Array||s instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${s.constructor.name}`)});let r=new Uint8Array(t),a=0;return n.forEach(s=>{r.set(new Uint8Array(s.buffer),a),a+=s.byteLength}),r.buffer}var Ef=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Wx(e){return Ef?Buffer.byteLength(e):new Blob([e]).size}function iI(e){if(Ef)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let r=0,a=t.length;r{t+=a.byteLength});let n=new Uint8Array(t),r=0;return e.forEach(a=>{n.set(new Uint8Array(a),r),r+=a.byteLength}),n.buffer}function Bx(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function Lu(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:Wx(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:Wx(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function lI(){let e=n=>{let r=n<<13,a=0;for(;(r&8388608)==0;)a-=8388608,r<<=1;return r&=~8388608,a+=947912704,r|a},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function uI(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function cI(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function sI(){let e=lI(),t=uI(),n=cI();return r=>{let a=new ArrayBuffer(4*r.length),s=new Uint32Array(a);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(a)}}var St=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return St.instance==null&&(St.instance=new St),St.instance}static registerSaveRouter(e){St.getInstance().saveRouters.push(e)}static registerLoadRouter(e){St.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return St.getHandlers(e,"save")}static getLoadHandlers(e,t){return St.getHandlers(e,"load",t)}static getHandlers(e,t,n){let r=[];return(t==="load"?St.getInstance().loadRouters:St.getInstance().saveRouters).forEach(a=>{let s=a(e,n);s!==null&&r.push(s)}),r}},hI=e=>St.registerSaveRouter(e),dI=e=>St.registerLoadRouter(e),pI=e=>St.getSaveHandlers(e),fI=(e,t)=>St.getLoadHandlers(e,t),Rf="tensorflowjs",Mf=1,ai="models_store",Ra="model_info_store";function Vx(){if(!J().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ff(e){let t=e.result;t.createObjectStore(ai,{keyPath:"modelPath"}),t.createObjectStore(Ra,{keyPath:"modelPath"})}var si=class{constructor(e){if(this.indexedDB=Vx(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise((n,r)=>{let a=this.indexedDB.open(Rf,Mf);a.onupgradeneeded=()=>Ff(a),a.onsuccess=()=>{let s=a.result;if(t==null){let i=s.transaction(ai,"readonly"),o=i.objectStore(ai).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),r(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=l=>(s.close(),r(o.error)),i.oncomplete=()=>s.close()}else{let i=Lu(t),o=s.transaction(Ra,"readwrite"),l=o.objectStore(Ra),c=l.put({modelPath:this.modelPath,modelArtifactsInfo:i}),u;c.onsuccess=()=>{u=s.transaction(ai,"readwrite");let h=u.objectStore(ai).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});h.onsuccess=()=>n({modelArtifactsInfo:i}),h.onerror=d=>{l=o.objectStore(Ra);let p=l.delete(this.modelPath);p.onsuccess=()=>(s.close(),r(h.error)),p.onerror=m=>(s.close(),r(h.error))}},c.onerror=h=>(s.close(),r(c.error)),o.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}}},a.onerror=s=>r(a.error)})}};si.URL_SCHEME="indexeddb://";var jx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(si.URL_SCHEME)?mI(e.slice(si.URL_SCHEME.length)):null;St.registerSaveRouter(jx);St.registerLoadRouter(jx);function mI(e){return new si(e)}function AI(e){return e.startsWith(si.URL_SCHEME)?e.slice(si.URL_SCHEME.length):e}var yI=class{constructor(){this.indexedDB=Vx()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(Rf,Mf);n.onupgradeneeded=()=>Ff(n),n.onsuccess=()=>{let r=n.result,a=r.transaction(Ra,"readonly"),s=a.objectStore(Ra).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(r.close(),t(s.error)),a.oncomplete=()=>r.close()},n.onerror=r=>t(n.error)})}async removeModel(e){return e=AI(e),new Promise((t,n)=>{let r=this.indexedDB.open(Rf,Mf);r.onupgradeneeded=()=>Ff(r),r.onsuccess=()=>{let a=r.result,s=a.transaction(Ra,"readwrite"),i=s.objectStore(Ra),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return a.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let c=i.delete(e),u=()=>{l=a.transaction(ai,"readwrite");let h=l.objectStore(ai).delete(e);h.onsuccess=()=>t(o.result.modelArtifactsInfo),h.onerror=d=>n(o.error)};c.onsuccess=u,c.onerror=h=>(u(),a.close(),n(o.error))}},o.onerror=c=>(a.close(),n(o.error)),s.oncomplete=()=>{l==null?a.close():l.oncomplete=()=>a.close()}},r.onerror=a=>n(r.error)})}},ra="/",al="tensorflowjs_models",Ux="info",gI="model_topology",xI="weight_specs",wI="weight_data",bI="model_metadata";function Hx(e){return{info:[al,e,Ux].join(ra),topology:[al,e,gI].join(ra),weightSpecs:[al,e,xI].join(ra),weightData:[al,e,wI].join(ra),modelMetadata:[al,e,bI].join(ra)}}function _I(e){let t=e.split(ra);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(ra)}function vI(e){return e.startsWith(ii.URL_SCHEME)?e.slice(ii.URL_SCHEME.length):e}var ii=class{constructor(e){if(!J().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Hx(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Lu(e);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,iI(e.weightData));let a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:r}}catch(a){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${r.modelTopologyBytes}, weightSpecsBytes=${r.weightSpecsBytes}, weightDataBytes=${r.weightDataBytes}.`)}}}async load(){let e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(r==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=r;let a=this.LS.getItem(this.keys.modelMetadata);if(a!=null){let i=JSON.parse(a);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=oI(s),t}};ii.URL_SCHEME="localstorage://";var Gx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ii.URL_SCHEME)?kI(e.slice(ii.URL_SCHEME.length)):null;St.registerSaveRouter(Gx);St.registerLoadRouter(Gx);function kI(e){return new ii(e)}var II=class{constructor(){M(J().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),M(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=al+ra,n=ra+Ux;for(let r=0;r"scheme must not be undefined or null."),e.endsWith(sl)&&(e=e.slice(0,e.indexOf(sl))),M(e.length>0,()=>"scheme must not be an empty string.");let n=Gn.getInstance();M(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function cd(e){if(e.indexOf(sl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Gn.getSchemes().join(",")}`);return{scheme:e.split(sl)[0],path:e.split(sl)[1]}}async function qx(e,t,n=!1){M(e!==t,()=>`Old path and new path are the same: '${e}'`);let r=St.getLoadHandlers(e);M(r.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),M(r.length<2,()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${e}.`);let a=r[0],s=St.getSaveHandlers(t);M(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),M(s.length<2,()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${t}.`);let i=s[0],o=cd(e).scheme,l=cd(e).path,c=o===cd(e).scheme,u=await a.load();n&&c&&await Gn.getManager(o).removeModel(l);let h=await i.save(u);return n&&!c&&await Gn.getManager(o).removeModel(l),h.modelArtifactsInfo}async function SI(){let e=Gn.getSchemes(),t={};for(let n of e){let r=await Gn.getManager(n).listModels();for(let a in r){let s=n+sl+a;t[s]=r[a]}}return t}async function NI(e){let t=cd(e);return Gn.getManager(t.scheme).removeModel(t.path)}async function TI(e,t){return qx(e,t,!1)}async function EI(e,t){return qx(e,t,!0)}var CI=class{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}};if(J().get("IS_BROWSER")){J().setPlatform("browser",new CI);try{Gn.registerManager(ii.URL_SCHEME,new II)}catch(e){}try{Gn.registerManager(si.URL_SCHEME,new yI)}catch(e){}}var RI={importFetch:()=>Pk()},$f,MI=class{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return J().global.fetch!=null?J().global.fetch(e,t):($f==null&&($f=RI.importFetch()),$f(e,t))}now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)}};J().get("IS_NODE")&&J().setPlatform("node",new MI);function We(e,t="float32",n){return t=t||"float32",ff(e),new $t(e,t,n)}function FI(e,t){let n=R(e,"x","cast");if(!gx(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let r={x:n},a={dtype:t};return $.runKernel(cs,r,a)}var Ae=D({cast_:FI});function $I(e){let t={x:R(e,"x","clone","string_or_numeric")};return $.runKernel(vs,t)}var Dr=D({clone_:$I});function Xx(e,t=!1){console.log(e.toString(t))}$x();var DI={buffer:We,cast:Ae,clone:Dr,print:Xx};q9(DI);var bn={};Me(bn,{browserFiles:()=>OI,browserHTTPRequest:()=>PI,concatenateArrayBuffers:()=>Cf,copyModel:()=>TI,decodeWeights:()=>Lx,encodeWeights:()=>aI,fromMemory:()=>LI,getLoadHandlers:()=>fI,getModelArtifactsInfoForJSON:()=>Lu,getSaveHandlers:()=>pI,http:()=>Of,isHTTPScheme:()=>Df,listModels:()=>SI,loadWeights:()=>zI,moveModel:()=>EI,registerLoadRouter:()=>dI,registerSaveRouter:()=>hI,removeModel:()=>NI,weightsLoaderFactory:()=>Kx,withSaveHandler:()=>WI});var BI="model",VI=".json",jI=".weights.bin";function Zx(e){return new Promise(t=>setTimeout(t)).then(e)}var il=class{constructor(e){if(!J().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(il.URL_SCHEME)&&(e=e.slice(il.URL_SCHEME.length)),(e==null||e.length===0)&&(e=BI),this.modelTopologyFileName=e+VI,this.weightDataFileName=e+jI}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer);let a=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=a,await Zx(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await Zx(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Lu(e)}}}};il.URL_SCHEME="downloads://";var UI=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,r)=>{let a=new FileReader;a.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){r(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let l=i.weightsManifest;if(l==null){r(new Error(`weightManifest field is missing from file ${e.name}`));return}let c;try{c=this.checkManifestAndWeightFiles(l,t)}catch(p){r(p);return}let u=[],h=[],d=[];l.forEach(p=>{p.paths.forEach(m=>{h.push(m),d.push(null)}),u.push(...p.weights)}),l.forEach(p=>{p.paths.forEach(m=>{let f=new FileReader;f.onload=A=>{let y=A.target.result,g=h.indexOf(m);if(d[g]=y,d.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:u,weightData:Cf(d),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=A=>r(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(c[m])})})},a.onerror=s=>r(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),a.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],r=t.map(s=>Bx(s.name)),a={};for(let s of e)s.paths.forEach(i=>{let o=Bx(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),r.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);a[i]=t[r.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return a}},GI=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(il.URL_SCHEME)?HI(e.slice(il.URL_SCHEME.length)):null;St.registerSaveRouter(GI);function HI(e="model"){return new il(e)}function OI(e){return new UI(e)}function Yx(e,t,n,r){i(e),n=n==null?0:n,r=r==null?1:r,o(n,r);let a=0,s=l=>(l.then(c=>{let u=n+ ++a/e.length*(r-n);return t(u),c}),l);function i(l){M(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,c){M(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),M(c>=0&&c<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${c}`),M(c>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${c}`)}return Promise.all(e.map(s))}async function Jx(e,t){t==null&&(t={});let n=t.fetchFunc==null?J().platform.fetch:t.fetchFunc,r=e.map(c=>n(c,t.requestInit,{isBinary:!0})),a=0,s=.5,i=(t.onProgress==null?await Promise.all(r):await Yx(r,t.onProgress,a,s)).map(c=>c.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await Yx(i,t.onProgress,o,l)}async function zI(e,t="",n,r){return Kx(a=>Jx(a,{requestInit:r}))(e,t,n)}function Kx(e){return async(t,n="",r)=>{let a=t.map(()=>!1),s={},i=r!=null?r.map(()=>!1):[],o=[];if(t.forEach((p,m)=>{let f=0;p.weights.forEach(A=>{let y="quantization"in A?A.quantization.dtype:A.dtype,g=Tf[y]*Nt(A.shape),x=()=>{a[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:A,groupOffset:f,sizeBytes:g})};r!=null?r.forEach((v,w)=>{v===A.name&&(x(),i[w]=!0)}):x(),o.push(A.name),f+=g})}),!i.every(p=>p)){let p=r.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${p.join(", ")}. -Manifest JSON has weights with names: ${o.join(", ")}.`)}let l=a.reduce((p,m,f)=>(m&&p.push(f),p),[]),c=[];l.forEach(p=>{t[p].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;c.push(f)})});let u=await e(c),h={},d=0;return l.forEach(p=>{let m=t[p].paths.length,f=0;for(let x=0;x{let v=A.slice(x.groupOffset,x.groupOffset+x.sizeBytes),w=Lx(v,[x.manifestEntry]);for(let b in w)h[b]=w[b]}),d+=m}),h}}var qI="application/octet-stream",XI="application/json",zf=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(M(typeof t.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=t.fetchFunc):this.fetch=J().platform.fetch,M(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&M(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(r)],{type:XI}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:qI}),"model.weights.bin");let a=await this.fetch(this.path,t);if(a.ok)return{modelArtifactsInfo:Lu(e),responses:[a]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${a.status}.`)}async load(){let e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(p){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,r=t.weightsManifest,a=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,l=t.userDefinedMetadata;if(n==null&&r==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let c,u;r!=null&&([c,u]=await this.loadWeights(r));let h={modelTopology:n,weightSpecs:c,weightData:u,generatedBy:a,convertedBy:s,format:i};o!=null&&(h.signature=o),l!=null&&(h.userDefinedMetadata=l);let d=t.modelInitializer;return d&&(h.modelInitializer=d),h}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=KI(t),a=this.weightPathPrefix||n,s=[];for(let c of e)s.push(...c.weights);let i=[],o=[];for(let c of e)for(let u of c.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(u)):i.push(a+u+r);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await Jx(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,Cf(l)]}};zf.URL_SCHEME_REGEX=/^https?:\/\//;function KI(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),r=e.substring(0,t),a=n>t?e.substring(n):"";return[r+"/",a]}function Df(e){return e.match(zf.URL_SCHEME_REGEX)!=null}var Qx=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(r=>Df(r)):n=Df(e),n)return Of(e,t)}return null};St.registerSaveRouter(Qx);St.registerLoadRouter(Qx);function Of(e,t){return new zf(e,t)}function PI(e,t){return Of(e,t)}var Pf=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},ZI=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function LI(e,t,n,r){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new Pf(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pf({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pf({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r}))}function WI(e){return new ZI(e)}var ew={};Me(ew,{confusionMatrix:()=>YI});function JI(e,t,n=!1,r=!1){let a=R(e,"a","matMul"),s=R(t,"b","matMul");[a,s]=bt(a,s);let i={a,b:s},o={transposeA:n,transposeB:r};return $.runKernel(us,i,o)}var Be=D({matMul_:JI});function QI(e,t,n=1,r=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let a={indices:R(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:r};return $.runKernel($s,a,s)}var ol=D({oneHot_:QI});function eS(e,t){let n=R(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),M(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{M(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let r={x:n},a={perm:t};return $.runKernel(Qs,r,a)}var Ze=D({transpose_:eS});function tS(e,t,n){let r=R(e,"labels","confusionMatrix"),a=R(t,"predictions","confusionMatrix");M(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),M(r.rank===1,()=>`Expected the rank of labels to be 1, but got ${r.rank}`),M(a.rank===1,()=>`Expected the rank of predictions to be 1, but got ${a.rank}`),M(r.shape[0]===a.shape[0],()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`),M(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=ol(Ae(r,"int32"),n),i=ol(Ae(a,"int32"),n),o=Ze(s),l=Be(o,i);return Ae(l,"int32")}var YI=D({confusionMatrix_:tS}),oi={};Me(oi,{fromPixels:()=>aS,fromPixelsAsync:()=>nS,toPixels:()=>rS});function hd(e,t,n){if(as(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let r=$r(e,n);if(r.length!==3&&r.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}var ll;function tw(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)r=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)a=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)o=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);if(a){let d=2;if(a&&e.readyState element.")}if(ad(rd,$.backendName)!=null){let d={pixels:e},p={numChannels:t};return $.runKernel(rd,d,p)}let[l,c]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height],u;i?u=e.getContext("2d").getImageData(0,0,l,c).data:r||n?u=e.data:(s||a||o)&&(ll==null&&(ll=document.createElement("canvas").getContext("2d")),ll.canvas.width=l,ll.canvas.height=c,ll.drawImage(e,0,0,l,c),u=ll.getImageData(0,0,l,c).data);let h;if(t===4)h=new Int32Array(u);else{let d=l*c;h=new Int32Array(d*t);for(let p=0;p4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(a*r*4);for(let c=0;c1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${p}.`)}else if(n.dtype==="int32"&&(p<0||p>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${p}.`);s===1?(u[0]=p*o,u[1]=p*o,u[2]=p*o):u[d]=p*o}let h=c*4;l[h+0]=Math.round(u[0]),l[h+1]=Math.round(u[1]),l[h+2]=Math.round(u[2]),l[h+3]=Math.round(u[3])}if(t!=null){t.width=a,t.height=r;let c=t.getContext("2d"),u=new ImageData(l,a,r);c.putImageData(u,0,0)}return n!==e&&n.dispose(),l}var aS=D({fromPixels_:tw}),Lf={};Me(Lf,{prepareAndValidate:()=>nw});function nw(e,t){let n=e.shape.length,r=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(Nt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let a=t.shape,s=a[a.length-1],i=1;for(let h=0;hh/c),1].slice(0,s);return[l,i,c,u]}var Wf={};Me(Wf,{calculateShapes:()=>rw,validateInput:()=>Vf,validateUpdateShape:()=>Bf});function Bf(e,t,n){let r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank1?t.shape[r-1]:1,s=n.length,i=1;for(let h=a;huS,computeFlatOffset:()=>hS,computeOutShape:()=>aw,getNormalizedAxes:()=>iw,isSliceContinous:()=>cS,maskToAxes:()=>dd,parseSliceParams:()=>dw,sliceInfo:()=>dS,startForAxis:()=>cw,startIndicesWithElidedDims:()=>ow,stopForAxis:()=>hw,stopIndicesWithElidedDims:()=>lw,stridesForAxis:()=>uw,stridesWithElidedDims:()=>sw});function uS(e,t,n){let r=e.shape.length;M(r===t.length,()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`),M(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let a=0;a`Error in slice${r}D: begin[${a}] + size[${a}] (${t[a]+n[a]}) would overflow input.shape[${a}] (${e.shape[a]})`)}function dd(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function aw(e,t,n){let r=[];for(let a=0;a0){let p=t[0],m=n+1;u=ow(i,p,m,r,e),h=lw(o,p,m,a,e),d=sw(s,p,m,e)}else for(let p=0;p-1)s[o]=0;else{let l=pw(t,n,o),c=r[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=pw(t,n,o),c=r[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=r[a];return i<0&&(i+=l),i=hu(0,i,l-1),i}function hw(e,t,n,r,a,s){let i=t[a],o=n[a]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=r[a];return i<0&&(i+=l),o>0?i=hu(0,i,l):i=hu(-1,i,l-1),i}function cS(e,t,n){let r=n.length;for(let a=0;a1){r=a;break}for(let a=r+1;a0||n[a]!==e[a])return!1;return!0}function hS(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r{M(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(a).fill(-1):typeof n=="number"?s=[n,...new Array(a-1).fill(-1)]:n.lengthi>=0?i:(M(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-r[o])),[r,s]}function dS(e,t,n,r,a,s,i,o,l){let c=t.slice(),u=n.slice(),h=r;r==null&&(h=new Array(c.length));let d=dd(i);if(d.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&l!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let p=e.length-c.length,m=dd(o),f=e.slice();m.forEach(b=>{c[b]=0,u[b]=1,f.splice(b,0,1)});let{begin:A,end:y,strides:g}=iw(f,d,p,c,u,h,a,s,i);c=A,u=y,h=g;let x=dd(l);x.forEach(b=>{u[b]=c[b]+1,h[b]=1});let v=aw(c,u,h),w=v.filter((b,k)=>x.indexOf(k)===-1);return{nonStrided:h.every(b=>b===1),$begin:c,$end:u,$strides:h,size:v,newShape:f,outShape:w}}var re={};Me(re,{Serializable:()=>mw,SerializationMap:()=>li,registerClass:()=>Ma});var mw=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},li=class{constructor(){this.classNameMap={}}static getMap(){return li.instance==null&&(li.instance=new li),li.instance}static register(e){li.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function Ma(e){M(e.className!=null,()=>"Class being registered does not have the static className property defined."),M(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),M(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),li.register(e)}var Aw={};Me(Aw,{TEST_EPSILON_FLOAT16:()=>yw,encodeStrings:()=>gw,expectArrayBuffersEqual:()=>gS,expectArraysClose:()=>pS,expectArraysEqual:()=>mS,expectNumbersClose:()=>AS,expectPromiseToFail:()=>fS,expectValuesInRange:()=>yS,testEpsilon:()=>jf});var xS=.001,yw=.1;function pS(e,t,n){return n==null&&(n=jf()),Uf(e,t,(r,a)=>Hf(r,a,n))}function jf(){return $.backend.floatPrecision()===32?xS:yw}function Uf(e,t,n){let r=!0;if((tn(e)||tn(t))&&(r=!1),tn(e)&&tn(t)&&(r=!0),r){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=$r(e),o=$r(t);if(!na(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let a=tn(e)?e:ss(e),s=tn(t)?t:ss(t);if(a.length!==s.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${s.length}. -Actual: ${a}. -Expected: ${s}.`);for(let i=0;it.fail(),()=>t())}function mS(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return va(e)||va(e[0])||va(t)||va(t[0])?Uf(e,n,(r,a)=>r==a):Uf(e,t,(r,a)=>Hf(r,a,0))}function AS(e,t,n){if(n==null&&(n=jf()),!Hf(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Hf(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function yS(e,t,n){for(let r=0;rn)throw new Error(`Value out of range:${e[r]} low: ${t}, high: ${n}`)}function gS(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function gw(e){for(let t=0;tt.dispose())}function Vt(e){return $.keep(e)}function SS(e){return $.time(e)}function NS(e){return $.setBackend(e)}function TS(){return $.ready()}function ES(){return $.backendName}function CS(e){$.removeBackend(e)}function qf(e){return $.findBackend(e)}function RS(e){return $.findBackendFactory(e)}function ul(e,t,n=1){return $.registerBackend(e,t,n)}function xw(){return $.backend}function MS(e,t){J().setPlatform(e,t)}function FS(e,t){let n=R(e,"a","add"),r=R(t,"b","add");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Ia,a)}var se=D({add_:FS});function $S(e,t){let n=R(e,"a","floorDiv"),r=R(t,"b","floorDiv");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(ws,a)}var fd=D({floorDiv_:$S});function DS(e,t){let n=R(e,"a","div"),r=R(t,"b","div");if([n,r]=bt(n,r),n.dtype==="int32"&&r.dtype==="int32")return fd(n,r);let a={a:n,b:r},s={};return $.runKernel(ys,a,s)}var ge=D({div_:DS});function OS(e,t){let n=R(e,"a","mul"),r=R(t,"b","mul");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Fs,a)}var B=D({mul_:OS});function zS(e){let t=R(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return $.runKernel(Au,n)}else{let n={x:t};return $.runKernel(eo,n)}}var Dt=D({abs_:zS});function PS(e){let t={x:R(e,"x","acos")};return $.runKernel(to,t)}var Xf=D({acos_:PS});function LS(e){let t={x:R(e,"x","acosh")};return $.runKernel(no,t)}var Kf=D({acosh_:LS});function WS(e){M(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),M(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((a,s)=>R(a,`tensors${s}`,"addN")),n=t[0];t.forEach(a=>{if(a.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(a=>{if(!na(a.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let r=t;return $.runKernel(is,r)}var md=D({addN_:WS});function BS(e,t=null,n=!1){let r={x:R(e,"x","all","bool")},a={axis:t,keepDims:n};return $.runKernel(ro,r,a)}var Ad=D({all_:BS});function VS(e,t=null,n=!1){let r={x:R(e,"x","any","bool")},a={axis:t,keepDims:n};return $.runKernel(ao,r,a)}var Wu=D({any_:VS});function jS(e,t=0){let n={x:R(e,"x","argMax")},r={axis:t};return $.runKernel(os,n,r)}var Bu=D({argMax_:jS});function US(e,t=0){let n={x:R(e,"x","argMin")},r={axis:t};return $.runKernel(pu,n,r)}var Zf=D({argMin_:US});function HS(e){let t={x:R(e,"x","asin")};return $.runKernel(so,t)}var Yf=D({asin_:HS});function GS(e){let t={x:R(e,"x","asinh")};return $.runKernel(io,t)}var Jf=D({asinh_:GS});function qS(e){let t={x:R(e,"x","atan")};return $.runKernel(oo,t)}var Qf=D({atan_:qS});function XS(e,t){let n=R(e,"a","atan2"),r=R(t,"b","atan2");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(uo,a)}var em=D({atan2_:XS});function KS(e){let t={x:R(e,"x","atanh")};return $.runKernel(lo,t)}var tm=D({atanh_:KS});function ZS(e,t,n,r,a="NHWC",s){let i=e[3],o=[...t,i],l=ww(a);return Vu(e,o,n,s,r,null,null,l)}function bw(e,t,n,r,a,s,i="channelsLast"){let[o,l]=yd(t),c;if(i==="channelsLast")c=[o,l,e[3],e[3]];else if(i==="channelsFirst")c=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Vu(e,c,n,r,a,s,!1,i)}function YS(e,t,n,r,a,s,i="NDHWC"){let[o,l,c]=nm(t),u,h;if(i==="NDHWC")h="channelsLast",u=[o,l,c,e[4],e[4]];else if(i==="NCDHW")h="channelsFirst",u=[o,l,c,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return _w(e,u,n,r,a,!1,h,s)}function Vu(e,t,n,r,a,s,i=!1,o="channelsLast"){let[l,c,u,h]=[-1,-1,-1,-1];if(o==="channelsLast")[l,c,u,h]=e;else if(o==="channelsFirst")[l,h,c,u]=e;else throw new Error(`Unknown dataFormat ${o}`);let[d,p,,m]=t,[f,A]=yd(n),[y,g]=yd(r),x=cl(d,y),v=cl(p,g),{padInfo:w,outHeight:b,outWidth:k}=JS(a,c,u,f,A,x,v,s,o),N=i?m*h:m,C;return o==="channelsFirst"?C=[l,N,b,k]:o==="channelsLast"&&(C=[l,b,k,N]),{batchSize:l,dataFormat:o,inHeight:c,inWidth:u,inChannels:h,outHeight:b,outWidth:k,outChannels:N,padInfo:w,strideHeight:f,strideWidth:A,filterHeight:d,filterWidth:p,effectiveFilterHeight:x,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:g,inShape:e,outShape:C,filterShape:t}}function _w(e,t,n,r,a,s=!1,i="channelsLast",o){let[l,c,u,h,d]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,c,u,h,d]=e;else if(i==="channelsFirst")[l,d,c,u,h]=e;else throw new Error(`Unknown dataFormat ${i}`);let[p,m,f,,A]=t,[y,g,x]=nm(n),[v,w,b]=nm(r),k=cl(p,v),N=cl(m,w),C=cl(f,b),{padInfo:F,outDepth:O,outHeight:z,outWidth:V}=QS(a,c,u,h,y,g,x,k,N,C,o),j=s?A*d:A,U;return i==="channelsFirst"?U=[l,j,O,z,V]:i==="channelsLast"&&(U=[l,O,z,V,j]),{batchSize:l,dataFormat:i,inDepth:c,inHeight:u,inWidth:h,inChannels:d,outDepth:O,outHeight:z,outWidth:V,outChannels:j,padInfo:F,strideDepth:y,strideHeight:g,strideWidth:x,filterDepth:p,filterHeight:m,filterWidth:f,effectiveFilterDepth:k,effectiveFilterHeight:N,effectiveFilterWidth:C,dilationDepth:v,dilationHeight:w,dilationWidth:b,inShape:e,outShape:U,filterShape:t}}function eN(e,t,n,r,a){r==null&&(r=rm(e,t,n));let s=e[0],i=e[1],o=ui((s-t+2*r)/n+1,a),l=ui((i-t+2*r)/n+1,a);return[o,l]}function tN(e,t,n,r,a,s){a==null&&(a=rm(e,t,r));let i=e[0],o=e[1],l=e[2],c=ui((i-t+2*a)/r+1,s),u=ui((o-t+2*a)/r+1,s),h=ui((l-t+2*a)/r+1,s);return[c,u,h,n]}function rm(e,t,n,r=1){let a=cl(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function yd(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function nm(e){return typeof e=="number"?[e,e,e]:e}function cl(e,t){return t<=1?e:e+(e-1)*(t-1)}function JS(e,t,n,r,a,s,i,o,l){let c,u,h;if(typeof e=="number"){c={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let d=eN([t,n],s,r,e,o);u=d[0],h=d[1]}else if(e==="same"){u=Math.ceil(t/r),h=Math.ceil(n/a);let d=Math.max(0,(u-1)*r+s-t),p=Math.max(0,(h-1)*a+i-n),m=Math.floor(d/2),f=d-m,A=Math.floor(p/2),y=p-A;c={top:m,bottom:f,left:A,right:y,type:"SAME"}}else if(e==="valid")c={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-s+1)/r),h=Math.ceil((n-i+1)/a);else if(typeof e=="object"){let d=l==="channelsLast"?e[1][0]:e[2][0],p=l==="channelsLast"?e[1][1]:e[2][1],m=l==="channelsLast"?e[2][0]:e[3][0],f=l==="channelsLast"?e[2][1]:e[3][1];c={top:d,bottom:p,left:m,right:f,type:d===0&&p===0&&m===0&&f===0?"VALID":"EXPLICIT"},u=ui((t-s+d+p)/r+1,o),h=ui((n-i+m+f)/a+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:c,outHeight:u,outWidth:h}}function QS(e,t,n,r,a,s,i,o,l,c,u){let h,d,p,m;if(typeof e=="number"){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=tN([t,n,r,1],o,1,a,e,u);d=f[0],p=f[1],m=f[2]}else if(e==="same"){d=Math.ceil(t/a),p=Math.ceil(n/s),m=Math.ceil(r/i);let f=(d-1)*a+o-t,A=(p-1)*s+l-n,y=(m-1)*i+c-r,g=Math.floor(f/2),x=f-g,v=Math.floor(A/2),w=A-v,b=Math.floor(y/2),k=y-b;h={top:v,bottom:w,left:b,right:k,front:g,back:x,type:"SAME"}}else if(e==="valid")h={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},d=Math.ceil((t-o+1)/a),p=Math.ceil((n-l+1)/s),m=Math.ceil((r-c+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:h,outDepth:d,outHeight:p,outWidth:m}}function ui(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Fa(e){let[t,n,r]=yd(e);return t===1&&n===1&&r===1}function Or(e,t){return Fa(e)||Fa(t)}function ww(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function nN(e,t){let n={x:R(e,"x","reshape","string_or_numeric")},r={shape:t};return $.runKernel(Bo,n,r)}var H=D({reshape_:nN});function rN(e,t,n,r,a){let s=R(e,"x","avgPool","float32"),i=1;M(Or(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),M(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),a!=null&&M(Bt(r),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a},h=$.runKernel(ls,c,u);return h=Ae(h,s.dtype),l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var ju=D({avgPool_:rN});function aN(e,t,n,r,a,s="NDHWC"){let i=R(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),M(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),a!=null&&M(Bt(r),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},h=$.runKernel(fu,c,u);return h=Ae(h,o.dtype),l?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var am=D({avgPool3d_:aN});function sN(e,t=0){M(e.length>=1,()=>"Pass at least one tensor to concat");let n=Pu(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${s.dtype}. `)}),n.length===1)return Dr(n[0]);let r=n,a={axis:t};return $.runKernel(co,r,a)}var ot=D({concat_:sN});function iN(e){let t={x:R(e,"x","sigmoid")};return $.runKernel(Hs,t)}var _n=D({sigmoid_:iN});function oN(e,t,n){let r=R(e,"x","slice","string_or_numeric");if(r.rank===0)throw new Error("Slicing scalar is not possible");let a={x:r},s={begin:t,size:n};return $.runKernel(Ho,a,s)}var Re=D({slice_:oN});function lN(e){let t={x:R(e,"x","tanh")};return $.runKernel(Js,t)}var ci=D({tanh_:lN});function uN(e,t,n,r,a,s){let i=R(e,"forgetBias","basicLSTMCell"),o=R(t,"lstmKernel","basicLSTMCell"),l=R(n,"lstmBias","basicLSTMCell"),c=R(r,"data","basicLSTMCell"),u=R(a,"c","basicLSTMCell"),h=R(s,"h","basicLSTMCell"),d=ot([c,h],1),p=Be(d,o),m=se(p,l),f=m.shape[0],A=m.shape[1]/4,y=[f,A],g=Re(m,[0,0],y),x=Re(m,[0,A],y),v=Re(m,[0,A*2],y),w=Re(m,[0,A*3],y),b=se(B(_n(g),ci(x)),B(u,_n(se(i,v)))),k=B(ci(b),_n(w));return[b,k]}var cN=D({basicLSTMCell_:uN});function hN(e,t,n){let r=R(e,"x","batchToSpaceND"),a=t.reduce((o,l)=>o*l);M(r.rank>=1+t.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${t.length}`),M(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),M(r.shape[0]%a==0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${a}`);let s={x:r},i={blockShape:t,crops:n};return $.runKernel(mu,s,i)}var Uu=D({batchToSpaceND_:hN});function dN(e){let t;return e.rank===0||e.rank===1?t=H(e,[1,1,1,e.size]):e.rank===2?t=H(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function pN(e,t,n,r,a,s){s==null&&(s=.001);let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;r!=null&&(u=R(r,"offset","batchNorm")),M(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),M(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),M(c==null||o.rank===c.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let h={x:dN(i),scale:c,offset:u,mean:o,variance:l},d={varianceEpsilon:s},p=$.runKernel(bs,h,d);return H(p,i.shape)}var hi=D({batchNorm_:pN});function fN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),M(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),M(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var vw=D({batchNorm2d_:fN});function mN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),M(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),M(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var kw=D({batchNorm3d_:mN});function AN(e,t,n,r,a,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(n,"variance","batchNorm"),c;a!=null&&(c=R(a,"scale","batchNorm"));let u;return r!=null&&(u=R(r,"offset","batchNorm")),M(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),M(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),M(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),c!=null&&M(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`),u!=null&&M(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`),hi(i,o,l,u,c,s)}var Iw=D({batchNorm4d_:AN});function yN(e,t,n){let r=R(e,"x","bincount"),a=R(t,"weights","bincount");M(r.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),M(n>=0,()=>`size must be non-negative, but got ${n}.`),M(a.size===r.size||a.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`);let s={x:r,weights:a},i={size:n};return $.runKernel(Th,s,i)}var Sw=D({bincount_:yN});function gN(e,t){let n=R(e,"broadcastTo","x"),r=n.shape;if(t.some(l=>!(l>0)||l%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let l=n.shape.slice();for(;l.length=0;l--)if(a[l]===t[l])s[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${t}].`);if(s.map((l,c)=>l>1?c:-1).filter(l=>l>=0).length===0)return Dr(n);let i={x:n},o={reps:s};return $.runKernel(Na,i,o)}var hl=D({broadcastTo_:gN});function xN(e){let t={x:R(e,"x","ceil")};return $.runKernel(hs,t)}var sm=D({ceil_:xN});function wN(e,t,n){let r=R(e,"x","clipByValue");M(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let a={x:r},s={clipValueMin:t,clipValueMax:n};return $.runKernel(Sa,a,s)}var vn=D({clipByValue_:wN});function bN(e){return ot(e,0)}var Nw=D({concat1d_:bN});function _N(e,t){return ot(e,t)}var dl=D({concat2d_:_N});function vN(e,t){return ot(e,t)}var Tw=D({concat3d_:vN});function kN(e,t){return ot(e,t)}var Ew=D({concat4d_:kN});function IN(e,t,n,r,a="NHWC",s=[1,1],i){let o=R(e,"x","conv2d"),l=R(t,"filter","conv2d"),c=o,u=!1;o.rank===3&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),M(c.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`),M(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),i!=null&&M(Bt(r),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let h=a==="NHWC"?c.shape[3]:c.shape[1];M(h===l.shape[2],()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`),M(Or(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let d={x:c,filter:l},p={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i},m=$.runKernel(ds,d,p);return u?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var sa=D({conv2d_:IN});function SN(e,t,n,r,a="NWC",s=1,i){let o=R(e,"x","conv1d"),l=R(t,"filter","conv1d"),c=o,u=!1;o.rank===2&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1]])),M(c.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`),M(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),i!=null&&M(Bt(r),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`),M(c.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`),M(Or(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),M(a==="NWC",()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`);let h=H(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=H(c,[c.shape[0],1,c.shape[1],c.shape[2]]),p=sa(d,h,[1,n],r,"NHWC",[1,s],i);return u?H(p,[p.shape[2],p.shape[3]]):H(p,[p.shape[0],p.shape[2],p.shape[3]])}var gd=D({conv1d_:SN});function NN(e,t,n,r,a,s="NHWC",i){M(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,c=!1;t.rank===3&&(c=!0,l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),M(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),M(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),M(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let u=s==="NHWC"?o[3]:o[1],h=s==="NHWC"?l.shape[3]:l.shape[1];M(u===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`),M(h===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`),i!=null&&M(Bt(a),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let d={dy:l,filter:n},p={strides:r,pad:a,dataFormat:s,dimRoundingMode:i,inputShape:o},m=$.runKernel(ps,d,p);return c?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var im=D({conv2DBackpropInput_:NN});function TN(e,t,n,r,a,s){let i=R(e,"x","conv2dTranspose"),o=R(t,"filter","conv2dTranspose");return im(n,i,o,r,a,"NHWC",s)}var xd=D({conv2dTranspose_:TN});function EN(e,t,n,r,a="NDHWC",s=[1,1,1]){let i=R(e,"x","conv3d"),o=R(t,"filter","conv3d"),l=i,c=!1;i.rank===4&&(c=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),M(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),M(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),M(Or(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),M(a==="NDHWC",()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`);let u={x:l,filter:o},h={strides:n,pad:r,dataFormat:a,dilations:s},d=$.runKernel(yu,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var om=D({conv3d_:EN});function CN(e,t,n,r,a){M(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let l=s[4],c=i.shape[4];M(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),M(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),M(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),M(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),M(c===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`);let u={dy:i,filter:n},h={pad:a,strides:r,inputShape:s},d=$.runKernel(Mh,u,h);return o?H(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var Cw=D({conv3DBackpropInput_:CN});function RN(e,t,n,r,a){let s=R(e,"x","conv3dTranspose"),i=R(t,"filter","conv3dTranspose");return Cw(n,s,i,r,a)}var Rw=D({conv3dTranspose_:RN});function MN(e){let t={x:R(e,"x","cos")};return $.runKernel(fs,t)}var Hu=D({cos_:MN});function FN(e){let t={x:R(e,"x","cosh")};return $.runKernel(ho,t)}var wd=D({cosh_:FN});function $N(e,t=0,n=!1,r=!1){let a={x:R(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:r};return $.runKernel(ms,a,s)}var bd=D({cumsum_:$N});function DN(e,t,n,r=!1){let a=R(e,"x","denseBincount"),s=R(t,"weights","denseBincount");M(a.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`),M(a.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`),M(n>=0,()=>`size must be non-negative, but got ${n}.`),M(s.size===a.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${s.shape}.`);let i={x:a,weights:s},o={size:n,binaryOutput:r};return $.runKernel(Fh,i,o)}var Mw=D({denseBincount_:DN});function ON(e,t,n="NHWC"){let r=R(e,"x","depthToSpace"),a=n==="NHWC"?r.shape[1]:r.shape[2],s=n==="NHWC"?r.shape[2]:r.shape[3],i=n==="NHWC"?r.shape[3]:r.shape[1];M(a*t>=0,()=>`Negative dimension size caused by overflow when multiplying - ${a} and ${t} for depthToSpace with input shape - ${r.shape}`),M(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying +`;return c[c.length-1]=" "+c[c.length-1]+"]"+(s?"":m),c}function Du(e){let t=[];for(let n=0;n`Length of values '${a}' does not match the size inferred by the shape '${this.size}'.`)}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||yx(t,this.size),this.strides=Ji(e)}set(e,...t){t.length===0&&(t=[0]),F(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let n=this.locToIndex(t);this.values[n]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let a of e){if(a<0||a>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let n=e[e.length-1];for(let a=0;aic(n))}catch(n){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();let e=$a().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>ic(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();let e=await $a().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||($a().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return al.print(this,e)}clone(){return this.throwIfDisposed(),al.clone(this)}toString(e=!1){let t=this.dataSync();return KI(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),al.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),$a().makeVariable(this,e,t,n)}};Object.defineProperty(Le,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function Z(){return ym("Tensor",()=>Le)}Z();var Ou=class extends Le{constructor(e,t,n,a){super(e.shape,e.dtype,e.dataId,a);this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!er(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);$a().disposeTensor(this),this.dataId=e.dataId,$a().incRef(this,null)}dispose(){$a().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Ou,Symbol.hasInstance,{value:e=>e instanceof Le&&e.assign!=null&&e.assign instanceof Function});var ya={};Fe(ya,{assertTypesMatch:()=>Fx,getTensorsInContainer:()=>vm,isTensorInList:()=>eS,makeTypesMatch:()=>vt});var wm;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(wm||(wm={}));var km;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(km||(km={}));var Im;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(Im||(Im={}));var Sm;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(Sm||(Sm={}));var Nm;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(Nm||(Nm={}));var tS={float32:Sm,int32:km,bool:Im,complex64:Nm};function ia(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return tS[e][t]}function lc(e){return ia(e,"int32")}function vt(e,t){if(e.dtype===t.dtype)return[e,t];let n=ia(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Fx(e,t){F(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function eS(e,t){return t.some(n=>n.id===e.id)}function vm(e){let t=[],n=new Set;return $x(e,t,n),t}function $x(e,t,n){if(e==null)return;if(e instanceof Le){t.push(e);return}if(!nS(e))return;let a=e;for(let r in a){let s=a[r];n.has(s)||(n.add(s),$x(s,t,n))}}function nS(e){return Array.isArray(e)||typeof e=="object"}function Tm(e){return e.kernelName!=null}var Dx=class{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(let e in this.registeredVariables)this.registeredVariables[e].dispose()}},zu=class{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Dx}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){nl(e).forEach(t=>{t.disposeFunc!=null&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(t==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{let n=t.factory();if(n&&!(n instanceof du)&&typeof n.then=="function"){let a=++this.pendingBackendInitId,r=n.then(s=>a(athis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(a),()=>(a=t(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,t,n){e();try{let a=n();return t(),a}catch(a){throw t(),a}}nextTensorId(){return zu.nextTensorId++}nextVariableId(){return zu.nextVariableId++}clone(e){let t=D.runKernel(ks,{x:e}),n={x:e},a=s=>({x:()=>{let i="float32",o={x:s},l={dtype:i};return D.runKernel(ds,o,l)}}),r=[];return this.addTapeNode(this.state.activeScope.name,n,[t],a,r,{}),t}runKernel(e,t,n){if(rc(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){let a=this.backend.numDataIds(),r=0;n.forEach(o=>{r+=o.dtype==="complex64"?3:1});let s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=a-t-r-s;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[],a=this.isTapeOn(),r=this.state.numBytes,s=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let o,l=Tm(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Tm(e)){let{kernelName:h,inputs:m,attrs:f}=e;this.backendName==null&&this.backend;let A=rc(h,this.backendName);F(A!=null,()=>`Cannot find registered kernel '${h}' for backend '${this.backendName}'`),i=()=>{let y=this.backend.numDataIds();o=A.kernelFunc({inputs:m,attrs:f,backend:this.backend});let g=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(h,y,g);let x=g.map(k=>{if(k.rank!=null)return k;let{dataId:b,shape:v,dtype:I}=k;return this.makeTensorFromDataId(b,v,I)});if(a){let k=this.getTensorsForGradient(h,m,x);n=this.saveTensorsForBackwardMode(k)}return x}}else{let{forwardFunc:h}=e,m=f=>{!a||(n=f.map(A=>this.keep(this.clone(A))))};i=()=>{let f=this.backend.numDataIds();o=this.tidy(()=>h(this.backend,m));let A=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,f,A),A}}let{inputs:d,attrs:u}=e,p=Tm(e)?null:e.backwardsFunc,c;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?t=i():(c=this.profiler.profileKernel(l,d,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(c),t=c.outputs)}),a&&this.addTapeNode(l,d,t,p,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map(h=>d[h]!=null?d[h].shape:null),outputShapes:t.map(h=>h.shape),kernelTimeMs:c.timeMs,extraInfo:c.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(e,t,n){let a=xm(e);if(a!=null){let r=a.inputsToSave||[],s=a.outputsToSave||[],i;a.saveAllInputs?(F(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(l=>t[l])):i=r.map(l=>t[l]);let o=n.filter((l,d)=>s[d]);return i.concat(o)}return[]}makeTensor(e,t,n,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",a=a||this.backend;let r=e;n==="string"&&vr(e[0])&&(r=e.map(o=>Mu(o)));let s=a.write(r,t,n),i=new Le(t,n,s,this.nextTensorId());if(this.trackTensor(i,a),n==="string"){let o=this.state.tensorInfo.get(s),l=bx(r);this.state.numBytes+=l-o.bytes,o.bytes=l}return i}makeTensorFromDataId(e,t,n,a){n=n||"float32";let r=new Le(t,n,e,this.nextTensorId());return this.trackTensor(r,a),r}makeVariable(e,t=!0,n,a){n=n||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));let r=new Ou(e,t,n,this.nextTensorId());if(this.state.registeredVariables[r.name]!=null)throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let n=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(n=e.size*cm(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Ou||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;let t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){let n=e.size*cm(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(let e in this.state.registeredVariables){let t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){let e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;let t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(let a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,n,a,r,s){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=xm(e);o!=null&&(a=o.gradFunc),a!=null&&(i.gradient=l=>(l=l.map((d,u)=>{if(d==null){let p=n[u],c=Sp(p.size,p.dtype);return this.makeTensor(c,p.shape,p.dtype)}return d}),a(l.length>1?l:l[0],r,s))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){let t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){let t=vm(e),n=new Set(t.map(r=>r.id));for(let r=0;r{!r.kept&&r.scopeId===a.id&&this.track(r)})}gradients(e,t,n,a=!1){if(F(t.length>0,()=>"gradients() received an empty list of xs."),n!=null&&n.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);let r=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));F(r instanceof Le,()=>"The result y returned by f() must be a tensor.");let s=GI(this.state.activeTape,t,r);if(!a&&s.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{let i={};i[r.id]=n==null?aS(r.shape):n,qI(i,s,l=>this.tidy(l),rS);let o=t.map(l=>i[l.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(l=>{for(let d of l.saved)d.dispose()}),this.state.activeTape=null),{value:r,grads:o}})}customGrad(e){return F(wr(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{F(t.every(i=>i instanceof Le),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,a={};t.forEach((i,o)=>{a[o]=i});let r=(i,o)=>(n=e(...t,o),F(n.value instanceof Le,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),F(wr(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),s=(i,o)=>{let l=n.gradFunc(i,o),d=Array.isArray(l)?l:[l];F(d.length===t.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),F(d.every(p=>p instanceof Le),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");let u={};return d.forEach((p,c)=>{u[c]=()=>p}),u};return this.runKernelFunc({forwardFunc:r,backwardsFunc:s,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){let t=Ru(),n=await this.backend.time(e);return n.wallMs=Ru()-t,n}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Dx;for(let e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};zu.nextTensorId=0;zu.nextVariableId=0;function aS(e){let t=hm(Tt(e),"float32");return D.makeTensor(t,e,"float32")}function Ox(){let e=Nx();if(e._tfengine==null){let t=new Sx(e);e._tfengine=new zu(t)}return DI(e._tfengine.ENV),YI(()=>e._tfengine),e._tfengine}var D=Ox();function rS(e,t){let n={a:e,b:t};return D.runKernel(kr,n)}var _u={};Fe(_u,{isBrowser:()=>zx,isMobile:()=>sS});function iS(){return typeof navigator!="undefined"&&navigator!=null}function sS(e){if(e||iS()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function zx(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var ga=J();ga.registerFlag("DEBUG",()=>!1,e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")});ga.registerFlag("IS_BROWSER",()=>zx());ga.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");ga.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));ga.registerFlag("PROD",()=>!1);ga.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>ga.getBool("DEBUG"));ga.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);ga.registerFlag("IS_TEST",()=>!1);ga.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0);ga.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);function Da(e,t){let n=e;if(tn(e))return t==="string"?[]:[e.length];if(!Array.isArray(e))return[];let a=[];for(;Array.isArray(n)||tn(n)&&t!=="string";)a.push(n.length),n=n[0];return Array.isArray(e)&&J().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&_x(e,a,[]),a}function _x(e,t,n){if(n=n||[],!Array.isArray(e)&&!tn(e)){F(t.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}F(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),F(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let a=t.slice(1);for(let r=0;r=0&&(r=a),Px(a,r,t,n),e==null||!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string"){let o=e==null?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${o}'`)}let s=Da(e,r);!tn(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?sc(e,r):ss(e,[],!0);return D.makeTensor(i,s,r)}function Pu(e,t,n,a="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>M(r,`${t}[${s}]`,n,a))}var Lx="__op";function O(e){let t=Object.keys(e);if(t.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0],a=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+Lx;let r=(...s)=>{D.startScope(n);try{let i=a(...s);return mm(i)&&console.error("Cannot return a Promise inside of tidy."),D.endScope(i),i}catch(i){throw D.endScope(null),i}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}function oS(e,t){let n=M(e,"real","complex"),a=M(t,"imag","complex");rn(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, must match in call to tf.complex().`);let r={real:n,imag:a};return D.runKernel(Cp,r)}var Tr=O({complex_:oS});function Er(e,t,n,a){if(a==null&&(a=kp(e)),a==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!tn(e)&&!Array.isArray(e)&&typeof e!="number"&&typeof e!="boolean"&&typeof e!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(t!=null){fm(t);let r=Tt(t),s=Tt(n);F(r===s,()=>`Based on the provided shape, [${t}], the tensor should have ${r} values but has ${s}`);for(let i=0;i`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return!tn(e)&&!Array.isArray(e)&&(e=[e]),t=t||n,e=a!=="string"?sc(e,a):ss(e,[],!0),D.makeTensor(e,t,a)}function xa(e,t,n){let a=Da(e,n);return Er(e,t,a,n)}var Em={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},uc=4;async function uS(e,t){let n=[],a=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let c=await l.bytes(),h=c.reduce((A,y)=>A+y.length,0)+uc*c.length,m=new Uint8Array(h),f=0;for(let A=0;A{if(t+=s.byteLength,n.push(s.byteLength===s.buffer.byteLength?s:new s.constructor(s)),!(s instanceof Float32Array||s instanceof Int32Array||s instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${s.constructor.name}`)});let a=new Uint8Array(t),r=0;return n.forEach(s=>{a.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),a.buffer}var Cm=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Bx(e){return Cm?Buffer.byteLength(e):new Blob([e]).size}function pS(e){if(Cm)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),n="";for(let a=0,r=t.length;a{t+=r.byteLength});let n=new Uint8Array(t),a=0;return e.forEach(r=>{n.set(new Uint8Array(r),a),a+=r.byteLength}),n.buffer}function Vx(e){let t="/";for(e=e.trim();e.endsWith(t);)e=e.slice(0,e.length-1);let n=e.split(t);return n[n.length-1]}function Lu(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:e.modelTopology==null?0:Bx(JSON.stringify(e.modelTopology)),weightSpecsBytes:e.weightSpecs==null?0:Bx(JSON.stringify(e.weightSpecs)),weightDataBytes:e.weightData==null?0:e.weightData.byteLength}}function hS(){let e=n=>{let a=n<<13,r=0;for(;(a&8388608)==0;)r-=8388608,a<<=1;return a&=~8388608,r+=947912704,a|r},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let n=1024;n<2048;n++)t[n]=939524096+(n-1024<<13);return t}function fS(){let e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}function mS(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function dS(){let e=hS(),t=fS(),n=mS();return a=>{let r=new ArrayBuffer(4*a.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(r)}}var Nt=class{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return Nt.instance==null&&(Nt.instance=new Nt),Nt.instance}static registerSaveRouter(e){Nt.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Nt.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Nt.getHandlers(e,"save")}static getLoadHandlers(e,t){return Nt.getHandlers(e,"load",t)}static getHandlers(e,t,n){let a=[];return(t==="load"?Nt.getInstance().loadRouters:Nt.getInstance().saveRouters).forEach(r=>{let s=r(e,n);s!==null&&a.push(s)}),a}},AS=e=>Nt.registerSaveRouter(e),yS=e=>Nt.registerLoadRouter(e),gS=e=>Nt.getSaveHandlers(e),xS=(e,t)=>Nt.getLoadHandlers(e,t),Mm="tensorflowjs",Fm=1,ri="models_store",Cr="model_info_store";function jx(){if(!J().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e=typeof window=="undefined"?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function $m(e){let t=e.result;t.createObjectStore(ri,{keyPath:"modelPath"}),t.createObjectStore(Cr,{keyPath:"modelPath"})}var si=class{constructor(e){if(this.indexedDB=jx(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise((n,a)=>{let r=this.indexedDB.open(Mm,Fm);r.onupgradeneeded=()=>$m(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(ri,"readonly"),o=i.objectStore(ri).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));n(o.result.modelArtifacts)},o.onerror=l=>(s.close(),a(o.error)),i.oncomplete=()=>s.close()}else{let i=Lu(t),o=s.transaction(Cr,"readwrite"),l=o.objectStore(Cr),d=l.put({modelPath:this.modelPath,modelArtifactsInfo:i}),u;d.onsuccess=()=>{u=s.transaction(ri,"readwrite");let p=u.objectStore(ri).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i});p.onsuccess=()=>n({modelArtifactsInfo:i}),p.onerror=c=>{l=o.objectStore(Cr);let h=l.delete(this.modelPath);h.onsuccess=()=>(s.close(),a(p.error)),h.onerror=m=>(s.close(),a(p.error))}},d.onerror=p=>(s.close(),a(d.error)),o.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}}},r.onerror=s=>a(r.error)})}};si.URL_SCHEME="indexeddb://";var Ux=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(si.URL_SCHEME)?bS(e.slice(si.URL_SCHEME.length)):null;Nt.registerSaveRouter(Ux);Nt.registerLoadRouter(Ux);function bS(e){return new si(e)}function vS(e){return e.startsWith(si.URL_SCHEME)?e.slice(si.URL_SCHEME.length):e}var wS=class{constructor(){this.indexedDB=jx()}async listModels(){return new Promise((e,t)=>{let n=this.indexedDB.open(Mm,Fm);n.onupgradeneeded=()=>$m(n),n.onsuccess=()=>{let a=n.result,r=a.transaction(Cr,"readonly"),s=r.objectStore(Cr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(a.close(),t(s.error)),r.oncomplete=()=>a.close()},n.onerror=a=>t(n.error)})}async removeModel(e){return e=vS(e),new Promise((t,n)=>{let a=this.indexedDB.open(Mm,Fm);a.onupgradeneeded=()=>$m(a),a.onsuccess=()=>{let r=a.result,s=r.transaction(Cr,"readwrite"),i=s.objectStore(Cr),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let d=i.delete(e),u=()=>{l=r.transaction(ri,"readwrite");let p=l.objectStore(ri).delete(e);p.onsuccess=()=>t(o.result.modelArtifactsInfo),p.onerror=c=>n(o.error)};d.onsuccess=u,d.onerror=p=>(u(),r.close(),n(o.error))}},o.onerror=d=>(r.close(),n(o.error)),s.oncomplete=()=>{l==null?r.close():l.oncomplete=()=>r.close()}},a.onerror=r=>n(a.error)})}},tr="/",rl="tensorflowjs_models",Hx="info",kS="model_topology",IS="weight_specs",SS="weight_data",NS="model_metadata";function Gx(e){return{info:[rl,e,Hx].join(tr),topology:[rl,e,kS].join(tr),weightSpecs:[rl,e,IS].join(tr),weightData:[rl,e,SS].join(tr),modelMetadata:[rl,e,NS].join(tr)}}function TS(e){let t=e.split(tr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(tr)}function ES(e){return e.startsWith(ii.URL_SCHEME)?e.slice(ii.URL_SCHEME.length):e}var ii=class{constructor(e){if(!J().getBool("IS_BROWSER")||typeof window=="undefined"||typeof window.localStorage=="undefined")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Gx(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),a=Lu(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,pS(e.weightData));let r={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};return e.signature!=null&&(r.signature=e.signature),e.userDefinedMetadata!=null&&(r.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(r.modelInitializer=e.modelInitializer),this.LS.setItem(this.keys.modelMetadata,JSON.stringify(r)),{modelArtifactsInfo:a}}catch(r){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){let e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(n==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;let a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=a;let r=this.LS.getItem(this.keys.modelMetadata);if(r!=null){let i=JSON.parse(r);t.format=i.format,t.generatedBy=i.generatedBy,t.convertedBy=i.convertedBy,i.signature!=null&&(t.signature=i.signature),i.userDefinedMetadata!=null&&(t.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(t.modelInitializer=i.modelInitializer)}let s=this.LS.getItem(this.keys.weightData);if(s==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=cS(s),t}};ii.URL_SCHEME="localstorage://";var qx=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ii.URL_SCHEME)?CS(e.slice(ii.URL_SCHEME.length)):null;Nt.registerSaveRouter(qx);Nt.registerLoadRouter(qx);function CS(e){return new ii(e)}var RS=class{constructor(){F(J().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),F(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=rl+tr,n=tr+Hx;for(let a=0;a"scheme must not be undefined or null."),e.endsWith(sl)&&(e=e.slice(0,e.indexOf(sl))),F(e.length>0,()=>"scheme must not be an empty string.");let n=Gn.getInstance();F(n.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){let t=this.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}};function dc(e){if(e.indexOf(sl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Gn.getSchemes().join(",")}`);return{scheme:e.split(sl)[0],path:e.split(sl)[1]}}async function Xx(e,t,n=!1){F(e!==t,()=>`Old path and new path are the same: '${e}'`);let a=Nt.getLoadHandlers(e);F(a.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),F(a.length<2,()=>`Copying failed because more than one (${a.length}) load handlers for source URL ${e}.`);let r=a[0],s=Nt.getSaveHandlers(t);F(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),F(s.length<2,()=>`Copying failed because more than one (${a.length}) save handlers for destination URL ${t}.`);let i=s[0],o=dc(e).scheme,l=dc(e).path,d=o===dc(e).scheme,u=await r.load();n&&d&&await Gn.getManager(o).removeModel(l);let p=await i.save(u);return n&&!d&&await Gn.getManager(o).removeModel(l),p.modelArtifactsInfo}async function MS(){let e=Gn.getSchemes(),t={};for(let n of e){let a=await Gn.getManager(n).listModels();for(let r in a){let s=n+sl+r;t[s]=a[r]}}return t}async function FS(e){let t=dc(e);return Gn.getManager(t.scheme).removeModel(t.path)}async function $S(e,t){return Xx(e,t,!1)}async function DS(e,t){return Xx(e,t,!0)}var OS=class{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}};if(J().get("IS_BROWSER")){J().setPlatform("browser",new OS);try{Gn.registerManager(ii.URL_SCHEME,new RS)}catch(e){}try{Gn.registerManager(si.URL_SCHEME,new wS)}catch(e){}}var zS={importFetch:()=>j9()},Dm,_S=class{constructor(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return J().global.fetch!=null?J().global.fetch(e,t):(Dm==null&&(Dm=zS.importFetch()),Dm(e,t))}now(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}encode(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)}};J().get("IS_NODE")&&J().setPlatform("node",new _S);function We(e,t="float32",n){return t=t||"float32",fm(e),new Dt(e,t,n)}function PS(e,t){let n=M(e,"x","cast");if(!xx(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&n.dtype!=="string"||t!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");let a={x:n},r={dtype:t};return D.runKernel(ds,a,r)}var Ae=O({cast_:PS});function LS(e){let t={x:M(e,"x","clone","string_or_numeric")};return D.runKernel(ks,t)}var Oa=O({clone_:LS});function Kx(e,t=!1){console.log(e.toString(t))}Ox();var WS={buffer:We,cast:Ae,clone:Oa,print:Kx};JI(WS);var vn={};Fe(vn,{browserFiles:()=>BS,browserHTTPRequest:()=>jS,concatenateArrayBuffers:()=>Rm,copyModel:()=>$S,decodeWeights:()=>Wx,encodeWeights:()=>uS,fromMemory:()=>US,getLoadHandlers:()=>xS,getModelArtifactsInfoForJSON:()=>Lu,getSaveHandlers:()=>gS,http:()=>zm,isHTTPScheme:()=>Om,listModels:()=>MS,loadWeights:()=>VS,moveModel:()=>DS,registerLoadRouter:()=>yS,registerSaveRouter:()=>AS,removeModel:()=>FS,weightsLoaderFactory:()=>Zx,withSaveHandler:()=>HS});var GS="model",qS=".json",XS=".weights.bin";function Yx(e){return new Promise(t=>setTimeout(t)).then(e)}var il=class{constructor(e){if(!J().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(il.URL_SCHEME)&&(e=e.slice(il.URL_SCHEME.length)),(e==null||e.length===0)&&(e=GS),this.modelTopologyFileName=e+qS,this.weightDataFileName=e+XS}async save(e){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer);let r=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor;if(s.download=this.modelTopologyFileName,s.href=r,await Yx(()=>s.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let i=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;i.download=this.weightDataFileName,i.href=t,await Yx(()=>i.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Lu(e)}}}};il.URL_SCHEME="downloads://";var KS=class{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.files=e}async load(){let e=this.files[0],t=this.files.slice(1);return new Promise((n,a)=>{let r=new FileReader;r.onload=s=>{let i=JSON.parse(s.target.result),o=i.modelTopology;if(o==null){a(new Error(`modelTopology field is missing from file ${e.name}`));return}t.length===0&&n({modelTopology:o});let l=i.weightsManifest;if(l==null){a(new Error(`weightManifest field is missing from file ${e.name}`));return}let d;try{d=this.checkManifestAndWeightFiles(l,t)}catch(h){a(h);return}let u=[],p=[],c=[];l.forEach(h=>{h.paths.forEach(m=>{p.push(m),c.push(null)}),u.push(...h.weights)}),l.forEach(h=>{h.paths.forEach(m=>{let f=new FileReader;f.onload=A=>{let y=A.target.result,g=p.indexOf(m);if(c[g]=y,c.indexOf(null)===-1){let x={modelTopology:o,weightSpecs:u,weightData:Rm(c),format:i.format,generatedBy:i.generatedBy,convertedBy:i.convertedBy};i.signature!=null&&(x.signature=i.signature),i.userDefinedMetadata!=null&&(x.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(x.modelInitializer=i.modelInitializer),n(x)}},f.onerror=A=>a(`Failed to weights data from file of path '${m}'.`),f.readAsArrayBuffer(d[m])})})},r.onerror=s=>a(`Failed to read model topology and weights manifest JSON from file '${e.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(e)})}checkManifestAndWeightFiles(e,t){let n=[],a=t.map(s=>Vx(s.name)),r={};for(let s of e)s.paths.forEach(i=>{let o=Vx(i);if(n.indexOf(o)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${o}'`);if(n.push(o),a.indexOf(o)===-1)throw new Error(`Weight file with basename '${o}' is not provided.`);r[i]=t[a.indexOf(o)]});if(n.length!==t.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${t.length}).`);return r}},YS=e=>J().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(il.URL_SCHEME)?ZS(e.slice(il.URL_SCHEME.length)):null;Nt.registerSaveRouter(YS);function ZS(e="model"){return new il(e)}function BS(e){return new KS(e)}function Jx(e,t,n,a){i(e),n=n==null?0:n,a=a==null?1:a,o(n,a);let r=0,s=l=>(l.then(d=>{let u=n+ ++r/e.length*(a-n);return t(u),d}),l);function i(l){F(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,d){F(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),F(d>=0&&d<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${d}`),F(d>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${d}`)}return Promise.all(e.map(s))}async function Qx(e,t){t==null&&(t={});let n=t.fetchFunc==null?J().platform.fetch:t.fetchFunc,a=e.map(d=>n(d,t.requestInit,{isBinary:!0})),r=0,s=.5,i=(t.onProgress==null?await Promise.all(a):await Jx(a,t.onProgress,r,s)).map(d=>d.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await Jx(i,t.onProgress,o,l)}async function VS(e,t="",n,a){return Zx(r=>Qx(r,{requestInit:a}))(e,t,n)}function Zx(e){return async(t,n="",a)=>{let r=t.map(()=>!1),s={},i=a!=null?a.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(A=>{let y="quantization"in A?A.quantization.dtype:A.dtype,g=Em[y]*Tt(A.shape),x=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:A,groupOffset:f,sizeBytes:g})};a!=null?a.forEach((k,b)=>{k===A.name&&(x(),i[b]=!0)}):x(),o.push(A.name),f+=g})}),!i.every(h=>h)){let h=a.filter((m,f)=>!i[f]);throw new Error(`Could not find weights in manifest with names: ${h.join(", ")}. +Manifest JSON has weights with names: ${o.join(", ")}.`)}let l=r.reduce((h,m,f)=>(m&&h.push(f),h),[]),d=[];l.forEach(h=>{t[h].paths.forEach(m=>{let f=n+(n.endsWith("/")?"":"/")+m;d.push(f)})});let u=await e(d),p={},c=0;return l.forEach(h=>{let m=t[h].paths.length,f=0;for(let x=0;x{let k=A.slice(x.groupOffset,x.groupOffset+x.sizeBytes),b=Wx(k,[x.manifestEntry]);for(let v in b)p[v]=b[v]}),c+=m}),p}}var JS="application/octet-stream",QS="application/json",_m=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(F(typeof t.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=t.fetchFunc):this.fetch=J().platform.fetch,F(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&F(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;let n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n};e.signature!=null&&(a.signature=e.signature),e.userDefinedMetadata!=null&&(a.userDefinedMetadata=e.userDefinedMetadata),e.modelInitializer!=null&&(a.modelInitializer=e.modelInitializer),t.body.append("model.json",new Blob([JSON.stringify(a)],{type:QS}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:JS}),"model.weights.bin");let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:Lu(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){let e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(h){let m=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?m+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":m+=" Please make sure the server is serving valid JSON for this request.",new Error(m)}let n=t.modelTopology,a=t.weightsManifest,r=t.generatedBy,s=t.convertedBy,i=t.format,o=t.signature,l=t.userDefinedMetadata;if(n==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);let d,u;a!=null&&([d,u]=await this.loadWeights(a));let p={modelTopology:n,weightSpecs:d,weightData:u,generatedBy:r,convertedBy:s,format:i};o!=null&&(p.signature=o),l!=null&&(p.userDefinedMetadata=l);let c=t.modelInitializer;return c&&(p.modelInitializer=c),p}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[n,a]=eN(t),r=this.weightPathPrefix||n,s=[];for(let d of e)s.push(...d.weights);let i=[],o=[];for(let d of e)for(let u of d.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(u)):i.push(r+u+a);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await Qx(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,Rm(l)]}};_m.URL_SCHEME_REGEX=/^https?:\/\//;function eN(e){let t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),a=e.substring(0,t),r=n>t?e.substring(n):"";return[a+"/",r]}function Om(e){return e.match(_m.URL_SCHEME_REGEX)!=null}var eb=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let n=!0;if(Array.isArray(e)?n=e.every(a=>Om(a)):n=Om(e),n)return zm(e,t)}return null};Nt.registerSaveRouter(eb);Nt.registerLoadRouter(eb);function zm(e,t){return new _m(e,t)}function jS(e,t){return zm(e,t)}var Pm=class{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}},tN=class{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}};function US(e,t,n,a){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new Pm(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pm({modelTopology:e})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Pm({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:a}))}function HS(e){return new tN(e)}var tb={};Fe(tb,{confusionMatrix:()=>nN});function aN(e,t,n=!1,a=!1){let r=M(e,"a","matMul"),s=M(t,"b","matMul");[r,s]=vt(r,s);let i={a:r,b:s},o={transposeA:n,transposeB:a};return D.runKernel(us,i,o)}var Be=O({matMul_:aN});function rN(e,t,n=1,a=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let r={indices:M(e,"indices","oneHot","int32")},s={depth:t,onValue:n,offValue:a};return D.runKernel(Ds,r,s)}var ol=O({oneHot_:rN});function sN(e,t){let n=M(e,"x","transpose");if(t==null&&(t=n.shape.map((s,i)=>i).reverse()),F(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(s=>{F(s>=0&&s`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let a={x:n},r={perm:t};return D.runKernel(Qs,a,r)}var Ze=O({transpose_:sN});function iN(e,t,n){let a=M(e,"labels","confusionMatrix"),r=M(t,"predictions","confusionMatrix");F(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),F(a.rank===1,()=>`Expected the rank of labels to be 1, but got ${a.rank}`),F(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),F(a.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${a.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),F(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);let s=ol(Ae(a,"int32"),n),i=ol(Ae(r,"int32"),n),o=Ze(s),l=Be(o,i);return Ae(l,"int32")}var nN=O({confusionMatrix_:iN}),oi={};Fe(oi,{fromPixels:()=>uN,fromPixelsAsync:()=>oN,toPixels:()=>lN});function pc(e,t,n){if(rs(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let a=Da(e,n);if(a.length!==3&&a.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}var ll;function nb(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(e==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,a=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)a=!0;else if(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)r=!0;else if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)s=!0;else if(e.getContext!=null)i=!0;else if(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)o=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);if(r){let c=2;if(r&&e.readyState element.")}if(rc(ac,D.backendName)!=null){let c={pixels:e},h={numChannels:t};return D.runKernel(ac,c,h)}let[l,d]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],u;i?u=e.getContext("2d").getImageData(0,0,l,d).data:a||n?u=e.data:(s||r||o)&&(ll==null&&(ll=document.createElement("canvas").getContext("2d")),ll.canvas.width=l,ll.canvas.height=d,ll.drawImage(e,0,0,l,d),u=ll.getImageData(0,0,l,d).data);let p;if(t===4)p=new Int32Array(u);else{let c=l*d;p=new Int32Array(c*t);for(let h=0;h4||s===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);let i=await n.data(),o=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(r*a*4);for(let d=0;d1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(n.dtype==="int32"&&(h<0||h>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${h}.`);s===1?(u[0]=h*o,u[1]=h*o,u[2]=h*o):u[c]=h*o}let p=d*4;l[p+0]=Math.round(u[0]),l[p+1]=Math.round(u[1]),l[p+2]=Math.round(u[2]),l[p+3]=Math.round(u[3])}if(t!=null){t.width=r,t.height=a;let d=t.getContext("2d"),u=new ImageData(l,r,a);d.putImageData(u,0,0)}return n!==e&&n.dispose(),l}var uN=O({fromPixels_:nb}),Lm={};Fe(Lm,{prepareAndValidate:()=>ab});function ab(e,t){let n=e.shape.length,a=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(a<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${a}.`);if(t.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[a-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[a-1]} vs. ${n}`);if(Tt(e.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let r=t.shape,s=r[r.length-1],i=1;for(let p=0;pp/d),1].slice(0,s);return[l,i,d,u]}var Wm={};Fe(Wm,{calculateShapes:()=>rb,validateInput:()=>Vm,validateUpdateShape:()=>Bm});function Bm(e,t,n){let a=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${a}, and batchDim: ${r}.`;if(n.rank1?t.shape[a-1]:1,s=n.length,i=1;for(let p=r;pfN,computeFlatOffset:()=>AN,computeOutShape:()=>sb,getNormalizedAxes:()=>ob,isSliceContinous:()=>mN,maskToAxes:()=>cc,parseSliceParams:()=>hb,sliceInfo:()=>yN,startForAxis:()=>pb,startIndicesWithElidedDims:()=>lb,stopForAxis:()=>cb,stopIndicesWithElidedDims:()=>ub,stridesForAxis:()=>db,stridesWithElidedDims:()=>ib});function fN(e,t,n){let a=e.shape.length;F(a===t.length,()=>`Error in slice${a}D: Length of begin ${t} must match the rank of the array (${a}).`),F(a===n.length,()=>`Error in slice${a}D: Length of size ${n} must match the rank of the array (${a}).`);for(let r=0;r`Error in slice${a}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function cc(e){let t=[],n=0;for(;e>0;)e&1&&t.push(n),e/=2,n++;return t}function sb(e,t,n){let a=[];for(let r=0;r0){let h=t[0],m=n+1;u=lb(i,h,m,a,e),p=ub(o,h,m,r,e),c=ib(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let l=fb(t,n,o),d=a[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=fb(t,n,o),d=a[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),i=pu(0,i,l-1),i}function cb(e,t,n,a,r,s){let i=t[r],o=n[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=a[r];return i<0&&(i+=l),o>0?i=pu(0,i,l):i=pu(-1,i,l-1),i}function mN(e,t,n){let a=n.length;for(let r=0;r1){a=r;break}for(let r=a+1;r0||n[r]!==e[r])return!1;return!0}function AN(e,t){let n=e.length>0?e[e.length-1]:1;for(let a=0;a{F(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return n==null?s=new Array(r).fill(-1):typeof n=="number"?s=[n,...new Array(r-1).fill(-1)]:n.lengthi>=0?i:(F(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-a[o])),[a,s]}function yN(e,t,n,a,r,s,i,o,l){let d=t.slice(),u=n.slice(),p=a;a==null&&(p=new Array(d.length));let c=cc(i);if(c.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(i!==0&&o!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(i!==0&&l!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let h=e.length-d.length,m=cc(o),f=e.slice();m.forEach(v=>{d[v]=0,u[v]=1,f.splice(v,0,1)});let{begin:A,end:y,strides:g}=ob(f,c,h,d,u,p,r,s,i);d=A,u=y,p=g;let x=cc(l);x.forEach(v=>{u[v]=d[v]+1,p[v]=1});let k=sb(d,u,p),b=k.filter((v,I)=>x.indexOf(I)===-1);return{nonStrided:p.every(v=>v===1),$begin:d,$end:u,$strides:p,size:k,newShape:f,outShape:b}}var ae={};Fe(ae,{Serializable:()=>Ab,SerializationMap:()=>li,registerClass:()=>Rr});var Ab=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},li=class{constructor(){this.classNameMap={}}static getMap(){return li.instance==null&&(li.instance=new li),li.instance}static register(e){li.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function Rr(e){F(e.className!=null,()=>"Class being registered does not have the static className property defined."),F(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),F(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),li.register(e)}var yb={};Fe(yb,{TEST_EPSILON_FLOAT16:()=>gb,encodeStrings:()=>xb,expectArrayBuffersEqual:()=>kN,expectArraysClose:()=>gN,expectArraysEqual:()=>bN,expectNumbersClose:()=>vN,expectPromiseToFail:()=>xN,expectValuesInRange:()=>wN,testEpsilon:()=>jm});var IN=.001,gb=.1;function gN(e,t,n){return n==null&&(n=jm()),Um(e,t,(a,r)=>Hm(a,r,n))}function jm(){return D.backend.floatPrecision()===32?IN:gb}function Um(e,t,n){let a=!0;if((tn(e)||tn(t))&&(a=!1),tn(e)&&tn(t)&&(a=!0),a){let i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error(`Arrays are of different type. Actual: ${i}. Expected: ${o}`)}if(Array.isArray(e)&&Array.isArray(t)){let i=Da(e),o=Da(t);if(!er(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=tn(e)?e:ss(e),s=tn(t)?t:ss(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}. +Actual: ${r}. +Expected: ${s}.`);for(let i=0;it.fail(),()=>t())}function bN(e,t){let n=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return vr(e)||vr(e[0])||vr(t)||vr(t[0])?Um(e,n,(a,r)=>a==r):Um(e,t,(a,r)=>Hm(a,r,0))}function vN(e,t,n){if(n==null&&(n=jm()),!Hm(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Hm(e,t,n){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function wN(e,t,n){for(let a=0;an)throw new Error(`Value out of range:${e[a]} low: ${t}, high: ${n}`)}function kN(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function xb(e){for(let t=0;tt.dispose())}function jt(e){return D.keep(e)}function MN(e){return D.time(e)}function FN(e){return D.setBackend(e)}function $N(){return D.ready()}function DN(){return D.backendName}function ON(e){D.removeBackend(e)}function qm(e){return D.findBackend(e)}function zN(e){return D.findBackendFactory(e)}function ul(e,t,n=1){return D.registerBackend(e,t,n)}function bb(){return D.backend}function _N(e,t){J().setPlatform(e,t)}function PN(e,t){let n=M(e,"a","add"),a=M(t,"b","add");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(kr,r)}var se=O({add_:PN});function LN(e,t){let n=M(e,"a","floorDiv"),a=M(t,"b","floorDiv");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(bs,r)}var fc=O({floorDiv_:LN});function WN(e,t){let n=M(e,"a","div"),a=M(t,"b","div");if([n,a]=vt(n,a),n.dtype==="int32"&&a.dtype==="int32")return fc(n,a);let r={a:n,b:a},s={};return D.runKernel(ys,r,s)}var ge=O({div_:WN});function BN(e,t){let n=M(e,"a","mul"),a=M(t,"b","mul");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel($s,r)}var B=O({mul_:BN});function VN(e){let t=M(e,"x","abs");if(t.dtype==="complex64"){let n={x:t};return D.runKernel(Au,n)}else{let n={x:t};return D.runKernel(eo,n)}}var Ot=O({abs_:VN});function jN(e){let t={x:M(e,"x","acos")};return D.runKernel(to,t)}var Xm=O({acos_:jN});function UN(e){let t={x:M(e,"x","acosh")};return D.runKernel(no,t)}var Km=O({acosh_:UN});function HN(e){F(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),F(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((r,s)=>M(r,`tensors${s}`,"addN")),n=t[0];t.forEach(r=>{if(r.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!er(r.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let a=t;return D.runKernel(is,a)}var mc=O({addN_:HN});function GN(e,t=null,n=!1){let a={x:M(e,"x","all","bool")},r={axis:t,keepDims:n};return D.runKernel(ao,a,r)}var Ac=O({all_:GN});function qN(e,t=null,n=!1){let a={x:M(e,"x","any","bool")},r={axis:t,keepDims:n};return D.runKernel(ro,a,r)}var Wu=O({any_:qN});function XN(e,t=0){let n={x:M(e,"x","argMax")},a={axis:t};return D.runKernel(os,n,a)}var Bu=O({argMax_:XN});function KN(e,t=0){let n={x:M(e,"x","argMin")},a={axis:t};return D.runKernel(hu,n,a)}var Zm=O({argMin_:KN});function ZN(e){let t={x:M(e,"x","asin")};return D.runKernel(so,t)}var Ym=O({asin_:ZN});function YN(e){let t={x:M(e,"x","asinh")};return D.runKernel(io,t)}var Jm=O({asinh_:YN});function JN(e){let t={x:M(e,"x","atan")};return D.runKernel(oo,t)}var Qm=O({atan_:JN});function QN(e,t){let n=M(e,"a","atan2"),a=M(t,"b","atan2");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(uo,r)}var eA=O({atan2_:QN});function eT(e){let t={x:M(e,"x","atanh")};return D.runKernel(lo,t)}var tA=O({atanh_:eT});function tT(e,t,n,a,r="NHWC",s){let i=e[3],o=[...t,i],l=vb(r);return Vu(e,o,n,s,a,null,null,l)}function wb(e,t,n,a,r,s,i="channelsLast"){let[o,l]=yc(t),d;if(i==="channelsLast")d=[o,l,e[3],e[3]];else if(i==="channelsFirst")d=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Vu(e,d,n,a,r,s,!1,i)}function nT(e,t,n,a,r,s,i="NDHWC"){let[o,l,d]=nA(t),u,p;if(i==="NDHWC")p="channelsLast",u=[o,l,d,e[4],e[4]];else if(i==="NCDHW")p="channelsFirst",u=[o,l,d,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return kb(e,u,n,a,r,!1,p,s)}function Vu(e,t,n,a,r,s,i=!1,o="channelsLast"){let[l,d,u,p]=[-1,-1,-1,-1];if(o==="channelsLast")[l,d,u,p]=e;else if(o==="channelsFirst")[l,p,d,u]=e;else throw new Error(`Unknown dataFormat ${o}`);let[c,h,,m]=t,[f,A]=yc(n),[y,g]=yc(a),x=dl(c,y),k=dl(h,g),{padInfo:b,outHeight:v,outWidth:I}=aT(r,d,u,f,A,x,k,s,o),T=i?m*p:m,R;return o==="channelsFirst"?R=[l,T,v,I]:o==="channelsLast"&&(R=[l,v,I,T]),{batchSize:l,dataFormat:o,inHeight:d,inWidth:u,inChannels:p,outHeight:v,outWidth:I,outChannels:T,padInfo:b,strideHeight:f,strideWidth:A,filterHeight:c,filterWidth:h,effectiveFilterHeight:x,effectiveFilterWidth:k,dilationHeight:y,dilationWidth:g,inShape:e,outShape:R,filterShape:t}}function kb(e,t,n,a,r,s=!1,i="channelsLast",o){let[l,d,u,p,c]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,d,u,p,c]=e;else if(i==="channelsFirst")[l,c,d,u,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,A]=t,[y,g,x]=nA(n),[k,b,v]=nA(a),I=dl(h,k),T=dl(m,b),R=dl(f,v),{padInfo:$,outDepth:z,outHeight:_,outWidth:V}=rT(r,d,u,p,y,g,x,I,T,R,o),j=s?A*c:A,U;return i==="channelsFirst"?U=[l,j,z,_,V]:i==="channelsLast"&&(U=[l,z,_,V,j]),{batchSize:l,dataFormat:i,inDepth:d,inHeight:u,inWidth:p,inChannels:c,outDepth:z,outHeight:_,outWidth:V,outChannels:j,padInfo:$,strideDepth:y,strideHeight:g,strideWidth:x,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:I,effectiveFilterHeight:T,effectiveFilterWidth:R,dilationDepth:k,dilationHeight:b,dilationWidth:v,inShape:e,outShape:U,filterShape:t}}function sT(e,t,n,a,r){a==null&&(a=aA(e,t,n));let s=e[0],i=e[1],o=ui((s-t+2*a)/n+1,r),l=ui((i-t+2*a)/n+1,r);return[o,l]}function iT(e,t,n,a,r,s){r==null&&(r=aA(e,t,a));let i=e[0],o=e[1],l=e[2],d=ui((i-t+2*r)/a+1,s),u=ui((o-t+2*r)/a+1,s),p=ui((l-t+2*r)/a+1,s);return[d,u,p,n]}function aA(e,t,n,a=1){let r=dl(t,a);return Math.floor((e[0]*(n-1)-n+r)/2)}function yc(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function nA(e){return typeof e=="number"?[e,e,e]:e}function dl(e,t){return t<=1?e:e+(e-1)*(t-1)}function aT(e,t,n,a,r,s,i,o,l){let d,u,p;if(typeof e=="number"){d={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let c=sT([t,n],s,a,e,o);u=c[0],p=c[1]}else if(e==="same"){u=Math.ceil(t/a),p=Math.ceil(n/r);let c=Math.max(0,(u-1)*a+s-t),h=Math.max(0,(p-1)*r+i-n),m=Math.floor(c/2),f=c-m,A=Math.floor(h/2),y=h-A;d={top:m,bottom:f,left:A,right:y,type:"SAME"}}else if(e==="valid")d={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-s+1)/a),p=Math.ceil((n-i+1)/r);else if(typeof e=="object"){let c=l==="channelsLast"?e[1][0]:e[2][0],h=l==="channelsLast"?e[1][1]:e[2][1],m=l==="channelsLast"?e[2][0]:e[3][0],f=l==="channelsLast"?e[2][1]:e[3][1];d={top:c,bottom:h,left:m,right:f,type:c===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},u=ui((t-s+c+h)/a+1,o),p=ui((n-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:d,outHeight:u,outWidth:p}}function rT(e,t,n,a,r,s,i,o,l,d,u){let p,c,h,m;if(typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=iT([t,n,a,1],o,1,r,e,u);c=f[0],h=f[1],m=f[2]}else if(e==="same"){c=Math.ceil(t/r),h=Math.ceil(n/s),m=Math.ceil(a/i);let f=(c-1)*r+o-t,A=(h-1)*s+l-n,y=(m-1)*i+d-a,g=Math.floor(f/2),x=f-g,k=Math.floor(A/2),b=A-k,v=Math.floor(y/2),I=y-v;p={top:k,bottom:b,left:v,right:I,front:g,back:x,type:"SAME"}}else if(e==="valid")p={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},c=Math.ceil((t-o+1)/r),h=Math.ceil((n-l+1)/s),m=Math.ceil((a-d+1)/i);else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:c,outHeight:h,outWidth:m}}function ui(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Mr(e){let[t,n,a]=yc(e);return t===1&&n===1&&a===1}function za(e,t){return Mr(e)||Mr(t)}function vb(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function oT(e,t){let n={x:M(e,"x","reshape","string_or_numeric")},a={shape:t};return D.runKernel(Bo,n,a)}var H=O({reshape_:oT});function lT(e,t,n,a,r){let s=M(e,"x","avgPool","float32"),i=1;F(za(n,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),F(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),r!=null&&F(Vt(a),()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=D.runKernel(ls,d,u);return p=Ae(p,s.dtype),l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var ju=O({avgPool_:lT});function uT(e,t,n,a,r,s="NDHWC"){let i=M(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),F(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&F(Vt(a),()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=D.runKernel(fu,d,u);return p=Ae(p,o.dtype),l?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var rA=O({avgPool3d_:uT});function dT(e,t=0){F(e.length>=1,()=>"Pass at least one tensor to concat");let n=Pu(e,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${s.dtype}. `)}),n.length===1)return Oa(n[0]);let a=n,r={axis:t};return D.runKernel(po,a,r)}var ot=O({concat_:dT});function pT(e){let t={x:M(e,"x","sigmoid")};return D.runKernel(Hs,t)}var wn=O({sigmoid_:pT});function cT(e,t,n){let a=M(e,"x","slice","string_or_numeric");if(a.rank===0)throw new Error("Slicing scalar is not possible");let r={x:a},s={begin:t,size:n};return D.runKernel(Ho,r,s)}var Me=O({slice_:cT});function hT(e){let t={x:M(e,"x","tanh")};return D.runKernel(Js,t)}var di=O({tanh_:hT});function fT(e,t,n,a,r,s){let i=M(e,"forgetBias","basicLSTMCell"),o=M(t,"lstmKernel","basicLSTMCell"),l=M(n,"lstmBias","basicLSTMCell"),d=M(a,"data","basicLSTMCell"),u=M(r,"c","basicLSTMCell"),p=M(s,"h","basicLSTMCell"),c=ot([d,p],1),h=Be(c,o),m=se(h,l),f=m.shape[0],A=m.shape[1]/4,y=[f,A],g=Me(m,[0,0],y),x=Me(m,[0,A],y),k=Me(m,[0,A*2],y),b=Me(m,[0,A*3],y),v=se(B(wn(g),di(x)),B(u,wn(se(i,k)))),I=B(di(v),wn(b));return[v,I]}var mT=O({basicLSTMCell_:fT});function AT(e,t,n){let a=M(e,"x","batchToSpaceND"),r=t.reduce((o,l)=>o*l);F(a.rank>=1+t.length,()=>`input rank is ${a.rank} but should be > than blockShape.length ${t.length}`),F(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),F(a.shape[0]%r==0,()=>`input tensor batch is ${a.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:a},i={blockShape:t,crops:n};return D.runKernel(mu,s,i)}var Uu=O({batchToSpaceND_:AT});function yT(e){let t;return e.rank===0||e.rank===1?t=H(e,[1,1,1,e.size]):e.rank===2?t=H(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function gT(e,t,n,a,r,s){s==null&&(s=.001);let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;a!=null&&(u=M(a,"offset","batchNorm")),F(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),F(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),F(d==null||o.rank===d.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let p={x:yT(i),scale:d,offset:u,mean:o,variance:l},c={varianceEpsilon:s},h=D.runKernel(vs,p,c);return H(h,i.shape)}var pi=O({batchNorm_:gT});function xT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),F(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),F(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===2||d.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Ib=O({batchNorm2d_:xT});function bT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),F(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),F(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===3||d.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Sb=O({batchNorm3d_:bT});function vT(e,t,n,a,r,s){let i=M(e,"x","batchNorm"),o=M(t,"mean","batchNorm"),l=M(n,"variance","batchNorm"),d;r!=null&&(d=M(r,"scale","batchNorm"));let u;return a!=null&&(u=M(a,"offset","batchNorm")),F(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),F(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),F(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),d!=null&&F(d.rank===4||d.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${d.rank}.`),u!=null&&F(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`),pi(i,o,l,u,d,s)}var Nb=O({batchNorm4d_:vT});function wT(e,t,n){let a=M(e,"x","bincount"),r=M(t,"weights","bincount");F(a.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${a.dtype}`),F(n>=0,()=>`size must be non-negative, but got ${n}.`),F(r.size===a.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${a.shape}, weights shape: ${r.shape}.`);let s={x:a,weights:r},i={size:n};return D.runKernel(Ep,s,i)}var Tb=O({bincount_:wT});function kT(e,t){let n=M(e,"broadcastTo","x"),a=n.shape;if(t.some(l=>!(l>0)||l%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){let l=n.shape.slice();for(;l.length=0;l--)if(r[l]===t[l])s[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${t}].`);if(s.map((l,d)=>l>1?d:-1).filter(l=>l>=0).length===0)return Oa(n);let i={x:n},o={reps:s};return D.runKernel(Sr,i,o)}var pl=O({broadcastTo_:kT});function IT(e){let t={x:M(e,"x","ceil")};return D.runKernel(ps,t)}var sA=O({ceil_:IT});function ST(e,t,n){let a=M(e,"x","clipByValue");F(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`);let r={x:a},s={clipValueMin:t,clipValueMax:n};return D.runKernel(Ir,r,s)}var kn=O({clipByValue_:ST});function NT(e){return ot(e,0)}var Eb=O({concat1d_:NT});function TT(e,t){return ot(e,t)}var cl=O({concat2d_:TT});function ET(e,t){return ot(e,t)}var Cb=O({concat3d_:ET});function CT(e,t){return ot(e,t)}var Rb=O({concat4d_:CT});function RT(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","conv2d"),l=M(t,"filter","conv2d"),d=o,u=!1;o.rank===3&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(d.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${d.rank}.`),F(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),i!=null&&F(Vt(a),()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p=r==="NHWC"?d.shape[3]:d.shape[1];F(p===l.shape[2],()=>`Error in conv2d: depth of input (${p}) must match input depth for filter ${l.shape[2]}.`),F(za(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);let c={x:d,filter:l},h={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},m=D.runKernel(cs,c,h);return u?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var ar=O({conv2d_:RT});function MT(e,t,n,a,r="NWC",s=1,i){let o=M(e,"x","conv1d"),l=M(t,"filter","conv1d"),d=o,u=!1;o.rank===2&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1]])),F(d.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${d.rank}.`),F(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),i!=null&&F(Vt(a),()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),F(d.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${d.shape[2]}) must match input depth for filter ${l.shape[1]}.`),F(za(n,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${s}'`),F(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let p=H(l,[1,l.shape[0],l.shape[1],l.shape[2]]),c=H(d,[d.shape[0],1,d.shape[1],d.shape[2]]),h=ar(c,p,[1,n],a,"NHWC",[1,s],i);return u?H(h,[h.shape[2],h.shape[3]]):H(h,[h.shape[0],h.shape[2],h.shape[3]])}var gc=O({conv1d_:MT});function FT(e,t,n,a,r,s="NHWC",i){F(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,d=!1;t.rank===3&&(d=!0,l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),F(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),F(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),F(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);let u=s==="NHWC"?o[3]:o[1],p=s==="NHWC"?l.shape[3]:l.shape[1];F(u===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`),F(p===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${p}) must match output depth for filter ${n.shape[3]}.`),i!=null&&F(Vt(r),()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let c={dy:l,filter:n},h={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=D.runKernel(hs,c,h);return d?H(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var iA=O({conv2DBackpropInput_:FT});function $T(e,t,n,a,r,s){let i=M(e,"x","conv2dTranspose"),o=M(t,"filter","conv2dTranspose");return iA(n,i,o,a,r,"NHWC",s)}var xc=O({conv2dTranspose_:$T});function DT(e,t,n,a,r="NDHWC",s=[1,1,1]){let i=M(e,"x","conv3d"),o=M(t,"filter","conv3d"),l=i,d=!1;i.rank===4&&(d=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),F(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),F(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),F(za(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),F(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`);let u={x:l,filter:o},p={strides:n,pad:a,dataFormat:r,dilations:s},c=D.runKernel(yu,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var oA=O({conv3d_:DT});function OT(e,t,n,a,r){F(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let s=e,i=t,o=!1;t.rank===4&&(o=!0,i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);let l=s[4],d=i.shape[4];F(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),F(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),F(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),F(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),F(d===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[4]}.`);let u={dy:i,filter:n},p={pad:r,strides:a,inputShape:s},c=D.runKernel(Fp,u,p);return o?H(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var Mb=O({conv3DBackpropInput_:OT});function zT(e,t,n,a,r){let s=M(e,"x","conv3dTranspose"),i=M(t,"filter","conv3dTranspose");return Mb(n,s,i,a,r)}var Fb=O({conv3dTranspose_:zT});function _T(e){let t={x:M(e,"x","cos")};return D.runKernel(fs,t)}var Hu=O({cos_:_T});function PT(e){let t={x:M(e,"x","cosh")};return D.runKernel(co,t)}var bc=O({cosh_:PT});function LT(e,t=0,n=!1,a=!1){let r={x:M(e,"x","cumsum")},s={axis:t,exclusive:n,reverse:a};return D.runKernel(ms,r,s)}var vc=O({cumsum_:LT});function WT(e,t,n,a=!1){let r=M(e,"x","denseBincount"),s=M(t,"weights","denseBincount");F(r.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),F(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),F(n>=0,()=>`size must be non-negative, but got ${n}.`),F(s.size===r.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${s.shape}.`);let i={x:r,weights:s},o={size:n,binaryOutput:a};return D.runKernel($p,i,o)}var $b=O({denseBincount_:WT});function BT(e,t,n="NHWC"){let a=M(e,"x","depthToSpace"),r=n==="NHWC"?a.shape[1]:a.shape[2],s=n==="NHWC"?a.shape[2]:a.shape[3],i=n==="NHWC"?a.shape[3]:a.shape[1];F(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying + ${r} and ${t} for depthToSpace with input shape + ${a.shape}`),F(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${s} and ${t} for depthToSpace with input shape - ${r.shape}`),M(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${r.shape}`);let o={x:r},l={blockSize:t,dataFormat:n};return $.runKernel(fo,o,l)}var lm=D({depthToSpace_:ON});function zN(e,t,n,r,a="NHWC",s=[1,1],i){let o=R(e,"x","depthwiseConv2d"),l=R(t,"filter","depthwiseConv2d"),c=o,u=!1;o.rank===3&&(u=!0,c=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),M(c.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`),M(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),M(c.shape[3]===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),i!=null&&M(Bt(r),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let h={x:c,filter:l},d={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i},p=$.runKernel(As,h,d);return u?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var pl=D({depthwiseConv2d_:zN});function PN(e){let t={x:R(e,"x","diag")};return $.runKernel(Oh,t)}var LN=D({diag_:PN});function WN(e,t,n,r,a=[1,1],s="NHWC"){let i=R(e,"x","dilation2d"),o=R(t,"filter","dilation2d");M(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),M(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),M(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,c=!1;i.rank===3&&(l=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),c=!0);let u={x:l,filter:o},h={strides:n,pad:r,dilations:a},d=$.runKernel(gu,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var um=D({dilation2d_:WN});function BN(e,t){let n=e.length,r=[];for(let a=0;a1&&i===1&&r.unshift(s)}return r}function Ot(e,t){let n=[];for(let r=0;r1)&&n.unshift(s)}return n}function dt(e,t){let n=[],r=Math.max(e.length,t.length);for(let a=0;a`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`);let a=n.rank===1?n.size:n.shape[1],s=r.rank===1?r.size:r.shape[0];if(M(a===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`),n.rank===1&&r.rank===1){let i=H(n,[1,-1]),o=H(r,[-1,1]),l=Be(i,o);return H(l,[])}else if(n.rank===1&&r.rank===2){let i=H(n,[1,-1]),o=H(r,[r.shape[0],r.shape[1]]),l=Be(i,o);return H(l,[l.size])}else if(n.rank===2&&r.rank===1){let i=H(r,[-1,1]),o=Be(n,i);return H(o,[o.size])}else{let i=H(r,[r.shape[0],r.shape[1]]);return Be(n,i)}}var Fw=D({dot_:GN});function qN(e,...t){let n=t.map((a,s)=>R(a,`tensors${s}`,"einsum")),r={equation:e};return $.runKernel(Lh,n,r)}var $w=D({einsum_:qN});function XN(e){let t={x:R(e,"x","elu")};return $.runKernel(mo,t)}var fl=D({elu_:XN});function KN(e){let t=R(e,"x","erf");M(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ae(t,"float32"));let n={x:t};return $.runKernel(Ao,n)}var hm=D({erf_:KN});function ZN(e){let t={x:R(e,"x","exp")};return $.runKernel(gs,t)}var qn=D({exp_:ZN});function YN(e,t=0){let n=R(e,"x","expandDims","string_or_numeric");M(t<=n.rank,()=>"Axis must be <= rank of the tensor");let r={input:n},a={dim:t};return $.runKernel(go,r,a)}var on=D({expandDims_:YN});function JN(e){let t={x:R(e,"x","expm1")};return $.runKernel(xo,t)}var dm=D({expm1_:JN});function QN(e,t){let n=R(e,"x","tile","string_or_numeric");M(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let r={x:n},a={reps:t};return $.runKernel(Na,r,a)}var Da=D({tile_:QN});function eT(e,t,n,r="float32"){t==null&&(t=e);let a=We([e,t],r),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${s.rank}.`),M(Bt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=H(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},c={depthRadius:t,bias:n,alpha:r,beta:a},u=$.runKernel(_u,l,c);return o?H(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var mm=D({localResponseNormalization_:dT});function pT(e){let t={x:R(e,"x","log")};return $.runKernel(Is,t)}var Mn=D({log_:pT});function fT(e){let t={x:R(e,"x","log1p")};return $.runKernel(Eo,t)}var kd=D({log1p_:fT});function mT(e){return M(ka(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let r=R(t,"x","tf.grad","string_or_numeric"),a=n!=null?R(n,"dy","tf.grad"):null;return $.tidy(()=>{let{value:s,grads:i}=$.gradients(()=>e(r),[r],a);return a!=null&&an(s.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Id(i),i[0]})}}function AT(e){return M(ka(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{M(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let r=Pu(t,"args","tf.grads","string_or_numeric"),a=n!=null?R(n,"dy","tf.grads"):null;return $.tidy(()=>{let{value:s,grads:i}=$.gradients(()=>e(...r),r,a);return a!=null&&an(s.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Id(i),i})}}function yT(e){return M(ka(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{M(t instanceof Le,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),M(n==null||n instanceof Le,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:r,value:a}=$.gradients(()=>e(t),[t],n);return Id(r),{grad:r[0],value:a}}}function gT(e){return M(ka(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{M(Array.isArray(t)&&t.every(a=>a instanceof Le),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),M(n==null||n instanceof Le,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let r=$.gradients(()=>e(...t),t,n);return n!=null&&an(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Id(r.grads),r}}function Pw(e,t){M(ka(e),()=>"The f passed in variableGrads(f) must be a function"),M(t==null||Array.isArray(t)&&t.every(c=>c instanceof Du),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let c in $.registeredVariables)t.push($.registeredVariables[c])}let r=n?t.filter(c=>!c.trainable):null,a=t.length;t=t.filter(c=>c.trainable),M(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`);let s=!0,{value:i,grads:o}=$.gradients(e,t,null,s);M(o.some(c=>c!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),M(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let l={};return t.forEach((c,u)=>{o[u]!=null&&(l[c.name]=o[u])}),r!=null&&r.forEach(c=>l[c.name]=null),{value:i,grads:l}}function zr(e){return $.customGrad(e)}function Id(e){if(e.filter(t=>t==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that - the f you passed encloses all operations that lead from x to y.`)}function xT(e){let t={x:R(e,"x","neg")};return $.runKernel(Mo,t)}var _t=D({neg_:xT});function wT(e){let t={x:R(e,"x","softplus")};return $.runKernel(Xo,t)}var fi=D({softplus_:wT});function bT(e){let t=R(e,"x","logSigmoid");return zr(n=>({value:_t(fi(_t(n))),gradFunc:r=>B(r,_n(_t(n)))}))(t)}var Lw=D({logSigmoid_:bT});function _T(e,t=null,n=!1){let r={x:R(e,"x","max")},a={reductionIndices:t,keepDims:n};return $.runKernel(Ss,r,a)}var Xn=D({max_:_T});function vT(e,t){let n=R(e,"a","sub"),r=R(t,"b","sub");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Zs,a)}var ye=D({sub_:vT});function kT(e,t=null,n=!1){let r=R(e,"x","sum");r.dtype==="bool"&&(r=Ae(r,"int32"));let a={x:r},s={axis:t,keepDims:n};return $.runKernel(qs,a,s)}var Ne=D({sum_:kT});function IT(e,t=-1){let n=R(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return zr((r,a)=>{let s=!0,i=Xn(r,t,!0),o=ye(r,i),l=ye(Ae(o,"float32"),Mn(Ne(qn(o),t,s)));return a([l]),{value:l,gradFunc:(c,u)=>{let[h]=u,d=!0,p=qn(h);return ye(c,B(Ne(c,t,d),p))}}})(n)}var Sd=D({logSoftmax_:IT});function Am(e,t){for(let n=0;ne[s]);return[n,a]}function mi(e,t){let n=t.map(r=>1);return Ww(e,n,t)}function ST(e,t,n){M(Am(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function Vw(e,t){if(Am(e,t))return null;let n=[];for(let r=0;rn.push(r)),n}function ym(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function NT(e,t){let n=[];for(let r=t-e;r`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),M(Or(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),a!=null&&M(Bt(r),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a},h=$.runKernel(Ts,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var Ku=D({maxPool_:FT});function $T(e,t=[1,1,1],n,r,a,s="NDHWC"){let i=R(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),M(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),M(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),a!=null&&M(Bt(r),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${a} but got pad ${r}.`);let c={x:o},u={filterSize:t,strides:n,pad:r,dimRoundingMode:a,dataFormat:s},h=$.runKernel(vu,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var xm=D({maxPool3d_:$T});function DT(e,t,n,r,a=!1){let s={x:R(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:r,includeBatchInIndex:a},o=$.runKernel(Xh,s,i);return{result:o[0],indexes:o[1]}}var Uw=D({maxPoolWithArgmax_:DT});function OT(e,t){let n=R(e,"a","maximum"),r=R(t,"b","maximum");[n,r]=bt(n,r),n.dtype==="bool"&&(n=Ae(n,"int32"),r=Ae(r,"int32")),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Ns,a)}var Pr=D({maximum_:OT});function zT(e,t=null,n=!1){let r={x:R(e,"x","mean")},a={axis:t,keepDims:n};return $.runKernel(Es,r,a)}var vt=D({mean_:zT});function Et(e,t="float32"){if(t==="complex64"){let r=Et(e,"float32"),a=Et(e,"float32");return Ea(r,a)}let n=Ih(Nt(e),t);return $.makeTensor(n,e,t)}function Fn(e,t="float32"){if(t==="complex64"){let r=Fn(e,"float32"),a=Et(e,"float32");return Ea(r,a)}let n=pf(Nt(e),t);return $.makeTensor(n,e,t)}function PT(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let r=R(e,"x","meshgrid",e instanceof Le?e.dtype:"float32");if(t===void 0)return[r];let a=R(t,"y","meshgrid",t instanceof Le?t.dtype:"float32"),s=Nt(r.shape),i=Nt(a.shape);return n==="xy"?(r=H(r,[1,-1]),a=H(a,[-1,1]),[Be(Fn([i,1],r.dtype),r),Be(a,Fn([1,s],a.dtype))]):(r=H(r,[-1,1]),a=H(a,[1,-1]),[Be(r,Fn([1,i],r.dtype)),Be(Fn([s,1],a.dtype),a)])}function LT(e,t=null,n=!1){let r={x:R(e,"x","min")},a={axis:t,keepDims:n};return $.runKernel(Cs,r,a)}var Al=D({min_:LT});function WT(e,t){let n=R(e,"a","minimum"),r=R(t,"b","minimum");[n,r]=bt(n,r),n.dtype==="bool"&&(n=Ae(n,"int32"),r=Ae(r,"int32")),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Rs,a)}var yl=D({minimum_:WT});function BT(e,t,n){M(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let r=R(e,"x","mirrorPad");if(r.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");M(t.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${t.length}.`);let a=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),M(t[o][0]>=0&&t[o][0]<=r.shape[o]-a&&t[o][1]>=0&&t[o][1]<=r.shape[o]-a,()=>`Padding in dimension ${o} cannot be greater than or equal to ${r.shape[o]-a} or less than 0 for input of shape ${r.shape}`);let s={paddings:t,mode:n},i={x:r};return $.runKernel(Ms,i,s)}var wm=D({mirrorPad_:BT});function VT(e,t){let n=R(e,"a","mod"),r=R(t,"b","mod");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Ro,a)}var bm=D({mod_:VT});function jT(e){let t=R(e,"x","square"),n={};return $.runKernel("Square",{x:t},n)}var st=D({square_:jT});function UT(e,t=null,n=!1){e=R(e,"x","moments");let r=sr(t,e.shape),a=vt(e,r,n),s=a.shape;n||(s=mi(a.shape,r));let i=st(ye(Ae(e,"float32"),H(a,s))),o=vt(i,r,n);return{mean:a,variance:o}}var Td=D({moments_:UT});function HT(e,t,n,r){let a=R(t,"data","multiRNNCell"),s=Pu(n,"c","multiRNNCell"),i=Pu(r,"h","multiRNNCell"),o=a,l=[];for(let h=0;h2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?H(a,[1,-1]):a},l={numSamples:t,seed:n,normalized:r},c=$.runKernel(Kh,o,l);return i===1?H(c,[c.size]):c}var Hw=D({multinomial_:qT});function XT(e,t){let n=R(e,"a","notEqual"),r=R(t,"b","notEqual");[n,r]=bt(n,r),dt(n.shape,r.shape);let a={a:n,b:r};return $.runKernel(Fo,a)}var Ai=D({notEqual_:XT});function KT(e){let t={x:R(e,"x","onesLike")};return $.runKernel(zo,t)}var $n=D({onesLike_:KT});function ZT(e,t){let n=R(e,"v1","outerProduct"),r=R(t,"v2","outerProduct");M(n.rank===1&&r.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`);let a=H(n,[-1,1]),s=H(r,[1,-1]);return Be(a,s)}var YT=D({outerProduct_:ZT});function JT(e,t,n=0){let r=R(e,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let a={paddings:t,constantValue:n},s={x:r};return $.runKernel(Ds,s,a)}var ia=D({pad_:JT});function QT(e,t,n=0){return M(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),ia(e,[t],n)}var eE=D({pad1d_:QT});function tE(e,t,n=0){return M(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var nE=D({pad2d_:tE});function rE(e,t,n=0){return M(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var aE=D({pad3d_:rE});function sE(e,t,n=0){return M(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ia(e,t,n)}var iE=D({pad4d_:sE});function oE(e,t,n){let r=R(e,"x","spaceToBatchND");M(r.rank>=1+t.length,()=>`input rank ${r.rank} should be > than [blockShape] ${t.length}`),M(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),M(r.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+n[l-1][0]+n[l-1][1])%t[l-1]==0:i,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let a={x:r},s={blockShape:t,paddings:n};return $.runKernel(Su,a,s)}var Zu=D({spaceToBatchND_:oE});function cE(e,t,n,r,a,s){a==null&&(a=[1,1]),s==null&&(s=1),r===0&&(r="valid");let i=R(e,"x","maxPool"),o=i,l=!1;i.rank===3&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]])),M(Or(s,a),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`);let c=bw(o.shape,t,s,a,r),u=[c.dilationHeight,c.dilationWidth],h;r==="same"?h=uE([c.filterHeight,c.filterWidth],u):h=[[0,0],[0,0]];let d=u[0]===1&&u[1]===1,[p,m]=lE([c.inHeight,c.inWidth],u,h),f=d?r:"valid",A=d?o:Zu(o,u,p),y=(n==="avg"?()=>ju(A,t,s,f):()=>Ku(A,t,s,f))(),g=d?y:Uu(y,u,m);return l?H(g,[g.shape[1],g.shape[2],g.shape[3]]):g}function lE(e,t,n){let r=n.map(u=>u[0]),a=n.map(u=>u[1]),s=e.concat(r,a),i=t.map((u,h)=>(u-s[h]%u)%u),o=a.map((u,h)=>u+i[h]),l=t.map((u,h)=>[r[h],o[h]]),c=t.map((u,h)=>[0,i[h]]);return[l,c]}function uE(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),r=n.map(s=>Math.floor(s/2)),a=n.map((s,i)=>s-r[i]);return n.map((s,i)=>[r[i],a[i]])}var Gw=D({pool_:cE});function hE(e,t){let n=R(e,"base","pow"),r=R(t,"exp","pow");[n,r]=bt(n,r);let a={a:n,b:r};return $.runKernel(Os,a)}var oa=D({pow_:hE});function dE(e,t){let n=R(e,"x","prelu"),r=R(t,"alpha","prelu"),a={x:n,alpha:r};return $.runKernel(zs,a)}var Yu=D({prelu_:dE});function pE(e,t=null,n=!1){let r=R(e,"x","prod");r.dtype==="bool"&&(r=Ae(r,"int32"));let a={x:r},s={axis:t,keepDims:n};return $.runKernel(Lo,a,s)}var Ed=D({prod_:pE});function fE(e,t,n){let r=Nt(e),a=null;if(n==null||n==="float32")a=new Float32Array(r);else if(n==="int32")a=new Int32Array(r);else if(n==="bool")a=new Uint8Array(r);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*r*i,t=this.mean+this.stdDev*a*i,(!this.truncated||this.isValidTruncated(e))&&(n=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}},AE=class{constructor(e,t,n,r){this.alpha=e,this.beta=1/t,this.dtype=n;let a=r||Math.random();this.randu=_m.alea(a.toString()),this.randn=new vm(0,1,n,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,r,a,s;for(;;){do r=this.randn.nextValue(),s=1+this.c*r;while(s<=0);if(s*=s*s,e=r*r,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),a=this.randu(),athis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,r==null&&(r=Math.random()),typeof r=="number"&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=_m.alea(r)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function gE(e,t,n=1,r="float32",a){if(n==null&&(n=1),r==null&&(r="float32"),r!=="float32"&&r!=="int32")throw new Error(`Unsupported data type ${r}`);let s=new AE(t,n,r,a),i=We(e,r);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),Dn(t,0)}var TE=D({reverse1d_:NE});function EE(e,t){let n=R(e,"x","reverse");return M(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),Dn(n,t)}var CE=D({reverse2d_:EE});function RE(e,t){let n=R(e,"x","reverse");return M(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),Dn(n,t)}var ME=D({reverse3d_:RE});function FE(e,t){let n=R(e,"x","reverse");return M(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),Dn(n,t)}var $E=D({reverse4d_:FE});function DE(e){let t={x:R(e,"x","round")};return $.runKernel(Vs,t)}var Im=D({round_:DE});function OE(e){let t={x:R(e,"x","rsqrt")};return $.runKernel(js,t)}var Md=D({rsqrt_:OE});function ke(e,t){if((tn(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&tn(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Ca(e,[],[],t)}function zE(e){let t={x:R(e,"x","selu")};return $.runKernel(Uo,t)}var Fd=D({selu_:zE});function PE(e,t,n,r,a,s=[1,1],i="NHWC"){let o=R(e,"x","separableConv2d"),l=R(t,"depthwiseFilter","separableConv2d"),c=R(n,"pointwiseFilter","separableConv2d"),u=o,h=!1;if(o.rank===3&&(h=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");M(u.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`),M(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),M(c.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),M(c.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`),M(c.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`);let d=l.shape[2],p=l.shape[3];M(c.shape[2]===d*p,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${c.shape[2]}.`);let m=pl(u,l,r,a,i,s),f=sa(m,c,1,"valid",i);return h?H(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var Sm=D({separableConv2d_:PE});async function LE(e,t){let n=R(e,"x","setdiff1d"),r=R(t,"y","setdiff1d");M(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),M(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),M(r.rank===1,()=>`y should be 1D tensor, but got y (${r.shape}).`);let a=await n.data(),s=await r.data(),i=new Set(s),o=0;for(let u=0;u`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),Re(r,[t],[n])}var Od=D({slice1d_:jE});function UE(e,t,n){let r=R(e,"x","slice2d");return M(r.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var Tm=D({slice2d_:UE});function HE(e,t,n){let r=R(e,"x","slice3d");return M(r.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var zd=D({slice3d_:HE});function GE(e,t,n){let r=R(e,"x","slice4d");return M(r.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),Re(r,t,n)}var Qu=D({slice4d_:GE});function qE(e,t=-1){let n=R(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let r={logits:n},a={dim:t};return $.runKernel(Xs,r,a)}var ec=D({softmax_:qE});function XE(e){M(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return $.runKernel(Bh,t)}var tc=D({fft_:XE});function KE(e){M(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return $.runKernel(Vh,t)}var xl=D({ifft_:KE});function ZE(e){let t=e.shape[e.shape.length-1],n=e.size/t,r;if(t<=2){let a=H(e,[n,t]);r=xl(a)}else{let a=[n,2*(t-1)],s=H(Ju(e),[n,t]),i=H(_d(e),[n,t]),o=Dn(Re(s,[0,1],[n,t-2]),1),l=B(Dn(Re(i,[0,1],[n,t-2]),1),ke(-1)),c=ot([s,o],1),u=ot([i,l],1),h=H(Ea(c,u),[a[0],a[1]]);r=xl(h)}if(r=Ju(r),e.rank===3&&e.shape[0]!==0){let a=r,s=e.shape[0];r=H(r,[s,r.shape[0]/s,r.shape[1]]),a.dispose()}return r}var Pd=D({irfft_:ZE});function YE(e,t,n=0){let r={x:R(e,"x","split")},a={numOrSizeSplits:t,axis:n};return $.runKernel(Ko,r,a)}var ln=D({split_:YE});function JE(e,t){M(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],r=e.size/n,a;if(t!=null&&t0),f=e.shape.map(A=>A);f[e.shape.length-1]=t,a=Re(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,a=ot([e,Et(m)],e.shape.length-1),n=t}else a=e;let s=Ue(a),i=H(Ea(a,s),[r,n]),o=tc(i),l=Math.floor(n/2)+1,c=Ju(o),u=_d(o),h=ln(c,[l,n-l],c.shape.length-1),d=ln(u,[l,n-l],u.shape.length-1),p=a.shape.slice();return p[a.shape.length-1]=l,H(Ea(h[0],d[0]),p)}var nc=D({rfft_:JE});function QE(e){let t={x:R(e,"x","sqrt")};return $.runKernel(Gs,t)}var Jt=D({sqrt_:QE});function eC(e,t){let n=R(e,"a","squaredDifference"),r=R(t,"b","squaredDifference");[n,r]=bt(n,r),dt(n.shape,r.shape);let a={a:n,b:r},s={};return $.runKernel(Ks,a,s)}var Ld=D({squaredDifference_:eC});function tC(e,t){let n=R(e,"x","squeeze");return H(n,fx(n.shape,t).newShape)}var za=D({squeeze_:tC});function nC(e,t=0){let n=Pu(e,"tensors","stack","string_or_numeric");M(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&M(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let r=n,a={axis:t};return $.runKernel(Po,r,a)}var On=D({stack_:nC});function rC(e,t=0){let n={x:R(e,"x","step")},r={alpha:t};return $.runKernel(Ta,n,r)}var wl=D({step_:rC});function aC(e,t,n,r,a=0,s=0,i=0,o=0,l=0){let c={x:R(e,"x","stridedSlice")},u={begin:t,end:n,strides:r,beginMask:a,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return $.runKernel(Zo,c,u)}var Em=D({stridedSlice_:aC});function sC(e){let t={x:R(e,"x","tan")};return $.runKernel(Ys,t)}var Cm=D({tan_:sC});function nn(e,t){as(e);let n=$r(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ca(e,null,n,t)}function Kn(e,t,n){if(as(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let r=$r(e,n);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ca(e,t,r,n)}function iC(e,t,n){if(as(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let r=$r(e,n);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}function oC(e,t,n){if(as(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let r=$r(e,n);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Ca(e,t,r,n)}function lC(e,t,n){if(as(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let r=$r(e,n);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,Ca(e,t,r,n)}function uC(e,t=1,n=!0){let r=R(e,"x","topk");if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let a=r.shape[r.shape.length-1];if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);let s={x:r},i={k:t,sorted:n},[o,l]=$.runKernel(Yo,s,i);return{values:o,indices:l}}var Rm=D({topk_:uC});function cC(e,t=0,n=1,r,a){if(r!=null&&r==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new vm(t,n,r,!0,a),i=We(e,r);for(let o=0;o0,()=>"The input tensor must be at least 1D");let r={x:n},a={axis:t},[s,i]=$.runKernel(nd,r,a);return{values:s,indices:i}}var Bd=D({unique_:hC});function dC(e,t,n){let r=R(e,"x","unsortedSegmentSum"),a=R(t,"segmentIds","unsortedSegmentSum","int32");M(Bt(n),()=>"numSegments must be of dtype int");let s={x:r,segmentIds:a},i={numSegments:n};return $.runKernel(Tu,s,i)}var Mm=D({unsortedSegmentSum_:dC});function pC(e,t=0){let n=R(e,"x","unstack","string_or_numeric");M(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let r={value:n},a={axis:t};return $.runKernel(Jo,r,a)}var ur=D({unstack_:pC});function Kw(e,t=!0,n,r){return $.makeVariable(e,t,n,r)}function Zw(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),an(o.slice(s,s+i),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let f=s;f"Shape mismatch in v and x");let l=ke(1),c=ye(l,o),u=B(ye(i,s),c);if(a){M(r!=null,()=>"When using zeroDebias: true, step is required.");let h=R(r,"step","movingAverage");u=ge(u,ye(l,oa(o,h)))}return se(s,u)}var xC=D({movingAverage_:gC});function wC(e,t,n){let r=R(e,"indices","scatterND","int32"),a=R(t,"updates","scatterND");Vf(a,r,n);let s={indices:r,updates:a},i={shape:n};return $.runKernel(Vo,s,i)}var Jw=D({scatterND_:wC});function bC(e,t,n,r){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let a=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function _C(e,t,n,r=0){let a=R(e,"sparseIndices","sparseToDense","int32"),s=R(t,"sparseValues","sparseToDense"),i=R(r,"defaultValue","sparseToDense",s.dtype);bC(a,s,n,i);let o={sparseIndices:a,sparseValues:s,defaultValue:i},l={outputShape:n};return $.runKernel(ed,o,l)}var $m=D({sparseToDense_:_C});function vC(e,t){let n=R(t,"indices","gatherND","int32"),r={params:R(e,"x","gatherND"),indices:n};return $.runKernel(_o,r)}var Qw=D({gatherND_:vC});function kC(e,t){if(t==null)return e.shape.slice();if(na(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let r=0;r`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`),M(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Le?a.clone():a;let s=kC(a,n),i=1-t,o=ge(ml(se(gl(s,0,1,"float32",r),i)),i);return B(a,o)}var eb=D({dropout_:IC});function tb(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function Dm(e,t,n){let r=1-e%2,a=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`),M(r.rank-1===a.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`),an(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=r.shape[r.shape.length-1];M(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await r.data(),o=await a.data(),[l,c]=[i.length/s,s],u=mx("bool",l);for(let h=0;hA.value-f.value),u[h]=0;for(let f=0;fTC,depthwiseConv2d:()=>EC,matMul:()=>CC});function RC(e,t,n,r,a,s="NHWC",i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]])),M(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),M(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),M(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let c=s==="NHWC"?o.shape[3]:o.shape[1],u=s==="NHWC"?l.shape[3]:l.shape[1];M(c===n[2],()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`),M(u===n[3],()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`),i!=null&&M(Bt(a),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let h={x:o,dy:l},d={strides:r,pad:a,dataFormat:s,dimRoundingMode:i,filterShape:n};return $.runKernel(Ch,h,d)}var Om=D({conv2DBackpropFilter_:RC});function jd(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,wl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Ud(e,t){let n=t,r=Ot(e.shape,t.shape);return r.length>0&&(n=Ne(n,r)),H(n,e.shape)}function Hd(e,t,n,r){if(t==="linear")return e;if(t==="relu")return Lr(e);if(t==="elu")return fl(e);if(t==="relu6")return Rd(e);if(t==="prelu")return Yu(e,n);if(t==="leakyrelu")return qu(e,r);if(t==="sigmoid")return _n(e);throw new Error(`Unknown fused activation ${t}.`)}var Gd=(e,t)=>!(e>0)||t==="linear";function MC({x:e,filter:t,strides:n,pad:r,dataFormat:a="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(l=l||"linear",Gd($.state.gradientDepth,l)===!1){let w=sa(e,t,n,r,a,s,i);return o!=null&&(w=se(w,o)),Hd(w,l,c,u)}let h=R(e,"x","conv2d"),d=R(t,"filter","conv2d"),p=h,m=!1;h.rank===3&&(m=!0,p=H(h,[1,h.shape[0],h.shape[1],h.shape[2]])),M(p.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`),M(d.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`),i!=null&&M(Bt(r),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`),M(p.shape[3]===d.shape[2],()=>`Error in conv2d: depth of input (${p.shape[3]}) must match input depth for filter ${d.shape[2]}.`),M(Or(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),M(a==="NHWC",()=>`Error in conv2d: got dataFormat of ${a} but only NHWC is currently supported.`);let f=Vu(p.shape,d.shape,n,s,r,i),A;o!=null&&(A=R(o,"bias","fused conv2d"),[A]=bt(A,h),dt(f.outShape,A.shape));let y;c!=null&&(y=R(c,"prelu weights","fused conv2d"));let g=(w,b)=>{let[k,N,C,F]=b,O=jd(w,C,l);M(Fa(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let z=im(N.shape,O,k,n,r),V=Om(N,O,k.shape,n,r),j=[z,V];if(F!=null){let U=Ud(F,O);j.push(U)}return j},x={x:p,filter:d,bias:A,preluActivationWeights:y},v={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?zr((w,b,k)=>{let N=$.runKernel(ti,x,v);return k([b,w,N]),m&&(N=H(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:g}})(p,d):zr((w,b,k,N)=>{let C=$.runKernel(ti,x,v);return N([b,w,C,k]),m&&(C=H(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:g}})(p,d,A)}var TC=D({fusedConv2d_:MC});function FC(e,t,n,r,a,s=[1,1],i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c={x:o,dy:l},u={strides:r,pad:a,dimRoundingMode:i,dilations:s,filterShape:n};return $.runKernel($h,c,u)}var nb=D({depthwiseConv2dNativeBackpropFilter_:FC});function $C(e,t,n,r,a,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c={dy:o,filter:n},u={strides:r,pad:a,dimRoundingMode:i,dilations:s,inputShape:e},h=$.runKernel(Dh,c,u);return l?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var rb=D({depthwiseConv2dNativeBackpropInput_:$C});function DC({x:e,filter:t,strides:n,pad:r,dataFormat:a="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(Gd($.state.gradientDepth,l)===!1){let w=pl(e,t,n,r,a,s,i);return o!=null&&(w=se(w,o)),Hd(w,l,c,u)}let h=R(e,"x","depthwiseConv2d"),d=R(t,"filter","depthwiseConv2d"),p=h,m=!1;h.rank===3&&(m=!0,p=H(h,[1,h.shape[0],h.shape[1],h.shape[2]])),M(p.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`),M(d.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`),M(p.shape[3]===d.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),s==null&&(s=[1,1]),M(Or(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&M(Bt(r),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${r}.`);let f=Vu(p.shape,d.shape,n,s,r,i,!0),A;o!=null&&(A=R(o,"bias","fused conv2d"),[A]=bt(A,h),dt(f.outShape,A.shape));let y;c!=null&&(y=R(c,"prelu weights","fused depthwiseConv2d"));let g=(w,b)=>{M(Fa(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[k,N,C,F]=b,O=jd(w,C,l),z=rb(N.shape,O,k,n,r,s,i),V=nb(N,O,k.shape,n,r,s,i);if(F!=null){let j=Ud(A,O);return[z,V,j]}return[z,V]},x={x:p,filter:d,bias:A,preluActivationWeights:y},v={strides:n,pad:r,dataFormat:a,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?zr((w,b,k)=>{let N=$.runKernel(ni,x,v);return k([b,w,N]),m&&(N=H(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:g}})(p,d):zr((w,b,k,N)=>{let C=$.runKernel(ni,x,v);return N([b,w,C,k]),m&&(C=H(C,[C.shape[1],C.shape[2],C.shape[3]])),{value:C,gradFunc:g}})(p,d,A)}var EC=D({fusedDepthwiseConv2d_:DC});function OC({a:e,b:t,transposeA:n=!1,transposeB:r=!1,bias:a,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(Gd($.state.gradientDepth,s)===!1){let F=Be(e,t,n,r);return a!=null&&(F=se(F,a)),Hd(F,s,i,o)}let l=R(e,"a","fused matMul"),c=R(t,"b","fused matMul");[l,c]=bt(l,c);let u=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=r?c.shape[c.rank-1]:c.shape[c.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=r?c.shape[c.rank-2]:c.shape[c.rank-1],m=l.shape.slice(0,-2),f=c.shape.slice(0,-2),A=Nt(m),y=Nt(f);M(l.rank>=2&&c.rank>=2&&l.rank===c.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${l.rank} and ${c.rank}.`),M(na(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${l.shape} and ${c.shape} must match.`),M(u===h,()=>`Error in fused matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${l.shape} and ${c.shape} and transposeA=${n} and transposeB=${r} must match.`);let g=l.shape.slice(0,-2).concat([d,p]),x=n?H(l,[A,u,d]):H(l,[A,d,u]),v=r?H(c,[y,p,h]):H(c,[y,h,p]),w;a!=null&&(w=R(a,"bias","fused matMul"),[w]=bt(w,l),dt(g,w.shape));let b;i!=null&&(b=R(i,"prelu weights","fused matMul"));let k=(F,O)=>{let[z,V,j,U]=O,X=jd(H(F,j.shape),j,s),G,ee;if(!n&&!r?(G=Be(X,V,!1,!0),ee=Be(z,X,!0,!1)):!n&&r?(G=Be(X,V,!1,!1),ee=Be(X,z,!0,!1)):n&&!r?(G=Be(V,X,!1,!0),ee=Be(z,X,!1,!1)):(G=Be(V,X,!0,!0),ee=Be(X,z,!0,!0)),a!=null){let Y=Ud(U,X);return[G,ee,Y]}else return[G,ee]},N={a:x,b:v,bias:w,preluActivationWeights:b},C={transposeA:n,transposeB:r,activation:s,leakyreluAlpha:o};return a==null?zr((F,O,z)=>{let V=$.runKernel(ei,N,C);return z([F,O,V]),{value:H(V,g),gradFunc:k}})(x,v):zr((F,O,z,V)=>{let j=$.runKernel(ei,N,C);return V([F,O,j,z]),{value:H(j,g),gradFunc:k}})(x,v,w)}var CC=D({fusedMatMul_:OC});function zC(e){return Dm(e,.54,.46)}var PC=D({hammingWindow_:zC});function LC(e){return Dm(e,.5,.5)}var ab=D({hannWindow_:LC});function WC(e,t,n,r=!1,a=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Re(e,s,t)),s+=n;if(r)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),M(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${o.shape}.`),M(l.rank===1&&l.shape[0]===c,()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${o.shape}.`),M(r.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),M(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),M(a==="bilinear"||a==="nearest",()=>`method must be bilinear or nearest, but was ${a}`);let u={image:i,boxes:o,boxInd:l},h={method:a,extrapolationValue:s,cropSize:r};return $.runKernel(po,u,h)}var UC=D({cropAndResize_:jC});function HC(e){let t=R(e,"image","flipLeftRight","float32");M(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return $.runKernel(wo,n,{})}var GC=D({flipLeftRight_:HC});function qC(e,t,n=0,r=.5){let a=R(e,"image","rotateWithOffset","float32");M(a.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`);let s={image:a},i={radians:t,fillValue:n,center:r};return $.runKernel(el,s,i)}var XC=D({rotateWithOffset_:qC});function bl(e,t,n,r,a,s){r==null&&(r=.5),a==null&&(a=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),M(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),M(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),M(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),M(t.rank===1,()=>"scores must be a 1D tensor"),M(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),M(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s}}function KC(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppression"),i=R(t,"scores","nonMaxSuppression"),o=bl(s,i,n,r,a);n=o.maxOutputSize,r=o.iouThreshold,a=o.scoreThreshold;let l={maxOutputSize:n,iouThreshold:r,scoreThreshold:a};return $.runKernel($o,{boxes:s,scores:i},l)}var ZC=D({nonMaxSuppression_:KC});function JC(e,t,n){let r=YC(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function YC(e,t,n){return eR(e,t,n||QC)}function QC(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?r=s+1:(a=s,i=!o)}return i?r:-r-1}function ib(e,t,n,r,a){return zm(e,t,n,r,a,0)}function ob(e,t,n,r,a,s){return zm(e,t,n,r,a,0,!1,s,!0)}function lb(e,t,n,r,a,s){return zm(e,t,n,r,a,s,!0)}function zm(e,t,n,r,a,s,i=!1,o=!1,l=!1){let c=[];for(let A=0;Aa&&c.push({score:t[A],boxIndex:A,suppressBeginIndex:0});c.sort(ub);let u=s>0?-.5/s:0,h=[],d=[];for(;h.length0;){let A=c.pop(),{score:y,boxIndex:g,suppressBeginIndex:x}=A;if(y=x;--w){let b=tR(e,g,h[w]);if(b>=r){v=!0;break}if(A.score=A.score*nR(r,u,b),A.score<=a)break}A.suppressBeginIndex=h.length,v||(A.score===y?(h.push(g),d.push(A.score)):A.score>a&&JC(c,A,ub))}let p=h.length,m=n-p;o&&m>0&&(h.push(...new Array(m).fill(0)),d.push(...new Array(m).fill(0)));let f={selectedIndices:h};return i&&(f.selectedScores=d),l&&(f.validOutputs=p),f}function tR(e,t,n){let r=e.subarray(t*4,t*4+4),a=e.subarray(n*4,n*4+4),s=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),o=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),c=Math.min(a[0],a[2]),u=Math.min(a[1],a[3]),h=Math.max(a[0],a[2]),d=Math.max(a[1],a[3]),p=(o-s)*(l-i),m=(h-c)*(d-u);if(p<=0||m<=0)return 0;let f=Math.max(s,c),A=Math.max(i,u),y=Math.min(o,h),g=Math.min(l,d),x=Math.max(y-f,0)*Math.max(g-A,0);return x/(p+m-x)}function nR(e,t,n){let r=Math.exp(t*n*n);return n<=e?r:0}function ub(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function rR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppressionAsync"),i=R(t,"scores","nonMaxSuppressionAsync"),o=bl(s,i,n,r,a);n=o.maxOutputSize,r=o.iouThreshold,a=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),c=l[0],u=l[1],{selectedIndices:h}=ib(c,u,n,r,a);return s!==e&&s.dispose(),i!==t&&i.dispose(),nn(h,"int32")}var aR=rR;function sR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=bl(i,o,n,r,a,s);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,s=l.softNmsSigma;let c={boxes:i,scores:o},u={maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s},h=$.runKernel(Oo,c,u);return{selectedIndices:h[0],selectedScores:h[1]}}var iR=D({nonMaxSuppressionWithScore_:sR});async function oR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=bl(i,o,n,r,a,s);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,s=l.softNmsSigma;let c=await Promise.all([i.data(),o.data()]),u=c[0],h=c[1],{selectedIndices:d,selectedScores:p}=lb(u,h,n,r,a,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(d,"int32"),selectedScores:nn(p)}}var lR=oR;function uR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=bl(i,o,n,r,a,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,d={boxes:i,scores:o},p={maxOutputSize:c,iouThreshold:u,scoreThreshold:h,padToMaxOutputSize:s},m=$.runKernel(Do,d,p);return{selectedIndices:m[0],validOutputs:m[1]}}var cR=D({nonMaxSuppressionPadded_:uR});async function hR(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=bl(i,o,n,r,a,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=ob(d,p,c,u,h,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(m,"int32"),validOutputs:ke(f,"int32")}}var dR=hR;function pR(e,t,n=!1,r=!1){let a=R(e,"images","resizeBilinear");M(a.rank===3||a.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`),M(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),M(r===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=a,i=!1;a.rank===3&&(i=!0,s=H(a,[1,a.shape[0],a.shape[1],a.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:r,size:t},c=$.runKernel(Ls,o,l);return i?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var cb=D({resizeBilinear_:pR});function fR(e,t,n=!1,r=!1){let a=R(e,"images","resizeNearestNeighbor");M(a.rank===3||a.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`),M(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),M(a.dtype==="float32"||a.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),M(r===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=a,i=!1;a.rank===3&&(i=!0,s=H(a,[1,a.shape[0],a.shape[1],a.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:r,size:t},c=$.runKernel(Iu,o,l);return i?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var hb=D({resizeNearestNeighbor_:fR});function mR(e,t,n="nearest",r="constant",a=0,s){let i=R(e,"image","transform","float32"),o=R(t,"transforms","transform","float32");M(i.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${i.rank}.`),M(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),M(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},c={interpolation:n,fillMode:r,fillValue:a,outputShape:s};return $.runKernel(td,l,c)}var AR=D({transform_:mR});function yR(e,t,n){M(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),M(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let r=R(e,"a","bandPart");M(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);let a=r.shape,[s,i]=r.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=H(Cd(0,s,1,"int32"),[-1,1]),l=Cd(0,i,1,"int32"),c=ye(o,l),u=lr(pi(c,ke(+t,"int32")),Oa(c,ke(-n,"int32"))),h=Et([s,i],r.dtype);return H(On(ur(H(r,[-1,s,i])).map(d=>kn(u,d,h))),a)}var gR=D({bandPart_:yR});function xR(e){let t;if(Array.isArray(e)){t=!1,M(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let a=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${a})`)}else t=!0,e=ln(e,e.shape[0],0).map(a=>za(a,[0]));M(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],r=e;for(let a=0;a{let s=r[a];if(a>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return db(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((l,c)=>l*c),r=ur(H(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],s=[];r.forEach(l=>{let[c,u]=db(l,t);a.push(c),s.push(u)});let i=H(On(a,0),e.shape),o=H(On(s,0),e.shape);return[i,o]}}function db(e,t=!1){return $.tidy(()=>{M(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],r=e.shape[1],a=pm(n),s=Dr(e),i=Kn([[1]],[1,1]),o=Dr(i),l=n>=r?r:n;for(let c=0;c{let p=Re(s,[c,c],[n-c,1]),m=Vd(p),f=Re(s,[c,c],[1,1]),A=kn(or(f,0),Kn([[-1]]),Kn([[1]])),y=ye(f,B(A,m)),g=ge(p,y);g.shape[0]===1?o=Dr(i):o=ot([i,Re(g,[1,0],[g.shape[0]-1,g.shape[1]])],0);let x=_t(ge(Be(A,y),m)),v=Re(s,[c,0],[n-c,r]),w=B(x,o),b=Ze(o);if(c===0)s=ye(v,Be(w,Be(b,v)));else{let C=ye(v,Be(w,Be(b,v)));s=ot([Re(s,[0,0],[c,r]),C],0)}let k=Ze(w),N=Re(a,[0,c],[n,a.shape[1]-c]);if(c===0)a=ye(N,Be(Be(N,o),k));else{let C=ye(N,Be(Be(N,o),k));a=ot([Re(a,[0,0],[n,c]),C],1)}return[o,s,a]}),Te([u,h,d])}return!t&&n>r&&(a=Re(a,[0,0],[n,r]),s=Re(s,[0,0],[r,r])),[a,s]})}var _R=D({qr_:bR}),un;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(un||(un={}));function vR(e,t,n=un.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"losses","computeWeightedLoss"),a=null;t!=null&&(a=R(t,"weights","computeWeightedLoss"));let s=a==null?r:B(r,a);if(n===un.NONE)return s;if(n===un.SUM)return Ne(s);if(n===un.MEAN){if(a==null)return vt(s);{let i=r.size/a.size,o=ge(Ne(s),Ne(a));return i>1?ge(o,ke(i)):o}}if(n===un.SUM_BY_NONZERO_WEIGHTS){if(a==null)return ge(Ne(s),ke(r.size));{let i=B(a,Fn(r.shape)),o=Ae(Ne(Ai(i,ke(0))),"float32");return ge(Ne(s),o)}}throw Error(`Unknown reduction: ${n}`)}var la=D({computeWeightedLoss_:vR});function kR(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","absoluteDifference"),s=R(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=R(n,"weights","absoluteDifference")),an(a.shape,s.shape,"Error in absoluteDifference: ");let o=Dt(ye(a,s));return la(o,i,r)}var IR=D({absoluteDifference_:kR});function SR(e,t,n,r,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","cosineDistance"),i=R(t,"predictions","cosineDistance"),o=null;r!=null&&(o=R(r,"weights","cosineDistance")),an(s.shape,i.shape,"Error in cosineDistance: ");let l=ke(1),c=ye(l,Ne(B(s,i),n,!0));return la(c,o,a)}var NR=D({cosineDistance_:SR});function TR(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","hingeLoss"),s=R(t,"predictions","hingeLoss"),i=null;n!=null&&(i=R(n,"weights","hingeLoss")),an(a.shape,s.shape,"Error in hingeLoss: ");let o=ke(1);a=ye(B(ke(2),a),o);let l=Lr(ye(o,B(a,s)));return la(l,i,r)}var ER=D({hingeLoss_:TR});function CR(e,t,n,r=1,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","huberLoss"),i=R(t,"predictions","huberLoss"),o=null;n!=null&&(o=R(n,"weights","huberLoss")),an(s.shape,i.shape,"Error in huberLoss: ");let l=ke(r),c=Dt(ye(i,s)),u=yl(c,l),h=ye(c,u),d=se(B(ke(.5),st(u)),B(l,h));return la(d,o,a)}var RR=D({huberLoss_:CR});function MR(e,t,n,r=1e-7,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","logLoss"),i=R(t,"predictions","logLoss"),o=null;n!=null&&(o=R(n,"weights","logLoss")),an(s.shape,i.shape,"Error in logLoss: ");let l=ke(1),c=ke(r),u=_t(B(s,Mn(se(i,c)))),h=B(ye(l,s),Mn(se(ye(l,i),c))),d=ye(u,h);return la(d,o,a)}var FR=D({logLoss_:MR});function $R(e,t,n,r=un.SUM_BY_NONZERO_WEIGHTS){let a=R(e,"labels","meanSquaredError"),s=R(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=R(n,"weights","meanSquaredError")),an(a.shape,s.shape,"Error in meanSquaredError: ");let o=Ld(a,s);return la(o,i,r)}var DR=D({meanSquaredError_:$R});function OR(e,t){let n=R(e,"labels","sigmoidCrossEntropyWithLogits"),r=R(t,"logits","sigmoidCrossEntropyWithLogits");an(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");let a=Lr(r),s=B(r,n),i=kd(qn(_t(Dt(r))));return se(ye(a,s),i)}function zR(e,t,n,r=0,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"multiClassLabels","sigmoidCrossEntropy"),i=R(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=R(n,"weights","sigmoidCrossEntropy")),an(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),r>0){let c=ke(r),u=ke(1),h=ke(.5);s=se(B(s,ye(u,c)),B(h,c))}let l=OR(s,i);return la(l,o,a)}var PR=D({sigmoidCrossEntropy_:zR});function LR(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return zr((r,a,s)=>{let i=gm(a,[n],!0),o=ye(Ae(a,"float32"),i);s([r,o]);let l=_t(B(o,r));return{value:Ne(l,[n]),gradFunc:(c,u)=>{let[h,d]=u,p=mi(c.shape,[n]);return[B(H(c,p),ye(Ae(h,"float32"),qn(d))),B(H(c,p),ye(qn(d),Ae(h,"float32")))]}}})(e,t)}function WR(e,t,n,r=0,a=un.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"onehotLabels","softmaxCrossEntropy"),i=R(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=R(n,"weights","softmaxCrossEntropy")),an(s.shape,i.shape,"Error in softmaxCrossEntropy: "),r>0){let c=ke(r),u=ke(1),h=ke(s.shape[1]);s=se(B(s,ye(u,c)),ge(c,h))}let l=LR(s,i);return la(l,o,a)}var BR=D({softmaxCrossEntropy_:WR});function VR(e,t,n){let r=R(e,"inputIndices","sparseReshape"),a=R(t,"inputShape","sparseReshape"),s=R(n,"newShape","sparseReshape");if(r.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${r.shape}`);if(a.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:r,inputShape:a,newShape:s},o=$.runKernel(Qh,i);return{outputIndices:o[0],outputShape:o[1]}}var jR=D({sparseReshape_:VR}),UR={fft:tc,ifft:xl,rfft:nc,irfft:Pd},HR={hammingWindow:PC,hannWindow:ab,frame:sb,stft:VC},Ye={flipLeftRight:GC,resizeNearestNeighbor:hb,resizeBilinear:cb,rotateWithOffset:XC,cropAndResize:UC,nonMaxSuppression:ZC,nonMaxSuppressionAsync:aR,nonMaxSuppressionWithScore:iR,nonMaxSuppressionWithScoreAsync:lR,nonMaxSuppressionPadded:cR,nonMaxSuppressionPaddedAsync:dR,transform:AR},pb={bandPart:gR,gramSchmidt:wR,qr:_R},GR={absoluteDifference:IR,computeWeightedLoss:la,cosineDistance:NR,hingeLoss:ER,huberLoss:RR,logLoss:FR,meanSquaredError:DR,sigmoidCrossEntropy:PR,softmaxCrossEntropy:BR},fb={sparseReshape:jR},ua=class extends mw{minimize(e,t=!1,n){let{value:r,grads:a}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:a[i.name]}));this.applyGradients(s)}else this.applyGradients(a);return Te(a),t?r:(r.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Pw(e,t)}dispose(){this.iterations_!=null&&Te(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:ke(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}};Object.defineProperty(ua,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var qd=class extends ua{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:L(()=>Ue(r).variable(a))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;L(()=>{let l=se(B(i,this.rho),B(st(s),1-this.rho)),c=B(ge(Jt(se(o,this.epsilon)),Jt(se(i,this.epsilon))),s),u=se(B(o,this.rho),B(st(c),1-this.rho));i.assign(l),o.assign(u);let h=se(B(c,-this.learningRate),r);r.assign(h)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Te(this.accumulatedGrads.map(e=>e.variable)),Te(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};qd.className="Adadelta";Ma(qd);var Xd=class extends ua{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:L(()=>Gu(r.shape,this.initialAccumulatorValue).variable(i))}}let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let s=this.accumulatedGrads[n].variable;L(()=>{let i=se(s,st(a));s.assign(i);let o=se(B(ge(a,Jt(se(i,$.backend.epsilon()))),-this.learningRate),r);r.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Te(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};Xd.className="Adagrad";Ma(Xd);var Kd=class extends ua{constructor(e,t,n,r=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],L(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(n).variable()}),r==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),r=ye(1,this.accBeta2);t.forEach((a,s)=>{let i=$.registeredVariables[a],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${a}/m`,variable:L(()=>Ue(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${a}/v`,variable:L(()=>Ue(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[a];if(l==null)return;let c=this.accumulatedFirstMoment[s].variable,u=this.accumulatedSecondMoment[s].variable,h=se(B(c,this.beta1),B(l,1-this.beta1)),d=se(B(u,this.beta2),B(st(l),1-this.beta2)),p=ge(h,n),m=ge(d,r);c.assign(h),u.assign(d);let f=se(B(ge(p,se(Jt(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Te(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Te(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e),L(()=>{this.accBeta1.assign(oa(this.beta1,this.iterations_+1)),this.accBeta2.assign(oa(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}};Kd.className="Adam";Ma(Kd);var Zd=class extends ua{constructor(e,t,n,r=null,a=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],L(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),r==null&&(this.epsilon=$.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),r=ge(-this.learningRate,se(B(this.iteration,this.decay),1));t.forEach((a,s)=>{let i=$.registeredVariables[a],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${a}/m`,variable:Ue(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${a}/v`,variable:Ue(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[a];if(l==null)return;let c=this.accumulatedFirstMoment[s].variable,u=this.accumulatedWeightedInfNorm[s].variable,h=se(B(c,this.beta1),B(l,1-this.beta1)),d=B(u,this.beta2),p=Dt(l),m=Pr(d,p);c.assign(h),u.assign(m);let f=se(B(ge(r,n),ge(h,se(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(se(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Te(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Te(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}};Zd.className="Adamax";Ma(Zd);var rc=class extends ua{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let a=$.registeredVariables[t];L(()=>{let s=se(B(this.c,r),a);a.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Vt(ke(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}};rc.className="SGD";Ma(rc);var Yd=class extends rc{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(r).variable(i))}}let a=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&L(()=>{let i,o=se(B(this.m,a),s);this.useNesterov?i=se(B(this.c,se(s,B(o,this.m))),r):i=se(B(this.c,o),r),a.assign(o),r.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Te(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}};Yd.className="Momentum";Ma(Yd);var Jd=class extends ua{constructor(e,t=.9,n=0,r=null,a=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,r==null&&(this.epsilon=$.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let r=$.registeredVariables[t],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(r).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:L(()=>Ue(r).variable(a))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;L(()=>{let l=se(B(i,this.decay),B(st(s),1-this.decay));if(this.centered){let c=this.accumulatedMeanGrads[n].variable,u=se(B(c,this.decay),B(s,1-this.decay)),h=ge(B(s,this.learningRate),Jt(ye(l,se(st(u),this.epsilon)))),d=se(B(o,this.momentum),h);i.assign(l),c.assign(u),o.assign(d);let p=ye(r,d);r.assign(p)}else{let c=se(B(i,this.decay),B(st(s),1-this.decay)),u=se(B(o,this.momentum),ge(B(s,this.learningRate),Jt(se(c,this.epsilon))));i.assign(c),o.assign(u);let h=ye(r,u);r.assign(h)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Te(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Te(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Te(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(r=>({originalName:r.name,variable:r.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}};Jd.className="RMSProp";Ma(Jd);var yi=class{static sgd(e){return new rc(e)}static momentum(e,t,n=!1){return new Yd(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,a=!1){return new Jd(e,t,n,r,a)}static adam(e=.001,t=.9,n=.999,r=null){return new Kd(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new qd(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,a=0){return new Zd(e,t,n,r,a)}static adagrad(e,t=.1){return new Xd(e,t)}},gi={sgd:yi.sgd,momentum:yi.momentum,adadelta:yi.adadelta,adagrad:yi.adagrad,rmsprop:yi.rmsprop,adamax:yi.adamax,adam:yi.adam},qR=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Qd(){return new Promise(e=>qR(()=>e()))}var E={};Me(E,{ERF_A1:()=>aM,ERF_A2:()=>sM,ERF_A3:()=>iM,ERF_A4:()=>oM,ERF_A5:()=>lM,ERF_P:()=>rM,PARALLELIZE_THRESHOLD:()=>Pm,SELU_SCALE:()=>Ab,SELU_SCALEALPHA:()=>mb,applyActivation:()=>Hd,assertAndGetBroadcastShape:()=>dt,assertAxesAreInnerMostDims:()=>ST,assertParamsConsistent:()=>XR,assignToTypedArray:()=>AM,axesAreInnerMostDims:()=>Am,calculateShapes:()=>rw,checkEinsumDimSizes:()=>bM,combineLocations:()=>Ww,complexWithEvenIndex:()=>pM,complexWithOddIndex:()=>fM,computeConv2DInfo:()=>Vu,computeConv3DInfo:()=>_w,computeDefaultPad:()=>rm,computeDilation2DInfo:()=>ZS,computeOptimalWindowSize:()=>ZR,computeOutAndReduceShapes:()=>Bw,computeOutShape:()=>KR,computePool2DInfo:()=>bw,computePool3DInfo:()=>YS,convertConv2DDataFormat:()=>ww,decodeEinsumEquation:()=>xM,eitherStridesOrDilationsAreOne:()=>Or,expandShapeToKeepDim:()=>mi,exponent:()=>gM,exponents:()=>yM,fromStringArrayToUint8:()=>SM,fromUint8ToStringArray:()=>IM,getAxesPermutation:()=>Vw,getBroadcastDims:()=>BN,getComplexWithIndex:()=>mM,getEinsumComputePath:()=>_M,getEinsumPermutation:()=>wM,getFusedBiasGradient:()=>Ud,getFusedDyActivation:()=>jd,getImageCenter:()=>YR,getInnerMostAxes:()=>NT,getPermuted:()=>QR,getReductionAxes:()=>Ot,getReshaped:()=>JR,getReshapedPermuted:()=>eM,getSliceBeginCoords:()=>tM,getSliceSize:()=>nM,getUndoAxesPermutation:()=>ym,isIdentityPermutation:()=>vM,log:()=>cM,mergeRealAndImagArrays:()=>hM,prepareAndValidate:()=>nw,prepareSplitSize:()=>kM,segment_util:()=>yb,shouldFuse:()=>Gd,slice_util:()=>sn,splitRealAndImagArrays:()=>dM,tupleValuesAreOne:()=>Fa,upcastType:()=>ir,validateInput:()=>Vf,validateUpdateShape:()=>Bf,warn:()=>uM});function XR(e,t){let n=e[0].length;e.forEach((a,s)=>{M(a.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),M(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let r=e[0];e.forEach((a,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${a}) does not match the shape of the rest (${r}) along the non-concatenated axis ${s}.`)})}function KR(e,t){let n=e[0].slice();for(let r=1;r=t*2+1||i%2==1?s.push(i):a.push(i);r.push(...a),r.push(0),r.push(...s)}return r}function eM(e,t,n,r=!0){let a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(let s=1;s/g,gb=",",xb="...";function xM(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(NM,"").length)/Lm.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${Lm}").`);let[r,a]=e.split(Lm);M(r.indexOf(xb)===-1,()=>`The ellipsis notation ("${xb}") is not supported yet.`);let s=r.split(gb),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let d=0;dm.indexOf(p)!==-1))throw new Error(`Output subscripts contain the label ${p} not present in the input subscripts.`);o.indexOf(p)===-1&&o.push(p)}for(let d=0;da!==-1),{permutationIndices:n,expandDims:r}}function bM(e,t,n){let r=new Array(e);for(let a=0;a`Expected dimension ${r[t[a][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function _M(e,t){let n=e,r=[],a=0;e.length===0&&n.push(-1),a=e.length+1;for(let i=0;it===n)}function TM(e,t){let n=[];for(let r=0;r"Number of splits must evenly divide the axis."),r=new Array(t).fill(e.shape[n]/t);else{let a=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);M(a<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,l)=>l>0?o+l:o);t[s]=e.shape[n]-i}M(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),r=t}return r}var yb={};Me(yb,{collectGatherOpShapeInfo:()=>RM,computeOutShape:()=>CM,segOpComputeOptimalWindowSize:()=>EM});function EM(e,t){let n=!1,r;for(e<=Pm?(r=e,n=!0):r=kh(e,Math.floor(Math.sqrt(e)));!n;)r>t||r===e?n=!0:r=kh(e,r+1);return r}function CM(e,t,n){let r=[],a=e.length;for(let s=0;sa))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) ( - ${s}).`);if(nid(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function SM(e){return e.map(t=>Ru(t))}var Wr={};Me(Wr,{nonMaxSuppressionV3Impl:()=>ib,nonMaxSuppressionV4Impl:()=>ob,nonMaxSuppressionV5Impl:()=>lb,whereImpl:()=>Zw});function be(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&_.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var MM=Wr.whereImpl,ep=class extends cu{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new _h(this,aa())}nextDataId(){return ep.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,J().get("IS_NODE")&&E.warn(` + ${a.shape}`),F(i%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${a.shape}`);let o={x:a},l={blockSize:t,dataFormat:n};return D.runKernel(fo,o,l)}var lA=O({depthToSpace_:BT});function VT(e,t,n,a,r="NHWC",s=[1,1],i){let o=M(e,"x","depthwiseConv2d"),l=M(t,"filter","depthwiseConv2d"),d=o,u=!1;o.rank===3&&(u=!0,d=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(d.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),F(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`),F(d.shape[3]===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${l.shape[2]}.`),i!=null&&F(Vt(a),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`);let p={x:d,filter:l},c={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i},h=D.runKernel(As,p,c);return u?H(h,[h.shape[1],h.shape[2],h.shape[3]]):h}var hl=O({depthwiseConv2d_:VT});function jT(e){let t={x:M(e,"x","diag")};return D.runKernel(zp,t)}var UT=O({diag_:jT});function HT(e,t,n,a,r=[1,1],s="NHWC"){let i=M(e,"x","dilation2d"),o=M(t,"filter","dilation2d");F(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),F(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),F(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,d=!1;i.rank===3&&(l=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),d=!0);let u={x:l,filter:o},p={strides:n,pad:a,dilations:r},c=D.runKernel(gu,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var uA=O({dilation2d_:HT});function GT(e,t){let n=e.length,a=[];for(let r=0;r1&&i===1&&a.unshift(s)}return a}function zt(e,t){let n=[];for(let a=0;a1)&&n.unshift(s)}return n}function ct(e,t){let n=[],a=Math.max(e.length,t.length);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${a.rank}.`);let r=n.rank===1?n.size:n.shape[1],s=a.rank===1?a.size:a.shape[0];if(F(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),n.rank===1&&a.rank===1){let i=H(n,[1,-1]),o=H(a,[-1,1]),l=Be(i,o);return H(l,[])}else if(n.rank===1&&a.rank===2){let i=H(n,[1,-1]),o=H(a,[a.shape[0],a.shape[1]]),l=Be(i,o);return H(l,[l.size])}else if(n.rank===2&&a.rank===1){let i=H(a,[-1,1]),o=Be(n,i);return H(o,[o.size])}else{let i=H(a,[a.shape[0],a.shape[1]]);return Be(n,i)}}var Db=O({dot_:YT});function JT(e,...t){let n=t.map((r,s)=>M(r,`tensors${s}`,"einsum")),a={equation:e};return D.runKernel(Lp,n,a)}var Ob=O({einsum_:JT});function QT(e){let t={x:M(e,"x","elu")};return D.runKernel(mo,t)}var fl=O({elu_:QT});function eE(e){let t=M(e,"x","erf");F(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ae(t,"float32"));let n={x:t};return D.runKernel(Ao,n)}var pA=O({erf_:eE});function tE(e){let t={x:M(e,"x","exp")};return D.runKernel(gs,t)}var qn=O({exp_:tE});function nE(e,t=0){let n=M(e,"x","expandDims","string_or_numeric");F(t<=n.rank,()=>"Axis must be <= rank of the tensor");let a={input:n},r={dim:t};return D.runKernel(go,a,r)}var on=O({expandDims_:nE});function aE(e){let t={x:M(e,"x","expm1")};return D.runKernel(xo,t)}var cA=O({expm1_:aE});function rE(e,t){let n=M(e,"x","tile","string_or_numeric");F(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);let a={x:n},r={reps:t};return D.runKernel(Sr,a,r)}var $r=O({tile_:rE});function sE(e,t,n,a="float32"){t==null&&(t=e);let r=We([e,t],a),s=e<=t?e:t;for(let o=0;o`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${s.rank}.`),F(Vt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=H(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},d={depthRadius:t,bias:n,alpha:a,beta:r},u=D.runKernel(wu,l,d);return o?H(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var mA=O({localResponseNormalization_:yE});function gE(e){let t={x:M(e,"x","log")};return D.runKernel(Ss,t)}var Fn=O({log_:gE});function xE(e){let t={x:M(e,"x","log1p")};return D.runKernel(Co,t)}var Ic=O({log1p_:xE});function bE(e){return F(wr(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{let a=M(t,"x","tf.grad","string_or_numeric"),r=n!=null?M(n,"dy","tf.grad"):null;return D.tidy(()=>{let{value:s,grads:i}=D.gradients(()=>e(a),[a],r);return r!=null&&rn(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Sc(i),i[0]})}}function vE(e){return F(wr(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{F(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let a=Pu(t,"args","tf.grads","string_or_numeric"),r=n!=null?M(n,"dy","tf.grads"):null;return D.tidy(()=>{let{value:s,grads:i}=D.gradients(()=>e(...a),a,r);return r!=null&&rn(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Sc(i),i})}}function wE(e){return F(wr(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{F(t instanceof Le,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),F(n==null||n instanceof Le,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:a,value:r}=D.gradients(()=>e(t),[t],n);return Sc(a),{grad:a[0],value:r}}}function kE(e){return F(wr(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{F(Array.isArray(t)&&t.every(r=>r instanceof Le),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),F(n==null||n instanceof Le,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let a=D.gradients(()=>e(...t),t,n);return n!=null&&rn(a.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Sc(a.grads),a}}function Lb(e,t){F(wr(e),()=>"The f passed in variableGrads(f) must be a function"),F(t==null||Array.isArray(t)&&t.every(d=>d instanceof Ou),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let n=t!=null;if(!n){t=[];for(let d in D.registeredVariables)t.push(D.registeredVariables[d])}let a=n?t.filter(d=>!d.trainable):null,r=t.length;t=t.filter(d=>d.trainable),F(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`);let s=!0,{value:i,grads:o}=D.gradients(e,t,null,s);F(o.some(d=>d!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),F(i.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let l={};return t.forEach((d,u)=>{o[u]!=null&&(l[d.name]=o[u])}),a!=null&&a.forEach(d=>l[d.name]=null),{value:i,grads:l}}function _a(e){return D.customGrad(e)}function Sc(e){if(e.filter(t=>t==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that + the f you passed encloses all operations that lead from x to y.`)}function IE(e){let t={x:M(e,"x","neg")};return D.runKernel(Fo,t)}var wt=O({neg_:IE});function SE(e){let t={x:M(e,"x","softplus")};return D.runKernel(Xo,t)}var fi=O({softplus_:SE});function NE(e){let t=M(e,"x","logSigmoid");return _a(n=>({value:wt(fi(wt(n))),gradFunc:a=>B(a,wn(wt(n)))}))(t)}var Wb=O({logSigmoid_:NE});function TE(e,t=null,n=!1){let a={x:M(e,"x","max")},r={reductionIndices:t,keepDims:n};return D.runKernel(Ns,a,r)}var Xn=O({max_:TE});function EE(e,t){let n=M(e,"a","sub"),a=M(t,"b","sub");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(Zs,r)}var ye=O({sub_:EE});function CE(e,t=null,n=!1){let a=M(e,"x","sum");a.dtype==="bool"&&(a=Ae(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return D.runKernel(qs,r,s)}var Te=O({sum_:CE});function RE(e,t=-1){let n=M(e,"logits","logSoftmax");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return _a((a,r)=>{let s=!0,i=Xn(a,t,!0),o=ye(a,i),l=ye(Ae(o,"float32"),Fn(Te(qn(o),t,s)));return r([l]),{value:l,gradFunc:(d,u)=>{let[p]=u,c=!0,h=qn(p);return ye(d,B(Te(d,t,c),h))}}})(n)}var Nc=O({logSoftmax_:RE});function AA(e,t){for(let n=0;ne[s]);return[n,r]}function mi(e,t){let n=t.map(a=>1);return Bb(e,n,t)}function ME(e,t,n){F(AA(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function jb(e,t){if(AA(e,t))return null;let n=[];for(let a=0;an.push(a)),n}function yA(e){return e.map((t,n)=>[n,t]).sort((t,n)=>t[1]-n[1]).map(t=>t[0])}function FE(e,t){let n=[];for(let a=t-e;a`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),F(za(n,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),r!=null&&F(Vt(a),()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r},p=D.runKernel(Es,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var Ku=O({maxPool_:PE});function LE(e,t=[1,1,1],n,a,r,s="NDHWC"){let i=M(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),F(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),F(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),r!=null&&F(Vt(a),()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${r} but got pad ${a}.`);let d={x:o},u={filterSize:t,strides:n,pad:a,dimRoundingMode:r,dataFormat:s},p=D.runKernel(ku,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var xA=O({maxPool3d_:LE});function WE(e,t,n,a,r=!1){let s={x:M(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:a,includeBatchInIndex:r},o=D.runKernel(Xp,s,i);return{result:o[0],indexes:o[1]}}var Hb=O({maxPoolWithArgmax_:WE});function BE(e,t){let n=M(e,"a","maximum"),a=M(t,"b","maximum");[n,a]=vt(n,a),n.dtype==="bool"&&(n=Ae(n,"int32"),a=Ae(a,"int32")),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel(Ts,r)}var Pa=O({maximum_:BE});function VE(e,t=null,n=!1){let a={x:M(e,"x","mean")},r={axis:t,keepDims:n};return D.runKernel(Cs,a,r)}var kt=O({mean_:VE});function Ct(e,t="float32"){if(t==="complex64"){let a=Ct(e,"float32"),r=Ct(e,"float32");return Tr(a,r)}let n=Sp(Tt(e),t);return D.makeTensor(n,e,t)}function $n(e,t="float32"){if(t==="complex64"){let a=$n(e,"float32"),r=Ct(e,"float32");return Tr(a,r)}let n=hm(Tt(e),t);return D.makeTensor(n,e,t)}function jE(e,t,{indexing:n="xy"}={}){if(n!=="xy"&&n!=="ij")throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(e===void 0)return[];let a=M(e,"x","meshgrid",e instanceof Le?e.dtype:"float32");if(t===void 0)return[a];let r=M(t,"y","meshgrid",t instanceof Le?t.dtype:"float32"),s=Tt(a.shape),i=Tt(r.shape);return n==="xy"?(a=H(a,[1,-1]),r=H(r,[-1,1]),[Be($n([i,1],a.dtype),a),Be(r,$n([1,s],r.dtype))]):(a=H(a,[-1,1]),r=H(r,[1,-1]),[Be(a,$n([1,i],a.dtype)),Be($n([s,1],r.dtype),r)])}function UE(e,t=null,n=!1){let a={x:M(e,"x","min")},r={axis:t,keepDims:n};return D.runKernel(Rs,a,r)}var Al=O({min_:UE});function HE(e,t){let n=M(e,"a","minimum"),a=M(t,"b","minimum");[n,a]=vt(n,a),n.dtype==="bool"&&(n=Ae(n,"int32"),a=Ae(a,"int32")),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel(Ms,r)}var yl=O({minimum_:HE});function GE(e,t,n){F(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);let a=M(e,"x","mirrorPad");if(a.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");F(t.length===a.rank,()=>`Padding doesn't match input. Must be ${a.rank}. Got ${t.length}.`);let r=n==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),F(t[o][0]>=0&&t[o][0]<=a.shape[o]-r&&t[o][1]>=0&&t[o][1]<=a.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${a.shape[o]-r} or less than 0 for input of shape ${a.shape}`);let s={paddings:t,mode:n},i={x:a};return D.runKernel(Fs,i,s)}var bA=O({mirrorPad_:GE});function qE(e,t){let n=M(e,"a","mod"),a=M(t,"b","mod");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(Mo,r)}var vA=O({mod_:qE});function XE(e){let t=M(e,"x","square"),n={};return D.runKernel("Square",{x:t},n)}var st=O({square_:XE});function KE(e,t=null,n=!1){e=M(e,"x","moments");let a=sa(t,e.shape),r=kt(e,a,n),s=r.shape;n||(s=mi(r.shape,a));let i=st(ye(Ae(e,"float32"),H(r,s))),o=kt(i,a,n);return{mean:r,variance:o}}var Ec=O({moments_:KE});function ZE(e,t,n,a){let r=M(t,"data","multiRNNCell"),s=Pu(n,"c","multiRNNCell"),i=Pu(a,"h","multiRNNCell"),o=r,l=[];for(let p=0;p2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();let o={logits:i===1?H(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:a},d=D.runKernel(Kp,o,l);return i===1?H(d,[d.size]):d}var Gb=O({multinomial_:JE});function QE(e,t){let n=M(e,"a","notEqual"),a=M(t,"b","notEqual");[n,a]=vt(n,a),ct(n.shape,a.shape);let r={a:n,b:a};return D.runKernel($o,r)}var Ai=O({notEqual_:QE});function eC(e){let t={x:M(e,"x","onesLike")};return D.runKernel(_o,t)}var Dn=O({onesLike_:eC});function tC(e,t){let n=M(e,"v1","outerProduct"),a=M(t,"v2","outerProduct");F(n.rank===1&&a.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${a.rank}.`);let r=H(n,[-1,1]),s=H(a,[1,-1]);return Be(r,s)}var nC=O({outerProduct_:tC});function aC(e,t,n=0){let a=M(e,"x","pad");if(a.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:n},s={x:a};return D.runKernel(Os,s,r)}var rr=O({pad_:aC});function rC(e,t,n=0){return F(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),rr(e,[t],n)}var sC=O({pad1d_:rC});function iC(e,t,n=0){return F(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var oC=O({pad2d_:iC});function lC(e,t,n=0){return F(t.length===3&&t[0].length===2&&t[1].length===2&&t[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var uC=O({pad3d_:lC});function dC(e,t,n=0){return F(t.length===4&&t[0].length===2&&t[1].length===2&&t[2].length===2&&t[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rr(e,t,n)}var pC=O({pad4d_:dC});function cC(e,t,n){let a=M(e,"x","spaceToBatchND");F(a.rank>=1+t.length,()=>`input rank ${a.rank} should be > than [blockShape] ${t.length}`),F(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),F(a.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+n[l-1][0]+n[l-1][1])%t[l-1]==0:i,!0),()=>`input spatial dimensions ${a.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:a},s={blockShape:t,paddings:n};return D.runKernel(Nu,r,s)}var Zu=O({spaceToBatchND_:cC});function mC(e,t,n,a,r,s){r==null&&(r=[1,1]),s==null&&(s=1),a===0&&(a="valid");let i=M(e,"x","maxPool"),o=i,l=!1;i.rank===3&&(l=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]])),F(za(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let d=wb(o.shape,t,s,r,a),u=[d.dilationHeight,d.dilationWidth],p;a==="same"?p=fC([d.filterHeight,d.filterWidth],u):p=[[0,0],[0,0]];let c=u[0]===1&&u[1]===1,[h,m]=hC([d.inHeight,d.inWidth],u,p),f=c?a:"valid",A=c?o:Zu(o,u,h),y=(n==="avg"?()=>ju(A,t,s,f):()=>Ku(A,t,s,f))(),g=c?y:Uu(y,u,m);return l?H(g,[g.shape[1],g.shape[2],g.shape[3]]):g}function hC(e,t,n){let a=n.map(u=>u[0]),r=n.map(u=>u[1]),s=e.concat(a,r),i=t.map((u,p)=>(u-s[p]%u)%u),o=r.map((u,p)=>u+i[p]),l=t.map((u,p)=>[a[p],o[p]]),d=t.map((u,p)=>[0,i[p]]);return[l,d]}function fC(e,t){let n=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),a=n.map(s=>Math.floor(s/2)),r=n.map((s,i)=>s-a[i]);return n.map((s,i)=>[a[i],r[i]])}var qb=O({pool_:mC});function AC(e,t){let n=M(e,"base","pow"),a=M(t,"exp","pow");[n,a]=vt(n,a);let r={a:n,b:a};return D.runKernel(zs,r)}var sr=O({pow_:AC});function yC(e,t){let n=M(e,"x","prelu"),a=M(t,"alpha","prelu"),r={x:n,alpha:a};return D.runKernel(_s,r)}var Yu=O({prelu_:yC});function gC(e,t=null,n=!1){let a=M(e,"x","prod");a.dtype==="bool"&&(a=Ae(a,"int32"));let r={x:a},s={axis:t,keepDims:n};return D.runKernel(Lo,r,s)}var Cc=O({prod_:gC});function xC(e,t,n){let a=Tt(e),r=null;if(n==null||n==="float32")r=new Float32Array(a);else if(n==="int32")r=new Int32Array(a);else if(n==="bool")r=new Uint8Array(a);else throw new Error(`Unknown data type ${n}`);for(let s=0;s=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*a*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(n=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}},vC=class{constructor(e,t,n,a){this.alpha=e,this.beta=1/t,this.dtype=n;let r=a||Math.random();this.randu=wA.alea(r.toString()),this.randn=new kA(0,1,n,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,a,r,s;for(;;){do a=this.randn.nextValue(),s=1+this.c*a;while(s<=0);if(s*=s*s,e=a*a,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),r=this.randu(),rthis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=n,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=wA.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function kC(e,t,n=1,a="float32",r){if(n==null&&(n=1),a==null&&(a="float32"),a!=="float32"&&a!=="int32")throw new Error(`Unsupported data type ${a}`);let s=new vC(t,n,a,r),i=We(e,a);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),On(t,0)}var $C=O({reverse1d_:FC});function DC(e,t){let n=M(e,"x","reverse");return F(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),On(n,t)}var OC=O({reverse2d_:DC});function zC(e,t){let n=M(e,"x","reverse");return F(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),On(n,t)}var _C=O({reverse3d_:zC});function PC(e,t){let n=M(e,"x","reverse");return F(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),On(n,t)}var LC=O({reverse4d_:PC});function WC(e){let t={x:M(e,"x","round")};return D.runKernel(Vs,t)}var SA=O({round_:WC});function BC(e){let t={x:M(e,"x","rsqrt")};return D.runKernel(js,t)}var Fc=O({rsqrt_:BC});function Ie(e,t){if((tn(e)&&t!=="string"||Array.isArray(e))&&t!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(t==="string"&&tn(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Er(e,[],[],t)}function VC(e){let t={x:M(e,"x","selu")};return D.runKernel(Uo,t)}var $c=O({selu_:VC});function jC(e,t,n,a,r,s=[1,1],i="NHWC"){let o=M(e,"x","separableConv2d"),l=M(t,"depthwiseFilter","separableConv2d"),d=M(n,"pointwiseFilter","separableConv2d"),u=o,p=!1;if(o.rank===3&&(p=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2]])),i==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");F(u.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`),F(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),F(d.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),F(d.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${d.shape[0]}.`),F(d.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${d.shape[1]}.`);let c=l.shape[2],h=l.shape[3];F(d.shape[2]===c*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${c*h}, but got ${d.shape[2]}.`);let m=hl(u,l,a,r,i,s),f=ar(m,d,1,"valid",i);return p?H(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var NA=O({separableConv2d_:jC});async function UC(e,t){let n=M(e,"x","setdiff1d"),a=M(t,"y","setdiff1d");F(n.dtype===a.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${a.dtype}).`),F(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),F(a.rank===1,()=>`y should be 1D tensor, but got y (${a.shape}).`);let r=await n.data(),s=await a.data(),i=new Set(s),o=0;for(let u=0;u`slice1d expects a rank-1 tensor, but got a rank-${a.rank} tensor`),Me(a,[t],[n])}var zc=O({slice1d_:XC});function KC(e,t,n){let a=M(e,"x","slice2d");return F(a.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var EA=O({slice2d_:KC});function ZC(e,t,n){let a=M(e,"x","slice3d");return F(a.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var _c=O({slice3d_:ZC});function YC(e,t,n){let a=M(e,"x","slice4d");return F(a.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${a.rank} tensor`),Me(a,t,n)}var Qu=O({slice4d_:YC});function JC(e,t=-1){let n=M(e,"logits","softmax","float32");if(t===-1&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);let a={logits:n},r={dim:t};return D.runKernel(Xs,a,r)}var ed=O({softmax_:JC});function QC(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return D.runKernel(Bp,t)}var td=O({fft_:QC});function eR(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return D.runKernel(Vp,t)}var xl=O({ifft_:eR});function tR(e){let t=e.shape[e.shape.length-1],n=e.size/t,a;if(t<=2){let r=H(e,[n,t]);a=xl(r)}else{let r=[n,2*(t-1)],s=H(Ju(e),[n,t]),i=H(wc(e),[n,t]),o=On(Me(s,[0,1],[n,t-2]),1),l=B(On(Me(i,[0,1],[n,t-2]),1),Ie(-1)),d=ot([s,o],1),u=ot([i,l],1),p=H(Tr(d,u),[r[0],r[1]]);a=xl(p)}if(a=Ju(a),e.rank===3&&e.shape[0]!==0){let r=a,s=e.shape[0];a=H(a,[s,a.shape[0]/s,a.shape[1]]),r.dispose()}return a}var Pc=O({irfft_:tR});function nR(e,t,n=0){let a={x:M(e,"x","split")},r={numOrSizeSplits:t,axis:n};return D.runKernel(Ko,a,r)}var ln=O({split_:nR});function aR(e,t){F(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],a=e.size/n,r;if(t!=null&&t0),f=e.shape.map(A=>A);f[e.shape.length-1]=t,r=Me(e,m,f),n=t}else if(t!=null&&t>n){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-n,r=ot([e,Ct(m)],e.shape.length-1),n=t}else r=e;let s=Ue(r),i=H(Tr(r,s),[a,n]),o=td(i),l=Math.floor(n/2)+1,d=Ju(o),u=wc(o),p=ln(d,[l,n-l],d.shape.length-1),c=ln(u,[l,n-l],u.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=l,H(Tr(p[0],c[0]),h)}var nd=O({rfft_:aR});function rR(e){let t={x:M(e,"x","sqrt")};return D.runKernel(Gs,t)}var Jt=O({sqrt_:rR});function sR(e,t){let n=M(e,"a","squaredDifference"),a=M(t,"b","squaredDifference");[n,a]=vt(n,a),ct(n.shape,a.shape);let r={a:n,b:a},s={};return D.runKernel(Ks,r,s)}var Lc=O({squaredDifference_:sR});function iR(e,t){let n=M(e,"x","squeeze");return H(n,mx(n.shape,t).newShape)}var Or=O({squeeze_:iR});function oR(e,t=0){let n=Pu(e,"tensors","stack","string_or_numeric");F(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&F(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");let a=n,r={axis:t};return D.runKernel(Po,a,r)}var zn=O({stack_:oR});function lR(e,t=0){let n={x:M(e,"x","step")},a={alpha:t};return D.runKernel(Nr,n,a)}var bl=O({step_:lR});function uR(e,t,n,a,r=0,s=0,i=0,o=0,l=0){let d={x:M(e,"x","stridedSlice")},u={begin:t,end:n,strides:a,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return D.runKernel(Zo,d,u)}var CA=O({stridedSlice_:uR});function dR(e){let t={x:M(e,"x","tan")};return D.runKernel(Ys,t)}var RA=O({tan_:dR});function nn(e,t){rs(e);let n=Da(e,t);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Er(e,null,n,t)}function Kn(e,t,n){if(rs(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let a=Da(e,n);if(a.length!==2&&a.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Er(e,t,a,n)}function pR(e,t,n){if(rs(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let a=Da(e,n);if(a.length!==4&&a.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}function cR(e,t,n){if(rs(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let a=Da(e,n);if(a.length!==5&&a.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Er(e,t,a,n)}function hR(e,t,n){if(rs(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let a=Da(e,n);if(a.length!==6&&a.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(a.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||a,Er(e,t,a,n)}function fR(e,t=1,n=!0){let a=M(e,"x","topk");if(a.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");let r=a.shape[a.shape.length-1];if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:a},i={k:t,sorted:n},[o,l]=D.runKernel(Yo,s,i);return{values:o,indices:l}}var MA=O({topk_:fR});function mR(e,t=0,n=1,a,r){if(a!=null&&a==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new kA(t,n,a,!0,r),i=We(e,a);for(let o=0;o0,()=>"The input tensor must be at least 1D");let a={x:n},r={axis:t},[s,i]=D.runKernel(nc,a,r);return{values:s,indices:i}}var Bc=O({unique_:AR});function yR(e,t,n){let a=M(e,"x","unsortedSegmentSum"),r=M(t,"segmentIds","unsortedSegmentSum","int32");F(Vt(n),()=>"numSegments must be of dtype int");let s={x:a,segmentIds:r},i={numSegments:n};return D.runKernel(Eu,s,i)}var FA=O({unsortedSegmentSum_:yR});function gR(e,t=0){let n=M(e,"x","unstack","string_or_numeric");F(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);let a={value:n},r={axis:t};return D.runKernel(Jo,a,r)}var ua=O({unstack_:gR});function Zb(e,t=!0,n,a){return D.makeVariable(e,t,n,a)}function Yb(e,t){let n=[];for(let s=0;s0,()=>"mask cannot be scalar"),rn(o.slice(s,s+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let f=s;f"Shape mismatch in v and x");let l=Ie(1),d=ye(l,o),u=B(ye(i,s),d);if(r){F(a!=null,()=>"When using zeroDebias: true, step is required.");let p=M(a,"step","movingAverage");u=ge(u,ye(l,sr(o,p)))}return se(s,u)}var IR=O({movingAverage_:kR});function SR(e,t,n){let a=M(e,"indices","scatterND","int32"),r=M(t,"updates","scatterND");Vm(r,a,n);let s={indices:a,updates:r},i={shape:n};return D.runKernel(Vo,s,i)}var Qb=O({scatterND_:SR});function NR(e,t,n,a){if(e.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let r=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);let i=t.size;if(!(t.rank===0||t.rank===1&&i===r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==a.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function TR(e,t,n,a=0){let r=M(e,"sparseIndices","sparseToDense","int32"),s=M(t,"sparseValues","sparseToDense"),i=M(a,"defaultValue","sparseToDense",s.dtype);NR(r,s,n,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},l={outputShape:n};return D.runKernel(ec,o,l)}var DA=O({sparseToDense_:TR});function ER(e,t){let n=M(t,"indices","gatherND","int32"),a={params:M(e,"x","gatherND"),indices:n};return D.runKernel(wo,a)}var e3=O({gatherND_:ER});function CR(e,t){if(t==null)return e.shape.slice();if(er(e.shape,t))return t;if(e.shape.length===t.length){let n=[];for(let a=0;a`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`),F(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof Le?r.clone():r;let s=CR(r,n),i=1-t,o=ge(ml(se(gl(s,0,1,"float32",a),i)),i);return B(r,o)}var t3=O({dropout_:RR});function n3(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function OA(e,t,n){let a=1-e%2,r=new Float32Array(e);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${a.rank}`),F(a.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${a.rank} and targets rank ${r.rank}`),rn(a.shape.slice(0,a.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=a.shape[a.shape.length-1];F(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);let i=await a.data(),o=await r.data(),[l,d]=[i.length/s,s],u=Ax("bool",l);for(let p=0;pA.value-f.value),u[p]=0;for(let f=0;f$R,depthwiseConv2d:()=>DR,matMul:()=>OR});function zR(e,t,n,a,r,s="NHWC",i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]])),F(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),F(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),F(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);let d=s==="NHWC"?o.shape[3]:o.shape[1],u=s==="NHWC"?l.shape[3]:l.shape[1];F(d===n[2],()=>`Error in conv2dDerFilter: depth of input ${d}) must match input depth in filter (${n[2]}.`),F(u===n[3],()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`),i!=null&&F(Vt(r),()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${i} but got pad ${r}.`);let p={x:o,dy:l},c={strides:a,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:n};return D.runKernel(Rp,p,c)}var zA=O({conv2DBackpropFilter_:zR});function jc(e,t,n){if(n==null||n==="linear")return e;if(n==="relu")return B(e,bl(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Uc(e,t){let n=t,a=zt(e.shape,t.shape);return a.length>0&&(n=Te(n,a)),H(n,e.shape)}function Hc(e,t,n,a){if(t==="linear")return e;if(t==="relu")return La(e);if(t==="elu")return fl(e);if(t==="relu6")return Mc(e);if(t==="prelu")return Yu(e,n);if(t==="leakyrelu")return qu(e,a);if(t==="sigmoid")return wn(e);throw new Error(`Unknown fused activation ${t}.`)}var Gc=(e,t)=>!(e>0)||t==="linear";function _R({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:d,leakyreluAlpha:u}){if(l=l||"linear",Gc(D.state.gradientDepth,l)===!1){let b=ar(e,t,n,a,r,s,i);return o!=null&&(b=se(b,o)),Hc(b,l,d,u)}let p=M(e,"x","conv2d"),c=M(t,"filter","conv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=H(p,[1,p.shape[0],p.shape[1],p.shape[2]])),F(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),F(c.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${c.rank}.`),i!=null&&F(Vt(a),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${a}.`),F(h.shape[3]===c.shape[2],()=>`Error in conv2d: depth of input (${h.shape[3]}) must match input depth for filter ${c.shape[2]}.`),F(za(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),F(r==="NHWC",()=>`Error in conv2d: got dataFormat of ${r} but only NHWC is currently supported.`);let f=Vu(h.shape,c.shape,n,s,a,i),A;o!=null&&(A=M(o,"bias","fused conv2d"),[A]=vt(A,p),ct(f.outShape,A.shape));let y;d!=null&&(y=M(d,"prelu weights","fused conv2d"));let g=(b,v)=>{let[I,T,R,$]=v,z=jc(b,R,l);F(Mr(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let _=iA(T.shape,z,I,n,a),V=zA(T,z,I.shape,n,a),j=[_,V];if($!=null){let U=Uc($,z);j.push(U)}return j},x={x:h,filter:c,bias:A,preluActivationWeights:y},k={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?_a((b,v,I)=>{let T=D.runKernel(ti,x,k);return I([v,b,T]),m&&(T=H(T,[T.shape[1],T.shape[2],T.shape[3]])),{value:T,gradFunc:g}})(h,c):_a((b,v,I,T)=>{let R=D.runKernel(ti,x,k);return T([v,b,R,I]),m&&(R=H(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:g}})(h,c,A)}var $R=O({fusedConv2d_:_R});function PR(e,t,n,a,r,s=[1,1],i){let o=e;e.rank===3&&(o=H(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={x:o,dy:l},u={strides:a,pad:r,dimRoundingMode:i,dilations:s,filterShape:n};return D.runKernel(Dp,d,u)}var a3=O({depthwiseConv2dNativeBackpropFilter_:PR});function LR(e,t,n,a,r,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=H(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={dy:o,filter:n},u={strides:a,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},p=D.runKernel(Op,d,u);return l?H(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var r3=O({depthwiseConv2dNativeBackpropInput_:LR});function WR({x:e,filter:t,strides:n,pad:a,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:d,leakyreluAlpha:u}){if(Gc(D.state.gradientDepth,l)===!1){let b=hl(e,t,n,a,r,s,i);return o!=null&&(b=se(b,o)),Hc(b,l,d,u)}let p=M(e,"x","depthwiseConv2d"),c=M(t,"filter","depthwiseConv2d"),h=p,m=!1;p.rank===3&&(m=!0,h=H(p,[1,p.shape[0],p.shape[1],p.shape[2]])),F(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),F(c.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${c.rank}.`),F(h.shape[3]===c.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),s==null&&(s=[1,1]),F(za(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),i!=null&&F(Vt(a),()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${i} but got pad ${a}.`);let f=Vu(h.shape,c.shape,n,s,a,i,!0),A;o!=null&&(A=M(o,"bias","fused conv2d"),[A]=vt(A,p),ct(f.outShape,A.shape));let y;d!=null&&(y=M(d,"prelu weights","fused depthwiseConv2d"));let g=(b,v)=>{F(Mr(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[I,T,R,$]=v,z=jc(b,R,l),_=r3(T.shape,z,I,n,a,s,i),V=a3(T,z,I.shape,n,a,s,i);if($!=null){let j=Uc(A,z);return[_,V,j]}return[_,V]},x={x:h,filter:c,bias:A,preluActivationWeights:y},k={strides:n,pad:a,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:u};return o==null?_a((b,v,I)=>{let T=D.runKernel(ni,x,k);return I([v,b,T]),m&&(T=H(T,[T.shape[1],T.shape[2],T.shape[3]])),{value:T,gradFunc:g}})(h,c):_a((b,v,I,T)=>{let R=D.runKernel(ni,x,k);return T([v,b,R,I]),m&&(R=H(R,[R.shape[1],R.shape[2],R.shape[3]])),{value:R,gradFunc:g}})(h,c,A)}var DR=O({fusedDepthwiseConv2d_:WR});function BR({a:e,b:t,transposeA:n=!1,transposeB:a=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o}){if(Gc(D.state.gradientDepth,s)===!1){let $=Be(e,t,n,a);return r!=null&&($=se($,r)),Hc($,s,i,o)}let l=M(e,"a","fused matMul"),d=M(t,"b","fused matMul");[l,d]=vt(l,d);let u=n?l.shape[l.rank-2]:l.shape[l.rank-1],p=a?d.shape[d.rank-1]:d.shape[d.rank-2],c=n?l.shape[l.rank-1]:l.shape[l.rank-2],h=a?d.shape[d.rank-2]:d.shape[d.rank-1],m=l.shape.slice(0,-2),f=d.shape.slice(0,-2),A=Tt(m),y=Tt(f);F(l.rank>=2&&d.rank>=2&&l.rank===d.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${l.rank} and ${d.rank}.`),F(er(m,f),()=>`Error in fused matMul: outer dimensions (${m}) and (${f}) of Tensors with shapes ${l.shape} and ${d.shape} must match.`),F(u===p,()=>`Error in fused matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${l.shape} and ${d.shape} and transposeA=${n} and transposeB=${a} must match.`);let g=l.shape.slice(0,-2).concat([c,h]),x=n?H(l,[A,u,c]):H(l,[A,c,u]),k=a?H(d,[y,h,p]):H(d,[y,p,h]),b;r!=null&&(b=M(r,"bias","fused matMul"),[b]=vt(b,l),ct(g,b.shape));let v;i!=null&&(v=M(i,"prelu weights","fused matMul"));let I=($,z)=>{let[_,V,j,U]=z,X=jc(H($,j.shape),j,s),G,ee;if(!n&&!a?(G=Be(X,V,!1,!0),ee=Be(_,X,!0,!1)):!n&&a?(G=Be(X,V,!1,!1),ee=Be(X,_,!0,!1)):n&&!a?(G=Be(V,X,!1,!0),ee=Be(_,X,!1,!1)):(G=Be(V,X,!0,!0),ee=Be(X,_,!0,!0)),r!=null){let Y=Uc(U,X);return[G,ee,Y]}else return[G,ee]},T={a:x,b:k,bias:b,preluActivationWeights:v},R={transposeA:n,transposeB:a,activation:s,leakyreluAlpha:o};return r==null?_a(($,z,_)=>{let V=D.runKernel(ei,T,R);return _([$,z,V]),{value:H(V,g),gradFunc:I}})(x,k):_a(($,z,_,V)=>{let j=D.runKernel(ei,T,R);return V([$,z,j,_]),{value:H(j,g),gradFunc:I}})(x,k,b)}var OR=O({fusedMatMul_:BR});function VR(e){return OA(e,.54,.46)}var jR=O({hammingWindow_:VR});function UR(e){return OA(e,.5,.5)}var s3=O({hannWindow_:UR});function HR(e,t,n,a=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Me(e,s,t)),s+=n;if(a)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),F(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${d},4] but had shape ${o.shape}.`),F(l.rank===1&&l.shape[0]===d,()=>`Error in cropAndResize: boxInd must be have size [${d}] but had shape ${o.shape}.`),F(a.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${a.length}.`),F(a[0]>=1&&a[1]>=1,()=>`cropSize must be atleast [1,1], but was ${a}`),F(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let u={image:i,boxes:o,boxInd:l},p={method:r,extrapolationValue:s,cropSize:a};return D.runKernel(ho,u,p)}var KR=O({cropAndResize_:XR});function ZR(e){let t=M(e,"image","flipLeftRight","float32");F(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let n={image:t};return D.runKernel(bo,n,{})}var YR=O({flipLeftRight_:ZR});function JR(e,t,n=0,a=.5){let r=M(e,"image","rotateWithOffset","float32");F(r.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);let s={image:r},i={radians:t,fillValue:n,center:a};return D.runKernel(el,s,i)}var QR=O({rotateWithOffset_:JR});function vl(e,t,n,a,r,s){a==null&&(a=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return n=Math.min(n,i),F(0<=a&&a<=1,()=>`iouThreshold must be in [0, 1], but was '${a}'`),F(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),F(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),F(t.rank===1,()=>"scores must be a 1D tensor"),F(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),F(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s}}function eM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppression"),i=M(t,"scores","nonMaxSuppression"),o=vl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l={maxOutputSize:n,iouThreshold:a,scoreThreshold:r};return D.runKernel(Do,{boxes:s,scores:i},l)}var tM=O({nonMaxSuppression_:eM});function aM(e,t,n){let a=nM(e,t,n),r=a<0?-(a+1):a;e.splice(r,0,t)}function nM(e,t,n){return sM(e,t,n||rM)}function rM(e,t){return e>t?1:e>>1);let o=n(t,e[s]);o>0?a=s+1:(r=s,i=!o)}return i?a:-a-1}function o3(e,t,n,a,r){return _A(e,t,n,a,r,0)}function l3(e,t,n,a,r,s){return _A(e,t,n,a,r,0,!1,s,!0)}function u3(e,t,n,a,r,s){return _A(e,t,n,a,r,s,!0)}function _A(e,t,n,a,r,s,i=!1,o=!1,l=!1){let d=[];for(let A=0;Ar&&d.push({score:t[A],boxIndex:A,suppressBeginIndex:0});d.sort(d3);let u=s>0?-.5/s:0,p=[],c=[];for(;p.length0;){let A=d.pop(),{score:y,boxIndex:g,suppressBeginIndex:x}=A;if(y=x;--b){let v=iM(e,g,p[b]);if(v>=a){k=!0;break}if(A.score=A.score*oM(a,u,v),A.score<=r)break}A.suppressBeginIndex=p.length,k||(A.score===y?(p.push(g),c.push(A.score)):A.score>r&&aM(d,A,d3))}let h=p.length,m=n-h;o&&m>0&&(p.push(...new Array(m).fill(0)),c.push(...new Array(m).fill(0)));let f={selectedIndices:p};return i&&(f.selectedScores=c),l&&(f.validOutputs=h),f}function iM(e,t,n){let a=e.subarray(t*4,t*4+4),r=e.subarray(n*4,n*4+4),s=Math.min(a[0],a[2]),i=Math.min(a[1],a[3]),o=Math.max(a[0],a[2]),l=Math.max(a[1],a[3]),d=Math.min(r[0],r[2]),u=Math.min(r[1],r[3]),p=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),h=(o-s)*(l-i),m=(p-d)*(c-u);if(h<=0||m<=0)return 0;let f=Math.max(s,d),A=Math.max(i,u),y=Math.min(o,p),g=Math.min(l,c),x=Math.max(y-f,0)*Math.max(g-A,0);return x/(h+m-x)}function oM(e,t,n){let a=Math.exp(t*n*n);return n<=e?a:0}function d3(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function lM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY){let s=M(e,"boxes","nonMaxSuppressionAsync"),i=M(t,"scores","nonMaxSuppressionAsync"),o=vl(s,i,n,a,r);n=o.maxOutputSize,a=o.iouThreshold,r=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),d=l[0],u=l[1],{selectedIndices:p}=o3(d,u,n,a,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),nn(p,"int32")}var uM=lM;function dM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=vl(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let d={boxes:i,scores:o},u={maxOutputSize:n,iouThreshold:a,scoreThreshold:r,softNmsSigma:s},p=D.runKernel(zo,d,u);return{selectedIndices:p[0],selectedScores:p[1]}}var pM=O({nonMaxSuppressionWithScore_:dM});async function cM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=vl(i,o,n,a,r,s);n=l.maxOutputSize,a=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let d=await Promise.all([i.data(),o.data()]),u=d[0],p=d[1],{selectedIndices:c,selectedScores:h}=u3(u,p,n,a,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(c,"int32"),selectedScores:nn(h)}}var hM=cM;function fM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppression"),o=M(t,"scores","nonMaxSuppression"),l=vl(i,o,n,a,r,null),d=l.maxOutputSize,u=l.iouThreshold,p=l.scoreThreshold,c={boxes:i,scores:o},h={maxOutputSize:d,iouThreshold:u,scoreThreshold:p,padToMaxOutputSize:s},m=D.runKernel(Oo,c,h);return{selectedIndices:m[0],validOutputs:m[1]}}var mM=O({nonMaxSuppressionPadded_:fM});async function AM(e,t,n,a=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=M(e,"boxes","nonMaxSuppressionAsync"),o=M(t,"scores","nonMaxSuppressionAsync"),l=vl(i,o,n,a,r,null),d=l.maxOutputSize,u=l.iouThreshold,p=l.scoreThreshold,[c,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=l3(c,h,d,u,p,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:nn(m,"int32"),validOutputs:Ie(f,"int32")}}var yM=AM;function gM(e,t,n=!1,a=!1){let r=M(e,"images","resizeBilinear");F(r.rank===3||r.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`),F(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),F(a===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=H(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},d=D.runKernel(Ls,o,l);return i?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var p3=O({resizeBilinear_:gM});function xM(e,t,n=!1,a=!1){let r=M(e,"images","resizeNearestNeighbor");F(r.rank===3||r.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`),F(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),F(r.dtype==="float32"||r.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),F(a===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=H(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:n,halfPixelCenters:a,size:t},d=D.runKernel(Su,o,l);return i?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var c3=O({resizeNearestNeighbor_:xM});function bM(e,t,n="nearest",a="constant",r=0,s){let i=M(e,"image","transform","float32"),o=M(t,"transforms","transform","float32");F(i.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${i.rank}.`),F(o.rank===2&&(o.shape[0]===i.shape[0]||o.shape[0]===1)&&o.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),F(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},d={interpolation:n,fillMode:a,fillValue:r,outputShape:s};return D.runKernel(tc,l,d)}var vM=O({transform_:bM});function wM(e,t,n){F(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),F(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);let a=M(e,"a","bandPart");F(a.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${a.rank}.`);let r=a.shape,[s,i]=a.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=i))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`);t<0&&(t=s),n<0&&(n=i);let o=H(Rc(0,s,1,"int32"),[-1,1]),l=Rc(0,i,1,"int32"),d=ye(o,l),u=la(hi(d,Ie(+t,"int32")),Dr(d,Ie(-n,"int32"))),p=Ct([s,i],a.dtype);return H(zn(ua(H(a,[-1,s,i])).map(c=>In(u,c,p))),r)}var kM=O({bandPart_:wM});function IM(e){let t;if(Array.isArray(e)){t=!1,F(e!=null&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let r=e[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[s].shape[0]} vs. ${r})`)}else t=!0,e=ln(e,e.shape[0],0).map(r=>Or(r,[0]));F(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let n=[],a=e;for(let r=0;r{let s=a[r];if(r>0)for(let i=0;i=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),e.rank===2)return h3(e,t);{let n=e.shape.slice(0,e.shape.length-2).reduce((l,d)=>l*d),a=ua(H(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];a.forEach(l=>{let[d,u]=h3(l,t);r.push(d),s.push(u)});let i=H(zn(r,0),e.shape),o=H(zn(s,0),e.shape);return[i,o]}}function h3(e,t=!1){return D.tidy(()=>{F(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let n=e.shape[0],a=e.shape[1],r=hA(n),s=Oa(e),i=Kn([[1]],[1,1]),o=Oa(i),l=n>=a?a:n;for(let d=0;d{let h=Me(s,[d,d],[n-d,1]),m=Vc(h),f=Me(s,[d,d],[1,1]),A=In(oa(f,0),Kn([[-1]]),Kn([[1]])),y=ye(f,B(A,m)),g=ge(h,y);g.shape[0]===1?o=Oa(i):o=ot([i,Me(g,[1,0],[g.shape[0]-1,g.shape[1]])],0);let x=wt(ge(Be(A,y),m)),k=Me(s,[d,0],[n-d,a]),b=B(x,o),v=Ze(o);if(d===0)s=ye(k,Be(b,Be(v,k)));else{let R=ye(k,Be(b,Be(v,k)));s=ot([Me(s,[0,0],[d,a]),R],0)}let I=Ze(b),T=Me(r,[0,d],[n,r.shape[1]-d]);if(d===0)r=ye(T,Be(Be(T,o),I));else{let R=ye(T,Be(Be(T,o),I));r=ot([Me(r,[0,0],[n,d]),R],1)}return[o,s,r]}),Ee([u,p,c])}return!t&&n>a&&(r=Me(r,[0,0],[n,a]),s=Me(s,[0,0],[a,a])),[r,s]})}var TM=O({qr_:NM}),un;(function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(un||(un={}));function EM(e,t,n=un.SUM_BY_NONZERO_WEIGHTS){let a=M(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=M(t,"weights","computeWeightedLoss"));let s=r==null?a:B(a,r);if(n===un.NONE)return s;if(n===un.SUM)return Te(s);if(n===un.MEAN){if(r==null)return kt(s);{let i=a.size/r.size,o=ge(Te(s),Te(r));return i>1?ge(o,Ie(i)):o}}if(n===un.SUM_BY_NONZERO_WEIGHTS){if(r==null)return ge(Te(s),Ie(a.size));{let i=B(r,$n(a.shape)),o=Ae(Te(Ai(i,Ie(0))),"float32");return ge(Te(s),o)}}throw Error(`Unknown reduction: ${n}`)}var ir=O({computeWeightedLoss_:EM});function CM(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","absoluteDifference"),s=M(t,"predictions","absoluteDifference"),i=null;n!=null&&(i=M(n,"weights","absoluteDifference")),rn(r.shape,s.shape,"Error in absoluteDifference: ");let o=Ot(ye(r,s));return ir(o,i,a)}var RM=O({absoluteDifference_:CM});function MM(e,t,n,a,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","cosineDistance"),i=M(t,"predictions","cosineDistance"),o=null;a!=null&&(o=M(a,"weights","cosineDistance")),rn(s.shape,i.shape,"Error in cosineDistance: ");let l=Ie(1),d=ye(l,Te(B(s,i),n,!0));return ir(d,o,r)}var FM=O({cosineDistance_:MM});function $M(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","hingeLoss"),s=M(t,"predictions","hingeLoss"),i=null;n!=null&&(i=M(n,"weights","hingeLoss")),rn(r.shape,s.shape,"Error in hingeLoss: ");let o=Ie(1);r=ye(B(Ie(2),r),o);let l=La(ye(o,B(r,s)));return ir(l,i,a)}var DM=O({hingeLoss_:$M});function OM(e,t,n,a=1,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","huberLoss"),i=M(t,"predictions","huberLoss"),o=null;n!=null&&(o=M(n,"weights","huberLoss")),rn(s.shape,i.shape,"Error in huberLoss: ");let l=Ie(a),d=Ot(ye(i,s)),u=yl(d,l),p=ye(d,u),c=se(B(Ie(.5),st(u)),B(l,p));return ir(c,o,r)}var zM=O({huberLoss_:OM});function _M(e,t,n,a=1e-7,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"labels","logLoss"),i=M(t,"predictions","logLoss"),o=null;n!=null&&(o=M(n,"weights","logLoss")),rn(s.shape,i.shape,"Error in logLoss: ");let l=Ie(1),d=Ie(a),u=wt(B(s,Fn(se(i,d)))),p=B(ye(l,s),Fn(se(ye(l,i),d))),c=ye(u,p);return ir(c,o,r)}var PM=O({logLoss_:_M});function LM(e,t,n,a=un.SUM_BY_NONZERO_WEIGHTS){let r=M(e,"labels","meanSquaredError"),s=M(t,"predictions","meanSquaredError"),i=null;n!=null&&(i=M(n,"weights","meanSquaredError")),rn(r.shape,s.shape,"Error in meanSquaredError: ");let o=Lc(r,s);return ir(o,i,a)}var WM=O({meanSquaredError_:LM});function BM(e,t){let n=M(e,"labels","sigmoidCrossEntropyWithLogits"),a=M(t,"logits","sigmoidCrossEntropyWithLogits");rn(n.shape,a.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=La(a),s=B(a,n),i=Ic(qn(wt(Ot(a))));return se(ye(r,s),i)}function VM(e,t,n,a=0,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"multiClassLabels","sigmoidCrossEntropy"),i=M(t,"logits","sigmoidCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","sigmoidCrossEntropy")),rn(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),a>0){let d=Ie(a),u=Ie(1),p=Ie(.5);s=se(B(s,ye(u,d)),B(p,d))}let l=BM(s,i);return ir(l,o,r)}var jM=O({sigmoidCrossEntropy_:VM});function UM(e,t,n=-1){if(n===-1&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return _a((a,r,s)=>{let i=gA(r,[n],!0),o=ye(Ae(r,"float32"),i);s([a,o]);let l=wt(B(o,a));return{value:Te(l,[n]),gradFunc:(d,u)=>{let[p,c]=u,h=mi(d.shape,[n]);return[B(H(d,h),ye(Ae(p,"float32"),qn(c))),B(H(d,h),ye(qn(c),Ae(p,"float32")))]}}})(e,t)}function HM(e,t,n,a=0,r=un.SUM_BY_NONZERO_WEIGHTS){let s=M(e,"onehotLabels","softmaxCrossEntropy"),i=M(t,"logits","softmaxCrossEntropy"),o=null;if(n!=null&&(o=M(n,"weights","softmaxCrossEntropy")),rn(s.shape,i.shape,"Error in softmaxCrossEntropy: "),a>0){let d=Ie(a),u=Ie(1),p=Ie(s.shape[1]);s=se(B(s,ye(u,d)),ge(d,p))}let l=UM(s,i);return ir(l,o,r)}var GM=O({softmaxCrossEntropy_:HM});function qM(e,t,n){let a=M(e,"inputIndices","sparseReshape"),r=M(t,"inputShape","sparseReshape"),s=M(n,"newShape","sparseReshape");if(a.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape + ${a.shape}`);if(r.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let i={inputIndices:a,inputShape:r,newShape:s},o=D.runKernel(Qp,i);return{outputIndices:o[0],outputShape:o[1]}}var XM=O({sparseReshape_:qM}),KM={fft:td,ifft:xl,rfft:nd,irfft:Pc},ZM={hammingWindow:jR,hannWindow:s3,frame:i3,stft:qR},Ye={flipLeftRight:YR,resizeNearestNeighbor:c3,resizeBilinear:p3,rotateWithOffset:QR,cropAndResize:KR,nonMaxSuppression:tM,nonMaxSuppressionAsync:uM,nonMaxSuppressionWithScore:pM,nonMaxSuppressionWithScoreAsync:hM,nonMaxSuppressionPadded:mM,nonMaxSuppressionPaddedAsync:yM,transform:vM},f3={bandPart:kM,gramSchmidt:SM,qr:TM},YM={absoluteDifference:RM,computeWeightedLoss:ir,cosineDistance:FM,hingeLoss:DM,huberLoss:zM,logLoss:PM,meanSquaredError:WM,sigmoidCrossEntropy:jM,softmaxCrossEntropy:GM},m3={sparseReshape:XM},or=class extends Ab{minimize(e,t=!1,n){let{value:a,grads:r}=this.computeGradients(e,n);if(n!=null){let s=n.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return Ee(r),t?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Lb(e,t)}dispose(){this.iterations_!=null&&Ee(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:Ie(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}};Object.defineProperty(or,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var qc=class extends or{constructor(e,t,n=null){super();this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],n==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t],r=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:L(()=>Ue(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;L(()=>{let l=se(B(i,this.rho),B(st(s),1-this.rho)),d=B(ge(Jt(se(o,this.epsilon)),Jt(se(i,this.epsilon))),s),u=se(B(o,this.rho),B(st(d),1-this.rho));i.assign(l),o.assign(u);let p=se(B(d,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Ee(this.accumulatedGrads.map(e=>e.variable)),Ee(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=e.length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedUpdates=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};qc.className="Adadelta";Rr(qc);var Xc=class extends or{constructor(e,t=.1){super();this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t];if(this.accumulatedGrads[n]==null){let i=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:L(()=>Gu(a.shape,this.initialAccumulatorValue).variable(i))}}let r=Array.isArray(e)?e[n].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[n].variable;L(()=>{let i=se(s,st(r));s.assign(i);let o=se(B(ge(r,Jt(se(i,D.backend.epsilon()))),-this.learningRate),a);a.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Ee(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulatedGrads=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};Xc.className="Adagrad";Rr(Xc);var Kc=class extends or{constructor(e,t,n,a=null){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],L(()=>{this.accBeta1=Ie(t).variable(),this.accBeta2=Ie(n).variable()}),a==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),a=ye(1,this.accBeta2);t.forEach((r,s)=>{let i=D.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:L(()=>Ue(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:L(()=>Ue(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let d=this.accumulatedFirstMoment[s].variable,u=this.accumulatedSecondMoment[s].variable,p=se(B(d,this.beta1),B(l,1-this.beta1)),c=se(B(u,this.beta2),B(st(l),1-this.beta2)),h=ge(p,n),m=ge(c,a);d.assign(p),u.assign(c);let f=se(B(ge(h,se(Jt(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(B(this.accBeta1,this.beta1)),this.accBeta2.assign(B(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Ee(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Ee(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e),L(()=>{this.accBeta1.assign(sr(this.beta1,this.iterations_+1)),this.accBeta2.assign(sr(this.beta2,this.iterations_+1))});let t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}};Kc.className="Adam";Rr(Kc);var Zc=class extends or{constructor(e,t,n,a=null,r=0){super();this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=a,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],L(()=>{this.iteration=Ie(0).variable(),this.accBeta1=Ie(t).variable()}),a==null&&(this.epsilon=D.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(n=>n.name):Object.keys(e);L(()=>{let n=ye(1,this.accBeta1),a=ge(-this.learningRate,se(B(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=D.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Ue(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:Ue(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let d=this.accumulatedFirstMoment[s].variable,u=this.accumulatedWeightedInfNorm[s].variable,p=se(B(d,this.beta1),B(l,1-this.beta1)),c=B(u,this.beta2),h=Ot(l),m=Pa(c,h);d.assign(p),u.assign(m);let f=se(B(ge(a,n),ge(p,se(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(se(this.iteration,1)),this.accBeta1.assign(B(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Ee(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Ee(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}};Zc.className="Adamax";Rr(Zc);var ad=class extends or{constructor(e){super();this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=Array.isArray(e)?e[n].tensor:e[t];if(a==null)return;let r=D.registeredVariables[t];L(()=>{let s=se(B(this.c,a),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=jt(Ie(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}};ad.className="SGD";Rr(ad);var Yc=class extends ad{constructor(e,t,n=!1){super(e);this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=Ie(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t];if(this.accumulations[n]==null){let i=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(a).variable(i))}}let r=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];s!=null&&L(()=>{let i,o=se(B(this.m,r),s);this.useNesterov?i=se(B(this.c,se(s,B(o,this.m))),a):i=se(B(this.c,o),a),r.assign(o),a.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Ee(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=!1;this.accumulations=e.map(n=>({originalName:n.name,variable:n.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}};Yc.className="Momentum";Rr(Yc);var Jc=class extends or{constructor(e,t=.9,n=0,a=null,r=!1){super();if(this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,a==null&&(this.epsilon=D.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,n)=>{let a=D.registeredVariables[t],r=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:L(()=>Ue(a).variable(r))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:L(()=>Ue(a).variable(r))});let s=Array.isArray(e)?e[n].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;L(()=>{let l=se(B(i,this.decay),B(st(s),1-this.decay));if(this.centered){let d=this.accumulatedMeanGrads[n].variable,u=se(B(d,this.decay),B(s,1-this.decay)),p=ge(B(s,this.learningRate),Jt(ye(l,se(st(u),this.epsilon)))),c=se(B(o,this.momentum),p);i.assign(l),d.assign(u),o.assign(c);let h=ye(a,c);a.assign(h)}else{let d=se(B(i,this.decay),B(st(s),1-this.decay)),u=se(B(o,this.momentum),ge(B(s,this.learningRate),Jt(se(d,this.epsilon))));i.assign(d),o.assign(u);let p=ye(a,u);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Ee(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Ee(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Ee(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.accumulatedMoments=e.slice(t,t*2).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(a=>({originalName:a.name,variable:a.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}};Jc.className="RMSProp";Rr(Jc);var yi=class{static sgd(e){return new ad(e)}static momentum(e,t,n=!1){return new Yc(e,t,n)}static rmsprop(e,t=.9,n=0,a=null,r=!1){return new Jc(e,t,n,a,r)}static adam(e=.001,t=.9,n=.999,a=null){return new Kc(e,t,n,a)}static adadelta(e=.001,t=.95,n=null){return new qc(e,t,n)}static adamax(e=.002,t=.9,n=.999,a=null,r=0){return new Zc(e,t,n,a,r)}static adagrad(e,t=.1){return new Xc(e,t)}},gi={sgd:yi.sgd,momentum:yi.momentum,adadelta:yi.adadelta,adagrad:yi.adagrad,rmsprop:yi.rmsprop,adamax:yi.adamax,adam:yi.adam},JM=(()=>typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e())();function Qc(){return new Promise(e=>JM(()=>e()))}var C={};Fe(C,{ERF_A1:()=>uF,ERF_A2:()=>dF,ERF_A3:()=>pF,ERF_A4:()=>cF,ERF_A5:()=>hF,ERF_P:()=>lF,PARALLELIZE_THRESHOLD:()=>PA,SELU_SCALE:()=>y3,SELU_SCALEALPHA:()=>A3,applyActivation:()=>Hc,assertAndGetBroadcastShape:()=>ct,assertAxesAreInnerMostDims:()=>ME,assertParamsConsistent:()=>QM,assignToTypedArray:()=>vF,axesAreInnerMostDims:()=>AA,calculateShapes:()=>rb,checkEinsumDimSizes:()=>NF,combineLocations:()=>Bb,complexWithEvenIndex:()=>gF,complexWithOddIndex:()=>xF,computeConv2DInfo:()=>Vu,computeConv3DInfo:()=>kb,computeDefaultPad:()=>aA,computeDilation2DInfo:()=>tT,computeOptimalWindowSize:()=>tF,computeOutAndReduceShapes:()=>Vb,computeOutShape:()=>eF,computePool2DInfo:()=>wb,computePool3DInfo:()=>nT,convertConv2DDataFormat:()=>vb,decodeEinsumEquation:()=>IF,eitherStridesOrDilationsAreOne:()=>za,expandShapeToKeepDim:()=>mi,exponent:()=>kF,exponents:()=>wF,fromStringArrayToUint8:()=>MF,fromUint8ToStringArray:()=>RF,getAxesPermutation:()=>jb,getBroadcastDims:()=>GT,getComplexWithIndex:()=>bF,getEinsumComputePath:()=>TF,getEinsumPermutation:()=>SF,getFusedBiasGradient:()=>Uc,getFusedDyActivation:()=>jc,getImageCenter:()=>nF,getInnerMostAxes:()=>FE,getPermuted:()=>rF,getReductionAxes:()=>zt,getReshaped:()=>aF,getReshapedPermuted:()=>sF,getSliceBeginCoords:()=>iF,getSliceSize:()=>oF,getUndoAxesPermutation:()=>yA,isIdentityPermutation:()=>EF,log:()=>mF,mergeRealAndImagArrays:()=>AF,prepareAndValidate:()=>ab,prepareSplitSize:()=>CF,segment_util:()=>g3,shouldFuse:()=>Gc,slice_util:()=>sn,splitRealAndImagArrays:()=>yF,tupleValuesAreOne:()=>Mr,upcastType:()=>ia,validateInput:()=>Vm,validateUpdateShape:()=>Bm,warn:()=>fF});function QM(e,t){let n=e[0].length;e.forEach((r,s)=>{F(r.length===n,()=>`Error in concat${n}D: rank of tensors[${s}] must be the same as the rank of the rest (${n})`)}),F(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`);let a=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${a}) along the non-concatenated axis ${s}.`)})}function eF(e,t){let n=e[0].slice();for(let a=1;a=t*2+1||i%2==1?s.push(i):r.push(i);a.push(...r),a.push(0),a.push(...s)}return a}function sF(e,t,n,a=!0){let r=[];a?r.push(e[0]/n):r.push(e[0]*n);for(let s=1;s/g,x3=",",b3="...";function IF(e,t){e=e.replace(/\s/g,"");let n=(e.length-e.replace(FF,"").length)/LA.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${LA}").`);let[a,r]=e.split(LA);F(a.indexOf(b3)===-1,()=>`The ellipsis notation ("${b3}") is not supported yet.`);let s=a.split(x3),i=s.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let o=[];for(let c=0;cm.indexOf(h)!==-1))throw new Error(`Output subscripts contain the label ${h} not present in the input subscripts.`);o.indexOf(h)===-1&&o.push(h)}for(let c=0;cr!==-1),{permutationIndices:n,expandDims:a}}function NF(e,t,n){let a=new Array(e);for(let r=0;r`Expected dimension ${a[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function TF(e,t){let n=e,a=[],r=0;e.length===0&&n.push(-1),r=e.length+1;for(let i=0;it===n)}function $F(e,t){let n=[];for(let a=0;a"Number of splits must evenly divide the axis."),a=new Array(t).fill(e.shape[n]/t);else{let r=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);F(r<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let i=t.reduce((o,l)=>l>0?o+l:o);t[s]=e.shape[n]-i}F(e.shape[n]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),a=t}return a}var g3={};Fe(g3,{collectGatherOpShapeInfo:()=>zF,computeOutShape:()=>OF,segOpComputeOptimalWindowSize:()=>DF});function DF(e,t){let n=!1,a;for(e<=PA?(a=e,n=!0):a=Ip(e,Math.floor(Math.sqrt(e)));!n;)a>t||a===e?n=!0:a=Ip(e,a+1);return a}function OF(e,t,n){let a=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${a}`);if(a<0&&(a+=r),a>s)throw new Error(`batchDims (${a}) must be less than rank(x) ( + ${s}).`);if(nic(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function MF(e){return e.map(t=>Mu(t))}var Wa={};Fe(Wa,{nonMaxSuppressionV3Impl:()=>o3,nonMaxSuppressionV4Impl:()=>l3,nonMaxSuppressionV5Impl:()=>u3,whereImpl:()=>Yb});function ve(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&w.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var _F=Wa.whereImpl,eh=class extends du{constructor(){super();this.blockSize=48,this.firstUse=!0,this.data=new wp(this,nr())}nextDataId(){return eh.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,J().get("IS_NODE")&&C.warn(` ============================ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details. -============================`));let r={id:this.nextDataId()};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}makeTensorInfo(e,t,n){let r;if(t==="string"&&n!=null&&n.length>0&&_.isString(n[0])){let a=n.map(s=>_.encodeString(s));r=this.write(a,e,t)}else r=this.write(n,e,t);return{dataId:r,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,r,a){this.data.set(e,{values:t,dtype:r,refCount:a})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let r=this.readSync(n.real.dataId),a=this.readSync(n.imag.dataId);return E.mergeRealAndImagArrays(r,a)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(r=>_.decodeString(r))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}makeOutput(e,t,n){let r=this.write(e,t,n);return aa().makeTensorFromDataId(r,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=_.now();return e(),{kernelMs:_.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){be([e],"where");let t=this.readSync(e.dataId);return MM(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};ep.nextDataId=0;var Wm={};Me(Wm,{addImpl:()=>bb,bincountImpl:()=>Bm,bincountReduceImpl:()=>_b,ceilImpl:()=>vb,concatImpl:()=>Vm,expImpl:()=>kb,expm1Impl:()=>Ib,floorImpl:()=>Sb,gatherV2Impl:()=>Nb,greaterImpl:()=>Tb,lessImpl:()=>Eb,linSpaceImpl:()=>Cb,logImpl:()=>Rb,maxImpl:()=>Mb,maximumImpl:()=>Fb,minimumImpl:()=>$b,multiplyImpl:()=>jm,negImpl:()=>Db,notEqualImpl:()=>Ob,prodImpl:()=>zb,rangeImpl:()=>Hm,rsqrtImpl:()=>Pb,simpleAbsImpl:()=>wb,sliceImpl:()=>tp,sparseReshapeImpl:()=>Lb,squaredDifferenceImpl:()=>Wb,stridedSliceImpl:()=>Bb,subImpl:()=>Vb,tileImpl:()=>jb,topKImpl:()=>Ub,transposeImpl:()=>Um,uniqueImpl:()=>Hb});function wb(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;be(t,"abs");let r=new Float32Array(_.sizeFromShape(t.shape)),a=n.data.get(t.dataId).values;return r=wb(a),n.makeOutput(r,t.shape,"float32")},$M={kernelName:eo,backendName:"cpu",kernelFunc:FM};function Ct(e){return(t,n,r,a,s)=>{let i=E.assertAndGetBroadcastShape(t,n),o=i.length,l=_.computeStrides(i),c=_.sizeFromShape(i),u=_.getTypedArrayFromDType(s,c),h=t.length,d=n.length,p=_.computeStrides(t),m=_.computeStrides(n),f=E.getBroadcastDims(t,i),A=E.getBroadcastDims(n,i);if(f.length+A.length===0)for(let y=0;yx[k]=0);let v=_.locToIndex(x,h,p),w=g.slice(-d);A.forEach(k=>w[k]=0);let b=_.locToIndex(w,d,m);u[y]=e(r[v],a[b])}return[u,i]}}function zn(e){let{inputs:t,backend:n}=e,{real:r,imag:a}=t,s=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,o=n.makeTensorInfo(r.shape,"complex64"),l=n.data.get(o.dataId);return l.complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",s),imag:n.makeTensorInfo(a.shape,"float32",i)},o}var DM={kernelName:Eh,backendName:"cpu",kernelFunc:zn};function np(e,t,n="float32"){if(n==="complex64"){let a=np(e,t,"float32"),s=np(e,t,"float32");return zn({inputs:{real:a,imag:s},backend:e})}let r=_.makeZerosTypedArray(_.sizeFromShape(t),n);return e.makeTensorInfo(t,n,r)}function Br(e){let{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var OM={kernelName:vs,backendName:"cpu",kernelFunc:Br};function xi(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.data.get(r.dataId).complexTensorInfos.real,s=n.data.get(a.dataId).values;return n.makeTensorInfo(a.shape,a.dtype,s)}var zM={kernelName:Zh,backendName:"cpu",kernelFunc:xi};function La(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dtype:s}=r;if(s==="complex64"){if(a.dtype==="complex64")return Br({inputs:{x:a},backend:n});let i=np(n,a.shape,a.dtype),o=La({inputs:{x:a},backend:n,attrs:{dtype:"float32"}}),l=zn({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}if(a.dtype==="complex64"){let i=xi({inputs:{input:a},backend:n}),o=La({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!_.hasEncodingLoss(a.dtype,s)){let i=Br({inputs:{x:a},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(a.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(a.shape,"int32",o)}if(s==="bool"){let i=n.data.get(a.dataId).values,o=_.toTypedArray([0],a.dtype),[l,c]=Ct((u,h)=>u!==h?1:0)(a.shape,[],i,o,"bool");return n.makeTensorInfo(c,"bool",l)}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${s}`)}var PM={kernelName:cs,backendName:"cpu",kernelFunc:La};function jt(e,t,n,r){return n==null?({inputs:a,backend:s})=>{let{a:i,b:o}=a,l=s;be([i,o],e);let c=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,h=r||i.dtype,[d,p]=t(i.shape,o.shape,c,u,h);return l.makeTensorInfo(p,h,d)}:({inputs:a,backend:s})=>{let{a:i,b:o}=a,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let c=La({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),u=l.data.get(c.dataId),h=u.complexTensorInfos.real,d=u.complexTensorInfos.imag,p=l.data.get(h.dataId).values,m=l.data.get(d.dataId).values,f=La({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),A=l.data.get(f.dataId),y=A.complexTensorInfos.real,g=A.complexTensorInfos.imag,x=l.data.get(y.dataId).values,v=l.data.get(g.dataId).values,[w,b,k]=n(i.shape,o.shape,p,m,x,v),N=l.makeTensorInfo(k,"float32",w),C=l.makeTensorInfo(k,"float32",b),F=zn({inputs:{real:N,imag:C},backend:l});return l.disposeIntermediateTensorInfo(c),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(N),l.disposeIntermediateTensorInfo(C),F}else{let c=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,h=r||i.dtype,[d,p]=t(i.shape,o.shape,c,u,h);return l.makeTensorInfo(p,h,d)}}}function Gm(e){return(t,n,r,a,s,i)=>{let o=E.assertAndGetBroadcastShape(t,n),l=_.sizeFromShape(o),c=o.length,u=_.computeStrides(o),h=_.getTypedArrayFromDType("float32",l),d=_.getTypedArrayFromDType("float32",l),p=E.getBroadcastDims(t,o),m=E.getBroadcastDims(n,o),f=E.mergeRealAndImagArrays(r,a),A=E.mergeRealAndImagArrays(s,i),y=t.length,g=_.computeStrides(t),x=n.length,v=_.computeStrides(n);if(p.length+m.length===0)for(let w=0;wk[z]=0);let N=_.locToIndex(k,y,g),C=b.slice(-x);m.forEach(z=>C[z]=0);let F=_.locToIndex(C,x,v),O=e(f[N*2],f[N*2+1],A[F*2],A[F*2+1]);h[w]=O.real,d[w]=O.imag}return[h,d,o]}}var bb=Ct((e,t)=>e+t),LM=Gm((e,t,n,r)=>({real:e+n,imag:t+r})),ac=jt(Ia,bb,LM),WM={kernelName:Ia,backendName:"cpu",kernelFunc:ac};function Bm(e,t,n,r,a){let s=_.sizeFromShape(r),i=_.makeZerosTypedArray(a,n);for(let o=0;o=a||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function _b(e,t,n,r=!1){let a=e.shape[0],s=e.shape[1],i=We([a,n],t.dtype);for(let o=0;o=n||(r?i.set(1,o,c):t.size>0?i.set(i.get(o,c)+t.get(o,l),o,c):i.set(i.get(o,c)+1,o,c))}return i}function _l(e){return(t,n,r)=>{let a=_.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=r;if(be(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,c=_.sizeFromShape(i.shape),u=n||i.dtype,h=_.getArrayFromDType(u,c);for(let d=0;d{let{x:i}=r;if(be(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,c=n||i.dtype,u=t(l,c,a);return o.makeTensorInfo(i.shape,c,u)}}var vb=_l(e=>Math.ceil(e)),BM=vl(hs,vb),VM={kernelName:hs,backendName:"cpu",kernelFunc:BM};function Vm(e,t,n,r){let a=_.getArrayFromDType(n,_.sizeFromShape(t));if(r&&n!=="string"){let s=0;e.forEach(i=>{let o=_.sizeFromShape(i.shape);a.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?E.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let c=0;cMath.exp(e)),Gb=vl(gs,kb),jM={kernelName:gs,backendName:"cpu",kernelFunc:Gb},Ib=_l(e=>Math.expm1(e)),UM=vl(xo,Ib),HM={kernelName:xo,backendName:"cpu",kernelFunc:UM},Sb=_l(e=>Math.floor(e)),GM=vl(xs,Sb),qM={kernelName:xs,backendName:"cpu",kernelFunc:GM};function Nb(e,t,n){let r=We(n,e.dtype);for(let a=0;ae>t?1:0),XM=jt(vo,Tb,null,"bool"),KM={kernelName:vo,backendName:"cpu",kernelFunc:XM},Eb=Ct((e,t)=>eMath.log(e)),JM=vl(Is,Rb),QM={kernelName:Is,backendName:"cpu",kernelFunc:JM};function Mb(e,t,n,r){let a=_.getTypedArrayFromDType(r,_.sizeFromShape(n));for(let s=0;so&&(o=c)}a[s]=o}return a}var Fb=Ct((e,t)=>Math.max(e,t)),eF=jt(Ns,Fb),tF={kernelName:Ns,backendName:"cpu",kernelFunc:eF},$b=Ct((e,t)=>Math.min(e,t)),nF=jt(Rs,$b),rF={kernelName:Rs,backendName:"cpu",kernelFunc:nF},jm=Ct((e,t)=>e*t),aF=Gm((e,t,n,r)=>({real:e*n-t*r,imag:e*r+t*n})),rp=jt(Fs,jm,aF),sF={kernelName:Fs,backendName:"cpu",kernelFunc:rp};function Db(e,t,n){let r=_.createScalarValue(-1,n);return jm([],t,r,e,n)}function iF(e){let{inputs:t,backend:n}=e,{x:r}=t;be(r,"neg");let a=n.data.get(r.dataId).values,[s,i]=Db(a,r.shape,r.dtype);return n.makeTensorInfo(i,r.dtype,s)}var oF={kernelName:Mo,backendName:"cpu",kernelFunc:iF},Ob=Ct((e,t)=>e!==t?1:0),lF=jt(Fo,Ob,null,"bool"),uF={kernelName:Fo,backendName:"cpu",kernelFunc:lF};function Um(e,t,n,r,a){let s=t.length,i=_.sizeFromShape(t),o=_.computeStrides(t),l=_.computeStrides(a),c=_.getTypedArrayFromDType(n,_.sizeFromShape(a));for(let u=0;un.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(y,A,m)}var dF={kernelName:Lo,backendName:"cpu",kernelFunc:hF};function Hm(e,t,n,r){let a=e===t,s=e1;if(a||s||i)return _.makeZerosTypedArray(0,r);let o=Math.abs(Math.ceil((t-e)/n)),l=_.makeZerosTypedArray(o,r);t1/Math.sqrt(e)),pF=vl(js,Pb),fF={kernelName:js,backendName:"cpu",kernelFunc:pF};function tp(e,t,n,r,a){let s=sn.isSliceContinous(r,t,n),i=_.sizeFromShape(n),o=_.computeStrides(r);if(s){let h=sn.computeFlatOffset(t,o);return a==="string"?e.slice(h,h+i):e.subarray(h,h+i)}let l=a==="string"?E.fromUint8ToStringArray(e):e,c=We(r,a,l),u=We(n,a);for(let h=0;hm+t[f]);u.set(c.get(...p),...d)}return a==="string"?E.fromStringArrayToUint8(u.values):u.values}function wi(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,size:i}=r;be(a,"slice");let[o,l]=sn.parseSliceParams(a,s,i);sn.assertParamsValid(a,o,l);let c=n.data.get(a.dataId).values,u=tp(c,o,l,a.shape,a.dtype);return n.makeTensorInfo(l,a.dtype,u)}var mF={kernelName:Ho,backendName:"cpu",kernelFunc:wi};function Lb(e,t,n,r,a){let s=_.sizeFromShape(r),i=t[0],o=a.length,l=[],c=1,u=-1;for(let A=0;A0){p[d-1]=1;for(let A=d-2;A>=0;--A)p[A]=p[A+1]*r[A+1]}let m=[];if(o>0){m[o-1]=1;for(let A=o-2;A>=0;--A)m[A]=m[A+1]*l[A+1]}let f=_.getArrayFromDType(n,i*o);for(let A=0;A{let n=e-t;return n*n}),AF=jt(Ks,Wb),yF={kernelName:Ks,backendName:"cpu",kernelFunc:AF};function Bb(e,t,n,r){let a=We(e,t.dtype);for(let s=0;se-t),gF=Gm((e,t,n,r)=>({real:e-n,imag:t-r})),qm=jt(Zs,Vb,gF),xF={kernelName:Zs,backendName:"cpu",kernelFunc:qm};function jb(e,t){let n=new Array(e.rank);for(let a=0;ax.value-g.value);let f=h*r,A=l.subarray(f,f+r),y=c.subarray(f,f+r);for(let g=0;g{for(let A=0;Anew ep,1);var Xb=nt(mo,e=>e>=0?e:Math.exp(e)-1),wF={kernelName:mo,backendName:"cpu",kernelFunc:Xb};function Kb(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{alpha:s}=r;be([a],"leakyRelu");let i=_.sizeFromShape(a.shape),o=n.data.get(a.dataId).values,l=_.getTypedArrayFromDType("float32",i);for(let c=0;ce<0?t*e:e);function Zb(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t;be([r,a],"prelu");let s=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,[o,l]=_F(r.shape,a.shape,s,i,r.dtype);return n.makeTensorInfo(l,r.dtype,o)}var vF={kernelName:zs,backendName:"cpu",kernelFunc:Zb},Yb=nt(Ps,e=>Math.max(0,e)),kF={kernelName:Ps,backendName:"cpu",kernelFunc:Yb},Jb=nt(Ws,e=>Math.min(Math.max(0,e),6)),IF={kernelName:Ws,backendName:"cpu",kernelFunc:Jb},Qb=nt(Hs,e=>1/(1+Math.exp(-e))),SF={kernelName:Hs,backendName:"cpu",kernelFunc:Qb};function Xm(e,t,n,r,a){if(n==="linear")return Br({inputs:{x:t},backend:e});if(n==="relu")return Yb({inputs:{x:t},backend:e});if(n==="elu")return Xb({inputs:{x:t},backend:e});if(n==="relu6")return Jb({inputs:{x:t},backend:e});if(n==="prelu")return Zb({inputs:{x:t,alpha:r},backend:e});if(n==="leakyrelu")return Kb({inputs:{x:t},backend:e,attrs:{alpha:a}});if(n==="sigmoid")return Qb({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function pt(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{shape:s}=r,i=_.sizeFromShape(a.shape),o=_.inferFromImplicitShape(s,i),l=_.sizeFromShape(o);_.assert(i===l,()=>`The new shape (${o}) has ${l} elements and the old shape (${a.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(a.dataId);let c=n.data.get(a.dataId);if(c.complexTensorInfos!=null){let u=c.complexTensorInfos.real,h=c.complexTensorInfos.imag;u.shape=o,h.shape=o}return{dataId:a.dataId,shape:o,dtype:a.dtype}}var NF={kernelName:Bo,backendName:"cpu",kernelFunc:pt};function e_(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;be([a,s],"matMul");let l=a.shape.length,c=s.shape.length,u=i?a.shape[l-2]:a.shape[l-1],h=o?s.shape[c-1]:s.shape[c-2],d=i?a.shape[l-1]:a.shape[l-2],p=o?s.shape[c-2]:s.shape[c-1],m=a.shape.slice(0,-2),f=s.shape.slice(0,-2),A=_.sizeFromShape(m),y=_.sizeFromShape(f),g=A===y||A===1||y===1;_.assert(l>=2&&c>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?a.shape.slice(0,-2):s.shape.slice(0,-2)).concat([d,p]);_.assert(u===h,()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${a.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[A,u,d]:[A,d,u],w=o?[y,p,h]:[y,h,p],b=pt({inputs:{x:a},backend:n,attrs:{shape:v}}),k=pt({inputs:{x:s},backend:n,attrs:{shape:w}}),N=i?b.shape[1]:b.shape[2],C=i?b.shape[2]:b.shape[1],F=o?k.shape[1]:k.shape[2],O=Math.max(A,y),z=n.data.get(b.dataId).values,V=n.data.get(k.dataId).values,j=_.computeStrides(b.shape),U=_.computeStrides(k.shape),[X,G,ee]=i?[j[0],1,j[1]]:[j[0],j[1],1],[Y,ae,te]=o?[1,U[1],U[0]]:[U[1],1,U[0]],ie=C*F,Q=We([O,C,F],b.dtype),ce=Q.values,oe=n.blockSize;for(let me=0;meMath.acos(e)),MF={kernelName:to,backendName:"cpu",kernelFunc:RF},FF=nt(no,e=>Math.acosh(e)),$F={kernelName:no,backendName:"cpu",kernelFunc:FF};function DF(e){let{inputs:t,backend:n}=e,r=t;be(t,"addN");let a=r.map(o=>n.data.get(o.dataId).values),s=We(r[0].shape,r[0].dtype),i=s.values;for(let o=0;og&&(g=w,x=v)}p[A]=x}return c.forEach(A=>n.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",p)}var VF={kernelName:os,backendName:"cpu",kernelFunc:BF};function jF(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r;be(a,"argMin");let i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=Zn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],E.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[u,h]=E.computeOutAndReduceShapes(l.shape,i),d=_.sizeFromShape(u),p=_.makeZerosTypedArray(d,"int32"),m=_.sizeFromShape(h),f=n.data.get(l.dataId).values;for(let A=0;An.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",p)}var UF={kernelName:pu,backendName:"cpu",kernelFunc:jF},HF=nt(so,e=>Math.asin(e)),GF={kernelName:so,backendName:"cpu",kernelFunc:HF},qF=nt(io,e=>Math.asinh(e)),XF={kernelName:io,backendName:"cpu",kernelFunc:qF},KF=nt(oo,e=>Math.atan(e)),ZF={kernelName:oo,backendName:"cpu",kernelFunc:KF},YF=Ct((e,t)=>Math.atan2(e,t)),JF=jt(uo,YF),QF={kernelName:uo,backendName:"cpu",kernelFunc:JF},e$=nt(lo,e=>Math.atanh(e)),t$={kernelName:lo,backendName:"cpu",kernelFunc:e$};function Km(e,t,n,r,a,s){let i=a.strideHeight,o=a.strideWidth,l=a.dilationHeight,c=a.dilationWidth,u=a.effectiveFilterHeight,h=a.effectiveFilterWidth,d=a.padInfo.top,p=a.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=We(a.outShape,n),A=f.values,y=a.outShape[1]*a.outShape[2]*a.outShape[3],g=a.outShape[2]*a.outShape[3],x=a.outShape[3];for(let v=0;vG?G=oe:s==="avg"&&(ee+=oe,Y++)}if(isNaN(G))break}let ae=z+V*x+k;A[ae]=s==="avg"?ee/Y:G}}}return f}function t_(e,t,n,r,a=!1,s=!1){let i=We(r.outShape,"int32"),o=r.strideHeight,l=r.strideWidth,c=r.dilationHeight,u=r.dilationWidth,h=r.effectiveFilterHeight,d=r.effectiveFilterWidth,p=r.padInfo.top,m=r.padInfo.left,f=We(t,n,e);for(let A=0;AF&&(F=X,a?O=s?((A*r.inHeight+z)*r.inWidth+j)*r.inChannels+y:(z*r.inWidth+j)*r.inChannels+y:O=V*d+U)}}i.set(O,A,g,b,y)}}return i}function n_(e,t,n,r,a,s){let i=a.strideDepth,o=a.strideHeight,l=a.strideWidth,c=a.dilationDepth,u=a.dilationHeight,h=a.dilationWidth,d=a.effectiveFilterDepth,p=a.effectiveFilterHeight,m=a.effectiveFilterWidth,f=a.padInfo.front,A=a.padInfo.top,y=a.padInfo.left,g=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=We(a.outShape,n),v=x.values,w=a.outShape[1]*a.outShape[2]*a.outShape[3]*a.outShape[4],b=a.outShape[2]*a.outShape[3]*a.outShape[4],k=a.outShape[3]*a.outShape[4],N=a.outShape[4];for(let C=0;Cve?ve=Ve:s==="avg"&&(Ie+=Ve,Fe++),isNaN(ve))break}if(isNaN(ve))break}if(isNaN(ve))break}let Oe=de+z;v[Oe]=s==="avg"?Ie/Fe:ve}}}}return x}function n$(e,t){let n=We(t.outShape,"int32"),r=t.strideDepth,a=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=V&&(V=te,j=X*u*h+ee*u+ae)}}}n.set(j,f,y,w,C,A)}}}return n}function r$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t;be(a,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=r,c=1;_.assert(E.eitherStridesOrDilationsAreOne(i,c),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l),h;if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))h=Br({inputs:{x:a},backend:n});else{let d=n.data.get(a.dataId).values,p=_.computeStrides(a.shape),m=Km(d,a.shape,a.dtype,p,u,"avg");h=n.makeTensorInfo(u.outShape,a.dtype,m.values)}return h}var a$={kernelName:ls,backendName:"cpu",kernelFunc:r$};function s$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r;be(a,"avgPool3d");let u=E.computePool3DInfo(a.shape,s,i,1,o,l,c),h=n.data.get(a.dataId).values,d=n_(h,a.shape,a.dtype,_.computeStrides(a.shape),u,"avg");return n.makeTensorInfo(d.shape,"float32",d.values)}var i$={kernelName:fu,backendName:"cpu",kernelFunc:s$};function o$(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=r;be([a,s],"avgPool3DGrad");let u=E.computePool3DInfo(s.shape,i,o,1,l,c),h=u.strideDepth,d=u.strideHeight,p=u.strideWidth,m=u.filterDepth,f=u.filterHeight,A=u.filterWidth,y=u.dilationDepth,g=u.dilationHeight,x=u.dilationWidth,v=u.effectiveFilterDepth,w=u.effectiveFilterHeight,b=u.effectiveFilterWidth,k=v-1-u.padInfo.front,N=b-1-u.padInfo.left,C=w-1-u.padInfo.top,F=We(s.shape,"float32"),O=1/(m*f*A),z=n.bufferSync(a);for(let V=0;V=u.outDepth||Math.floor(Q)!==Q))for(let ce=0;ce=u.outHeight||Math.floor(oe)!==oe))for(let me=0;me=u.outWidth||Math.floor(de)!==de||(te+=z.get(V,Q,oe,de,j))}}}F.set(te*O,V,U,X,G,j)}return n.makeTensorInfo(F.shape,F.dtype,F.values)}var l$={kernelName:Nh,backendName:"cpu",kernelFunc:o$};function u$(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s;be([a,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:c}=r,u=E.computePool2DInfo(i.shape,o,l,1,c),h=u.strideHeight,d=u.strideWidth,p=u.filterHeight,m=u.filterWidth,f=u.dilationHeight,A=u.dilationWidth,y=u.effectiveFilterHeight,g=u.effectiveFilterWidth,x=g-1-u.padInfo.left,v=y-1-u.padInfo.top,w=We(i.shape,"float32"),b=1/(p*m),k=n.data.get(a.dataId).values,N=We(a.shape,"float32",k);for(let C=0;C=u.outHeight||Math.floor(G)!==G))for(let ee=0;ee=u.outWidth||Math.floor(Y)!==Y||(U+=N.get(C,G,Y,F))}}w.set(U*b,C,O,z,F)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}var c$={kernelName:Sh,backendName:"cpu",kernelFunc:u$};function h$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,scale:s,offset:i,mean:o,variance:l}=t;_.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),_.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),_.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),be([a,o,l,s,i],"batchNorm");let{varianceEpsilon:c}=r;c==null&&(c=.001);let u=n.data.get(a.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(u.length),A=m.length,y=p.length,g=d.length,x=h.length,v=0,w=0,b=0,k=0;for(let N=0;N=A&&(v=0),w>=x&&(w=0),b>=y&&(b=0),k>=g&&(k=0);return n.makeTensorInfo(a.shape,a.dtype,f)}var d$={kernelName:bs,backendName:"cpu",kernelFunc:h$};function p$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,crops:i}=r;be([a],"batchToSpaceND");let o=s.reduce((y,g)=>y*g),l=E.getReshaped(a.shape,s,o),c=E.getPermuted(l.length,s.length),u=E.getReshapedPermuted(a.shape,s,o),h=E.getSliceBeginCoords(i,s.length),d=E.getSliceSize(u,i,s.length),p=pt({inputs:{x:a},backend:n,attrs:{shape:l}}),m=Zn({inputs:{x:p},backend:n,attrs:{perm:c}}),f=pt({inputs:{x:m},backend:n,attrs:{shape:u}}),A=wi({inputs:{x:f},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var f$={kernelName:mu,backendName:"cpu",kernelFunc:p$};function m$(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i}=r,o=n.data.get(a.dataId).values,l=n.data.get(s.dataId).values,c=Bm(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,c)}var A$={kernelName:Th,backendName:"cpu",kernelFunc:m$},y$=nt(Sa,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,r=new Float32Array(_.sizeFromShape(t.shape)),a=n.data.get(t.dataId),s=a.complexTensorInfos.real,i=a.complexTensorInfos.imag,o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values;for(let c=0;cf.shape),s);if(_.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>_.sizeFromShape(f.shape)>0);if(o.length===1)return Br({inputs:{x:o[0]},backend:n});let l=o.map(f=>f.shape);if(E.assertParamsConsistent(l,s),o[0].dtype==="complex64"){let f=o.map(v=>xi({inputs:{input:v},backend:n})),A=o.map(v=>kl({inputs:{input:v},backend:n})),y=Il({inputs:f,backend:n,attrs:{axis:s}}),g=Il({inputs:A,backend:n,attrs:{axis:s}}),x=zn({inputs:{real:y,imag:g},backend:n});return f.forEach(v=>n.disposeIntermediateTensorInfo(v)),A.forEach(v=>n.disposeIntermediateTensorInfo(v)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(g),x}let c=o.map(f=>{let A=_.sizeFromShape(f.shape.slice(s));return pt({inputs:{x:f},backend:n,attrs:{shape:[-1,A]}})}),u=c.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=E.computeOutShape(c.map(f=>f.shape),1);let h=c[0].shape[0]===1,d=Vm(u,i,t[0].dtype,h),p=E.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(p,t[0].dtype,d);return c.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var _$={kernelName:co,backendName:"cpu",kernelFunc:Il};function r_(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=r;be([a,s],"conv2d");let h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,s.shape,i,c,o,u,!1,h),p=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,A=d.dilationWidth,y=d.padInfo.left,g=d.padInfo.top,x=d.dataFormat==="channelsLast",v=new $t(d.outShape,a.dtype),w=_.computeStrides(a.shape),b=_.computeStrides(s.shape),k=w[0],N=x?w[1]:w[2],C=x?w[2]:1,F=x?1:w[1],O=v.strides[0],z=x?v.strides[1]:v.strides[2],V=x?v.strides[2]:1,j=x?1:v.strides[1],U=n.data.get(a.dataId).values,X=n.data.get(s.dataId).values,G=v.values;for(let ee=0;ee=d.inHeight)continue;let me=ce*b[0],de=Y+oe*N;for(let ve=0;ve=d.inWidth)continue;let Qe=me+Oe*b[1],et=de+$e*C,at=Qe;for(let Xe=0;Xe=c.inDepth)continue;let ee=X*C[0],Y=O+G*N[1];for(let ae=0;ae=c.inHeight)continue;let oe=ee+Q*C[1],me=Y+ce*N[2];for(let de=0;de=c.inWidth)continue;let $e=oe+Fe*C[2],Qe=me+Oe*c.inChannels,et=$e;for(let at=0;atMath.cos(e)),D$={kernelName:fs,backendName:"cpu",kernelFunc:$$},O$=nt(ho,e=>Math.cosh(e)),z$={kernelName:ho,backendName:"cpu",kernelFunc:O$};function P$(e){let{inputs:t,backend:n,attrs:r}=e,{image:a,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:c}=r,[u,h,d,p]=a.shape,m=s.shape[0],[f,A]=o,y=We([m,f,A,p],"float32"),g=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,v=n.data.get(a.dataId).values,w=_.computeStrides(a.shape),b=_.computeStrides(y.shape);for(let k=0;k=u)continue;let j=f>1?(O-C)*(h-1)/(f-1):0,U=A>1?(z-F)*(d-1)/(A-1):0;for(let X=0;X1?C*(h-1)+X*j:.5*(C+O)*(h-1);if(G<0||G>h-1){for(let ee=0;ee1?F*(d-1)+te*U:.5*(F+z)*(d-1);if(ie<0||ie>d-1){for(let me=0;me1?F*(d-1)+ee*U:.5*(F+z)*(d-1);if(Y<0||Y>d-1){for(let ie=0;iey+m-g-1:(y,g)=>y+g;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=a.shape[1],c=a.shape[2],u=a.shape[3],h=l*s,d=c*s,p=u/(s*s),m=n.data.get(a.dataId).values,f=new Float32Array(o*h*d*p),A=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let p=E.computeConv2DInfo(a.shape,s.shape,i,d,o,c,!0),{filterHeight:m,filterWidth:f,dilationHeight:A,dilationWidth:y,padInfo:g}=p,x=g.left,v=g.top,w=p.outChannels/p.inChannels,b=new $t(p.outShape,a.dtype),k=n.data.get(a.dataId).values,N=n.data.get(s.dataId).values,C=b.values;for(let F=0;F=p.inHeight)continue;let ee=X*h[0],Y=O+G*u[1];for(let ae=0;ae=p.inWidth)continue;let oe=ee+Q*h[1],me=Y+ce*p.inChannels,de=te,ve=oe;for(let Ie=0;Ie{let{x:r,filter:a}=e,{strides:s,pad:i,dilations:o}=n,l=t,c=l.data.get(r.dataId).values,u=r.shape.length,h=l.data.get(a.dataId).values,d=a.shape.length,{batchSize:p,inHeight:m,inWidth:f,inChannels:A,outHeight:y,outWidth:g,padInfo:x,strideHeight:v,strideWidth:w,filterHeight:b,filterWidth:k,dilationHeight:N,dilationWidth:C,outShape:F}=E.computeDilation2DInfo(r.shape,a.shape,s,i,"NHWC",o),O=_.sizeFromShape(F),z=F.length,V=_.getArrayFromDType(r.dtype,O);for(let j=0;j=0&&Q=0&&oeae&&(ae=ve)}}}let te=_.locToIndex([j,U,G,Y],z,_.computeStrides(F));V[te]=ae}}}return{dataId:l.write(_.toTypedArray(V,r.dtype),F,r.dtype),shape:F,dtype:r.dtype}}},eD={kernelName:Ph,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,c=t,u=_.toNestedArray(r.shape,c.data.get(r.dataId).values),h=_.toNestedArray(a.shape,c.data.get(a.dataId).values),{batchSize:d,inHeight:p,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:v,filterHeight:w,filterWidth:b,dilationHeight:k,dilationWidth:N,outShape:C}=E.computeDilation2DInfo(r.shape,a.shape,i,o,"NHWC",l);_.assert(s.rank===C.length,()=>`Error in ${Ph}, dy must have the same rank as output ${C.length}, but got ${s.rank}`);let F=_.toNestedArray(C,c.data.get(s.dataId).values),O=_.makeZerosNestedTypedArray(a.shape,a.dtype);for(let z=0;z=0&&ie=0&&ceee&&(ee=oe,Y=te,ae=Q)}}}O[Y][ae][G]+=F[z][V][U][G]}}}return{dataId:c.write(_.toTypedArray(O,r.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},tD={kernelName:zh,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,c=t,u=_.toNestedArray(r.shape,c.data.get(r.dataId).values),h=_.toNestedArray(a.shape,c.data.get(a.dataId).values),{batchSize:d,inHeight:p,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:v,filterHeight:w,filterWidth:b,dilationHeight:k,dilationWidth:N,outShape:C}=E.computeDilation2DInfo(r.shape,a.shape,i,o,"NHWC",l);_.assert(s.rank===C.length,()=>`Error in ${zh}, dy must have the same rank as output ${C.length}, but got ${s.rank}`);let F=_.toNestedArray(C,c.data.get(s.dataId).values),O=_.makeZerosNestedTypedArray(r.shape,r.dtype);for(let z=0;z=0&&ie=0&&ceee&&(ee=oe,Y=ie,ae=ce)}}}O[z][Y][ae][G]+=F[z][V][U][G]}}}return{dataId:c.write(_.toTypedArray(O,r.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}};function sc(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r;be(a,"sum");let o;a.dtype==="bool"?o=La({inputs:{x:a},backend:n,attrs:{dtype:"int32"}}):o=Br({inputs:{x:a},backend:n});let l=o.shape.length,c=_.parseAxisParam(s,o.shape),u=E.getAxesPermutation(c,l),h=c,d=o;u!=null&&(d=Zn({inputs:{x:o},backend:n,attrs:{perm:u}}),h=E.getInnerMostAxes(h.length,l)),E.assertAxesAreInnerMostDims("sum",h,d.shape.length);let[p,m]=E.computeOutAndReduceShapes(d.shape,h),f=E.upcastType(d.dtype,"int32"),A=np(n,p,f),y=_.sizeFromShape(m),g=n.data.get(A.dataId).values,x=n.data.get(d.dataId).values;for(let v=0;v=0&&(d=sc({inputs:{x:d},backend:n,attrs:{axis:c[f]-(i.length-p),keepDims:!1}}),m.push(d)),p--)}for(let f of m)f!==d&&n.disposeIntermediateTensorInfo(f);return d}var aD={kernelName:Lh,backendName:"cpu",kernelFunc:rD};function sD(e){let{inputs:t,backend:n}=e,{dy:r,y:a}=t;be([r,a],"eluGrad");let s=new Float32Array(_.sizeFromShape(a.shape)),i=n.data.get(a.dataId).values,o=n.data.get(r.dataId).values;for(let l=0;l=1?s[l]=o[l]:s[l]=o[l]*(c+1)}return n.makeTensorInfo(a.shape,"float32",s)}var iD={kernelName:Wh,backendName:"cpu",kernelFunc:sD},oD=Ct((e,t)=>e===t?1:0),s_=jt(yo,oD,null,"bool"),lD={kernelName:yo,backendName:"cpu",kernelFunc:s_},uD=E.ERF_P,cD=E.ERF_A1,hD=E.ERF_A2,dD=E.ERF_A3,pD=E.ERF_A4,fD=E.ERF_A5,mD=nt(Ao,e=>{let t=Math.sign(e),n=Math.abs(e),r=1/(1+uD*n);return t*(1-((((fD*r+pD)*r+dD)*r+hD)*r+cD)*r*Math.exp(-n*n))}),AD={kernelName:Ao,backendName:"cpu",kernelFunc:mD};function ap(e){let{inputs:t,backend:n,attrs:r}=e,{input:a}=t,{dim:s}=r,i=a.shape.length,o=a.shape.slice(),l=s;return s<0&&(_.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),pt({inputs:{x:a},backend:n,attrs:{shape:o}})}var yD={kernelName:go,backendName:"cpu",kernelFunc:ap},gD=Ct((e,t)=>e/t),Zm=jt(ys,gD),Ym={kernelName:ys,backendName:"cpu",kernelFunc:Zm};function i_(e,t,n){let r=e.shape,a=r[0],s=r[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,c=[a,s],u=_.sizeFromShape(c),h=_.getTypedArrayFromDType("float32",u),d=_.getTypedArrayFromDType("float32",u);for(let A=0;A{let{image:r}=e,a=n,s=_.getTypedArrayFromDType(r.dtype,_.sizeFromShape(r.shape)),[i,o,l,c]=r.shape,u=a.data.get(r.dataId).values;for(let h=0;h=0&&xMath.floor(e/t)),TD=jt(ws,ND,null,"int32"),ED={kernelName:ws,backendName:"cpu",kernelFunc:TD};function CD(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=r_({inputs:{x:a,filter:s},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(i){let A=f;f=ac({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(p){let A=f;f=Xm(n,f,p,o,m),n.disposeIntermediateTensorInfo(A)}return f}var RD={kernelName:ti,backendName:"cpu",kernelFunc:CD};function MD(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=a_({inputs:{x:a,filter:s},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(i){let A=f;f=ac({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(p){let A=f;f=Xm(n,f,p,o,m),n.disposeIntermediateTensorInfo(A)}return f}var FD={kernelName:ni,backendName:"cpu",kernelFunc:MD};function $D(e){let{inputs:t,backend:n}=e,{params:r,indices:a}=t,s=_.sizeFromShape(r.shape),i=a.shape,o=i[i.length-1],[l,c,u,h]=E.prepareAndValidate(r,a);if(c===0)return n.makeTensorInfo(l,r.dtype,[]);let d=We([c,u],r.dtype),p=n.data.get(a.dataId).values,m=n.data.get(r.dataId).values;for(let f=0;f=s/u)throw new Error(`Invalid indices: ${A} does not index into ${r.shape}`);for(let g=0;ge>=t?1:0),LD=jt(_s,PD,null,"bool"),WD={kernelName:_s,backendName:"cpu",kernelFunc:LD};function BD(e){let{inputs:t,backend:n}=e,{input:r}=t,a=_.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],i=a/s,o=pt({inputs:{x:r},backend:n,attrs:{shape:[i,s]}}),l=i_(o,!0,n),c=pt({inputs:{x:l},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),c}var VD={kernelName:Vh,backendName:"cpu",kernelFunc:BD},jD=nt(ko,e=>Number.isFinite(e)?1:0,"bool"),UD={kernelName:ko,backendName:"cpu",kernelFunc:jD},HD=nt(Io,e=>Math.abs(e)===Infinity?1:0,"bool"),GD={kernelName:Io,backendName:"cpu",kernelFunc:HD},qD=nt(So,e=>Number.isNaN(e)?1:0,"bool"),XD={kernelName:So,backendName:"cpu",kernelFunc:qD},KD=Ct((e,t)=>e<=t?1:0),ZD=jt(To,KD,null,"bool"),YD={kernelName:To,backendName:"cpu",kernelFunc:ZD};function JD(e){let{backend:t,attrs:n}=e,{start:r,stop:a,num:s}=n,i=Cb(r,a,s);return t.makeTensorInfo([i.length],"float32",i)}var QD={kernelName:Uh,backendName:"cpu",kernelFunc:JD},eO=nt(Eo,e=>Math.log1p(e)),tO={kernelName:Eo,backendName:"cpu",kernelFunc:eO},nO=Ct((e,t)=>e&&t),rO=jt(Co,nO,null,"bool"),aO={kernelName:Co,backendName:"cpu",kernelFunc:rO},sO=nt(wu,e=>e?0:1,"bool"),iO={kernelName:wu,backendName:"cpu",kernelFunc:sO},oO=Ct((e,t)=>e||t),lO=jt(bu,oO,null,"bool"),uO={kernelName:bu,backendName:"cpu",kernelFunc:lO};function cO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=r;be(a,"LRN");let c=a.shape[3],u=c-1,h=n.data.get(a.dataId).values,d=_.sizeFromShape(a.shape),p=new Float32Array(d);function m(f){let A=f%c,y=f-A+Math.max(0,A-s),g=f-A+Math.min(A+s,u),x=0;for(;y<=g;y++){let v=h[y];x+=v*v}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l),h;if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))h=Br({inputs:{x:a},backend:n});else{let d=n.data.get(a.dataId).values,p=_.computeStrides(a.shape),m=Km(d,a.shape,a.dtype,p,u,"max");h=n.makeTensorInfo(u.outShape,a.dtype,m.values)}return h}var AO={kernelName:Ts,backendName:"cpu",kernelFunc:mO};function yO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r;be(a,"maxPool3d");let u=E.computePool3DInfo(a.shape,s,i,1,o,l,c),h=n.data.get(a.dataId).values,d=n_(h,a.shape,a.dtype,_.computeStrides(a.shape),u,"max");return n.makeTensorInfo(d.shape,"float32",d.values)}var gO={kernelName:vu,backendName:"cpu",kernelFunc:yO};function xO(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=r;be([a,s],"maxPool3DGrad");let u=E.computePool3DInfo(s.shape,i,o,1,l,c),h=n.bufferSync(s),d=n$(h,u),p=u.strideDepth,m=u.strideHeight,f=u.strideWidth,A=u.dilationDepth,y=u.dilationHeight,g=u.dilationWidth,x=u.effectiveFilterDepth,v=u.effectiveFilterHeight,w=u.effectiveFilterWidth,b=x-1-u.padInfo.front,k=w-1-u.padInfo.left,N=v-1-u.padInfo.top,C=We(s.shape,"float32"),F=n.bufferSync(a);for(let O=0;O=u.outDepth||Math.floor(te)!==te))for(let ie=0;ie=u.outHeight||Math.floor(Q)!==Q))for(let ce=0;ce=u.outWidth||Math.floor(oe)!==oe)continue;let me=x*v*w-1-d.get(O,te,Q,oe,z),de=ae*v*w+ie*w+ce,ve=me===de?1:0;ve!==0&&(Y+=F.get(O,te,Q,oe,z)*ve)}}}C.set(Y,O,V,j,U,z)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}var wO={kernelName:qh,backendName:"cpu",kernelFunc:xO};function bO(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s,output:i}=t,o=s;be([s,i],"maxPoolGrad");let{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=r,d=E.computePool2DInfo(o.shape,l,c,1,u,h),p=n.data.get(o.dataId).values,m=We(d.outShape,o.dtype,t_(p,o.shape,o.dtype,d).values),f=d.strideHeight,A=d.strideWidth,y=d.dilationHeight,g=d.dilationWidth,x=d.effectiveFilterHeight,v=d.effectiveFilterWidth,w=v-1-d.padInfo.left,b=x-1-d.padInfo.top,k=We(o.shape,"float32"),N=n.data.get(a.dataId).values,C=We(a.shape,"float32",N);for(let F=0;F=d.outHeight||Math.floor(ee)!==ee))for(let Y=0;Y=d.outWidth||Math.floor(ae)!==ae)continue;let te=x*v-1-m.get(F,ee,ae,O),ie=G*v+Y,Q=te===ie?1:0;Q!==0&&(X+=C.get(F,ee,ae,O)*Q)}}k.set(X,F,z,V,O)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}var _O={kernelName:Gh,backendName:"cpu",kernelFunc:bO};function vO(e,t,n,r,a){let s=_.computeStrides(t),i=Km(e,t,n,s,a,"max"),o=t_(e,t,n,a,!0,r);return[i.values,o.values]}var kO={kernelName:Xh,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{filterSize:a,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;be(r,"MaxPoolWithArgmax");let c=l.data.get(r.dataId).values,u=E.computePool2DInfo(r.shape,a,s,[1,1],i),[h,d]=vO(c,r.shape,r.dtype,o,u),p=l.write(h,u.outShape,r.dtype),m=l.write(d,u.outShape,r.dtype);return[{dataId:p,shape:u.outShape,dtype:r.dtype},{dataId:m,shape:u.outShape,dtype:"int32"}]}};function IO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=_.parseAxisParam(s,a.shape),l=E.computeOutAndReduceShapes(a.shape,o)[1],c=_.sizeFromShape(l),u=[],h=n.makeTensorInfo([],"float32",new Float32Array([c]));u.push(h);let d=La({inputs:{x:a},backend:n,attrs:{dtype:"float32"}});u.push(d);let p=Zm({inputs:{a:d,b:h},backend:n});u.push(p);let m=sc({inputs:{x:p},backend:n,attrs:{axis:s,keepDims:i}});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var SO={kernelName:Es,backendName:"cpu",kernelFunc:IO};function NO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r;be(a,"min");let o=_.parseAxisParam(s,a.shape),l=o,c=E.getAxesPermutation(l,a.shape.length),u=a;c!=null&&(u=Zn({inputs:{x:a},backend:n,attrs:{perm:c}}),l=E.getInnerMostAxes(l.length,a.shape.length)),E.assertAxesAreInnerMostDims("min",l,u.shape.length);let[h,d]=E.computeOutAndReduceShapes(u.shape,l),p=_.sizeFromShape(d),m=_.makeZerosTypedArray(_.sizeFromShape(h),u.dtype),f=n.data.get(u.dataId).values;for(let y=0;yg[0]+a.shape[x]+g[1]),l=s.map(g=>g[0]),c=s.map((g,x)=>g[0]+a.shape[x]),u=i==="reflect"?0:1,h=n.data.get(a.dataId).values,d=a.shape.length,p=_.computeStrides(a.shape),m=_.sizeFromShape(o),f=o.length,A=_.computeStrides(o),y=_.getTypedArrayFromDType(a.dtype,m);for(let g=0;g=c[w]&&(x[w]=(c[w]-1)*2-x[w]+u);x=x.map((w,b)=>w-l[b]);let v=_.locToIndex(x,d,p);y[g]=h[v]}return{dataId:n.write(y,o,a.dtype),shape:o,dtype:a.dtype}}var CO={kernelName:Ms,backendName:"cpu",kernelFunc:EO},RO=Ct((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),MO=jt(Ro,RO),FO={kernelName:Ro,backendName:"cpu",kernelFunc:MO},$O=Yi(Og());function l_(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{dim:s}=r,i=a.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let l=_.parseAxisParam([o],a.shape),c=o_({inputs:{x:a},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=E.expandShapeToKeepDim(c.shape,l),h=pt({inputs:{x:c},backend:n,attrs:{shape:u}}),d=qm({inputs:{a,b:h},backend:n}),p=Gb({inputs:{x:d},backend:n}),m=sc({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),f=pt({inputs:{x:m},backend:n,attrs:{shape:u}}),A=Zm({inputs:{a:p,b:f},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var DO={kernelName:Xs,backendName:"cpu",kernelFunc:l_};function OO(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{numSamples:s,seed:i,normalized:o}=r;be(a,"multinomial");let l=o?a:l_({inputs:{logits:a},backend:n,attrs:{dim:-1}}),c=l.shape[0],u=l.shape[1],h=n.data.get(l.dataId).values,d=[c,s],p=_.makeZerosTypedArray(_.sizeFromShape(d),"int32");for(let m=0;m=0&&u[h]{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=ap({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=Il({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),c}var YO={kernelName:Po,backendName:"cpu",kernelFunc:c_};function JO(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{paddings:s,constantValue:i}=r;be(a,"pad");let o=s.map((y,g)=>y[0]+a.shape[g]+y[1]),l=s.map(y=>y[0]),c=n.data.get(a.dataId).values,u=_.sizeFromShape(a.shape),h=a.shape.length,d=_.computeStrides(a.shape),p=_.sizeFromShape(o),m=o.length,f=_.computeStrides(o),A=_.getTypedArrayFromDType(a.dtype,p);i!==0&&A.fill(i);for(let y=0;yv+l[w]),x=_.locToIndex(g,m,f);A[x]=c[y]}return{dataId:n.write(A,o,a.dtype),shape:o,dtype:a.dtype}}var h_={kernelName:Ds,backendName:"cpu",kernelFunc:JO},QO=Ct((e,t)=>Math.pow(e,t)),ez=jt(Os,QO),tz={kernelName:Os,backendName:"cpu",kernelFunc:ez};function nz(e){let{backend:t,attrs:n}=e,{start:r,stop:a,dtype:s,step:i}=n,o=Hm(r,a,i,s);return t.makeTensorInfo([o.length],s,o)}var rz={kernelName:ku,backendName:"cpu",kernelFunc:nz},az=nt(Wo,e=>1/e),sz={kernelName:Wo,backendName:"cpu",kernelFunc:az};function iz(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r;be(a,"resizeBilinear");let l=_.computeStrides(a.shape),[c,u]=o,[h,d,p,m]=a.shape,f=n.data.get(a.dataId).values,A=new Float32Array(_.sizeFromShape([h,c,u,m])),y=[s&&c>1?d-1:d,s&&u>1?p-1:p],g=[s&&c>1?c-1:c,s&&u>1?u-1:u],x=0,v=y[0]/g[0],w=y[1]/g[1];for(let b=0;b1?c-1:c,i&&p>1?u-1:u],A=[i&&d>1?d-1:d,i&&p>1?p-1:p],y=f[0]/A[0],g=f[1]/A[1],x=n.data.get(s.dataId).values,v=0;for(let w=0;w1?d-1:d,s&&u>1?p-1:p],g=[s&&c>1?c-1:c,s&&u>1?u-1:u],x=y[0]/g[0],v=y[1]/g[1],w=0;for(let b=0;b1?u-1:u,i&&m>1?h-1:h],g=[i&&p>1?p-1:p,i&&m>1?m-1:m],x=y[0]/g[0],v=y[1]/g[1],w=1/x,b=1/v,k=Math.ceil(w)*2+2,N=Math.ceil(b)*2+2;for(let C=0;C=p)continue;let Q=F+ie*l[1],ce=ie*x,oe=Math.min(u-1,i?Math.round(ce):Math.floor(ce));if(O===oe)for(let me=0;me=m)continue;let ve=Q+de*l[2],Ie=de*v,Fe=Math.min(h-1,i?Math.round(Ie):Math.floor(Ie));U===Fe&&(ae+=A[ve+Y])}}f[X+Y]=ae}}}}return n.makeTensorInfo(a.shape,a.dtype,f)}var pz={kernelName:Yh,backendName:"cpu",kernelFunc:dz};function fz(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r;be(a,"reverse");let i=a.shape.length,o=_.parseAxisParam(s,a.shape);if(i===0)return Br({inputs:{x:a},backend:n});let l=new $t(a.shape,a.dtype),c=n.bufferSync(a);for(let u=0;ud[p]=a.shape[p]-1-d[p]),l.set(c.get(...d),...h)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}var mz={kernelName:Bs,backendName:"cpu",kernelFunc:fz},Az={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:r}=e,{radians:a,fillValue:s,center:i}=t,o=n,l=_.getTypedArrayFromDType(r.dtype,_.sizeFromShape(r.shape)),[c,u,h,d]=r.shape,[p,m]=E.getImageCenter(i,u,h),f=255,A=Math.sin(a),y=Math.cos(a),g=o.data.get(r.dataId).values;for(let x=0;x=0&&V=0&&j{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),gz={kernelName:Vs,backendName:"cpu",kernelFunc:yz};function d_(e,t,n,r,a,s,i,o,l,c){let u=[r/a,a],h=e.values,d=t.values;if(r===0)return We(n,t.dtype);let p=We(u,t.dtype);p.values.fill(l);for(let m=0;m=r/a)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||a.shape.length===1?1:_.sizeFromShape(a.shape.slice(1));for(let m=0;me>=0?kz*e:vz*(Math.exp(e)-1)),Sz={kernelName:Uo,backendName:"cpu",kernelFunc:Iz},Nz=nt(qo,e=>e<0?-1:e>0?1:0),Tz={kernelName:qo,backendName:"cpu",kernelFunc:Nz},Ez=nt(Us,e=>Math.sin(e)),Cz={kernelName:Us,backendName:"cpu",kernelFunc:Ez},Rz=nt(Go,e=>Math.sinh(e)),Mz={kernelName:Go,backendName:"cpu",kernelFunc:Rz},Fz=11920928955078125e-23,p_=Math.log(Fz)+2,$z=nt(Xo,e=>{let t=e>-p_,n=e{let d=[...u];d[o]=h;let p=wi({inputs:{x:a},backend:n,attrs:{begin:c,size:d}});return c[o]+=h,p})}var jz={kernelName:Ko,backendName:"cpu",kernelFunc:Vz},Uz=nt(Gs,e=>Math.sqrt(e)),Hz={kernelName:Gs,backendName:"cpu",kernelFunc:Uz},Gz={kernelName:Nu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,r=t;be(n,"square");let a=r.data.get(n.dataId).values,s=new Float32Array(a.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),Xz={kernelName:Ta,backendName:"cpu",kernelFunc:qz};function Kz(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r;be(a,"stridedSlice");let{nonStrided:p,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(a.shape,s,i,o,l,c,u,h,d),x=pt({inputs:{x:a},backend:n,attrs:{shape:y}}),v;if(p){let b=wi({inputs:{x},backend:n,attrs:{begin:m,size:A}});v=pt({inputs:{x:b},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(b)}else if(g.some(b=>b===0))v=n.makeTensorInfo(g,a.dtype,[]);else{let b=n.bufferSync(x),k=Bb(g,b,f,m);v=n.makeTensorInfo(k.shape,k.dtype,k.values)}let w=pt({inputs:{x:v},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),w}var Zz={kernelName:Zo,backendName:"cpu",kernelFunc:Kz},Yz=nt(Ys,e=>Math.tan(e)),Jz={kernelName:Ys,backendName:"cpu",kernelFunc:Yz},Qz=nt(Js,e=>Math.tanh(e)),eP={kernelName:Js,backendName:"cpu",kernelFunc:Qz};function tP(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{reps:s}=r;be(a,"tile");let i=jb(n.bufferSync(a),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var nP={kernelName:Na,backendName:"cpu",kernelFunc:tP};function rP(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{k:s,sorted:i}=r;be(a,"topk");let o=n.data.get(a.dataId).values,[l,c]=Ub(o,a.shape,a.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}var aP={kernelName:Yo,backendName:"cpu",kernelFunc:rP};function oP(e){let{inputs:t,attrs:n,backend:r}=e,{image:a,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:c}=n,[u,h,d,p]=a.shape,[m,f]=c!=null?c:[h,d],A=[u,m,f,p],y=_.computeStrides(a.shape),g=y[0],x=y[1],v=y[2],w=_.getTypedArrayFromDType(a.dtype,_.sizeFromShape(A));w.fill(l);let b=r.data.get(a.dataId).values,k=r.data.get(s.dataId).values;for(let N=0;Nt-1)if(t<=1)n=0;else{let r=2*t;n-=r*Math.trunc(n/r),n>=t&&(n=r-n-1)}return _.clamp(0,n,t-1)}function cP(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let r=t-1;n+=t*(Math.trunc(-n/r)+1)}else if(n>t-1)if(t<=1)n=0;else{let r=t-1;n-=t*Math.trunc(n/r)}return _.clamp(0,n,t-1)}function hP(e,t){return e}function dP(e,t){return _.clamp(0,e,t-1)}function ic(e,t,n,r,a,s,i,o,l,c,u){let h=i*r+o*a+l*s+c;return 0<=o&&on.disposeIntermediateTensorInfo(m)),p}var gP={kernelName:Tu,backendName:"cpu",kernelFunc:yP},xP=[CF,$M,MF,$F,WM,OF,PF,WF,VF,UF,GF,XF,ZF,QF,t$,a$,i$,l$,c$,TF,d$,f$,A$,PM,VM,g$,DM,w$,_$,I$,N$,v$,R$,F$,E$,D$,z$,L$,B$,j$,H$,G$,X$,Z$,J$,Q$,tD,eD,Ym,aD,wF,iD,lD,AD,jM,yD,HM,vD,ID,SD,qM,ED,RD,FD,DD,zD,KM,WD,OM,VD,b$,UD,GD,XD,bF,YM,YD,QD,QM,tO,aO,iO,uO,hO,pO,tF,AO,gO,wO,_O,kO,fO,SO,TO,rF,CO,FO,zO,sF,oF,WO,jO,GO,uF,XO,ZO,YO,h_,tz,vF,dF,rz,zM,sz,kF,IF,NF,oz,uz,hz,pz,mz,Az,gz,fF,wz,_z,Sz,SF,Tz,Cz,Mz,mF,DO,Dz,zz,Lz,Bz,jz,Hz,Gz,yF,Xz,Zz,xF,nD,Jz,eP,nP,aP,cF,lP,fP,AP,gP,KO];for(let e of xP)ri(e);var m_={};Me(m_,{assertNotComplex:()=>Sl,bindCanvasToFramebuffer:()=>_P,bindColorTextureToFramebuffer:()=>op,bindTextureToProgramUniformSampler:()=>C_,bindTextureUnit:()=>N_,bindVertexBufferToProgramAttribute:()=>eA,callAndCheck:()=>xe,canBeRepresented:()=>A_,createFragmentShader:()=>x_,createFramebuffer:()=>S_,createProgram:()=>w_,createStaticIndexBuffer:()=>v_,createStaticVertexBuffer:()=>__,createTexture:()=>k_,createVertexShader:()=>g_,getBatchDim:()=>bi,getExtensionOrThrow:()=>oc,getFramebufferErrorMessage:()=>R_,getMaxTexturesInShader:()=>$_,getNumChannels:()=>wP,getProgramUniformLocation:()=>E_,getProgramUniformLocationOrThrow:()=>T_,getRowsCols:()=>_i,getShapeAs3D:()=>lp,getTextureShapeFromLogicalShape:()=>M_,getWebGLDisjointQueryTimerVersion:()=>D_,getWebGLErrorMessage:()=>y_,getWebGLMaxTextureSize:()=>F_,hasExtension:()=>Yn,isCapableOfRenderingToFloatTexture:()=>O_,isDownloadFloatTextureEnabled:()=>z_,isReshapeFree:()=>uc,isWebGLFenceEnabled:()=>P_,isWebGLVersionEnabled:()=>nA,linkProgram:()=>b_,resetMaxTextureSize:()=>vP,resetMaxTexturesInShader:()=>kP,unbindColorTextureFromFramebuffer:()=>tA,unbindTextureUnit:()=>bP,validateFramebuffer:()=>lc,validateProgram:()=>ip,validateTextureSize:()=>I_});var vi={},rA={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function up(e,t){vi[e]=t}function Vr(e){if(!(e in vi)){let n=IP(e);if(n!==null)vi[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=vi[e];return t.isContextLost()?(delete vi[e],Vr(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),vi[e])}function SP(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function IP(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=SP(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete vi[e]},!1),e===1?t.getContext("webgl",rA)||t.getContext("experimental-webgl",rA):t.getContext("webgl2",rA)}var cc;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(cc||(cc={}));var Jn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(Jn||(Jn={}));var Qt;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Qt||(Qt={}));function hc(e,t){return[t,e]}function NP(e,t){return e*t}function dc(e){let t=_.sizeFromShape(e),n=Math.ceil(t/4);return _.sizeToSquarishShape(n)}function Nl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function TP(e,t){let[n,r]=Nl(e,t);return n*r*4}function aA(e,t){let n=e,r,a,s,i,o,l,c,u,h,d;return J().getNumber("WEBGL_VERSION")===2?(r=n.R32F,a=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,c=4,u=1,h=n.HALF_FLOAT,d=n.FLOAT):(r=e.RGBA,a=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,c=4,u=4,h=t!=null?t.HALF_FLOAT_OES:null,d=e.FLOAT),l=e.RGBA,{internalFormatFloat:r,internalFormatHalfFloat:a,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:h,textureTypeFloat:d}}function xe(e,t){let n=t();return J().getBool("DEBUG")&&EP(e),n}function EP(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+y_(e,t))}var CP=596e-10,RP=65504;function A_(e){return!!(J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||CPe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function g_(e,t){let n=ca(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function x_(e,t){let n=ca(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw MP(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var FP=/ERROR: [0-9]+:([0-9]+):/g;function MP(e,t){let n=FP.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let r=+n[1],a=e.split(` -`),s=a.length.toString().length+2,i=a.map((h,d)=>_.rightPad((d+1).toString(),s)+h),o=0;for(let h=0;h0&&w.isString(n[0])){let r=n.map(s=>w.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return{dataId:a,shape:e,dtype:t}}refCount(e){return this.data.has(e)?this.data.get(e).refCount:0}incRef(e){let t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){let t=this.data.get(e);t.refCount--}}move(e,t,n,a,r){this.data.set(e,{values:t,dtype:a,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:n}=this.data.get(e);if(t==="complex64"){let a=this.readSync(n.real.dataId),r=this.readSync(n.imag.dataId);return C.mergeRealAndImagArrays(a,r)}return this.data.get(e).values}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>w.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}makeOutput(e,t,n){let a=this.write(e,t,n);return nr().makeTensorFromDataId(a,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(e);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=w.now();return e(),{kernelMs:w.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){ve([e],"where");let t=this.readSync(e.dataId);return _F(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};eh.nextDataId=0;var WA={};Fe(WA,{addImpl:()=>w3,bincountImpl:()=>BA,bincountReduceImpl:()=>k3,ceilImpl:()=>I3,concatImpl:()=>VA,expImpl:()=>S3,expm1Impl:()=>N3,floorImpl:()=>T3,gatherV2Impl:()=>E3,greaterImpl:()=>C3,lessImpl:()=>R3,linSpaceImpl:()=>M3,logImpl:()=>F3,maxImpl:()=>$3,maximumImpl:()=>D3,minimumImpl:()=>O3,multiplyImpl:()=>jA,negImpl:()=>z3,notEqualImpl:()=>_3,prodImpl:()=>P3,rangeImpl:()=>HA,rsqrtImpl:()=>L3,simpleAbsImpl:()=>v3,sliceImpl:()=>th,sparseReshapeImpl:()=>W3,squaredDifferenceImpl:()=>B3,stridedSliceImpl:()=>V3,subImpl:()=>j3,tileImpl:()=>U3,topKImpl:()=>H3,transposeImpl:()=>UA,uniqueImpl:()=>G3});function v3(e){let t=new Float32Array(e.length);for(let n=0;n{let{x:t}=e.inputs,n=e.backend;ve(t,"abs");let a=new Float32Array(w.sizeFromShape(t.shape)),r=n.data.get(t.dataId).values;return a=v3(r),n.makeOutput(a,t.shape,"float32")},LF={kernelName:eo,backendName:"cpu",kernelFunc:PF};function Rt(e){return(t,n,a,r,s)=>{let i=C.assertAndGetBroadcastShape(t,n),o=i.length,l=w.computeStrides(i),d=w.sizeFromShape(i),u=w.getTypedArrayFromDType(s,d),p=t.length,c=n.length,h=w.computeStrides(t),m=w.computeStrides(n),f=C.getBroadcastDims(t,i),A=C.getBroadcastDims(n,i);if(f.length+A.length===0)for(let y=0;yx[I]=0);let k=w.locToIndex(x,p,h),b=g.slice(-c);A.forEach(I=>b[I]=0);let v=w.locToIndex(b,c,m);u[y]=e(a[k],r[v])}return[u,i]}}function _n(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(a.shape,"complex64"),l=n.data.get(o.dataId);return l.complexTensorInfos={real:n.makeTensorInfo(a.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",i)},o}var WF={kernelName:Cp,backendName:"cpu",kernelFunc:_n};function nh(e,t,n="float32"){if(n==="complex64"){let r=nh(e,t,"float32"),s=nh(e,t,"float32");return _n({inputs:{real:r,imag:s},backend:e})}let a=w.makeZerosTypedArray(w.sizeFromShape(t),n);return e.makeTensorInfo(t,n,a)}function Ba(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var BF={kernelName:ks,backendName:"cpu",kernelFunc:Ba};function xi(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.data.get(a.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}var VF={kernelName:Zp,backendName:"cpu",kernelFunc:xi};function _r(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Ba({inputs:{x:r},backend:n});let i=nh(n,r.shape,r.dtype),o=_r({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=_n({inputs:{real:o,imag:i},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=xi({inputs:{input:r},backend:n}),o=_r({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!w.hasEncodingLoss(r.dtype,s)){let i=Ba({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32"){let i=n.data.get(r.dataId).values,o=Int32Array.from(i);return n.makeTensorInfo(r.shape,"int32",o)}if(s==="bool"){let i=n.data.get(r.dataId).values,o=w.toTypedArray([0],r.dtype),[l,d]=Rt((u,p)=>u!==p?1:0)(r.shape,[],i,o,"bool");return n.makeTensorInfo(d,"bool",l)}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var jF={kernelName:ds,backendName:"cpu",kernelFunc:_r};function Ut(e,t,n,a){return n==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;ve([i,o],e);let d=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,d,u,p);return l.makeTensorInfo(h,p,c)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let d=_r({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),u=l.data.get(d.dataId),p=u.complexTensorInfos.real,c=u.complexTensorInfos.imag,h=l.data.get(p.dataId).values,m=l.data.get(c.dataId).values,f=_r({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),A=l.data.get(f.dataId),y=A.complexTensorInfos.real,g=A.complexTensorInfos.imag,x=l.data.get(y.dataId).values,k=l.data.get(g.dataId).values,[b,v,I]=n(i.shape,o.shape,h,m,x,k),T=l.makeTensorInfo(I,"float32",b),R=l.makeTensorInfo(I,"float32",v),$=_n({inputs:{real:T,imag:R},backend:l});return l.disposeIntermediateTensorInfo(d),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(T),l.disposeIntermediateTensorInfo(R),$}else{let d=l.data.get(i.dataId).values,u=l.data.get(o.dataId).values,p=a||i.dtype,[c,h]=t(i.shape,o.shape,d,u,p);return l.makeTensorInfo(h,p,c)}}}function GA(e){return(t,n,a,r,s,i)=>{let o=C.assertAndGetBroadcastShape(t,n),l=w.sizeFromShape(o),d=o.length,u=w.computeStrides(o),p=w.getTypedArrayFromDType("float32",l),c=w.getTypedArrayFromDType("float32",l),h=C.getBroadcastDims(t,o),m=C.getBroadcastDims(n,o),f=C.mergeRealAndImagArrays(a,r),A=C.mergeRealAndImagArrays(s,i),y=t.length,g=w.computeStrides(t),x=n.length,k=w.computeStrides(n);if(h.length+m.length===0)for(let b=0;bI[_]=0);let T=w.locToIndex(I,y,g),R=v.slice(-x);m.forEach(_=>R[_]=0);let $=w.locToIndex(R,x,k),z=e(f[T*2],f[T*2+1],A[$*2],A[$*2+1]);p[b]=z.real,c[b]=z.imag}return[p,c,o]}}var w3=Rt((e,t)=>e+t),UF=GA((e,t,n,a)=>({real:e+n,imag:t+a})),rd=Ut(kr,w3,UF),HF={kernelName:kr,backendName:"cpu",kernelFunc:rd};function BA(e,t,n,a,r){let s=w.sizeFromShape(a),i=w.makeZerosTypedArray(r,n);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function k3(e,t,n,a=!1){let r=e.shape[0],s=e.shape[1],i=We([r,n],t.dtype);for(let o=0;o=n||(a?i.set(1,o,d):t.size>0?i.set(i.get(o,d)+t.get(o,l),o,d):i.set(i.get(o,d)+1,o,d))}return i}function wl(e){return(t,n,a)=>{let r=w.getTypedArrayFromDType(n,t.length);for(let s=0;s{let{x:i}=a;if(ve(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,d=w.sizeFromShape(i.shape),u=n||i.dtype,p=w.getArrayFromDType(u,d);for(let c=0;c{let{x:i}=a;if(ve(i,e),i.dtype==="string"||n==="string")throw new Error("unaryKernelFunc does not support string input/output");let o=s,l=o.data.get(i.dataId).values,d=n||i.dtype,u=t(l,d,r);return o.makeTensorInfo(i.shape,d,u)}}var I3=wl(e=>Math.ceil(e)),GF=kl(ps,I3),qF={kernelName:ps,backendName:"cpu",kernelFunc:GF};function VA(e,t,n,a){let r=w.getArrayFromDType(n,w.sizeFromShape(t));if(a&&n!=="string"){let s=0;e.forEach(i=>{let o=w.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=n==="string"?C.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let d=0;dMath.exp(e)),q3=kl(gs,S3),XF={kernelName:gs,backendName:"cpu",kernelFunc:q3},N3=wl(e=>Math.expm1(e)),KF=kl(xo,N3),ZF={kernelName:xo,backendName:"cpu",kernelFunc:KF},T3=wl(e=>Math.floor(e)),YF=kl(xs,T3),JF={kernelName:xs,backendName:"cpu",kernelFunc:YF};function E3(e,t,n){let a=We(n,e.dtype);for(let r=0;re>t?1:0),QF=Ut(ko,C3,null,"bool"),e$={kernelName:ko,backendName:"cpu",kernelFunc:QF},R3=Rt((e,t)=>eMath.log(e)),a$=kl(Ss,F3),r$={kernelName:Ss,backendName:"cpu",kernelFunc:a$};function $3(e,t,n,a){let r=w.getTypedArrayFromDType(a,w.sizeFromShape(n));for(let s=0;so&&(o=d)}r[s]=o}return r}var D3=Rt((e,t)=>Math.max(e,t)),s$=Ut(Ts,D3),i$={kernelName:Ts,backendName:"cpu",kernelFunc:s$},O3=Rt((e,t)=>Math.min(e,t)),o$=Ut(Ms,O3),l$={kernelName:Ms,backendName:"cpu",kernelFunc:o$},jA=Rt((e,t)=>e*t),u$=GA((e,t,n,a)=>({real:e*n-t*a,imag:e*a+t*n})),ah=Ut($s,jA,u$),d$={kernelName:$s,backendName:"cpu",kernelFunc:ah};function z3(e,t,n){let a=w.createScalarValue(-1,n);return jA([],t,a,e,n)}function p$(e){let{inputs:t,backend:n}=e,{x:a}=t;ve(a,"neg");let r=n.data.get(a.dataId).values,[s,i]=z3(r,a.shape,a.dtype);return n.makeTensorInfo(i,a.dtype,s)}var c$={kernelName:Fo,backendName:"cpu",kernelFunc:p$},_3=Rt((e,t)=>e!==t?1:0),h$=Ut($o,_3,null,"bool"),f$={kernelName:$o,backendName:"cpu",kernelFunc:h$};function UA(e,t,n,a,r){let s=t.length,i=w.sizeFromShape(t),o=w.computeStrides(t),l=w.computeStrides(r),d=w.getTypedArrayFromDType(n,w.sizeFromShape(r));for(let u=0;un.disposeIntermediateTensorInfo(g)),n.makeTensorInfo(y,A,m)}var y$={kernelName:Lo,backendName:"cpu",kernelFunc:A$};function HA(e,t,n,a){let r=e===t,s=e1;if(r||s||i)return w.makeZerosTypedArray(0,a);let o=Math.abs(Math.ceil((t-e)/n)),l=w.makeZerosTypedArray(o,a);t1/Math.sqrt(e)),g$=kl(js,L3),x$={kernelName:js,backendName:"cpu",kernelFunc:g$};function th(e,t,n,a,r){let s=sn.isSliceContinous(a,t,n),i=w.sizeFromShape(n),o=w.computeStrides(a);if(s){let p=sn.computeFlatOffset(t,o);return r==="string"?e.slice(p,p+i):e.subarray(p,p+i)}let l=r==="string"?C.fromUint8ToStringArray(e):e,d=We(a,r,l),u=We(n,r);for(let p=0;pm+t[f]);u.set(d.get(...h),...c)}return r==="string"?C.fromStringArrayToUint8(u.values):u.values}function bi(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a;ve(r,"slice");let[o,l]=sn.parseSliceParams(r,s,i);sn.assertParamsValid(r,o,l);let d=n.data.get(r.dataId).values,u=th(d,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}var b$={kernelName:Ho,backendName:"cpu",kernelFunc:bi};function W3(e,t,n,a,r){let s=w.sizeFromShape(a),i=t[0],o=r.length,l=[],d=1,u=-1;for(let A=0;A0){h[c-1]=1;for(let A=c-2;A>=0;--A)h[A]=h[A+1]*a[A+1]}let m=[];if(o>0){m[o-1]=1;for(let A=o-2;A>=0;--A)m[A]=m[A+1]*l[A+1]}let f=w.getArrayFromDType(n,i*o);for(let A=0;A{let n=e-t;return n*n}),v$=Ut(Ks,B3),w$={kernelName:Ks,backendName:"cpu",kernelFunc:v$};function V3(e,t,n,a){let r=We(e,t.dtype);for(let s=0;se-t),k$=GA((e,t,n,a)=>({real:e-n,imag:t-a})),qA=Ut(Zs,j3,k$),I$={kernelName:Zs,backendName:"cpu",kernelFunc:qA};function U3(e,t){let n=new Array(e.rank);for(let r=0;rx.value-g.value);let f=p*a,A=l.subarray(f,f+a),y=d.subarray(f,f+a);for(let g=0;g{for(let A=0;Anew eh,1);var K3=nt(mo,e=>e>=0?e:Math.exp(e)-1),S$={kernelName:mo,backendName:"cpu",kernelFunc:K3};function Z3(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a;ve([r],"leakyRelu");let i=w.sizeFromShape(r.shape),o=n.data.get(r.dataId).values,l=w.getTypedArrayFromDType("float32",i);for(let d=0;de<0?t*e:e);function Y3(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t;ve([a,r],"prelu");let s=n.data.get(a.dataId).values,i=n.data.get(r.dataId).values,[o,l]=T$(a.shape,r.shape,s,i,a.dtype);return n.makeTensorInfo(l,a.dtype,o)}var E$={kernelName:_s,backendName:"cpu",kernelFunc:Y3},J3=nt(Ps,e=>Math.max(0,e)),C$={kernelName:Ps,backendName:"cpu",kernelFunc:J3},Q3=nt(Ws,e=>Math.min(Math.max(0,e),6)),R$={kernelName:Ws,backendName:"cpu",kernelFunc:Q3},e7=nt(Hs,e=>1/(1+Math.exp(-e))),M$={kernelName:Hs,backendName:"cpu",kernelFunc:e7};function XA(e,t,n,a,r){if(n==="linear")return Ba({inputs:{x:t},backend:e});if(n==="relu")return J3({inputs:{x:t},backend:e});if(n==="elu")return K3({inputs:{x:t},backend:e});if(n==="relu6")return Q3({inputs:{x:t},backend:e});if(n==="prelu")return Y3({inputs:{x:t,alpha:a},backend:e});if(n==="leakyrelu")return Z3({inputs:{x:t},backend:e,attrs:{alpha:r}});if(n==="sigmoid")return e7({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function ht(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=w.sizeFromShape(r.shape),o=w.inferFromImplicitShape(s,i),l=w.sizeFromShape(o);w.assert(i===l,()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`),n.incRef(r.dataId);let d=n.data.get(r.dataId);if(d.complexTensorInfos!=null){let u=d.complexTensorInfos.real,p=d.complexTensorInfos.imag;u.shape=o,p.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var F$={kernelName:Bo,backendName:"cpu",kernelFunc:ht};function t7(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;ve([r,s],"matMul");let l=r.shape.length,d=s.shape.length,u=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[d-1]:s.shape[d-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[d-2]:s.shape[d-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),A=w.sizeFromShape(m),y=w.sizeFromShape(f),g=A===y||A===1||y===1;w.assert(l>=2&&d>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);w.assert(u===p,()=>`Error in matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let k=i?[A,u,c]:[A,c,u],b=o?[y,h,p]:[y,p,h],v=ht({inputs:{x:r},backend:n,attrs:{shape:k}}),I=ht({inputs:{x:s},backend:n,attrs:{shape:b}}),T=i?v.shape[1]:v.shape[2],R=i?v.shape[2]:v.shape[1],$=o?I.shape[1]:I.shape[2],z=Math.max(A,y),_=n.data.get(v.dataId).values,V=n.data.get(I.dataId).values,j=w.computeStrides(v.shape),U=w.computeStrides(I.shape),[X,G,ee]=i?[j[0],1,j[1]]:[j[0],j[1],1],[Y,re,te]=o?[1,U[1],U[0]]:[U[1],1,U[0]],ie=R*$,Q=We([z,R,$],v.dtype),de=Q.values,oe=n.blockSize;for(let me=0;meMath.acos(e)),_$={kernelName:to,backendName:"cpu",kernelFunc:z$},P$=nt(no,e=>Math.acosh(e)),L$={kernelName:no,backendName:"cpu",kernelFunc:P$};function W$(e){let{inputs:t,backend:n}=e,a=t;ve(t,"addN");let r=a.map(o=>n.data.get(o.dataId).values),s=We(a[0].shape,a[0].dtype),i=s.values;for(let o=0;og&&(g=b,x=k)}h[A]=x}return d.forEach(A=>n.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",h)}var q$={kernelName:os,backendName:"cpu",kernelFunc:G$};function X$(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a;ve(r,"argMin");let i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=Zn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],C.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[u,p]=C.computeOutAndReduceShapes(l.shape,i),c=w.sizeFromShape(u),h=w.makeZerosTypedArray(c,"int32"),m=w.sizeFromShape(p),f=n.data.get(l.dataId).values;for(let A=0;An.disposeIntermediateTensorInfo(A)),n.makeTensorInfo(u,"int32",h)}var K$={kernelName:hu,backendName:"cpu",kernelFunc:X$},Z$=nt(so,e=>Math.asin(e)),Y$={kernelName:so,backendName:"cpu",kernelFunc:Z$},J$=nt(io,e=>Math.asinh(e)),Q$={kernelName:io,backendName:"cpu",kernelFunc:J$},eD=nt(oo,e=>Math.atan(e)),tD={kernelName:oo,backendName:"cpu",kernelFunc:eD},nD=Rt((e,t)=>Math.atan2(e,t)),aD=Ut(uo,nD),rD={kernelName:uo,backendName:"cpu",kernelFunc:aD},sD=nt(lo,e=>Math.atanh(e)),iD={kernelName:lo,backendName:"cpu",kernelFunc:sD};function KA(e,t,n,a,r,s){let i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,d=r.dilationWidth,u=r.effectiveFilterHeight,p=r.effectiveFilterWidth,c=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=We(r.outShape,n),A=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],g=r.outShape[2]*r.outShape[3],x=r.outShape[3];for(let k=0;kG?G=oe:s==="avg"&&(ee+=oe,Y++)}if(isNaN(G))break}let re=_+V*x+I;A[re]=s==="avg"?ee/Y:G}}}return f}function n7(e,t,n,a,r=!1,s=!1){let i=We(a.outShape,"int32"),o=a.strideHeight,l=a.strideWidth,d=a.dilationHeight,u=a.dilationWidth,p=a.effectiveFilterHeight,c=a.effectiveFilterWidth,h=a.padInfo.top,m=a.padInfo.left,f=We(t,n,e);for(let A=0;A$&&($=X,r?z=s?((A*a.inHeight+_)*a.inWidth+j)*a.inChannels+y:(_*a.inWidth+j)*a.inChannels+y:z=V*c+U)}}i.set(z,A,g,v,y)}}return i}function a7(e,t,n,a,r,s){let i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,d=r.dilationDepth,u=r.dilationHeight,p=r.dilationWidth,c=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,A=r.padInfo.top,y=r.padInfo.left,g=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=We(r.outShape,n),k=x.values,b=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],v=r.outShape[2]*r.outShape[3]*r.outShape[4],I=r.outShape[3]*r.outShape[4],T=r.outShape[4];for(let R=0;Rke?ke=Ve:s==="avg"&&(Se+=Ve,$e++),isNaN(ke))break}if(isNaN(ke))break}if(isNaN(ke))break}let ze=ce+_;k[ze]=s==="avg"?Se/$e:ke}}}}return x}function oD(e,t){let n=We(t.outShape,"int32"),a=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,d=t.effectiveFilterDepth,u=t.effectiveFilterHeight,p=t.effectiveFilterWidth,c=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=V&&(V=te,j=X*u*p+ee*u+re)}}}n.set(j,f,y,b,R,A)}}}return n}function lD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;ve(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l),p;if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))p=Ba({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=w.computeStrides(r.shape),m=KA(c,r.shape,r.dtype,h,u,"avg");p=n.makeTensorInfo(u.outShape,r.dtype,m.values)}return p}var uD={kernelName:ls,backendName:"cpu",kernelFunc:lD};function dD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a;ve(r,"avgPool3d");let u=C.computePool3DInfo(r.shape,s,i,1,o,l,d),p=n.data.get(r.dataId).values,c=a7(p,r.shape,r.dtype,w.computeStrides(r.shape),u,"avg");return n.makeTensorInfo(c.shape,"float32",c.values)}var pD={kernelName:fu,backendName:"cpu",kernelFunc:dD};function cD(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=a;ve([r,s],"avgPool3DGrad");let u=C.computePool3DInfo(s.shape,i,o,1,l,d),p=u.strideDepth,c=u.strideHeight,h=u.strideWidth,m=u.filterDepth,f=u.filterHeight,A=u.filterWidth,y=u.dilationDepth,g=u.dilationHeight,x=u.dilationWidth,k=u.effectiveFilterDepth,b=u.effectiveFilterHeight,v=u.effectiveFilterWidth,I=k-1-u.padInfo.front,T=v-1-u.padInfo.left,R=b-1-u.padInfo.top,$=We(s.shape,"float32"),z=1/(m*f*A),_=n.bufferSync(r);for(let V=0;V=u.outDepth||Math.floor(Q)!==Q))for(let de=0;de=u.outHeight||Math.floor(oe)!==oe))for(let me=0;me=u.outWidth||Math.floor(ce)!==ce||(te+=_.get(V,Q,oe,ce,j))}}}$.set(te*z,V,U,X,G,j)}return n.makeTensorInfo($.shape,$.dtype,$.values)}var hD={kernelName:Tp,backendName:"cpu",kernelFunc:cD};function fD(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;ve([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:d}=a,u=C.computePool2DInfo(i.shape,o,l,1,d),p=u.strideHeight,c=u.strideWidth,h=u.filterHeight,m=u.filterWidth,f=u.dilationHeight,A=u.dilationWidth,y=u.effectiveFilterHeight,g=u.effectiveFilterWidth,x=g-1-u.padInfo.left,k=y-1-u.padInfo.top,b=We(i.shape,"float32"),v=1/(h*m),I=n.data.get(r.dataId).values,T=We(r.shape,"float32",I);for(let R=0;R=u.outHeight||Math.floor(G)!==G))for(let ee=0;ee=u.outWidth||Math.floor(Y)!==Y||(U+=T.get(R,G,Y,$))}}b.set(U*v,R,z,_,$)}return n.makeTensorInfo(b.shape,b.dtype,b.values)}var mD={kernelName:Np,backendName:"cpu",kernelFunc:fD};function AD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,scale:s,offset:i,mean:o,variance:l}=t;w.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),w.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),w.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),ve([r,o,l,s,i],"batchNorm");let{varianceEpsilon:d}=a;d==null&&(d=.001);let u=n.data.get(r.dataId).values,p=n.data.get(o.dataId).values,c=n.data.get(l.dataId).values,h=s?n.data.get(s.dataId).values:new Float32Array([1]),m=i?n.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(u.length),A=m.length,y=h.length,g=c.length,x=p.length,k=0,b=0,v=0,I=0;for(let T=0;T=A&&(k=0),b>=x&&(b=0),v>=y&&(v=0),I>=g&&(I=0);return n.makeTensorInfo(r.shape,r.dtype,f)}var yD={kernelName:vs,backendName:"cpu",kernelFunc:AD};function gD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;ve([r],"batchToSpaceND");let o=s.reduce((y,g)=>y*g),l=C.getReshaped(r.shape,s,o),d=C.getPermuted(l.length,s.length),u=C.getReshapedPermuted(r.shape,s,o),p=C.getSliceBeginCoords(i,s.length),c=C.getSliceSize(u,i,s.length),h=ht({inputs:{x:r},backend:n,attrs:{shape:l}}),m=Zn({inputs:{x:h},backend:n,attrs:{perm:d}}),f=ht({inputs:{x:m},backend:n,attrs:{shape:u}}),A=bi({inputs:{x:f},backend:n,attrs:{begin:p,size:c}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var xD={kernelName:mu,backendName:"cpu",kernelFunc:gD};function bD(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,d=BA(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}var vD={kernelName:Ep,backendName:"cpu",kernelFunc:bD},wD=nt(Ir,(e,t)=>{let n=t;return e>n.clipValueMax?n.clipValueMax:e{let{x:t}=e.inputs,n=e.backend,a=new Float32Array(w.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(s.dataId).values,l=n.data.get(i.dataId).values;for(let d=0;df.shape),s);if(w.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(f=>w.sizeFromShape(f.shape)>0);if(o.length===1)return Ba({inputs:{x:o[0]},backend:n});let l=o.map(f=>f.shape);if(C.assertParamsConsistent(l,s),o[0].dtype==="complex64"){let f=o.map(k=>xi({inputs:{input:k},backend:n})),A=o.map(k=>Il({inputs:{input:k},backend:n})),y=Sl({inputs:f,backend:n,attrs:{axis:s}}),g=Sl({inputs:A,backend:n,attrs:{axis:s}}),x=_n({inputs:{real:y,imag:g},backend:n});return f.forEach(k=>n.disposeIntermediateTensorInfo(k)),A.forEach(k=>n.disposeIntermediateTensorInfo(k)),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(g),x}let d=o.map(f=>{let A=w.sizeFromShape(f.shape.slice(s));return ht({inputs:{x:f},backend:n,attrs:{shape:[-1,A]}})}),u=d.map(f=>({vals:n.data.get(f.dataId).values,shape:f.shape}));i=C.computeOutShape(d.map(f=>f.shape),1);let p=d[0].shape[0]===1,c=VA(u,i,t[0].dtype,p),h=C.computeOutShape(o.map(f=>f.shape),s),m=n.makeTensorInfo(h,t[0].dtype,c);return d.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var TD={kernelName:po,backendName:"cpu",kernelFunc:Sl};function r7(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:d,dimRoundingMode:u}=a;ve([r,s],"conv2d");let p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!1,p),h=c.filterHeight,m=c.filterWidth,f=c.dilationHeight,A=c.dilationWidth,y=c.padInfo.left,g=c.padInfo.top,x=c.dataFormat==="channelsLast",k=new Dt(c.outShape,r.dtype),b=w.computeStrides(r.shape),v=w.computeStrides(s.shape),I=b[0],T=x?b[1]:b[2],R=x?b[2]:1,$=x?1:b[1],z=k.strides[0],_=x?k.strides[1]:k.strides[2],V=x?k.strides[2]:1,j=x?1:k.strides[1],U=n.data.get(r.dataId).values,X=n.data.get(s.dataId).values,G=k.values;for(let ee=0;ee=c.inHeight)continue;let me=de*v[0],ce=Y+oe*T;for(let ke=0;ke=c.inWidth)continue;let Qe=me+ze*v[1],et=ce+De*R,rt=Qe;for(let Xe=0;Xe=d.inDepth)continue;let ee=X*R[0],Y=z+G*T[1];for(let re=0;re=d.inHeight)continue;let oe=ee+Q*R[1],me=Y+de*T[2];for(let ce=0;ce=d.inWidth)continue;let De=oe+$e*R[2],Qe=me+ze*d.inChannels,et=De;for(let rt=0;rtMath.cos(e)),WD={kernelName:fs,backendName:"cpu",kernelFunc:LD},BD=nt(co,e=>Math.cosh(e)),VD={kernelName:co,backendName:"cpu",kernelFunc:BD};function jD(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:d}=a,[u,p,c,h]=r.shape,m=s.shape[0],[f,A]=o,y=We([m,f,A,h],"float32"),g=n.data.get(s.dataId).values,x=n.data.get(i.dataId).values,k=n.data.get(r.dataId).values,b=w.computeStrides(r.shape),v=w.computeStrides(y.shape);for(let I=0;I=u)continue;let j=f>1?(z-R)*(p-1)/(f-1):0,U=A>1?(_-$)*(c-1)/(A-1):0;for(let X=0;X1?R*(p-1)+X*j:.5*(R+z)*(p-1);if(G<0||G>p-1){for(let ee=0;ee1?$*(c-1)+te*U:.5*($+_)*(c-1);if(ie<0||ie>c-1){for(let me=0;me1?$*(c-1)+ee*U:.5*($+_)*(c-1);if(Y<0||Y>c-1){for(let ie=0;iey+m-g-1:(y,g)=>y+g;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`),w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=r.shape[1],d=r.shape[2],u=r.shape[3],p=l*s,c=d*s,h=u/(s*s),m=n.data.get(r.dataId).values,f=new Float32Array(o*p*c*h),A=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let h=C.computeConv2DInfo(r.shape,s.shape,i,c,o,d,!0),{filterHeight:m,filterWidth:f,dilationHeight:A,dilationWidth:y,padInfo:g}=h,x=g.left,k=g.top,b=h.outChannels/h.inChannels,v=new Dt(h.outShape,r.dtype),I=n.data.get(r.dataId).values,T=n.data.get(s.dataId).values,R=v.values;for(let $=0;$=h.inHeight)continue;let ee=X*p[0],Y=z+G*u[1];for(let re=0;re=h.inWidth)continue;let oe=ee+Q*p[1],me=Y+de*h.inChannels,ce=te,ke=oe;for(let Se=0;Se{let{x:a,filter:r}=e,{strides:s,pad:i,dilations:o}=n,l=t,d=l.data.get(a.dataId).values,u=a.shape.length,p=l.data.get(r.dataId).values,c=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:A,outHeight:y,outWidth:g,padInfo:x,strideHeight:k,strideWidth:b,filterHeight:v,filterWidth:I,dilationHeight:T,dilationWidth:R,outShape:$}=C.computeDilation2DInfo(a.shape,r.shape,s,i,"NHWC",o),z=w.sizeFromShape($),_=$.length,V=w.getArrayFromDType(a.dtype,z);for(let j=0;j=0&&Q=0&&oere&&(re=ke)}}}let te=w.locToIndex([j,U,G,Y],_,w.computeStrides($));V[te]=re}}}return{dataId:l.write(w.toTypedArray(V,a.dtype),$,a.dtype),shape:$,dtype:a.dtype}}},sO={kernelName:Pp,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,d=t,u=w.toNestedArray(a.shape,d.data.get(a.dataId).values),p=w.toNestedArray(r.shape,d.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:k,filterHeight:b,filterWidth:v,dilationHeight:I,dilationWidth:T,outShape:R}=C.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);w.assert(s.rank===R.length,()=>`Error in ${Pp}, dy must have the same rank as output ${R.length}, but got ${s.rank}`);let $=w.toNestedArray(R,d.data.get(s.dataId).values),z=w.makeZerosNestedTypedArray(r.shape,r.dtype);for(let _=0;_=0&&ie=0&&deee&&(ee=oe,Y=te,re=Q)}}}z[Y][re][G]+=$[_][V][U][G]}}}return{dataId:d.write(w.toTypedArray(z,a.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},iO={kernelName:_p,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{let{x:a,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=n,d=t,u=w.toNestedArray(a.shape,d.data.get(a.dataId).values),p=w.toNestedArray(r.shape,d.data.get(r.dataId).values),{batchSize:c,inHeight:h,inWidth:m,inChannels:f,outHeight:A,outWidth:y,padInfo:g,strideHeight:x,strideWidth:k,filterHeight:b,filterWidth:v,dilationHeight:I,dilationWidth:T,outShape:R}=C.computeDilation2DInfo(a.shape,r.shape,i,o,"NHWC",l);w.assert(s.rank===R.length,()=>`Error in ${_p}, dy must have the same rank as output ${R.length}, but got ${s.rank}`);let $=w.toNestedArray(R,d.data.get(s.dataId).values),z=w.makeZerosNestedTypedArray(a.shape,a.dtype);for(let _=0;_=0&&ie=0&&deee&&(ee=oe,Y=ie,re=de)}}}z[_][Y][re][G]+=$[_][V][U][G]}}}return{dataId:d.write(w.toTypedArray(z,a.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}};function sd(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;ve(r,"sum");let o;r.dtype==="bool"?o=_r({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):o=Ba({inputs:{x:r},backend:n});let l=o.shape.length,d=w.parseAxisParam(s,o.shape),u=C.getAxesPermutation(d,l),p=d,c=o;u!=null&&(c=Zn({inputs:{x:o},backend:n,attrs:{perm:u}}),p=C.getInnerMostAxes(p.length,l)),C.assertAxesAreInnerMostDims("sum",p,c.shape.length);let[h,m]=C.computeOutAndReduceShapes(c.shape,p),f=C.upcastType(c.dtype,"int32"),A=nh(n,h,f),y=w.sizeFromShape(m),g=n.data.get(A.dataId).values,x=n.data.get(c.dataId).values;for(let k=0;k=0&&(c=sd({inputs:{x:c},backend:n,attrs:{axis:d[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var uO={kernelName:Lp,backendName:"cpu",kernelFunc:lO};function dO(e){let{inputs:t,backend:n}=e,{dy:a,y:r}=t;ve([a,r],"eluGrad");let s=new Float32Array(w.sizeFromShape(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values;for(let l=0;l=1?s[l]=o[l]:s[l]=o[l]*(d+1)}return n.makeTensorInfo(r.shape,"float32",s)}var pO={kernelName:Wp,backendName:"cpu",kernelFunc:dO},cO=Rt((e,t)=>e===t?1:0),i7=Ut(yo,cO,null,"bool"),hO={kernelName:yo,backendName:"cpu",kernelFunc:i7},fO=C.ERF_P,mO=C.ERF_A1,AO=C.ERF_A2,yO=C.ERF_A3,gO=C.ERF_A4,xO=C.ERF_A5,bO=nt(Ao,e=>{let t=Math.sign(e),n=Math.abs(e),a=1/(1+fO*n);return t*(1-((((xO*a+gO)*a+yO)*a+AO)*a+mO)*a*Math.exp(-n*n))}),vO={kernelName:Ao,backendName:"cpu",kernelFunc:bO};function rh(e){let{inputs:t,backend:n,attrs:a}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(w.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),ht({inputs:{x:r},backend:n,attrs:{shape:o}})}var wO={kernelName:go,backendName:"cpu",kernelFunc:rh},kO=Rt((e,t)=>e/t),ZA=Ut(ys,kO),YA={kernelName:ys,backendName:"cpu",kernelFunc:ZA};function o7(e,t,n){let a=e.shape,r=a[0],s=a[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,d=[r,s],u=w.sizeFromShape(d),p=w.getTypedArrayFromDType("float32",u),c=w.getTypedArrayFromDType("float32",u);for(let A=0;A{let{image:a}=e,r=n,s=w.getTypedArrayFromDType(a.dtype,w.sizeFromShape(a.shape)),[i,o,l,d]=a.shape,u=r.data.get(a.dataId).values;for(let p=0;p=0&&xMath.floor(e/t)),$O=Ut(bs,FO,null,"int32"),DO={kernelName:bs,backendName:"cpu",kernelFunc:$O};function OO(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=r7({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c}});if(i){let A=f;f=rd({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(h){let A=f;f=XA(n,f,h,o,m),n.disposeIntermediateTensorInfo(A)}return f}var zO={kernelName:ti,backendName:"cpu",kernelFunc:OO};function _O(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=s7({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c}});if(i){let A=f;f=rd({inputs:{a:f,b:i},backend:n}),n.disposeIntermediateTensorInfo(A)}if(h){let A=f;f=XA(n,f,h,o,m),n.disposeIntermediateTensorInfo(A)}return f}var PO={kernelName:ni,backendName:"cpu",kernelFunc:_O};function LO(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=w.sizeFromShape(a.shape),i=r.shape,o=i[i.length-1],[l,d,u,p]=C.prepareAndValidate(a,r);if(d===0)return n.makeTensorInfo(l,a.dtype,[]);let c=We([d,u],a.dtype),h=n.data.get(r.dataId).values,m=n.data.get(a.dataId).values;for(let f=0;f=s/u)throw new Error(`Invalid indices: ${A} does not index into ${a.shape}`);for(let g=0;ge>=t?1:0),UO=Ut(ws,jO,null,"bool"),HO={kernelName:ws,backendName:"cpu",kernelFunc:UO};function GO(e){let{inputs:t,backend:n}=e,{input:a}=t,r=w.sizeFromShape(a.shape),s=a.shape[a.shape.length-1],i=r/s,o=ht({inputs:{x:a},backend:n,attrs:{shape:[i,s]}}),l=o7(o,!0,n),d=ht({inputs:{x:l},backend:n,attrs:{shape:a.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),d}var qO={kernelName:Vp,backendName:"cpu",kernelFunc:GO},XO=nt(Io,e=>Number.isFinite(e)?1:0,"bool"),KO={kernelName:Io,backendName:"cpu",kernelFunc:XO},ZO=nt(So,e=>Math.abs(e)===Infinity?1:0,"bool"),YO={kernelName:So,backendName:"cpu",kernelFunc:ZO},JO=nt(No,e=>Number.isNaN(e)?1:0,"bool"),QO={kernelName:No,backendName:"cpu",kernelFunc:JO},ez=Rt((e,t)=>e<=t?1:0),tz=Ut(Eo,ez,null,"bool"),nz={kernelName:Eo,backendName:"cpu",kernelFunc:tz};function az(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=M3(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var rz={kernelName:Up,backendName:"cpu",kernelFunc:az},sz=nt(Co,e=>Math.log1p(e)),iz={kernelName:Co,backendName:"cpu",kernelFunc:sz},oz=Rt((e,t)=>e&&t),lz=Ut(Ro,oz,null,"bool"),uz={kernelName:Ro,backendName:"cpu",kernelFunc:lz},dz=nt(bu,e=>e?0:1,"bool"),pz={kernelName:bu,backendName:"cpu",kernelFunc:dz},cz=Rt((e,t)=>e||t),hz=Ut(vu,cz,null,"bool"),fz={kernelName:vu,backendName:"cpu",kernelFunc:hz};function mz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a;ve(r,"LRN");let d=r.shape[3],u=d-1,p=n.data.get(r.dataId).values,c=w.sizeFromShape(r.shape),h=new Float32Array(c);function m(f){let A=f%d,y=f-A+Math.max(0,A-s),g=f-A+Math.min(A+s,u),x=0;for(;y<=g;y++){let k=p[y];x+=k*k}return x}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l),p;if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))p=Ba({inputs:{x:r},backend:n});else{let c=n.data.get(r.dataId).values,h=w.computeStrides(r.shape),m=KA(c,r.shape,r.dtype,h,u,"max");p=n.makeTensorInfo(u.outShape,r.dtype,m.values)}return p}var vz={kernelName:Es,backendName:"cpu",kernelFunc:bz};function wz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a;ve(r,"maxPool3d");let u=C.computePool3DInfo(r.shape,s,i,1,o,l,d),p=n.data.get(r.dataId).values,c=a7(p,r.shape,r.dtype,w.computeStrides(r.shape),u,"max");return n.makeTensorInfo(c.shape,"float32",c.values)}var kz={kernelName:ku,backendName:"cpu",kernelFunc:wz};function Iz(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=a;ve([r,s],"maxPool3DGrad");let u=C.computePool3DInfo(s.shape,i,o,1,l,d),p=n.bufferSync(s),c=oD(p,u),h=u.strideDepth,m=u.strideHeight,f=u.strideWidth,A=u.dilationDepth,y=u.dilationHeight,g=u.dilationWidth,x=u.effectiveFilterDepth,k=u.effectiveFilterHeight,b=u.effectiveFilterWidth,v=x-1-u.padInfo.front,I=b-1-u.padInfo.left,T=k-1-u.padInfo.top,R=We(s.shape,"float32"),$=n.bufferSync(r);for(let z=0;z=u.outDepth||Math.floor(te)!==te))for(let ie=0;ie=u.outHeight||Math.floor(Q)!==Q))for(let de=0;de=u.outWidth||Math.floor(oe)!==oe)continue;let me=x*k*b-1-c.get(z,te,Q,oe,_),ce=re*k*b+ie*b+de,ke=me===ce?1:0;ke!==0&&(Y+=$.get(z,te,Q,oe,_)*ke)}}}R.set(Y,z,V,j,U,_)}return n.makeTensorInfo(R.shape,R.dtype,R.values)}var Sz={kernelName:qp,backendName:"cpu",kernelFunc:Iz};function Nz(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s,output:i}=t,o=s;ve([s,i],"maxPoolGrad");let{filterSize:l,strides:d,pad:u,dimRoundingMode:p}=a,c=C.computePool2DInfo(o.shape,l,d,1,u,p),h=n.data.get(o.dataId).values,m=We(c.outShape,o.dtype,n7(h,o.shape,o.dtype,c).values),f=c.strideHeight,A=c.strideWidth,y=c.dilationHeight,g=c.dilationWidth,x=c.effectiveFilterHeight,k=c.effectiveFilterWidth,b=k-1-c.padInfo.left,v=x-1-c.padInfo.top,I=We(o.shape,"float32"),T=n.data.get(r.dataId).values,R=We(r.shape,"float32",T);for(let $=0;$=c.outHeight||Math.floor(ee)!==ee))for(let Y=0;Y=c.outWidth||Math.floor(re)!==re)continue;let te=x*k-1-m.get($,ee,re,z),ie=G*k+Y,Q=te===ie?1:0;Q!==0&&(X+=R.get($,ee,re,z)*Q)}}I.set(X,$,_,V,z)}return n.makeTensorInfo(I.shape,I.dtype,I.values)}var Tz={kernelName:Gp,backendName:"cpu",kernelFunc:Nz};function Ez(e,t,n,a,r){let s=w.computeStrides(t),i=KA(e,t,n,s,r,"max"),o=n7(e,t,n,r,!0,a);return[i.values,o.values]}var Cz={kernelName:Xp,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;ve(a,"MaxPoolWithArgmax");let d=l.data.get(a.dataId).values,u=C.computePool2DInfo(a.shape,r,s,[1,1],i),[p,c]=Ez(d,a.shape,a.dtype,o,u),h=l.write(p,u.outShape,a.dtype),m=l.write(c,u.outShape,a.dtype);return[{dataId:h,shape:u.outShape,dtype:a.dtype},{dataId:m,shape:u.outShape,dtype:"int32"}]}};function Rz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=w.parseAxisParam(s,r.shape),l=C.computeOutAndReduceShapes(r.shape,o)[1],d=w.sizeFromShape(l),u=[],p=n.makeTensorInfo([],"float32",new Float32Array([d]));u.push(p);let c=_r({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(c);let h=ZA({inputs:{a:c,b:p},backend:n});u.push(h);let m=sd({inputs:{x:h},backend:n,attrs:{axis:s,keepDims:i}});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),m}var Mz={kernelName:Cs,backendName:"cpu",kernelFunc:Rz};function Fz(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;ve(r,"min");let o=w.parseAxisParam(s,r.shape),l=o,d=C.getAxesPermutation(l,r.shape.length),u=r;d!=null&&(u=Zn({inputs:{x:r},backend:n,attrs:{perm:d}}),l=C.getInnerMostAxes(l.length,r.shape.length)),C.assertAxesAreInnerMostDims("min",l,u.shape.length);let[p,c]=C.computeOutAndReduceShapes(u.shape,l),h=w.sizeFromShape(c),m=w.makeZerosTypedArray(w.sizeFromShape(p),u.dtype),f=n.data.get(u.dataId).values;for(let y=0;yg[0]+r.shape[x]+g[1]),l=s.map(g=>g[0]),d=s.map((g,x)=>g[0]+r.shape[x]),u=i==="reflect"?0:1,p=n.data.get(r.dataId).values,c=r.shape.length,h=w.computeStrides(r.shape),m=w.sizeFromShape(o),f=o.length,A=w.computeStrides(o),y=w.getTypedArrayFromDType(r.dtype,m);for(let g=0;g=d[b]&&(x[b]=(d[b]-1)*2-x[b]+u);x=x.map((b,v)=>b-l[v]);let k=w.locToIndex(x,c,h);y[g]=p[k]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var Oz={kernelName:Fs,backendName:"cpu",kernelFunc:Dz},zz=Rt((e,t)=>{let n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),_z=Ut(Mo,zz),Pz={kernelName:Mo,backendName:"cpu",kernelFunc:_z},Lz=Yi(_g());function u7(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=r.shape.length,o=s;if(o===-1&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);let l=w.parseAxisParam([o],r.shape),d=l7({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=C.expandShapeToKeepDim(d.shape,l),p=ht({inputs:{x:d},backend:n,attrs:{shape:u}}),c=qA({inputs:{a:r,b:p},backend:n}),h=q3({inputs:{x:c},backend:n}),m=sd({inputs:{x:h},backend:n,attrs:{axis:l,keepDims:!1}}),f=ht({inputs:{x:m},backend:n,attrs:{shape:u}}),A=ZA({inputs:{a:h,b:f},backend:n});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),A}var Wz={kernelName:Xs,backendName:"cpu",kernelFunc:u7};function Bz(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a;ve(r,"multinomial");let l=o?r:u7({inputs:{logits:r},backend:n,attrs:{dim:-1}}),d=l.shape[0],u=l.shape[1],p=n.data.get(l.dataId).values,c=[d,s],h=w.makeZerosTypedArray(w.sizeFromShape(c),"int32");for(let m=0;m=0&&u[p]{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=rh({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=Sl({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),d}var n_={kernelName:Po,backendName:"cpu",kernelFunc:p7};function a_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a;ve(r,"pad");let o=s.map((y,g)=>y[0]+r.shape[g]+y[1]),l=s.map(y=>y[0]),d=n.data.get(r.dataId).values,u=w.sizeFromShape(r.shape),p=r.shape.length,c=w.computeStrides(r.shape),h=w.sizeFromShape(o),m=o.length,f=w.computeStrides(o),A=w.getTypedArrayFromDType(r.dtype,h);i!==0&&A.fill(i);for(let y=0;yk+l[b]),x=w.locToIndex(g,m,f);A[x]=d[y]}return{dataId:n.write(A,o,r.dtype),shape:o,dtype:r.dtype}}var c7={kernelName:Os,backendName:"cpu",kernelFunc:a_},r_=Rt((e,t)=>Math.pow(e,t)),s_=Ut(zs,r_),i_={kernelName:zs,backendName:"cpu",kernelFunc:s_};function o_(e){let{backend:t,attrs:n}=e,{start:a,stop:r,dtype:s,step:i}=n,o=HA(a,r,i,s);return t.makeTensorInfo([o.length],s,o)}var l_={kernelName:Iu,backendName:"cpu",kernelFunc:o_},u_=nt(Wo,e=>1/e),d_={kernelName:Wo,backendName:"cpu",kernelFunc:u_};function p_(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a;ve(r,"resizeBilinear");let l=w.computeStrides(r.shape),[d,u]=o,[p,c,h,m]=r.shape,f=n.data.get(r.dataId).values,A=new Float32Array(w.sizeFromShape([p,d,u,m])),y=[s&&d>1?c-1:c,s&&u>1?h-1:h],g=[s&&d>1?d-1:d,s&&u>1?u-1:u],x=0,k=y[0]/g[0],b=y[1]/g[1];for(let v=0;v1?d-1:d,i&&h>1?u-1:u],A=[i&&c>1?c-1:c,i&&h>1?h-1:h],y=f[0]/A[0],g=f[1]/A[1],x=n.data.get(s.dataId).values,k=0;for(let b=0;b1?c-1:c,s&&u>1?h-1:h],g=[s&&d>1?d-1:d,s&&u>1?u-1:u],x=y[0]/g[0],k=y[1]/g[1],b=0;for(let v=0;v1?u-1:u,i&&m>1?p-1:p],g=[i&&h>1?h-1:h,i&&m>1?m-1:m],x=y[0]/g[0],k=y[1]/g[1],b=1/x,v=1/k,I=Math.ceil(b)*2+2,T=Math.ceil(v)*2+2;for(let R=0;R=h)continue;let Q=$+ie*l[1],de=ie*x,oe=Math.min(u-1,i?Math.round(de):Math.floor(de));if(z===oe)for(let me=0;me=m)continue;let ke=Q+ce*l[2],Se=ce*k,$e=Math.min(p-1,i?Math.round(Se):Math.floor(Se));U===$e&&(re+=A[ke+Y])}}f[X+Y]=re}}}}return n.makeTensorInfo(r.shape,r.dtype,f)}var g_={kernelName:Yp,backendName:"cpu",kernelFunc:y_};function x_(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a;ve(r,"reverse");let i=r.shape.length,o=w.parseAxisParam(s,r.shape);if(i===0)return Ba({inputs:{x:r},backend:n});let l=new Dt(r.shape,r.dtype),d=n.bufferSync(r);for(let u=0;uc[h]=r.shape[h]-1-c[h]),l.set(d.get(...c),...p)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}var b_={kernelName:Bs,backendName:"cpu",kernelFunc:x_},v_={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=w.getTypedArrayFromDType(a.dtype,w.sizeFromShape(a.shape)),[d,u,p,c]=a.shape,[h,m]=C.getImageCenter(i,u,p),f=255,A=Math.sin(r),y=Math.cos(r),g=o.data.get(a.dataId).values;for(let x=0;x=0&&V=0&&j{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),k_={kernelName:Vs,backendName:"cpu",kernelFunc:w_};function h7(e,t,n,a,r,s,i,o,l,d){let u=[a/r,r],p=e.values,c=t.values;if(a===0)return We(n,t.dtype);let h=We(u,t.dtype);h.values.fill(l);for(let m=0;m=a/r)throw new Error(`Invalid indices: ${f} does not index into ${n}`);for(let y=0;y1||r.shape.length===1?1:w.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?C_*e:E_*(Math.exp(e)-1)),M_={kernelName:Uo,backendName:"cpu",kernelFunc:R_},F_=nt(qo,e=>e<0?-1:e>0?1:0),$_={kernelName:qo,backendName:"cpu",kernelFunc:F_},D_=nt(Us,e=>Math.sin(e)),O_={kernelName:Us,backendName:"cpu",kernelFunc:D_},z_=nt(Go,e=>Math.sinh(e)),__={kernelName:Go,backendName:"cpu",kernelFunc:z_},P_=11920928955078125e-23,f7=Math.log(P_)+2,L_=nt(Xo,e=>{let t=e>-f7,n=e{let c=[...u];c[o]=p;let h=bi({inputs:{x:r},backend:n,attrs:{begin:d,size:c}});return d[o]+=p,h})}var X_={kernelName:Ko,backendName:"cpu",kernelFunc:q_},K_=nt(Gs,e=>Math.sqrt(e)),Z_={kernelName:Gs,backendName:"cpu",kernelFunc:K_},Y_={kernelName:Tu,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:n}=e,a=t;ve(n,"square");let r=a.data.get(n.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),Q_={kernelName:Nr,backendName:"cpu",kernelFunc:J_};function eP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a;ve(r,"stridedSlice");let{nonStrided:h,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(r.shape,s,i,o,l,d,u,p,c),x=ht({inputs:{x:r},backend:n,attrs:{shape:y}}),k;if(h){let v=bi({inputs:{x},backend:n,attrs:{begin:m,size:A}});k=ht({inputs:{x:v},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(v)}else if(g.some(v=>v===0))k=n.makeTensorInfo(g,r.dtype,[]);else{let v=n.bufferSync(x),I=V3(g,v,f,m);k=n.makeTensorInfo(I.shape,I.dtype,I.values)}let b=ht({inputs:{x:k},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(k),b}var tP={kernelName:Zo,backendName:"cpu",kernelFunc:eP},nP=nt(Ys,e=>Math.tan(e)),aP={kernelName:Ys,backendName:"cpu",kernelFunc:nP},rP=nt(Js,e=>Math.tanh(e)),sP={kernelName:Js,backendName:"cpu",kernelFunc:rP};function iP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reps:s}=a;ve(r,"tile");let i=U3(n.bufferSync(r),s);return n.makeTensorInfo(i.shape,i.dtype,i.values)}var oP={kernelName:Sr,backendName:"cpu",kernelFunc:iP};function lP(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a;ve(r,"topk");let o=n.data.get(r.dataId).values,[l,d]=H3(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(d.shape,d.dtype,d.values)]}var uP={kernelName:Yo,backendName:"cpu",kernelFunc:lP};function cP(e){let{inputs:t,attrs:n,backend:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:d}=n,[u,p,c,h]=r.shape,[m,f]=d!=null?d:[p,c],A=[u,m,f,h],y=w.computeStrides(r.shape),g=y[0],x=y[1],k=y[2],b=w.getTypedArrayFromDType(r.dtype,w.sizeFromShape(A));b.fill(l);let v=a.data.get(r.dataId).values,I=a.data.get(s.dataId).values;for(let T=0;Tt-1)if(t<=1)n=0;else{let a=2*t;n-=a*Math.trunc(n/a),n>=t&&(n=a-n-1)}return w.clamp(0,n,t-1)}function mP(e,t){let n=e;if(n<0)if(t<=1)n=0;else{let a=t-1;n+=t*(Math.trunc(-n/a)+1)}else if(n>t-1)if(t<=1)n=0;else{let a=t-1;n-=t*Math.trunc(n/a)}return w.clamp(0,n,t-1)}function AP(e,t){return e}function yP(e,t){return w.clamp(0,e,t-1)}function id(e,t,n,a,r,s,i,o,l,d,u){let p=i*a+o*r+l*s+d;return 0<=o&&on.disposeIntermediateTensorInfo(m)),h}var kP={kernelName:Eu,backendName:"cpu",kernelFunc:wP},IP=[O$,LF,_$,L$,HF,B$,j$,H$,q$,K$,Y$,Q$,tD,rD,iD,uD,pD,hD,mD,$$,yD,xD,vD,jF,qF,kD,WF,SD,TD,RD,FD,ED,zD,PD,DD,WD,VD,UD,GD,XD,ZD,YD,QD,tO,aO,rO,iO,sO,YA,uO,S$,pO,hO,vO,XF,wO,ZF,EO,RO,MO,JF,DO,zO,PO,WO,VO,e$,HO,BF,qO,ND,KO,YO,QO,N$,n$,nz,rz,r$,iz,uz,pz,fz,Az,gz,i$,vz,kz,Sz,Tz,Cz,xz,Mz,$z,l$,Oz,Pz,Vz,d$,c$,Hz,Xz,Yz,f$,Qz,t_,n_,c7,i_,E$,y$,l_,VF,d_,C$,R$,F$,c_,f_,A_,g_,b_,v_,k_,x$,S_,T_,M_,M$,$_,O_,__,b$,Wz,W_,V_,U_,G_,X_,Z_,Y_,w$,Q_,tP,I$,oO,aP,sP,oP,uP,m$,hP,xP,vP,kP,e_];for(let e of IP)ai(e);var A7={};Fe(A7,{assertNotComplex:()=>Nl,bindCanvasToFramebuffer:()=>TP,bindColorTextureToFramebuffer:()=>oh,bindTextureToProgramUniformSampler:()=>M7,bindTextureUnit:()=>E7,bindVertexBufferToProgramAttribute:()=>e1,callAndCheck:()=>xe,canBeRepresented:()=>y7,createFragmentShader:()=>b7,createFramebuffer:()=>T7,createProgram:()=>v7,createStaticIndexBuffer:()=>I7,createStaticVertexBuffer:()=>k7,createTexture:()=>S7,createVertexShader:()=>x7,getBatchDim:()=>vi,getExtensionOrThrow:()=>od,getFramebufferErrorMessage:()=>F7,getMaxTexturesInShader:()=>O7,getNumChannels:()=>SP,getProgramUniformLocation:()=>R7,getProgramUniformLocationOrThrow:()=>C7,getRowsCols:()=>wi,getShapeAs3D:()=>lh,getTextureShapeFromLogicalShape:()=>$7,getWebGLDisjointQueryTimerVersion:()=>z7,getWebGLErrorMessage:()=>g7,getWebGLMaxTextureSize:()=>D7,hasExtension:()=>Yn,isCapableOfRenderingToFloatTexture:()=>_7,isDownloadFloatTextureEnabled:()=>P7,isReshapeFree:()=>ud,isWebGLFenceEnabled:()=>L7,isWebGLVersionEnabled:()=>n1,linkProgram:()=>w7,resetMaxTextureSize:()=>EP,resetMaxTexturesInShader:()=>CP,unbindColorTextureFromFramebuffer:()=>t1,unbindTextureUnit:()=>NP,validateFramebuffer:()=>ld,validateProgram:()=>ih,validateTextureSize:()=>N7});var ki={},a1={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function uh(e,t){ki[e]=t}function Va(e){if(!(e in ki)){let n=RP(e);if(n!==null)ki[e]=n;else return console.log("Could not get context for WebGL version",e),null}let t=ki[e];return t.isContextLost()?(delete ki[e],Va(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),ki[e])}function MP(e){if(typeof OffscreenCanvas!="undefined"&&e===2)return new OffscreenCanvas(300,150);if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function RP(e){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=MP(e);return t.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete ki[e]},!1),e===1?t.getContext("webgl",a1)||t.getContext("experimental-webgl",a1):t.getContext("webgl2",a1)}var dd;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(dd||(dd={}));var Jn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(Jn||(Jn={}));var Qt;(function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(Qt||(Qt={}));function pd(e,t){return[t,e]}function FP(e,t){return e*t}function cd(e){let t=w.sizeFromShape(e),n=Math.ceil(t/4);return w.sizeToSquarishShape(n)}function Tl(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function $P(e,t){let[n,a]=Tl(e,t);return n*a*4}function r1(e,t){let n=e,a,r,s,i,o,l,d,u,p,c;return J().getNumber("WEBGL_VERSION")===2?(a=n.R32F,r=n.R16F,s=n.RGBA16F,i=n.RGBA32F,o=n.RED,d=4,u=1,p=n.HALF_FLOAT,c=n.FLOAT):(a=e.RGBA,r=e.RGBA,s=e.RGBA,i=n.RGBA,o=e.RGBA,d=4,u=4,p=t!=null?t.HALF_FLOAT_OES:null,c=e.FLOAT),l=e.RGBA,{internalFormatFloat:a,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:d,defaultNumChannels:u,textureTypeHalfFloat:p,textureTypeFloat:c}}function xe(e,t){let n=t();return J().getBool("DEBUG")&&DP(e),n}function DP(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+g7(e,t))}var OP=596e-10,zP=65504;function y7(e){return!!(J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||OPe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function x7(e,t){let n=lr(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function b7(e,t){let n=lr(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(xe(e,()=>e.shaderSource(n,t)),xe(e,()=>e.compileShader(n)),e.getShaderParameter(n,e.COMPILE_STATUS)===!1)throw _P(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var PP=/ERROR: [0-9]+:([0-9]+):/g;function _P(e,t){let n=PP.exec(t);if(n==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let a=+n[1],r=e.split(` +`),s=r.length.toString().length+2,i=r.map((p,c)=>w.rightPad((c+1).toString(),s)+p),o=0;for(let p=0;pe.createProgram(),"Unable to create WebGLProgram.")}function b_(e,t){if(xe(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function ip(e,t){if(xe(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function __(e,t){let n=ca(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function v_(e,t){let n=ca(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function wP(){return J().getNumber("WEBGL_VERSION")===2?1:4}function k_(e){return ca(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function I_(e,t){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let r=`[${e}x${t}]`;throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n){let r=`[${e}x${t}]`,a=`[${n}x${n}]`;throw new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU "+a+".")}}function S_(e){return ca(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function eA(e,t,n,r,a,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,r)),xe(e,()=>e.vertexAttribPointer(o,a,e.FLOAT,!1,s,i)),xe(e,()=>e.enableVertexAttribArray(o)),!0)}function N_(e,t,n){L_(e,n),xe(e,()=>e.activeTexture(e.TEXTURE0+n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function bP(e,t){L_(e,t),xe(e,()=>e.activeTexture(e.TEXTURE0+t)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function T_(e,t,n){return ca(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function E_(e,t,n){return e.getUniformLocation(t,n)}function C_(e,t,n,r){xe(e,()=>N_(e,t,r)),xe(e,()=>e.uniform1i(n,r))}function _P(e){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),xe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function op(e,t,n){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function tA(e,t){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function lc(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+R_(e,t))}function R_(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function ca(e,t,n){let r=xe(e,()=>t());if(r==null)throw new Error(n);return r}function L_(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(rn){let a=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${a}.`)}}function bi(e,t=2){return _.sizeFromShape(e.slice(0,e.length-t))}function _i(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function lp(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[bi(e),..._i(e)]),t}function M_(e,t=!1){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((a,s)=>s>=e.length-2?_.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=_.squeezeShape(e).newShape);let r=_.sizeFromShape(e);if(e.length<=1&&r<=n)return[1,r];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let a=bi(e),s=2,i=2;return e.length&&([s,i]=_i(e)),r=a*(s/2)*(i/2),_.sizeToSquarishShape(r).map(o=>o*2)}return _.sizeToSquarishShape(r)}function cp(e){return e%2==0}function uc(e,t){if(e=e.slice(-2),t=t.slice(-2),_.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r||cp(n)&&cp(r)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&cp(e[0])&&cp(t[0])}var hp,dp;function F_(e){if(hp==null){let t=Vr(e);hp=t.getParameter(t.MAX_TEXTURE_SIZE)}return hp}function vP(){hp=null}function kP(){dp=null}function $_(e){if(dp==null){let t=Vr(e);dp=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,dp)}function D_(e){if(e===0)return 0;let t,n=Vr(e);return Yn(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:Yn(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function Yn(e,t){return e.getExtension(t)!=null}function nA(e){try{if(Vr(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function O_(e){if(e===0)return!1;let t=Vr(e);if(e===1){if(!Yn(t,"OES_texture_float"))return!1}else if(!Yn(t,"EXT_color_buffer_float"))return!1;return sA(t)}function z_(e){if(e===0)return!1;let t=Vr(e);if(e===1){if(!Yn(t,"OES_texture_float")||!Yn(t,"WEBGL_color_buffer_float"))return!1}else{if(Yn(t,"EXT_color_buffer_float"))return sA(t);let n="EXT_color_buffer_half_float";if(Yn(t,n)){let r=t.getExtension(n);return $P(t,r)}return!1}return sA(t)}function sA(e){let t=aA(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=1,a=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,r,a,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function $P(e,t){let n=aA(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);let a=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,a,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(i),o}function P_(e){return e!==2?!1:Vr(e).fenceSync!=null}function Sl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&_.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Ce=J();Ce.registerFlag("HAS_WEBGL",()=>Ce.getNumber("WEBGL_VERSION")>0);Ce.registerFlag("WEBGL_VERSION",()=>nA(2)?2:nA(1)?1:0);Ce.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Ce.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Ce.get("WEBGL_VERSION")===2);Ce.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Ce.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Ce.registerFlag("WEBGL_PACK",()=>Ce.getBool("HAS_WEBGL"));Ce.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_CLIP",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_PACK_REDUCE",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_LAZILY_UNPACK",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_CONV_IM2COL",()=>Ce.getBool("WEBGL_PACK"));Ce.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>F_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>$_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Ce.getNumber("WEBGL_VERSION");return e===0?0:D_(e)});Ce.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Ce.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!zu.isMobile());Ce.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>O_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Ce.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Ce.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Ce.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>z_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_FENCE_API_ENABLED",()=>P_(Ce.getNumber("WEBGL_VERSION")));Ce.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Ce.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Ce.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Ce.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>zu.isMobile()&&Ce.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});function cn(){let e,t,n,r,a,s,i,o,l,c;return J().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",r="in",a="texture",s="outputColor",i="out vec4 outputColor;",o=` +`)[0]),console.log(`%c ${w.rightPad(d[0],o)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(u.join(` +`))}function v7(e){return lr(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}function w7(e,t){if(xe(e,()=>e.linkProgram(t)),e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function ih(e,t){if(xe(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function k7(e,t){let n=lr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function I7(e,t){let n=lr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),xe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function SP(){return J().getNumber("WEBGL_VERSION")===2?1:4}function S7(e){return lr(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function N7(e,t){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let a=`[${e}x${t}]`;throw new Error("Requested texture size "+a+" is invalid.")}if(e>n||t>n){let a=`[${e}x${t}]`,r=`[${n}x${n}]`;throw new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU "+r+".")}}function T7(e){return lr(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function e1(e,t,n,a,r,s,i){let o=e.getAttribLocation(t,n);return o===-1?!1:(xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),xe(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),xe(e,()=>e.enableVertexAttribArray(o)),!0)}function E7(e,t,n){W7(e,n),xe(e,()=>e.activeTexture(e.TEXTURE0+n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function NP(e,t){W7(e,t),xe(e,()=>e.activeTexture(e.TEXTURE0+t)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function C7(e,t,n){return lr(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function R7(e,t,n){return e.getUniformLocation(t,n)}function M7(e,t,n,a){xe(e,()=>E7(e,t,a)),xe(e,()=>e.uniform1i(n,a))}function TP(e){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),xe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function oh(e,t,n){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function t1(e,t){xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),xe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function ld(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+F7(e,t))}function F7(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function lr(e,t,n){let a=xe(e,()=>t());if(a==null)throw new Error(n);return a}function W7(e,t){let n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,a=t+e.TEXTURE0;if(an){let r=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${r}.`)}}function vi(e,t=2){return w.sizeFromShape(e.slice(0,e.length-t))}function wi(e){if(e.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function lh(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[vi(e),...wi(e)]),t}function $7(e,t=!1){let n=J().getNumber("WEBGL_MAX_TEXTURE_SIZE");t&&(n=n*2,e=e.map((r,s)=>s>=e.length-2?w.nearestLargerEven(e[s]):e[s]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=w.squeezeShape(e).newShape);let a=w.sizeFromShape(e);if(e.length<=1&&a<=n)return[1,a];if(e.length===2&&e[0]<=n&&e[1]<=n)return e;if(e.length===3&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(e.length===3&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(e.length===4&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(e.length===4&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){let r=vi(e),s=2,i=2;return e.length&&([s,i]=wi(e)),a=r*(s/2)*(i/2),w.sizeToSquarishShape(a).map(o=>o*2)}return w.sizeToSquarishShape(a)}function dh(e){return e%2==0}function ud(e,t){if(e=e.slice(-2),t=t.slice(-2),w.arraysEqual(e,t)||!e.length||!t.length||e[0]===0||e[1]===0||t[0]===0||t[1]===0)return!0;if(e.length!==t.length){let n=e.slice(-1)[0],a=t.slice(-1)[0];if(n===a||dh(n)&&dh(a)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&dh(e[0])&&dh(t[0])}var ph,ch;function D7(e){if(ph==null){let t=Va(e);ph=t.getParameter(t.MAX_TEXTURE_SIZE)}return ph}function EP(){ph=null}function CP(){ch=null}function O7(e){if(ch==null){let t=Va(e);ch=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ch)}function z7(e){if(e===0)return 0;let t,n=Va(e);return Yn(n,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:Yn(n,"EXT_disjoint_timer_query")?t=1:t=0,t}function Yn(e,t){return e.getExtension(t)!=null}function n1(e){try{if(Va(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function _7(e){if(e===0)return!1;let t=Va(e);if(e===1){if(!Yn(t,"OES_texture_float"))return!1}else if(!Yn(t,"EXT_color_buffer_float"))return!1;return s1(t)}function P7(e){if(e===0)return!1;let t=Va(e);if(e===1){if(!Yn(t,"OES_texture_float")||!Yn(t,"WEBGL_color_buffer_float"))return!1}else{if(Yn(t,"EXT_color_buffer_float"))return s1(t);let n="EXT_color_buffer_half_float";if(Yn(t,n)){let a=t.getExtension(n);return LP(t,a)}return!1}return s1(t)}function s1(e){let t=r1(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let a=1,r=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,a,r,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),i}function LP(e,t){let n=r1(e,t),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);let r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(i),o}function L7(e){return e!==2?!1:Va(e).fenceSync!=null}function Nl(e,t){Array.isArray(e)||(e=[e]),e.forEach(n=>{n!=null&&w.assert(n.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Re=J();Re.registerFlag("HAS_WEBGL",()=>Re.getNumber("WEBGL_VERSION")>0);Re.registerFlag("WEBGL_VERSION",()=>n1(2)?2:n1(1)?1:0);Re.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Re.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Re.get("WEBGL_VERSION")===2);Re.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Re.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Re.registerFlag("WEBGL_PACK",()=>Re.getBool("HAS_WEBGL"));Re.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_CLIP",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_PACK_REDUCE",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_LAZILY_UNPACK",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_CONV_IM2COL",()=>Re.getBool("WEBGL_PACK"));Re.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>D7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>O7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Re.getNumber("WEBGL_VERSION");return e===0?0:z7(e)});Re.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Re.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!_u.isMobile());Re.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>_7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Re.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Re.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Re.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>P7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_FENCE_API_ENABLED",()=>L7(Re.getNumber("WEBGL_VERSION")));Re.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Re.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Re.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)});Re.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>_u.isMobile()&&Re.getBool("IS_CHROME")?1:-1,e=>{if(e<0&&e!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)});function dn(){let e,t,n,a,r,s,i,o,l,d;return J().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",n="out",a="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=` bool isnan_custom(float val) { return (val > 0.0 || val < 0.0) ? false : val != 0.0; } @@ -44,7 +44,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee } #define isnan(value) isnan_custom(value) - `,l="",c=` + `,l="",d=` #define round(value) newRound(value) int newRound(float value) { return int(floor(value + 0.5)); @@ -53,7 +53,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ivec4 newRound(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `):(e="",t="attribute",n="varying",r="varying",a="texture2D",s="gl_FragColor",i="",o=` + `):(e="",t="attribute",n="varying",a="varying",r="texture2D",s="gl_FragColor",i="",o=` #define isnan(value) isnan_custom(value) bool isnan_custom(float val) { return (val > 0. || val < 1. || val == 0.) ? false : true; @@ -70,7 +70,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee bvec4 isinf(vec4 val) { return equal(abs(val), vec4(INFINITY)); } - `,c=` + `,d=` int round(float value) { return int(floor(value + 0.5)); } @@ -78,11 +78,11 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:a,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:c}}function ki(e,t,n="index"){let r=_.computeStrides(t);return r.map((a,s)=>{let i=`int ${e[s]} = ${n} / ${a}`,o=s===r.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${a}`:`index -= ${e[s]} * ${a}`;return`${i}; ${o};`}).join("")}function iA(e){let t=_.computeStrides(e).map(n=>n.toString());return` + `),{version:e,attribute:t,varyingVs:n,varyingFs:a,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:d}}function Ii(e,t,n="index"){let a=w.computeStrides(t);return a.map((r,s)=>{let i=`int ${e[s]} = ${n} / ${r}`,o=s===a.length-1?`int ${e[s+1]} = ${n} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function i1(e){let t=w.computeStrides(e).map(n=>n.toString());return` int getFlatIndex(ivec3 coords) { return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; } -`}var W_=` +`}var B7=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -121,9 +121,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return c / 255.0; } -`,DP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=cc.DENSE;let t=dc(e),n=cn();this.outputShape=e,this.userCode=` +`,WP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=dd.DENSE;let t=cd(e),n=dn();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } @@ -142,9 +142,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},OP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=cc.DENSE;let t=dc(e),n=cn();this.outputShape=e,this.userCode=` + `}},BP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=dd.DENSE;let t=cd(e),n=dn();this.outputShape=e,this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } @@ -163,23 +163,23 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${n.output} = result; } - `}},zP=class{constructor(e){this.variableNames=["A"],this.outTexUsage=Jn.DOWNLOAD;let t=cn();this.outputShape=e,this.userCode=` - ${W_} + `}},VP=class{constructor(e){this.variableNames=["A"],this.outTexUsage=Jn.DOWNLOAD;let t=dn();this.outputShape=e,this.userCode=` + ${B7} void main() { float x = getAAtOutCoords(); ${t.output} = encode_float(x); } - `}},PP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Jn.DOWNLOAD;let t=cn();this.outputShape=e,this.userCode=` - ${W_} + `}},jP=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Jn.DOWNLOAD;let t=dn();this.outputShape=e,this.userCode=` + ${B7} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); ${t.output} = encode_float(x); } - `}},LP=class{constructor(e,t,n=!1){this.variableNames=["A"];let r=cn(),[a,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` - ${iA(e)} + `}},UP=class{constructor(e,t,n=!1){this.variableNames=["A"];let a=dn(),[r,s]=t;this.outputShape=e;let i="result";n&&(i="floor(result * 255. + 0.5)"),this.userCode=` + ${i1(e)} void main() { ivec3 coords = getOutputCoords(); @@ -191,8 +191,8 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee int r = flatIndex / ${s}; int c = imod(flatIndex, ${s}); - vec2 uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${a}.0); - vec4 values = ${r.texture2D}(A, uv); + vec2 uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${r}.0); + vec4 values = ${a.texture2D}(A, uv); float result; @@ -206,12 +206,12 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee result = values[3]; } - ${r.output} = vec4(${i}, 0., 0., 0.); + ${a.output} = vec4(${i}, 0., 0., 0.); } - `}},WP=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let r=cn(),[a,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let l=0;l<=1;l++)for(let c=0;c<=1;c++){let u=l*2+c;i+=` + `}},HP=class{constructor(e,t,n=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let a=dn(),[r,s]=t;this.outputShape=e;let i="",o="result";n&&(o="floor(result * 255. + 0.5)");for(let l=0;l<=1;l++)for(let d=0;d<=1;d++){let u=l*2+d;i+=` localCoords = coords; - if(localCoords[2] + ${c} < ${e[2]}) { - localCoords[2] += ${c}; + if(localCoords[2] + ${d} < ${e[2]}) { + localCoords[2] += ${d}; if(localCoords[1] + ${l} < ${e[1]}) { localCoords[1] += ${l}; @@ -222,8 +222,8 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee r = flatIndex / ${s}; c = imod(flatIndex, ${s}); - uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${a}.0); - values = ${r.texture2D}(A, uv); + uv = (vec2(c, r) + halfCR) / vec2(${s}.0, ${r}.0); + values = ${a.texture2D}(A, uv); if(offset == 0) { result[${u}] = values[0]; @@ -237,7 +237,7 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee } } `}this.userCode=` - ${iA(e)} + ${i1(e)} void main() { ivec3 coords = getOutputCoords(); @@ -250,9 +250,9 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee ${i} - ${r.output} = ${o}; + ${a.output} = ${o}; } - `}},B_={};Me(B_,{bindVertexProgramAttributeStreams:()=>Z_,createBufferFromOutputTexture:()=>Q_,createFloat16MatrixTexture:()=>G_,createFloat16PackedMatrixTexture:()=>K_,createFloat32MatrixTexture:()=>H_,createIndexBuffer:()=>U_,createPackedMatrixTexture:()=>X_,createUnsignedBytesMatrixTexture:()=>q_,createVertexBuffer:()=>j_,createVertexShader:()=>V_,downloadByteEncodedFloatMatrixFromOutputTexture:()=>t3,downloadFloat32MatrixFromBuffer:()=>e3,downloadMatrixFromPackedOutputTexture:()=>r3,downloadPackedMatrixFromBuffer:()=>n3,getInternalFormatForFloat16MatrixTexture:()=>lA,getInternalFormatForFloat16PackedMatrixTexture:()=>hA,getInternalFormatForFloat32MatrixTexture:()=>oA,getInternalFormatForPackedMatrixTexture:()=>cA,getInternalFormatForUnsignedBytesMatrixTexture:()=>uA,uploadDenseMatrixToTexture:()=>Y_,uploadPixelDataToTexture:()=>J_});function V_(e){let t=cn(),n=`${t.version} + `}},V7={};Fe(V7,{bindVertexProgramAttributeStreams:()=>Y7,createBufferFromOutputTexture:()=>ev,createFloat16MatrixTexture:()=>q7,createFloat16PackedMatrixTexture:()=>Z7,createFloat32MatrixTexture:()=>G7,createIndexBuffer:()=>H7,createPackedMatrixTexture:()=>K7,createUnsignedBytesMatrixTexture:()=>X7,createVertexBuffer:()=>U7,createVertexShader:()=>j7,downloadByteEncodedFloatMatrixFromOutputTexture:()=>nv,downloadFloat32MatrixFromBuffer:()=>tv,downloadMatrixFromPackedOutputTexture:()=>rv,downloadPackedMatrixFromBuffer:()=>av,getInternalFormatForFloat16MatrixTexture:()=>l1,getInternalFormatForFloat16PackedMatrixTexture:()=>p1,getInternalFormatForFloat32MatrixTexture:()=>o1,getInternalFormatForPackedMatrixTexture:()=>d1,getInternalFormatForUnsignedBytesMatrixTexture:()=>u1,uploadDenseMatrixToTexture:()=>J7,uploadPixelDataToTexture:()=>Q7});function j7(e){let t=dn(),n=`${t.version} precision highp float; ${t.attribute} vec3 clipSpacePos; ${t.attribute} vec2 uv; @@ -261,22 +261,22 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; - }`;return g_(e,n)}function j_(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return __(e,t)}function U_(e){let t=new Uint16Array([0,1,2,2,1,3]);return v_(e,t)}function pc(e,t,n,r,a,s){I_(t,n);let i=k_(e),o=e.TEXTURE_2D;return xe(e,()=>e.bindTexture(o,i)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),xe(e,()=>e.texImage2D(o,0,r,t,n,0,a,s,null)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function oA(e){return e.internalFormatFloat}function H_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,oA(r),r.textureFormatFloat,e.FLOAT)}function lA(e){return e.internalFormatHalfFloat}function G_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,lA(r),r.textureFormatFloat,r.textureTypeHalfFloat)}function uA(e){return e.downloadTextureFormat}function q_(e,t,n,r){let[a,s]=hc(t,n);return pc(e,a,s,uA(r),e.RGBA,e.UNSIGNED_BYTE)}function cA(e){return e.internalFormatPackedFloat}function X_(e,t,n,r){let[a,s]=Nl(t,n);return pc(e,a,s,cA(r),e.RGBA,e.FLOAT)}function hA(e){return e.internalFormatPackedHalfFloat}function K_(e,t,n,r){let[a,s]=Nl(t,n);return pc(e,a,s,hA(r),e.RGBA,r.textureTypeHalfFloat)}function Z_(e,t,n){let r=0,a=3*4,s=3*4+2*4;return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),eA(e,t,"clipSpacePos",n,3,s,r)&&eA(e,t,"uv",n,2,s,a)}function Y_(e,t,n,r,a,s){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;a instanceof Uint8Array?(i=new Uint8Array(n*r*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*r*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(a),xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,r,0,e.RGBA,o,i)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function J_(e,t,n){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Q_(e,t,n,r){let a=e.createBuffer();xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,a));let s=4*4*t*n;return xe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),a}function e3(e,t,n){let r=e,a=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,a),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),a}function t3(e,t,n,r){let[a,s]=hc(t,n),i=4,o=new Uint8Array(NP(t*n,i));return xe(e,()=>e.readPixels(0,0,a,s,r.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function n3(e,t,n,r,a,s,i,o){let l=e,c=new Float32Array(TP(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,c),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),c}function r3(e,t,n){let r=new Float32Array(t*n*4);return xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,r)),r}var pp=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=J().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,up(t,e)):this.gl=Vr(t);let n="WEBGL_color_buffer_float",r="EXT_color_buffer_half_float";if(J().getNumber("WEBGL_VERSION")===1){let a="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=oc(this.gl,a),Yn(this.gl,s))this.textureHalfFloatExtension=oc(this.gl,s);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),Yn(this.gl,r))this.colorBufferHalfFloatExtension=oc(this.gl,r);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",Yn(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(Yn(this.gl,r))this.colorBufferHalfFloatExtension=this.gl.getExtension(r);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=j_(this.gl),this.indexBuffer=U_(this.gl),this.framebuffer=S_(this.gl),this.textureConfig=aA(this.gl,this.textureHalfFloatExtension)}get debug(){return J().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");let e=this.gl;xe(e,()=>e.finish()),xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.deleteFramebuffer(this.framebuffer)),xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),xe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),H_(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),G_(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),q_(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),J_(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,r){this.throwIfDisposed(),Y_(this.gl,e,t,n,r,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),K_(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),X_(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(tA(this.gl,this.framebuffer),this.outputTexture=null),xe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>t3(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,r,a,s){return n3(this.gl,e,t,n,r,a,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return e3(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let r=Q_(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(J().getBool("WEBGL_FENCE_API_ENABLED")){let r=e,a=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=r.clientWaitSync(a,0,0);return s===r.ALREADY_SIGNALED||s===r.CONDITION_SATISFIED},t=a}else J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>r3(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=x_(t,e),r=V_(t),a=w_(t);return xe(t,()=>t.attachShader(a,r)),xe(t,()=>t.attachShader(a,n)),b_(t,a),this.debug&&ip(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=Z_(t,this.program,this.vertexBuffer)),a}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&xe(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&ip(this.gl,this.program),xe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?T_(this.gl,e,t):E_(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),xe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),C_(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[r,a]=Nl(t,n);this.setOutputMatrixTextureDriver(e,r,a)}setOutputMatrixWriteRegion(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)}setOutputPackedMatrixWriteRegion(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&ip(this.gl,this.program),lc(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),xe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),xe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=oc(this.gl,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.createQuery();return n.beginQuery(r.TIME_ELAPSED_EXT,a),a}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await _.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),a&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),r=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=BP(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&_.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),op(this.gl,e,this.framebuffer),this.debug&&lc(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(op(this.gl,this.outputTexture,this.framebuffer),this.debug&&lc(this.gl)):tA(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let r=this.gl;op(r,e,this.framebuffer),this.debug&&lc(r),this.outputTexture=e,xe(r,()=>r.viewport(0,0,t,n)),xe(r,()=>r.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,r){this.throwIfDisposed(),xe(this.gl,()=>this.gl.scissor(e,t,n,r))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}};function BP(e){let t=0;for(;t{let m=_.sizeFromShape(p.shapeInfo.logicalShape);p.shapeInfo.isUniform?a.push(`uniform float ${p.name}${m>1?`[${m}]`:""};`):(a.push(`uniform sampler2D ${p.name};`),a.push(`uniform int offset${p.name};`))});let s=a.join(` -`),i=e.map(p=>VP(p,t,r)).join(` -`),o=t.texShape,l=cn(),c=HP(l),u,h,d=XP(l);return t.isPacked?(u=jP(t.logicalShape,o),h=qP(l)):(u=UP(t.logicalShape,o),h=GP(l)),r&&(d+=KP),[d,c,h,s,u,i,n].join(` -`)}function Tl(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return YP(e);case 1:return JP(e);case 2:return QP(e);case 3:return eL(e);case 4:return tL(e);case 5:return nL(e);case 6:return rL(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function s3(e){switch(e.shapeInfo.logicalShape.length){case 0:return aL(e);case 1:return sL(e);case 2:return iL(e);case 3:return oL(e);default:return lL(e)}}function VP(e,t,n=!1){let r="";n?r+=s3(e):r+=Tl(e);let a=e.shapeInfo.logicalShape,s=t.logicalShape;return a.length<=s.length&&(n?r+=uL(e,t):r+=cL(e,t)),r}function jP(e,t){switch(e.length){case 0:return i3();case 1:return hL(e,t);case 2:return fL(e,t);case 3:return dL(e,t);default:return pL(e,t)}}function UP(e,t){switch(e.length){case 0:return i3();case 1:return mL(e,t);case 2:return wL(e,t);case 3:return AL(e,t);case 4:return yL(e,t);case 5:return gL(e,t);case 6:return xL(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function HP(e){return` + }`;return x7(e,n)}function U7(e){let t=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return k7(e,t)}function H7(e){let t=new Uint16Array([0,1,2,2,1,3]);return I7(e,t)}function hd(e,t,n,a,r,s){N7(t,n);let i=S7(e),o=e.TEXTURE_2D;return xe(e,()=>e.bindTexture(o,i)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),xe(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),xe(e,()=>e.texImage2D(o,0,a,t,n,0,r,s,null)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),i}function o1(e){return e.internalFormatFloat}function G7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,o1(a),a.textureFormatFloat,e.FLOAT)}function l1(e){return e.internalFormatHalfFloat}function q7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,l1(a),a.textureFormatFloat,a.textureTypeHalfFloat)}function u1(e){return e.downloadTextureFormat}function X7(e,t,n,a){let[r,s]=pd(t,n);return hd(e,r,s,u1(a),e.RGBA,e.UNSIGNED_BYTE)}function d1(e){return e.internalFormatPackedFloat}function K7(e,t,n,a){let[r,s]=Tl(t,n);return hd(e,r,s,d1(a),e.RGBA,e.FLOAT)}function p1(e){return e.internalFormatPackedHalfFloat}function Z7(e,t,n,a){let[r,s]=Tl(t,n);return hd(e,r,s,p1(a),e.RGBA,a.textureTypeHalfFloat)}function Y7(e,t,n){let a=0,r=3*4,s=3*4+2*4;return xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),e1(e,t,"clipSpacePos",n,3,s,a)&&e1(e,t,"uv",n,2,s,r)}function J7(e,t,n,a,r,s){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;r instanceof Uint8Array?(i=new Uint8Array(n*a*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*a*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(r),xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,a,0,e.RGBA,o,i)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Q7(e,t,n){xe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):xe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),xe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function ev(e,t,n,a){let r=e.createBuffer();xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*n;return xe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),xe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function tv(e,t,n){let a=e,r=new Float32Array(n);return a.bindBuffer(a.PIXEL_PACK_BUFFER,t),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,r),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),r}function nv(e,t,n,a){let[r,s]=pd(t,n),i=4,o=new Uint8Array(FP(t*n,i));return xe(e,()=>e.readPixels(0,0,r,s,a.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function av(e,t,n,a,r,s,i,o){let l=e,d=new Float32Array($P(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,d),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),d}function rv(e,t,n){let a=new Float32Array(t*n*4);return xe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,a)),a}var hh=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];let t=J().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,uh(t,e)):this.gl=Va(t);let n="WEBGL_color_buffer_float",a="EXT_color_buffer_half_float";if(J().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=od(this.gl,r),Yn(this.gl,s))this.textureHalfFloatExtension=od(this.gl,s);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),Yn(this.gl,a))this.colorBufferHalfFloatExtension=od(this.gl,a);else if(J().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",Yn(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else if(Yn(this.gl,a))this.colorBufferHalfFloatExtension=this.gl.getExtension(a);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=U7(this.gl),this.indexBuffer=H7(this.gl),this.framebuffer=T7(this.gl),this.textureConfig=r1(this.gl,this.textureHalfFloatExtension)}get debug(){return J().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");let e=this.gl;xe(e,()=>e.finish()),xe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),xe(e,()=>e.deleteFramebuffer(this.framebuffer)),xe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),xe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),xe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),G7(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),q7(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),X7(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),Q7(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,a){this.throwIfDisposed(),J7(this.gl,e,t,n,a,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Z7(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),K7(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(t1(this.gl,this.framebuffer),this.outputTexture=null),xe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>nv(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,a,r,s){return av(this.gl,e,t,n,a,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return tv(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);let a=ev(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),a}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(J().getBool("WEBGL_FENCE_API_ENABLED")){let a=e,r=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{let s=a.clientWaitSync(r,0,0);return s===a.ALREADY_SIGNALED||s===a.CONDITION_SATISFIED},t=r}else J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>rv(this.gl,t,n))}createProgram(e){this.throwIfDisposed();let t=this.gl,n=b7(t,e),a=j7(t),r=v7(t);return xe(t,()=>t.attachShader(r,a)),xe(t,()=>t.attachShader(r,n)),w7(t,r),this.debug&&ih(t,r),this.vertexAttrsAreBound||(this.setProgram(r),this.vertexAttrsAreBound=Y7(t,this.program,this.vertexBuffer)),r}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&xe(this.gl,()=>this.gl.deleteProgram(e))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&ih(this.gl,this.program),xe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?C7(this.gl,e,t):R7(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),xe(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),M7(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();let[a,r]=Tl(t,n);this.setOutputMatrixTextureDriver(e,a,r)}setOutputMatrixWriteRegion(e,t,n,a){this.setOutputMatrixWriteRegionDriver(n,e,a,t)}setOutputPackedMatrixWriteRegion(e,t,n,a){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&ih(this.gl,this.program),ld(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&this.debugValidate(),xe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),xe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=od(this.gl,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.createQuery();return n.beginQuery(a.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await w.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}else{let n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let n=this.gl,a=this.getQueryTimerExtensionWebGL2(),r=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let n=this.getQueryTimerExtensionWebGL1(),a=n.getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=GP(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:n}=this.itemsToPoll[t];n()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),!(this.itemsToPoll.length>1)&&w.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),oh(this.gl,e,this.framebuffer),this.debug&&ld(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(oh(this.gl,this.outputTexture,this.framebuffer),this.debug&&ld(this.gl)):t1(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();let a=this.gl;oh(a,e,this.framebuffer),this.debug&&ld(a),this.outputTexture=e,xe(a,()=>a.viewport(0,0,t,n)),xe(a,()=>a.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,a){this.throwIfDisposed(),xe(this.gl,()=>this.gl.scissor(e,t,n,a))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(this.program==null)throw new Error("No GPU program is currently set.")}};function GP(e){let t=0;for(;t{let m=w.sizeFromShape(h.shapeInfo.logicalShape);h.shapeInfo.isUniform?r.push(`uniform float ${h.name}${m>1?`[${m}]`:""};`):(r.push(`uniform sampler2D ${h.name};`),r.push(`uniform int offset${h.name};`))});let s=r.join(` +`),i=e.map(h=>qP(h,t,a)).join(` +`),o=t.texShape,l=dn(),d=ZP(l),u,p,c=QP(l);return t.isPacked?(u=XP(t.logicalShape,o),p=JP(l)):(u=KP(t.logicalShape,o),p=YP(l)),a&&(c+=eL),[c,d,p,s,u,i,n].join(` +`)}function El(e){let t=e.shapeInfo.logicalShape;switch(t.length){case 0:return nL(e);case 1:return aL(e);case 2:return rL(e);case 3:return sL(e);case 4:return iL(e);case 5:return oL(e);case 6:return lL(e);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function iv(e){switch(e.shapeInfo.logicalShape.length){case 0:return uL(e);case 1:return dL(e);case 2:return pL(e);case 3:return cL(e);default:return hL(e)}}function qP(e,t,n=!1){let a="";n?a+=iv(e):a+=El(e);let r=e.shapeInfo.logicalShape,s=t.logicalShape;return r.length<=s.length&&(n?a+=fL(e,t):a+=mL(e,t)),a}function XP(e,t){switch(e.length){case 0:return ov();case 1:return AL(e,t);case 2:return xL(e,t);case 3:return yL(e,t);default:return gL(e,t)}}function KP(e,t){switch(e.length){case 0:return ov();case 1:return bL(e,t);case 2:return SL(e,t);case 3:return vL(e,t);case 4:return wL(e,t);case 5:return kL(e,t);case 6:return IL(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function ZP(e){return` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${e.texture2D}(textureSampler, uv).r; } - `}function GP(e){return` + `}function YP(e){return` void setOutput(float val) { ${e.output} = vec4(val, 0, 0, 0); } - `}function qP(e){return` + `}function JP(e){return` void setOutput(vec4 val) { ${e.output} = val; } - `}function XP(e){return`${e.version} + `}function QP(e){return`${e.version} precision highp float; precision highp int; precision highp sampler2D; @@ -331,10 +331,10 @@ Hi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To spee return fract((p3.x + p3.y) * p3.z); } - ${bL} - ${_L} - ${vL} - `}var bL=` + ${NL} + ${TL} + ${EL} + `}var NL=` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -346,7 +346,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,_L=` +`,TL=` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -354,7 +354,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,vL=` +`,EL=` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -363,7 +363,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,KP=` +`,eL=` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -374,11 +374,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float modCoord = mod(float(dim), 2.); return modCoord == 0. ? frag.r : frag.g; } -`;function i3(){return` +`;function ov(){return` int getOutputCoords() { return 0; } - `}function hL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` + `}function AL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?` int getOutputCoords() { return 2 * int(resultUV.x * ${n[1]}.0); } @@ -392,7 +392,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${n[0]}, ${n[1]})); return 2 * (resTexRC.x * ${n[1]} + resTexRC.y); } - `}function mL(e,t){return t[0]===1?` + `}function bL(e,t){return t[0]===1?` int getOutputCoords() { return int(resultUV.x * ${t[1]}.0); } @@ -406,21 +406,21 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${t[0]}, ${t[1]})); return resTexRC.x * ${t[1]} + resTexRC.y; } - `}function dL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2);return` + `}function yL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),r=a*Math.ceil(e[1]/2);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); int index = resTexRC.x * ${n[1]} + resTexRC.y; - int b = index / ${a}; - index -= b * ${a}; + int b = index / ${r}; + index -= b * ${r}; - int r = 2 * (index / ${r}); - int c = imod(index, ${r}) * 2; + int r = 2 * (index / ${a}); + int c = imod(index, ${a}) * 2; return ivec3(b, r, c); } - `}function AL(e,t){let n=ki(["r","c","d"],e);return` + `}function vL(e,t){let n=Ii(["r","c","d"],e);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -428,7 +428,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${n} return ivec3(r, c, d); } - `}function pL(e,t){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2),s=a,i="",o="b, r, c";for(let l=2;l=1?u="coords = 0;":u=o.map(A=>`coords.${h[A+c]} = 0;`).join(` -`);let d="";i<2&&s>0?d="coords":d=e.shapeInfo.logicalShape.map((A,y)=>`coords.${h[y+c]}`).join(", ");let p="return outputValue;",m=_.sizeFromShape(e.shapeInfo.logicalShape)===1,f=_.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)p=` + `}function fL(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=sv(e.shapeInfo.logicalShape,t.logicalShape),l=lt(i),d=i-s,u,p=["x","y","z","w","u","v"];s===0?u="":i<2&&o.length>=1?u="coords = 0;":u=o.map(A=>`coords.${p[A+d]} = 0;`).join(` +`);let c="";i<2&&s>0?c="coords":c=e.shapeInfo.logicalShape.map((A,y)=>`coords.${p[y+d]}`).join(", ");let h="return outputValue;",m=w.sizeFromShape(e.shapeInfo.logicalShape)===1,f=w.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` return vec4(outputValue.xy, outputValue.xy); - `;else if(m&&!f)i===1?p=` + `;else if(m&&!f)i===1?h=` return vec4(outputValue.x, outputValue.x, 0., 0.); - `:p=` + `:h=` return vec4(outputValue.x); - `;else if(o.length){let A=s-2,y=s-1;o.indexOf(A)>-1&&o.indexOf(y)>-1?p="return vec4(outputValue.x);":o.indexOf(A)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(y)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}return` - vec4 ${a}() { + `;else if(o.length){let A=s-2,y=s-1;o.indexOf(A)>-1&&o.indexOf(y)>-1?h="return vec4(outputValue.x);":o.indexOf(A)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(y)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}return` + vec4 ${r}() { ${l} coords = getOutputCoords(); ${u} - vec4 outputValue = get${r}(${d}); - ${p} + vec4 outputValue = get${a}(${c}); + ${h} } - `}function cL(e,t){let n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),a="get"+r+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&e.shapeInfo.flatOffset==null&&_.arraysEqual(i,s))return` - float ${a}() { + `}function mL(e,t){let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),r="get"+a+"AtOutCoords",s=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&e.shapeInfo.flatOffset==null&&w.arraysEqual(i,s))return` + float ${r}() { return sampleTexture(${n}, resultUV); } - `;let c=lt(l),u=a3(e.shapeInfo.logicalShape,t.logicalShape),h=l-o,d,p=["x","y","z","w","u","v"];o===0?d="":l<2&&u.length>=1?d="coords = 0;":d=u.map(f=>`coords.${p[f+h]} = 0;`).join(` -`);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,A)=>`coords.${p[A+h]}`).join(", "),` - float ${a}() { - ${c} coords = getOutputCoords(); - ${d} - return get${r}(${m}); + `;let d=lt(l),u=sv(e.shapeInfo.logicalShape,t.logicalShape),p=l-o,c,h=["x","y","z","w","u","v"];o===0?c="":l<2&&u.length>=1?c="coords = 0;":c=u.map(f=>`coords.${h[f+p]} = 0;`).join(` +`);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,A)=>`coords.${h[A+p]}`).join(", "),` + float ${r}() { + ${d} coords = getOutputCoords(); + ${c} + return get${a}(${m}); } - `}function lt(e){if(e<=1)return"int";if(e===2)return"ivec2";if(e===3)return"ivec3";if(e===4)return"ivec4";if(e===5)return"ivec5";if(e===6)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Cl(e,t){let n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Rl(e,t){return t.map(n=>e[n]).join(", ")}function kL(e,t,n,r){let a=t.userCode,s=n.map((p,m)=>{let f={logicalShape:p.shape,texShape:p.isUniform?null:p.texData.texShape,isUniform:p.isUniform,isPacked:p.isUniform?!1:p.texData.isPacked,flatOffset:null};return p.texData!=null&&p.texData.slice!=null&&p.texData.slice.flatOffset>0&&(f.flatOffset=p.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(p=>p.shapeInfo),o={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},l=ZP(s,o,a,t.packedInputs),c=e.createProgram(l),u=null,h=e.getUniformLocation(c,"NAN",!1);J().getNumber("WEBGL_VERSION")===1&&(u=e.getUniformLocation(c,"INFINITY",!1));let d={};for(let p=0;p{let a=n.logicalShape,s=t[r],i=s.shape;if(!_.arraysEqual(a,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${a} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,l=s.isUniform?null:s.texData.texShape;if(!_.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function IL(e,t,n,r,a){o3(t.inShapeInfos,n),o3([t.outShapeInfo],[r]);let s=r.texData.texture,i=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),J().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,l)=>{let c=t.program.variableNames[l],u=t.uniformLocations[c],h=t.uniformLocations[`offset${c}`];if(u!=null){if(o.isUniform){if(_.sizeFromShape(o.shape)<2)e.gl.uniform1f(u,o.uniformValues[0]);else{let d=o.uniformValues;d instanceof Float32Array||(d=new Float32Array(d)),e.gl.uniform1fv(u,d)}return}o.texData.slice!=null&&h!=null&&e.gl.uniform1i(h,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,u,l)}}),a!=null&&a(e,t.webGLProgram),e.executeProgram()}function SL(e,t,n){let r="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,l=i.isUniform?"uniform":i.texData.texShape;r+=`${i.shape}_${l}_${o}`});let a=e.userCode,s=e.constructor.name;return s+="_"+r+"_"+a,s}var{addImpl:NL,bincountImpl:l3,bincountReduceImpl:TL,ceilImpl:EL,concatImpl:CL,expImpl:RL,expm1Impl:ML,floorImpl:FL,gatherV2Impl:$L,greaterImpl:DL,lessImpl:OL,linSpaceImpl:zL,logImpl:PL,maxImpl:LL,maximumImpl:WL,minimumImpl:BL,multiplyImpl:VL,negImpl:jL,prodImpl:UL,rangeImpl:HL,rsqrtImpl:GL,simpleAbsImpl:u3,sliceImpl:qL,sparseReshapeImpl:XL,stridedSliceImpl:KL,subImpl:ZL,tileImpl:YL,topKImpl:JL,transposeImpl:dA,uniqueImpl:QL}=Wm;function c3(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function hn(e,t){return t===1?[e]:c3(e,t)}function eW(e,t){if(e===1)return"rc";let n="";for(let r=0;re[n]).join(", ")}function CL(e,t,n,a){let r=t.userCode,s=n.map((h,m)=>{let f={logicalShape:h.shape,texShape:h.isUniform?null:h.texData.texShape,isUniform:h.isUniform,isPacked:h.isUniform?!1:h.texData.isPacked,flatOffset:null};return h.texData!=null&&h.texData.slice!=null&&h.texData.slice.flatOffset>0&&(f.flatOffset=h.texData.slice.flatOffset),{name:t.variableNames[m],shapeInfo:f}}),i=s.map(h=>h.shapeInfo),o={logicalShape:a.shape,texShape:a.texData.texShape,isUniform:!1,isPacked:a.texData.isPacked,flatOffset:null},l=tL(s,o,r,t.packedInputs),d=e.createProgram(l),u=null,p=e.getUniformLocation(d,"NAN",!1);J().getNumber("WEBGL_VERSION")===1&&(u=e.getUniformLocation(d,"INFINITY",!1));let c={};for(let h=0;h{let r=n.logicalShape,s=t[a],i=s.shape;if(!w.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(n.isUniform&&s.isUniform)return;let o=n.texShape,l=s.isUniform?null:s.texData.texShape;if(!w.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function RL(e,t,n,a,r){lv(t.inShapeInfos,n),lv([t.outShapeInfo],[a]);let s=a.texData.texture,i=a.texData.texShape;a.texData.isPacked?e.setOutputPackedMatrixTexture(s,i[0],i[1]):e.setOutputMatrixTexture(s,i[0],i[1]),e.setProgram(t.webGLProgram),J().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,Infinity),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach((o,l)=>{let d=t.program.variableNames[l],u=t.uniformLocations[d],p=t.uniformLocations[`offset${d}`];if(u!=null){if(o.isUniform){if(w.sizeFromShape(o.shape)<2)e.gl.uniform1f(u,o.uniformValues[0]);else{let c=o.uniformValues;c instanceof Float32Array||(c=new Float32Array(c)),e.gl.uniform1fv(u,c)}return}o.texData.slice!=null&&p!=null&&e.gl.uniform1i(p,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture,u,l)}}),r!=null&&r(e,t.webGLProgram),e.executeProgram()}function ML(e,t,n){let a="";t.concat(n).forEach(i=>{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0,l=i.isUniform?"uniform":i.texData.texShape;a+=`${i.shape}_${l}_${o}`});let r=e.userCode,s=e.constructor.name;return s+="_"+a+"_"+r,s}var{addImpl:FL,bincountImpl:uv,bincountReduceImpl:$L,ceilImpl:DL,concatImpl:OL,expImpl:zL,expm1Impl:_L,floorImpl:PL,gatherV2Impl:LL,greaterImpl:WL,lessImpl:BL,linSpaceImpl:VL,logImpl:jL,maxImpl:UL,maximumImpl:HL,minimumImpl:GL,multiplyImpl:qL,negImpl:XL,prodImpl:KL,rangeImpl:ZL,rsqrtImpl:YL,simpleAbsImpl:dv,sliceImpl:JL,sparseReshapeImpl:QL,stridedSliceImpl:eW,subImpl:tW,tileImpl:nW,topKImpl:aW,transposeImpl:c1,uniqueImpl:rW}=WA;function pv(e,t){return["x","y","z","w","u","v"].slice(0,t).map(n=>`${e}.${n}`)}function pn(e,t){return t===1?[e]:pv(e,t)}function sW(e,t){if(e===1)return"rc";let n="";for(let a=0;a ${t[0]}`;let r="";for(let a=e-2;a= ${t[a]}`,a ${t[0]}`;let a="";for(let r=e-2;r= ${t[r]}`,r= ${t}; bool rEdge = rp1 >= ${n}; - `}function rW(e,t){let n=e.length,r=sW(n,t);return n===1?`getA(rc), + `}function lW(e,t){let n=e.length,a=dW(n,t);return n===1?`getA(rc), rc + 1 >= ${e[0]} ? 0. : getA(rc + 1), - 0, 0`:`getA(${r[0]}), - cEdge ? 0. : getA(${r[1]}), - rEdge ? 0. : getA(${r[2]}), - rEdge || cEdge ? 0. : getA(${r[3]})`}var h3=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let r=0;r<4;r++){let a="thisRC = rc;";r%2==1&&(a+="thisRC.z += 1;"),r>1&&(a+="thisRC.y += 1;"),n+=` - ${a} - ${r>0?"if(thisRC.y < rows && thisRC.z < cols){":""} + 0, 0`:`getA(${a[0]}), + cEdge ? 0. : getA(${a[1]}), + rEdge ? 0. : getA(${a[2]}), + rEdge || cEdge ? 0. : getA(${a[3]})`}var cv=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let n="";for(let a=0;a<4;a++){let r="thisRC = rc;";a%2==1&&(r+="thisRC.z += 1;"),a>1&&(r+="thisRC.y += 1;"),n+=` + ${r} + ${a>0?"if(thisRC.y < rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); - result[${r}] = + result[${a}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); - ${r>0?"}":""} + ${a>0?"}":""} `}this.userCode=` - ${iW(t)} - ${iA(e)} + ${pW(t)} + ${i1(e)} void main() { ivec3 rc = getOutputCoords(); @@ -876,12 +876,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function iW(e){return` + `}};function pW(e){return` ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${ki(["r","c","d"],e)} + ${Ii(["r","c","d"],e)} return ivec3(r, c, d); } - `}var oW=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let r=p3(t,n),a=f3(e,r,n);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);let s=d3(e,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[a].shift();return this.usedTextures[a].push(o),o}let i;return r===Qt.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):r===Qt.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):r===Qt.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===Qt.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===Qt.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,r){if(this.freeTextures==null)return;let a=p3(n,r),s=f3(t,a,r);s in this.freeTextures||(this.freeTextures[s]=[]);let i=d3(t,a,this.gpgpu.gl,this.gpgpu.textureConfig,r),o=J().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],c=l.indexOf(e);if(c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(c,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function lW(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function d3(e,t,n,r,a){let s=uW(t,r),i;if(a){let[l,c]=Nl(e[0],e[1]);i=l*c}else{let[l,c]=hc(e[0],e[1]);i=l*c}let o=lW(n,s);return i*o}function uW(e,t){switch(e){case Qt.PACKED_2X2_FLOAT32:return cA(t);case Qt.PACKED_2X2_FLOAT16:return hA(t);case Qt.UNPACKED_FLOAT32:return oA(t);case Qt.UNPACKED_FLOAT16:return lA(t);case Qt.PACKED_4X1_UNSIGNED_BYTE:return uA(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function cW(e){return J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Qt.PACKED_2X2_FLOAT32:Qt.UNPACKED_FLOAT32:e?Qt.PACKED_2X2_FLOAT16:Qt.UNPACKED_FLOAT16}function p3(e,t){if(e===Jn.UPLOAD)return Qt.PACKED_2X2_FLOAT32;if(e===Jn.RENDER||e==null)return cW(t);if(e===Jn.DOWNLOAD||e===Jn.PIXELS)return Qt.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function f3(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Wa=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}var cW=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,n){let a=fv(t,n),r=mv(e,a,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=hv(e,a,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].shift();return this.usedTextures[r].push(o),o}let i;return a===Qt.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):a===Qt.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):a===Qt.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):a===Qt.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):a===Qt.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),i}releaseTexture(e,t,n,a){if(this.freeTextures==null)return;let r=fv(n,a),s=mv(t,r,a);s in this.freeTextures||(this.freeTextures[s]=[]);let i=hv(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,a),o=J().get("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],d=l.indexOf(e);if(d<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(d,1),this.log()}log(){if(!this.logEnabled)return;let e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);let t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(this.freeTextures!=null){for(let e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function hW(e,t){let n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F||t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error(`Unknown internal format ${t}`)}function hv(e,t,n,a,r){let s=fW(t,a),i;if(r){let[l,d]=Tl(e[0],e[1]);i=l*d}else{let[l,d]=pd(e[0],e[1]);i=l*d}let o=hW(n,s);return i*o}function fW(e,t){switch(e){case Qt.PACKED_2X2_FLOAT32:return d1(t);case Qt.PACKED_2X2_FLOAT16:return p1(t);case Qt.UNPACKED_FLOAT32:return o1(t);case Qt.UNPACKED_FLOAT16:return l1(t);case Qt.PACKED_4X1_UNSIGNED_BYTE:return u1(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function mW(e){return J().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Qt.PACKED_2X2_FLOAT32:Qt.UNPACKED_FLOAT32:e?Qt.PACKED_2X2_FLOAT16:Qt.UNPACKED_FLOAT16}function fv(e,t){if(e===Jn.UPLOAD)return Qt.PACKED_2X2_FLOAT32;if(e===Jn.RENDER||e==null)return mW(t);if(e===Jn.DOWNLOAD||e===Jn.PIXELS)return Qt.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function mv(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}var Pr=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode=` float unaryOperation(float x) { ${t} } @@ -892,11 +892,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},wr="if (isnan(x)) return x;",hW="return x;",m3="return abs(x);",dW="return (x >= 0.0) ? x : (exp(x) - 1.0);",pW=wr+` + `}},ba="if (isnan(x)) return x;",AW="return x;",Av="return abs(x);",yW="return (x >= 0.0) ? x : (exp(x) - 1.0);",gW=ba+` return (x < 0.0) ? 0.0 : x; -`,fW=wr+` +`,xW=ba+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,fp="return x;",mW="return 1.0 / (1.0 + exp(-1.0 * x));",AW="return x;",yW=` +`,fh="return x;",bW="return 1.0 / (1.0 + exp(-1.0 * x));",vW="return x;",wW=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -905,7 +905,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,gW=` +`,kW=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -915,7 +915,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,xW=` +`,IW=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -925,7 +925,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,wW="return 1.0 / (1.0 + exp(-1.0 * x));",Ml=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` +`,SW="return 1.0 / (1.0 + exp(-1.0 * x));",Fl=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` vec4 unaryOperation(vec4 x) { ${t} } @@ -936,17 +936,17 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},bW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=hn("rc",t),r=lt(t),a=eW(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` + `}},NW=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e;let t=e.length,n=pn("rc",t),a=lt(t),r=sW(t,n),s=n.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` void main() { - ${r} rc = getOutputCoords(); - vec4 packedInput = getA(${a}); + ${a} rc = getOutputCoords(); + vec4 packedInput = getA(${r}); setOutput(getChannel(packedInput, ${i})); } - `}},_W=Wr.whereImpl,vW=1e-7,kW=1e-4,pA={};function IW(e){return e in pA||(pA[e]={}),pA[e]}var SW=128,NW=600;function TW(){return J().global.screen==null?1024:J().global.screen.height*J().global.screen.width*window.devicePixelRatio*NW/1024/1024}var Fl=class extends cu{constructor(e){super();if(this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!J().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Vr(J().getNumber("WEBGL_VERSION"));this.binaryCache=IW(J().getNumber("WEBGL_VERSION")),this.gpgpu=new pp(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new oW(this.gpgpu),this.numMBBeforeWarning=TW(),this.texData=new _h(this,aa())}nextDataId(){return Fl.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((J().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||J().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let r={id:this.nextDataId()};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:Jn.UPLOAD,refCount:1}),r}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,r,a){if(J().getBool("DEBUG")&&this.checkNumericalProblems(t),r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:Jn.UPLOAD,refCount:a})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:r,complexTensorInfos:a,slice:s,shape:i,isPacked:o}=t;if(s!=null){let h;o?h=new Ml(i,fp):h=new Wa(i,fp);let d=this.runWebGLProgram(h,[{dataId:e,shape:i,dtype:r}],r),p=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),p}if(n!=null)return this.convertAndCacheOnCPU(e);if(r==="string")return n;let l=this.activeTimers!=null,c;l&&(c=_.now());let u;if(r==="complex64"){let h=this.readSync(a.real.dataId),d=this.readSync(a.imag.dataId);u=E.mergeRealAndImagArrays(h,d)}else u=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=_.now()-c),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){let p=this.pendingRead.get(e);return new Promise(m=>p.push(m))}let t=this.texData.get(e),{values:n,shape:r,slice:a,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(a!=null){let p;o?p=new Ml(r,fp):p=new Wa(r,fp);let m=this.runWebGLProgram(p,[{dataId:e,shape:r,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!J().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&J().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,c;if(s!=="complex64"&&J().get("WEBGL_BUFFER_SUPPORTED")){c=this.decode(e);let p=this.texData.get(c.dataId);l=this.gpgpu.createBufferFromTexture(p.texture,...dc(r))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let u;if(s==="complex64"){let p=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=p[0],f=p[1];u=E.mergeRealAndImagArrays(m,f)}else if(l==null)u=this.getValuesFromTexture(e);else{let p=_.sizeFromShape(r);u=this.gpgpu.downloadFloat32MatrixFromBuffer(l,p)}c!=null&&this.disposeIntermediateTensorInfo(c);let h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(p=>p(h)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&aa().removeDataId(e,this),this.pendingDeletes--),h}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(r=>_.decodeString(r))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,e();let a=_.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=_.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,r&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(a);i.kernelMs=_.sum(o),i.getExtraProfileInfo=()=>o.map((l,c)=>({name:s[c],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:_.now(),endMs:null}}endTimer(e){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=_.now(),e)}async getQueryTime(e){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:r,usage:a,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(t,r,a,s)));let c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=SW){return J().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&_.sizeFromShape(n.shape)0&&_.isString(n[0])){let a=n.map(s=>_.encodeString(s));r=this.write(a,e,t)}else r=this.write(n,e,t);return this.texData.get(r).usage=null,{dataId:r,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:r}=this.makeTensorInfo(e,t,n);return aa().makeTensorFromDataId(r,e,t,this)}unpackTensor(e){let t=new bW(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new aW(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[bi(e.shape),..._i(e.shape)],r={dtype:e.dtype,shape:n,dataId:e.dataId},a=[bi(t),..._i(t)],s=new h3(a,n),i=!0,o=this.runWebGLProgram(s,[r],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:r,dtype:a}=t,s=lp(r),i;n?i=new OP(s):i=new DP(s);let o=!0,l=this.runWebGLProgram(i,[{shape:s,dtype:a,dataId:e}],a,null,o);return{dtype:a,shape:r,dataId:l.dataId}}runWebGLProgram(e,t,n,r,a=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===cc.DENSE){let f=dc(e.outputShape);i.texShape=f.map(A=>A*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),_.sizeFromShape(s.shape)===0)return i.values=_.getTypedArrayFromDType(s.dtype,0),s;let o=[],l=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let A=this.texData.get(f.dataId);if(A.texture==null){if(!e.packedInputs&&_.sizeFromShape(f.shape)<=J().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:A.values};e.packedInputs&&(A.isPacked=!0,A.shape=f.shape)}else if(!!A.isPacked!=!!e.packedInputs)f=A.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),A=this.texData.get(f.dataId);else if(A.isPacked&&!uc(A.shape,f.shape)){let y=f,g=f.shape;f.shape=A.shape,f=this.packedReshape(f,g),o.push(f),A=this.texData.get(f.dataId),y.shape=g}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:A,isUniform:!1}});this.uploadToGPU(s.dataId);let c={shape:s.shape,texData:i,isUniform:!1},u=SL(e,l,c),h=this.getAndSaveBinary(u,()=>kL(this.gpgpu,e,l,c)),d=this.activeTimers!=null,p;d&&(p=this.startTimer()),IL(this.gpgpu,h,l,c,r),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),d&&(p=this.endTimer(p),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(p)}));let m=J().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=_.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!J().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&a===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,r,a=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,r,a)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(J().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=L(()=>{if(!J().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=J().getBool("DEBUG");J().set("DEBUG",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(J().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?vW:kW}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:r,values:a,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let l=this.activeTimers!=null,c;l&&(c=_.now());let u=t.texShape;if(u==null&&(u=M_(n,o),t.texShape=u),a!=null){let h=lp(n),d,p=u[1],m=u[0],f=a instanceof Uint8Array;o?([p,m]=Nl(u[0],u[1]),d=new WP(h,[m,p],f)):d=new LP(h,[m,p],f);let A=this.makeTensorInfo([m,p],r);f?this.texData.get(A.dataId).usage=Jn.PIXELS:this.texData.get(A.dataId).usage=Jn.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(A.dataId),p,m,a);let y=!0,g=this.runWebGLProgram(d,[A],r,null,y),x=this.texData.get(g.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(A),this.texData.delete(g.dataId),t.values=null,l&&(this.uploadWaitMs+=_.now()-c)}else{let h=this.acquireTexture(u,i,r,o);t.texture=h}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:r}=n;return this.releaseGPUData(e),t!=null&&(n.values=EW(t,r)),n.values}acquireTexture(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let a=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${a} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,r)}computeBytes(e,t){return e[0]*e[1]*_.bytesPerElement(t)}};Fl.nextDataId=0;function EW(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let r=0;rnew Fl,2);var CW={forceHalfFloat:y3},g3=` + `}},TW=Wa.whereImpl,EW=1e-7,CW=1e-4,h1={};function RW(e){return e in h1||(h1[e]={}),h1[e]}var MW=128,FW=600;function $W(){return J().global.screen==null?1024:J().global.screen.height*J().global.screen.width*window.devicePixelRatio*FW/1024/1024}var $l=class extends du{constructor(e){super();if(this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!J().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){let t=Va(J().getNumber("WEBGL_VERSION"));this.binaryCache=RW(J().getNumber("WEBGL_VERSION")),this.gpgpu=new hh(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new cW(this.gpgpu),this.numMBBeforeWarning=$W(),this.texData=new wp(this,nr())}nextDataId(){return $l.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(e,t,n){if((J().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||J().getBool("DEBUG"))&&this.checkNumericalProblems(e),n==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let a={id:this.nextDataId()};return this.texData.set(a,{shape:t,dtype:n,values:e,usage:Jn.UPLOAD,refCount:1}),a}refCount(e){return this.texData.has(e)?this.texData.get(e).refCount:0}incRef(e){let t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){let t=this.texData.get(e);t.refCount--}}move(e,t,n,a,r){if(J().getBool("DEBUG")&&this.checkNumericalProblems(t),a==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:a,values:t,usage:Jn.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:n,dtype:a,complexTensorInfos:r,slice:s,shape:i,isPacked:o}=t;if(s!=null){let p;o?p=new Fl(i,fh):p=new Pr(i,fh);let c=this.runWebGLProgram(p,[{dataId:e,shape:i,dtype:a}],a),h=this.readSync(c.dataId);return this.disposeIntermediateTensorInfo(c),h}if(n!=null)return this.convertAndCacheOnCPU(e);if(a==="string")return n;let l=this.activeTimers!=null,d;l&&(d=w.now());let u;if(a==="complex64"){let p=this.readSync(r.real.dataId),c=this.readSync(r.imag.dataId);u=C.mergeRealAndImagArrays(p,c)}else u=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=w.now()-d),this.convertAndCacheOnCPU(e,u)}async read(e){if(this.pendingRead.has(e)){let h=this.pendingRead.get(e);return new Promise(m=>h.push(m))}let t=this.texData.get(e),{values:n,shape:a,slice:r,dtype:s,complexTensorInfos:i,isPacked:o}=t;if(r!=null){let h;o?h=new Fl(a,fh):h=new Pr(a,fh);let m=this.runWebGLProgram(h,[{dataId:e,shape:a,dtype:s}],s),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(n!=null)return this.convertAndCacheOnCPU(e);if(!J().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&J().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,d;if(s!=="complex64"&&J().get("WEBGL_BUFFER_SUPPORTED")){d=this.decode(e);let h=this.texData.get(d.dataId);l=this.gpgpu.createBufferFromTexture(h.texture,...cd(a))}this.pendingRead.set(e,[]),s!=="complex64"&&await this.gpgpu.createAndWaitForFence();let u;if(s==="complex64"){let h=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),m=h[0],f=h[1];u=C.mergeRealAndImagArrays(m,f)}else if(l==null)u=this.getValuesFromTexture(e);else{let h=w.sizeFromShape(a);u=this.gpgpu.downloadFloat32MatrixFromBuffer(l,h)}d!=null&&this.disposeIntermediateTensorInfo(d);let p=this.convertAndCacheOnCPU(e,u),c=this.pendingRead.get(e);return this.pendingRead.delete(e),c.forEach(h=>h(p)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&nr().removeDataId(e,this),this.pendingDeletes--),p}bufferSync(e){let t=this.readSync(e.dataId),n=t;if(e.dtype==="string")try{n=t.map(a=>w.decodeString(a))}catch(a){throw new Error("Failed to decode encoded string bytes into utf-8")}return We(e.shape,e.dtype,n)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}async time(e){let t=this.activeTimers,n=[],a=!1;this.programTimersStack==null?(this.programTimersStack=n,a=!0):this.activeTimers.push(n),this.activeTimers=n,e();let r=w.flatten(this.activeTimers.map(o=>o.query)).filter(o=>o!=null),s=w.flatten(this.activeTimers.map(o=>o.name)).filter(o=>o!=null);this.activeTimers=t,a&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let o=await Promise.all(r);i.kernelMs=w.sum(o),i.getExtraProfileInfo=()=>o.map((l,d)=>({name:s[d],ms:l})).map(l=>`${l.name}: ${l.ms}`).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:w.now(),endMs:null}}endTimer(e){return J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=w.now(),e)}async getQueryTime(e){if(J().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);let t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);let{complexTensorInfos:n}=this.texData.get(e);return n!=null&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:n,texShape:a,usage:r,isPacked:s,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),t!=null&&(this.numBytesInGPU-=this.computeBytes(a,n),this.textureManager.releaseTexture(t,a,r,s)));let d=this.texData.get(e);d.texture=null,d.texShape=null,d.isPacked=!1,d.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=MW){return J().getBool("WEBGL_CPU_FORWARD")&&e.every(n=>this.texData.get(n.dataId).texture==null&&w.sizeFromShape(n.shape)0&&w.isString(n[0])){let r=n.map(s=>w.encodeString(s));a=this.write(r,e,t)}else a=this.write(n,e,t);return this.texData.get(a).usage=null,{dataId:a,shape:e,dtype:t}}makeOutput(e,t,n){let{dataId:a}=this.makeTensorInfo(e,t,n);return nr().makeTensorFromDataId(a,e,t,this)}unpackTensor(e){let t=new NW(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new uW(e.shape),n=!0;return this.runWebGLProgram(t,[e],e.dtype,null,n)}packedReshape(e,t){let n=[vi(e.shape),...wi(e.shape)],a={dtype:e.dtype,shape:n,dataId:e.dataId},r=[vi(t),...wi(t)],s=new cv(r,n),i=!0,o=this.runWebGLProgram(s,[a],e.dtype,null,i);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e){let t=this.texData.get(e),{isPacked:n,shape:a,dtype:r}=t,s=lh(a),i;n?i=new BP(s):i=new WP(s);let o=!0,l=this.runWebGLProgram(i,[{shape:s,dtype:r,dataId:e}],r,null,o);return{dtype:r,shape:a,dataId:l.dataId}}runWebGLProgram(e,t,n,a,r=!1){let s=this.makeTensorInfo(e.outputShape,n),i=this.texData.get(s.dataId);if(e.packedOutput&&(i.isPacked=!0),e.outPackingScheme===dd.DENSE){let f=cd(e.outputShape);i.texShape=f.map(A=>A*2)}if(e.outTexUsage!=null&&(i.usage=e.outTexUsage),w.sizeFromShape(s.shape)===0)return i.values=w.getTypedArrayFromDType(s.dtype,0),s;let o=[],l=t.map(f=>{if(f.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let A=this.texData.get(f.dataId);if(A.texture==null){if(!e.packedInputs&&w.sizeFromShape(f.shape)<=J().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:f.shape,texData:null,isUniform:!0,uniformValues:A.values};e.packedInputs&&(A.isPacked=!0,A.shape=f.shape)}else if(!!A.isPacked!=!!e.packedInputs)f=A.isPacked?this.unpackTensor(f):this.packTensor(f),o.push(f),A=this.texData.get(f.dataId);else if(A.isPacked&&!ud(A.shape,f.shape)){let y=f,g=f.shape;f.shape=A.shape,f=this.packedReshape(f,g),o.push(f),A=this.texData.get(f.dataId),y.shape=g}return this.uploadToGPU(f.dataId),{shape:f.shape,texData:A,isUniform:!1}});this.uploadToGPU(s.dataId);let d={shape:s.shape,texData:i,isUniform:!1},u=ML(e,l,d),p=this.getAndSaveBinary(u,()=>CL(this.gpgpu,e,l,d)),c=this.activeTimers!=null,h;c&&(h=this.startTimer()),RL(this.gpgpu,p,l,d,a),o.forEach(f=>this.disposeIntermediateTensorInfo(f)),c&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let m=J().get("WEBGL_FLUSH_THRESHOLD");if(m>0){let f=w.now();f-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=f)}if(!J().getBool("WEBGL_LAZILY_UNPACK")&&i.isPacked&&r===!1){let f=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),f}return s}compileAndRun(e,t,n,a,r=!1){return n=n||t[0].dtype,this.runWebGLProgram(e,t,n,a,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(J().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement!="undefined"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=L(()=>{if(!J().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=J().getBool("DEBUG");J().set("DEBUG",!1);let t=this.abs(Ie(1e-8)).dataSync()[0];if(J().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?EW:CW}uploadToGPU(e){let t=this.texData.get(e),{shape:n,dtype:a,values:r,texture:s,usage:i,isPacked:o}=t;if(s!=null)return;let l=this.activeTimers!=null,d;l&&(d=w.now());let u=t.texShape;if(u==null&&(u=$7(n,o),t.texShape=u),r!=null){let p=lh(n),c,h=u[1],m=u[0],f=r instanceof Uint8Array;o?([h,m]=Tl(u[0],u[1]),c=new HP(p,[m,h],f)):c=new UP(p,[m,h],f);let A=this.makeTensorInfo([m,h],a);f?this.texData.get(A.dataId).usage=Jn.PIXELS:this.texData.get(A.dataId).usage=Jn.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(A.dataId),h,m,r);let y=!0,g=this.runWebGLProgram(c,[A],a,null,y),x=this.texData.get(g.dataId);t.texture=x.texture,t.texShape=x.texShape,t.isPacked=x.isPacked,t.usage=x.usage,this.disposeIntermediateTensorInfo(A),this.texData.delete(g.dataId),t.values=null,l&&(this.uploadWaitMs+=w.now()-d)}else{let p=this.acquireTexture(u,i,a,o);t.texture=p}}convertAndCacheOnCPU(e,t){let n=this.texData.get(e),{dtype:a}=n;return this.releaseGPUData(e),t!=null&&(n.values=DW(t,a)),n.values}acquireTexture(e,t,n,a){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let r=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${r} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,a)}computeBytes(e,t){return e[0]*e[1]*w.bytesPerElement(t)}};$l.nextDataId=0;function DW(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let n=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let a=0;anew $l,2);var OW={forceHalfFloat:gv},xv=` if (isnan(a)) return a; if (isnan(b)) return b; -`,$l=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=E.assertAndGetBroadcastShape(t,n),this.userCode=` +`,Dl=class{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,n),this.userCode=` float binaryOperation(float a, float b) { ${e} } @@ -956,26 +956,26 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float b = getBAtOutCoords(); setOutput(binaryOperation(a, b)); } - `}},mp=` + `}},mh=` result.r = isNaN.r > 0. ? NAN : result.r; result.g = isNaN.g > 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`,fc=class{constructor(e,t,n,r=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=E.assertAndGetBroadcastShape(t,n);let a=this.outputShape.length,s="";if(r)if(a===0||_.sizeFromShape(this.outputShape)===1)s=` +`,fd=class{constructor(e,t,n,a=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=C.assertAndGetBroadcastShape(t,n);let r=this.outputShape.length,s="";if(a)if(r===0||w.sizeFromShape(this.outputShape)===1)s=` result.y = 0.; result.z = 0.; result.w = 0.; `;else if(s=` - ${lt(a)} coords = getOutputCoords(); - `,a===1)s+=` + ${lt(r)} coords = getOutputCoords(); + `,r===1)s+=` result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; result.z = 0.; result.w = 0.; - `;else{let i=hn("coords",a);s+=` + `;else{let i=pn("coords",r);s+=` bool nextRowOutOfBounds = - (${i[a-2]} + 1) >= ${this.outputShape[a-2]}; + (${i[r-2]} + 1) >= ${this.outputShape[r-2]}; bool nextColOutOfBounds = - (${i[a-1]} + 1) >= ${this.outputShape[a-1]}; + (${i[r-1]} + 1) >= ${this.outputShape[r-1]}; result.y = nextColOutOfBounds ? 0. : result.y; result.z = nextRowOutOfBounds ? 0. : result.z; result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; @@ -993,21 +993,21 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Pn(e){let{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var RW={kernelName:vs,backendName:"webgl",kernelFunc:Pn};function Ba(e){let{inputs:t,backend:n}=e,{real:r,imag:a}=t,s=n.makeTensorInfo(r.shape,"complex64"),i=n.texData.get(s.dataId),o=Pn({inputs:{x:r},backend:n}),l=Pn({inputs:{x:a},backend:n});return i.complexTensorInfos={real:o,imag:l},s}var MW={kernelName:Eh,backendName:"webgl",kernelFunc:Ba},x3="return (a < 0.) ? b * a : a;",w3=` + `}};function Pn(e){let{inputs:t,backend:n}=e,{x:a}=t;return n.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var zW={kernelName:ks,backendName:"webgl",kernelFunc:Pn};function Lr(e){let{inputs:t,backend:n}=e,{real:a,imag:r}=t,s=n.makeTensorInfo(a.shape,"complex64"),i=n.texData.get(s.dataId),o=Pn({inputs:{x:a},backend:n}),l=Pn({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:l},s}var _W={kernelName:Cp,backendName:"webgl",kernelFunc:Lr},bv="return (a < 0.) ? b * a : a;",vv=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function FW(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{alpha:s}=r,i=n.makeTensorInfo([],"float32",_.createScalarValue(s,"float32")),o=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(w3,a.shape,i.shape):new $l(x3,a.shape,i.shape),l=n.runWebGLProgram(o,[a,i],a.dtype);return n.disposeIntermediateTensorInfo(i),l}var $W={kernelName:ks,backendName:"webgl",kernelFunc:FW},b3="return (a < 0.) ? b * a : a;",_3=` +`;function PW(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{alpha:s}=a,i=n.makeTensorInfo([],"float32",w.createScalarValue(s,"float32")),o=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd(vv,r.shape,i.shape):new Dl(bv,r.shape,i.shape),l=n.runWebGLProgram(o,[r,i],r.dtype);return n.disposeIntermediateTensorInfo(i),l}var LW={kernelName:Is,backendName:"webgl",kernelFunc:PW},wv="return (a < 0.) ? b * a : a;",kv=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function DW(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(_3,r.shape,a.shape):new $l(b3,r.shape,a.shape);return n.runWebGLProgram(s,[r,a],r.dtype)}var OW={kernelName:zs,backendName:"webgl",kernelFunc:DW},v3="if (isnan(x)) return x;",zW=` +`;function WW(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd(kv,a.shape,r.shape):new Dl(wv,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)}var BW={kernelName:_s,backendName:"webgl",kernelFunc:WW},Iv="if (isnan(x)) return x;",VW=` if (isnan(a)) return a; if (isnan(b)) return b; -`,PW=` +`,jW=` result.r = isNaN.r > 0. ? NAN : result.r; result.g = isNaN.g > 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`;function qe({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:r}){return({inputs:a,backend:s})=>{let{x:i}=a,o=s,l=r||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let h=o.texData.get(i.dataId),d=n(h.values,l);return o.makeTensorInfo(i.shape,l,d)}let c=J().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,u;return c?u=new Ml(i.shape,t):u=new Wa(i.shape,e),o.runWebGLProgram(u,[i],l)}}function en({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:r=!1,cpuKernelImpl:a,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:c}=i,u=o;if(r&&l.dtype==="complex64"){let m=u.texData.get(l.dataId),f=u.texData.get(c.dataId),[A,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[v,w]=x,b={dataId:v.dataId,dtype:v.dtype,shape:l.shape},k={dataId:w.dataId,dtype:w.dtype,shape:c.shape},N=new $l(e,l.shape,c.shape);return u.runWebGLProgram(N,[b,k],ir(v.dtype,w.dtype))}),g=Ba({inputs:{real:A,imag:y},backend:u});return u.disposeIntermediateTensorInfo(A),u.disposeIntermediateTensorInfo(y),g}let h=s||ir(l.dtype,c.dtype);if(u.shouldExecuteOnCPU([l,c])&&a!=null){let m=u.texData.get(l.dataId),f=u.texData.get(c.dataId),[A,y]=a(l.shape,c.shape,m.values,f.values,h),g=u.makeTensorInfo(y,h),x=u.texData.get(g.dataId);return x.values=A,g}let d=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,p;return d?p=new fc(t,l.shape,c.shape,n):p=new $l(e,l.shape,c.shape),u.runWebGLProgram(p,[l,c],h)}}function Ap(e,t=!1){if(e==="linear")return t?AW:hW;if(e==="relu")return t?gW:pW;if(e==="elu")return t?yW:dW;if(e==="relu6")return t?xW:fW;if(e==="prelu")return t?_3:b3;if(e==="leakyrelu")return t?w3:x3;if(e==="sigmoid")return t?wW:mW;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var k3=class{constructor(e,t,n,r=!1,a=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let c=r?e[1]:e[2],u=Math.ceil(c/2),h=r?"i * 2, rc.y":"rc.y, i * 2",d=a?"rc.z, i * 2":"i * 2, rc.z",p=r?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=a?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",A="";i&&(o?f=`vec4 activation(vec4 a) { +`;function qe({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:a}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,l=a||i.dtype;if(o.shouldExecuteOnCPU([i])&&n!=null){let p=o.texData.get(i.dataId),c=n(p.values,l);return o.makeTensorInfo(i.shape,l,c)}let d=J().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,u;return d?u=new Fl(i.shape,t):u=new Pr(i.shape,e),o.runWebGLProgram(u,[i],l)}}function en({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:a=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:d}=i,u=o;if(a&&l.dtype==="complex64"){let m=u.texData.get(l.dataId),f=u.texData.get(d.dataId),[A,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(x=>{let[k,b]=x,v={dataId:k.dataId,dtype:k.dtype,shape:l.shape},I={dataId:b.dataId,dtype:b.dtype,shape:d.shape},T=new Dl(e,l.shape,d.shape);return u.runWebGLProgram(T,[v,I],ia(k.dtype,b.dtype))}),g=Lr({inputs:{real:A,imag:y},backend:u});return u.disposeIntermediateTensorInfo(A),u.disposeIntermediateTensorInfo(y),g}let p=s||ia(l.dtype,d.dtype);if(u.shouldExecuteOnCPU([l,d])&&r!=null){let m=u.texData.get(l.dataId),f=u.texData.get(d.dataId),[A,y]=r(l.shape,d.shape,m.values,f.values,p),g=u.makeTensorInfo(y,p),x=u.texData.get(g.dataId);return x.values=A,g}let c=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return c?h=new fd(t,l.shape,d.shape,n):h=new Dl(e,l.shape,d.shape),u.runWebGLProgram(h,[l,d],p)}}function Ah(e,t=!1){if(e==="linear")return t?vW:AW;if(e==="relu")return t?kW:gW;if(e==="elu")return t?wW:yW;if(e==="relu6")return t?IW:xW;if(e==="prelu")return t?kv:wv;if(e==="leakyrelu")return t?vv:bv;if(e==="sigmoid")return t?SW:bW;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var Sv=class{constructor(e,t,n,a=!1,r=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;let d=a?e[1]:e[2],u=Math.ceil(d/2),p=a?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",h=a?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",A="";i&&(o?f=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} }`:l?f=`vec4 activation(vec4 a) { @@ -1025,13 +1025,13 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, for (int i = 0; i < ${u}; i++) { int batchA = ${g}; int batchB = ${x}; - vec4 a = getMatrixA(batchA, ${h}); - vec4 b = getMatrixB(batchB, ${d}); + vec4 a = getMatrixA(batchA, ${p}); + vec4 b = getMatrixB(batchB, ${c}); // These swizzled products need to be separately added. // See: https://github.com/tensorflow/tfjs/issues/1735 - result += (${p[0]} * ${m[0]}); - result += (${p[1]} * ${m[1]}); + result += (${h[0]} * ${m[0]}); + result += (${h[1]} * ${m[1]}); } return result; } @@ -1046,7 +1046,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}},I3={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"},S3=class{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=E.assertAndGetBroadcastShape(t,n),this.userCode=` + `}},Nv={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"},Tv=class{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=C.assertAndGetBroadcastShape(t,n),this.userCode=` float binaryOpComplex( float areal, float aimag, float breal, float bimag) { ${e} @@ -1059,15 +1059,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float bimag = getBImagAtOutCoords(); setOutput(binaryOpComplex(areal, aimag, breal, bimag)); } - `}},N3="return a * b;";function fA(e){let{inputs:t,backend:n}=e,{a:r,b:a}=t,s=E.upcastType(r.dtype,a.dtype);if(r.dtype==="complex64"){let o=n.texData.get(r.dataId),l=n.texData.get(a.dataId),c=new S3(I3.REAL,r.shape,a.shape),u=new S3(I3.IMAG,r.shape,a.shape),h=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:r.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:r.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:a.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:a.shape}],d=n.runWebGLProgram(c,h,"float32"),p=n.runWebGLProgram(u,h,"float32"),m=Ba({inputs:{real:d,imag:p},backend:n});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}if(n.shouldExecuteOnCPU([r,a])){let o=n.texData.get(r.dataId),l=n.texData.get(a.dataId),[c,u]=VL(r.shape,a.shape,o.values,l.values,s),h=n.makeTensorInfo(u,s),d=n.texData.get(h.dataId);return d.values=c,h}let i;return J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new fc(N3,r.shape,a.shape):i=new $l(N3,r.shape,a.shape),n.runWebGLProgram(i,[r,a],s)}var LW={kernelName:Fs,backendName:"webgl",kernelFunc:fA};function WW(e,t,n){let r=[bi(e.shape),..._i(e.shape)],a={dtype:e.dtype,shape:r,dataId:e.dataId},s=[bi(t),..._i(t)],i=new h3(s,r),o=!0,l=n.runWebGLProgram(i,[a],e.dtype,null,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}function fe(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{shape:s}=r,i=n,o=_.sizeFromShape(a.shape),l=_.inferFromImplicitShape(s,o),c=_.sizeFromShape(l);_.assert(o===c,()=>`The new shape (${l}) has ${c} elements and the old shape (${a.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let u=i.texData.get(a.dataId);return u.isPacked&&!uc(a.shape,l)&&!(u.texture!==null&&uc(u.shape,l))?WW(a,l,i):(i.incRef(a.dataId),{dataId:a.dataId,shape:l,dtype:a.dtype})}var BW={kernelName:Bo,backendName:"webgl",kernelFunc:fe},T3=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:r,inSize:a,outSize:s}=e;this.outputShape=[r,s];let i=Math.floor(n/4)*4,o=n%4,l="sumValue += dot(values, ones);";if(t!=null){let u=1/t;l=`sumValue += dot(values * ${_.isInt(u)?u.toPrecision(2):u}, ones);`}let c="";a%n>0&&(c=` - if (inIdx < 0 || inIdx >= ${a}) { + `}},Ev="return a * b;";function f1(e){let{inputs:t,backend:n}=e,{a,b:r}=t,s=C.upcastType(a.dtype,r.dtype);if(a.dtype==="complex64"){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),d=new Tv(Nv.REAL,a.shape,r.shape),u=new Tv(Nv.IMAG,a.shape,r.shape),p=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:a.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:r.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:r.shape}],c=n.runWebGLProgram(d,p,"float32"),h=n.runWebGLProgram(u,p,"float32"),m=Lr({inputs:{real:c,imag:h},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}if(n.shouldExecuteOnCPU([a,r])){let o=n.texData.get(a.dataId),l=n.texData.get(r.dataId),[d,u]=qL(a.shape,r.shape,o.values,l.values,s),p=n.makeTensorInfo(u,s),c=n.texData.get(p.dataId);return c.values=d,p}let i;return J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new fd(Ev,a.shape,r.shape):i=new Dl(Ev,a.shape,r.shape),n.runWebGLProgram(i,[a,r],s)}var UW={kernelName:$s,backendName:"webgl",kernelFunc:f1};function HW(e,t,n){let a=[vi(e.shape),...wi(e.shape)],r={dtype:e.dtype,shape:a,dataId:e.dataId},s=[vi(t),...wi(t)],i=new cv(s,a),o=!0,l=n.runWebGLProgram(i,[r],e.dtype,null,o);return{dataId:l.dataId,shape:t,dtype:l.dtype}}function fe(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{shape:s}=a,i=n,o=w.sizeFromShape(r.shape),l=w.inferFromImplicitShape(s,o),d=w.sizeFromShape(l);w.assert(o===d,()=>`The new shape (${l}) has ${d} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let u=i.texData.get(r.dataId);return u.isPacked&&!ud(r.shape,l)&&!(u.texture!==null&&ud(u.shape,l))?HW(r,l,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype})}var GW={kernelName:Bo,backendName:"webgl",kernelFunc:fe},Cv=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i=Math.floor(n/4)*4,o=n%4,l="sumValue += dot(values, ones);";if(t!=null){let u=1/t;l=`sumValue += dot(values * ${w.isInt(u)?u.toPrecision(2):u}, ones);`}let d="";r%n>0&&(d=` + if (inIdx < 0 || inIdx >= ${r}) { return 0.0; } `),this.userCode=` const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${c} + ${d} return getX(batch, inIdx); } @@ -1112,7 +1112,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(sumValue); } - `}},VW=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:r,inSize:a,outSize:s}=e;this.outputShape=[r,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?l="sumValue":t==="prod"?l="prodValue":t==="all"?l="allValue":t==="any"&&(l="anyValue");let c=Math.floor(n/4)*4,u=n%4,h=` + `}},qW=class{constructor(e,t){this.variableNames=["x"];let{windowSize:n,batchSize:a,inSize:r,outSize:s}=e;this.outputShape=[a,s];let i="0.0",o="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",o="min"):t==="max"&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?l="sumValue":t==="prod"?l="prodValue":t==="all"?l="allValue":t==="any"&&(l="anyValue");let d=Math.floor(n/4)*4,u=n%4,p=` if (${t==="sum"}) { sumValue += dot(values, ones); } else if (${t==="prod"}) { @@ -1121,16 +1121,16 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } else { minMaxValue = ${o}(values, minMaxValue); } - `,d="vec4";t==="all"?(i="1.0",h=` + `,c="vec4";t==="all"?(i="1.0",p=` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); - `,d="bvec4"):t==="any"&&(i="0.0",h=` + `,c="bvec4"):t==="any"&&(i="0.0",p=` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); - `,d="bvec4");let p="";a%n>0&&(p=` - if (inIdx < 0 || inIdx >= ${a}) { + `,c="bvec4");let h="";r%n>0&&(h=` + if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } `),this.userCode=` @@ -1138,7 +1138,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${p} + ${h} return getX(batch, inIdx); } @@ -1154,64 +1154,64 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float allValue = 1.0; float anyValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${d}; i += 4) { int inIdx = inOffset + i; - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), getValue(batch, inIdx + 3) ); - ${h} + ${p} } - int inIdx = inOffset + ${c}; + int inIdx = inOffset + ${d}; if (${u===1}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), initializationValue, initializationValue, initializationValue ); - ${h} + ${p} } else if (${u===2}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), initializationValue, initializationValue ); - ${h} + ${p} } else if (${u===3}) { - ${d} values = ${d}( + ${c} values = ${c}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), initializationValue ); - ${h} + ${p} } setOutput(${l}); } - `}};function jW(e){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let n=t.length?t[t.length-1].outSize:e[1],r=E.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return t}function Si(e,t,n,r){let a=jW(e.shape),s=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t);for(let a=0;a6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let r=lt(this.rank),a=c3("rc",this.rank),s=new Array(this.rank);for(let c=0;c6)throw Error(`Transpose for rank ${t} is not yet supported`);let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],a=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let a=lt(this.rank),r=pv("rc",this.rank),s=new Array(this.rank);for(let d=0;d=2&&u>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${A}).`);let v=(y>g?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([p,m]);_.assert(h===d,()=>`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${r} must match.`);let w=n?[y,h,p]:[y,p,h],b=r?[g,m,d]:[g,d,m],k=fe({inputs:{x:e},backend:a,attrs:{shape:w}}),N=fe({inputs:{x:t},backend:a,attrs:{shape:b}}),C=[k,N],F=Math.max(y,g),O=n?k.shape[1]:k.shape[2],z=s!=null,V=i!=null,j=l==="leakyrelu",U=l!=null?Ap(l,!0):null,X=z||V||j||U!=null,G;if((p===1||m===1)&&O>E3&&X===!1){let Y=k,ae=N;n&&(Y=dn({inputs:{x:k},backend:a,attrs:{perm:[0,2,1]}}),C.push(Y)),r&&(ae=dn({inputs:{x:N},backend:a,attrs:{perm:[0,2,1]}}),C.push(ae));let te=m!==1,ie=m===1,Q=Y;te&&(Q=fe({inputs:{x:Y},backend:a,attrs:{shape:[F,O,1]}}),C.push(Q));let ce=m===1?2:1,oe=ae;ie&&(oe=fe({inputs:{x:ae},backend:a,attrs:{shape:[F,1,O]}}),C.push(oe));let me=fA({inputs:{a:Q,b:oe},backend:a});G=gp({inputs:{x:me},backend:a,attrs:{axis:ce,keepDims:!0}}),C.push(me)}else{let Y=ir(e.dtype,t.dtype),ae=new k3(w,b,[F,p,m],n,r,z,U,V,j),te=[k,N];if(s!=null&&te.push(s),V&&te.push(i),j){let ie=a.makeTensorInfo([],"float32",_.createScalarValue(o,"float32"));te.push(ie),C.push(ie)}G=a.runWebGLProgram(ae,te,Y)}let ee=fe({inputs:{x:G},backend:a,attrs:{shape:v}});C.push(G);for(let Y of C)a.disposeIntermediateTensorInfo(Y);return ee}function ZW(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=r;return xp({a,b:s,transposeA:l,transposeB:c,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:h,activation:u})}var YW={kernelName:ei,backendName:"webgl",kernelFunc:ZW},C3="return abs(x);";function JW(e){let{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])&&r.dtype!=="complex64"){let s=n.texData.get(r.dataId),i=u3(s.values);return n.makeTensorInfo(r.shape,r.dtype,i)}let a;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?a=new Ml(r.shape,C3):a=new Wa(r.shape,C3),n.runWebGLProgram(a,[r],r.dtype)}var QW={kernelName:eo,backendName:"webgl",kernelFunc:JW},eB=wr+` + `}};function yh(e,t,n){let a=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new YW(e.shape,t):new ZW(e.shape,t);return n.runWebGLProgram(a,[e],e.dtype)}function JW(e,t,n,a){let r=t,s=e.shape.length,i=w.parseAxisParam(r,e.shape),o=i,l=C.getAxesPermutation(o,s),d=l!=null,u=e;d&&(u=yh(e,l,a),o=C.getInnerMostAxes(o.length,s)),C.assertAxesAreInnerMostDims("sum",o,s);let[p,c]=C.computeOutAndReduceShapes(u.shape,o),h=p;n&&(h=C.expandShapeToKeepDim(p,i));let m=w.sizeFromShape(c),f=w.sizeFromShape(e.shape)/m,A=fe({inputs:{x:u},attrs:{shape:[f,m]},backend:a}),y=lc(e.dtype),g=Ni(A,y,"sum",a),x=fe({inputs:{x:g},attrs:{shape:h},backend:a});return a.disposeIntermediateTensorInfo(A),a.disposeIntermediateTensorInfo(g),d&&a.disposeIntermediateTensorInfo(u),x}function gh(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a;return JW(r,s,i,n)}var QW={kernelName:qs,backendName:"webgl",kernelFunc:gh};function cn(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{perm:s}=a,i=n,o=r.shape.length,l=new Array(o);for(let u=0;u=2&&u>=2&&x,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${f}) and (${A}).`);let k=(y>g?e.shape.slice(0,-2):t.shape.slice(0,-2)).concat([h,m]);w.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${a} must match.`);let b=n?[y,p,h]:[y,h,p],v=a?[g,m,c]:[g,c,m],I=fe({inputs:{x:e},backend:r,attrs:{shape:b}}),T=fe({inputs:{x:t},backend:r,attrs:{shape:v}}),R=[I,T],$=Math.max(y,g),z=n?I.shape[1]:I.shape[2],_=s!=null,V=i!=null,j=l==="leakyrelu",U=l!=null?Ah(l,!0):null,X=_||V||j||U!=null,G;if((h===1||m===1)&&z>Rv&&X===!1){let Y=I,re=T;n&&(Y=cn({inputs:{x:I},backend:r,attrs:{perm:[0,2,1]}}),R.push(Y)),a&&(re=cn({inputs:{x:T},backend:r,attrs:{perm:[0,2,1]}}),R.push(re));let te=m!==1,ie=m===1,Q=Y;te&&(Q=fe({inputs:{x:Y},backend:r,attrs:{shape:[$,z,1]}}),R.push(Q));let de=m===1?2:1,oe=re;ie&&(oe=fe({inputs:{x:re},backend:r,attrs:{shape:[$,1,z]}}),R.push(oe));let me=f1({inputs:{a:Q,b:oe},backend:r});G=gh({inputs:{x:me},backend:r,attrs:{axis:de,keepDims:!0}}),R.push(me)}else{let Y=ia(e.dtype,t.dtype),re=new Sv(b,v,[$,h,m],n,a,_,U,V,j),te=[I,T];if(s!=null&&te.push(s),V&&te.push(i),j){let ie=r.makeTensorInfo([],"float32",w.createScalarValue(o,"float32"));te.push(ie),R.push(ie)}G=r.runWebGLProgram(re,te,Y)}let ee=fe({inputs:{x:G},backend:r,attrs:{shape:k}});R.push(G);for(let Y of R)r.disposeIntermediateTensorInfo(Y);return ee}function tB(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:d,activation:u,leakyreluAlpha:p}=a;return xh({a:r,b:s,transposeA:l,transposeB:d,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:p,activation:u})}var nB={kernelName:ei,backendName:"webgl",kernelFunc:tB},Mv="return abs(x);";function aB(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])&&a.dtype!=="complex64"){let s=n.texData.get(a.dataId),i=dv(s.values);return n.makeTensorInfo(a.shape,a.dtype,i)}let r;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Fl(a.shape,Mv):r=new Pr(a.shape,Mv),n.runWebGLProgram(r,[a],a.dtype)}var rB={kernelName:eo,backendName:"webgl",kernelFunc:aB},sB=ba+` if (abs(x) > 1.) { return NAN; } return acos(x); -`,tB=qe({opSnippet:eB}),nB={kernelName:to,backendName:"webgl",kernelFunc:tB},rB=wr+` +`,iB=qe({opSnippet:sB}),oB={kernelName:to,backendName:"webgl",kernelFunc:iB},lB=ba+` if (x < 1.0) return NAN; -return log(x + sqrt(x * x - 1.0));`,aB=qe({opSnippet:rB}),sB={kernelName:no,backendName:"webgl",kernelFunc:aB},R3="return a + b;",iB=en({opSnippet:R3,packedOpSnippet:R3,supportsComplex:!0,cpuKernelImpl:NL}),oB={kernelName:Ia,backendName:"webgl",kernelFunc:iB},lB=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((a,s)=>`T${s}`);let n=[];this.variableNames.forEach(a=>{n.push(`float v${a} = get${a}AtOutCoords();`)});let r=this.variableNames.map(a=>`v${a}`).join(" + ");this.userCode=` +return log(x + sqrt(x * x - 1.0));`,uB=qe({opSnippet:lB}),dB={kernelName:no,backendName:"webgl",kernelFunc:uB},Fv="return a + b;",pB=en({opSnippet:Fv,packedOpSnippet:Fv,supportsComplex:!0,cpuKernelImpl:FL}),cB={kernelName:kr,backendName:"webgl",kernelFunc:pB},hB=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`float v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} - float result = ${r}; + float result = ${a}; setOutput(result); } - `}},uB=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((a,s)=>`T${s}`);let n=[];this.variableNames.forEach(a=>{n.push(`vec4 v${a} = get${a}AtOutCoords();`)});let r=this.variableNames.map(a=>`v${a}`).join(" + ");this.userCode=` + `}},fB=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let n=[];this.variableNames.forEach(r=>{n.push(`vec4 v${r} = get${r}AtOutCoords();`)});let a=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${n.join(` `)} - vec4 result = ${r}; + vec4 result = ${a}; setOutput(result); } - `}};function wp(e){let{inputs:t,backend:n}=e,r=t;if(r.length===1)return Pn({inputs:{x:r[0]},backend:n});if(r.length>J().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(r.length/2),l=wp({inputs:r.slice(0,o),backend:n}),c=wp({inputs:r.slice(o),backend:n});return wp({inputs:[l,c],backend:n})}let a=r.map(o=>o.dtype).reduce((o,l)=>ir(o,l)),s=r.map(o=>o.shape),i=J().getBool("WEBGL_PACK")?new uB(r[0].shape,s):new lB(r[0].shape,s);return n.runWebGLProgram(i,r,a)}var cB={kernelName:is,backendName:"webgl",kernelFunc:wp};function hB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),c=E.getInnerMostAxes(c.length,o)),E.assertAxesAreInnerMostDims("all",c,o);let[d,p]=E.computeOutAndReduceShapes(h.shape,c),m=_.sizeFromShape(p),f=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,m]}}),A=Si(f,f.dtype,"all",n),y;if(i){let g=E.expandShapeToKeepDim(d,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(h),y}var dB={kernelName:ro,backendName:"webgl",kernelFunc:hB};function pB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),c=E.getInnerMostAxes(c.length,o)),E.assertAxesAreInnerMostDims("any",c,o);let[d,p]=E.computeOutAndReduceShapes(h.shape,c),m=_.sizeFromShape(p),f=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,m]}}),A=Si(f,f.dtype,"any",n),y;if(i){let g=E.expandShapeToKeepDim(d,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(h),y}var fB={kernelName:ao,backendName:"webgl",kernelFunc:pB},mB=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:r,batchSize:a,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[a,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + `}};function bh(e){let{inputs:t,backend:n}=e,a=t;if(a.length===1)return Pn({inputs:{x:a[0]},backend:n});if(a.length>J().get("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(a.length/2),l=bh({inputs:a.slice(0,o),backend:n}),d=bh({inputs:a.slice(o),backend:n});return bh({inputs:[l,d],backend:n})}let r=a.map(o=>o.dtype).reduce((o,l)=>ia(o,l)),s=a.map(o=>o.shape),i=J().getBool("WEBGL_PACK")?new fB(a[0].shape,s):new hB(a[0].shape,s);return n.runWebGLProgram(i,a,r)}var mB={kernelName:is,backendName:"webgl",kernelFunc:bh};function AB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),d=C.getInnerMostAxes(d.length,o)),C.assertAxesAreInnerMostDims("all",d,o);let[c,h]=C.computeOutAndReduceShapes(p.shape,d),m=w.sizeFromShape(h),f=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),A=Ni(f,f.dtype,"all",n),y;if(i){let g=C.expandShapeToKeepDim(c,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(p),y}var yB={kernelName:ao,backendName:"webgl",kernelFunc:AB};function gB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),d=C.getInnerMostAxes(d.length,o)),C.assertAxesAreInnerMostDims("any",d,o);let[c,h]=C.computeOutAndReduceShapes(p.shape,d),m=w.sizeFromShape(h),f=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,m]}}),A=Ni(f,f.dtype,"any",n),y;if(i){let g=C.expandShapeToKeepDim(c,l);y=fe({inputs:{x:A},backend:n,attrs:{shape:g}})}else y=fe({inputs:{x:A},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(A),u!=null&&n.disposeIntermediateTensorInfo(p),y}var xB={kernelName:ro,backendName:"webgl",kernelFunc:gB},bB=class{constructor(e,t,n){this.variableNames=["A"];let{windowSize:a,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; - int inOffset = outIdx * ${r}; + int inOffset = outIdx * ${a}; int bestIndex = inOffset; float bestValue = getA(batch, bestIndex); - for (int i = 0; i < ${r}; i++) { + for (int i = 0; i < ${a}; i++) { int inIdx = ${o}; float candidate = getA(batch, inIdx); if (candidate ${i} bestValue) { @@ -1262,55 +1262,55 @@ return log(x + sqrt(x * x - 1.0));`,aB=qe({opSnippet:rB}),sB={kernelName:no,back } setOutput(float(bestIndex)); } - `}},AB=class{constructor(e,t,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,_.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let a=e[e.length-1],s=Math.ceil(a/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),r||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=lt(o),c=hn("coords",o),u,h;if(s===1){h=o+1;let k=lt(h);u=` - ${k} sourceLocR = ${k}(${c.join()}, 0); - ++${c[o-1]}; - ${k} sourceLocG = ${k}(${c.join()}, 0); - ++${c[o-2]}; - ${k} sourceLocA = ${k}(${c.join()}, 0); - --${c[o-1]}; - ${k} sourceLocB = ${k}(${c.join()}, 0); - --${c[o-2]};`}else h=o,u=` + `}},vB=class{constructor(e,t,n,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,w.assert(e.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);let r=e[e.length-1],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),a||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=lt(o),d=pn("coords",o),u,p;if(s===1){p=o+1;let I=lt(p);u=` + ${I} sourceLocR = ${I}(${d.join()}, 0); + ++${d[o-1]}; + ${I} sourceLocG = ${I}(${d.join()}, 0); + ++${d[o-2]}; + ${I} sourceLocA = ${I}(${d.join()}, 0); + --${d[o-1]}; + ${I} sourceLocB = ${I}(${d.join()}, 0); + --${d[o-2]};`}else p=o,u=` ${l} sourceLocR = coords; - ++${c[o-1]}; + ++${d[o-1]}; ${l} sourceLocG = coords; - ++${c[o-2]}; + ++${d[o-2]}; ${l} sourceLocA = coords; - --${c[o-1]}; + --${d[o-1]}; ${l} sourceLocB = coords; - --${c[o-2]};`;let d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],m=d.map(k=>"int "+k),f=hn("sourceLocR",h-1).concat("inIdx.r"),A=hn("sourceLocG",h-1).concat("inIdx.g"),y=hn("sourceLocB",h-1).concat("inIdx.b"),g=hn("sourceLocA",h-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",v=r?"":` + --${d[o-2]};`;let c=["x","y","z","w","u","v"].slice(0,p),h="."+c[p-1],m=c.map(I=>"int "+I),f=pn("sourceLocR",p-1).concat("inIdx.r"),A=pn("sourceLocG",p-1).concat("inIdx.g"),y=pn("sourceLocB",p-1).concat("inIdx.b"),g=pn("sourceLocA",p-1).concat("inIdx.a"),x=n==="max"?"greaterThan":"lessThan",k=a?"":` inIdx = round(vec4(getBestIndicesAChannel(${f.join()}), getBestIndicesAChannel(${A.join()}), getBestIndicesAChannel(${y.join()}), - getBestIndicesAChannel(${g.join()})));`,w=`vec4( + getBestIndicesAChannel(${g.join()})));`,b=`vec4( getAChannel(${f.join()}), hasNextCol ? getAChannel(${A.join()}) : 0., hasNextRow ? getAChannel(${y.join()}) : 0., - hasNextRow && hasNextCol ? getAChannel(${g.join()}) : 0.)`,b=r?"":` + hasNextRow && hasNextCol ? getAChannel(${g.join()}) : 0.)`,v=a?"":` float getBestIndicesAChannel(${m.join()}) { - return getChannel(getBestIndicesA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getBestIndicesA(${c.join()}), + vec2(${c.slice(-2).join()})); }`;this.userCode=` float getAChannel(${m.join()}) { - return getChannel(getA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getA(${c.join()}), + vec2(${c.slice(-2).join()})); } - ${b} + ${v} void main() { ${l} coords = getOutputCoords(); - bool hasNextCol = ${c[o-1]} < ${i[o-1]-1}; - bool hasNextRow = ${c[o-2]} < ${i[o-2]-1}; + bool hasNextCol = ${d[o-1]} < ${i[o-1]-1}; + bool hasNextRow = ${d[o-2]} < ${i[o-2]-1}; ${u} - ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p}, - sourceLocB${p}, sourceLocA${p}) * ${t}; + ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h}, + sourceLocB${h}, sourceLocA${h}) * ${t}; ivec4 inIdx = srcIdx; vec4 bestIndex = vec4(inIdx); - vec4 bestValue = ${w}; + vec4 bestValue = ${b}; for (int i = 0; i < ${t}; i++) { inIdx = srcIdx; - ${v} - vec4 candidate = ${w}; + ${k} + vec4 candidate = ${b}; bvec4 nan = isnan(candidate); bvec4 replace = bvec4( vec4(${x}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); @@ -1324,25 +1324,25 @@ return log(x + sqrt(x * x - 1.0));`,aB=qe({opSnippet:rB}),sB={kernelName:no,back } setOutput(bestIndex); } - `}};function M3(e,t,n,r=null){let a=t.shape[0],s=t.shape[1];r!=null&&(a=r.shape[0],s=r.shape[1]);let i=E.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:a,outSize:Math.ceil(s/i)},l=new mB(o,n,r==null),c=[t];r!=null&&c.push(r);let u=e.runWebGLProgram(l,c,"int32");if(u.shape[1]===1)return u;let h=M3(e,t,n,u);return e.disposeIntermediateTensorInfo(u),h}function F3(e,t,n,r=null){let a=r!=null?r.shape:t.shape,s=a[a.length-1],i=E.computeOptimalWindowSize(s),o=new AB(a,i,n,r==null),l=r==null?[t]:[t,r],c=e.runWebGLProgram(o,l,"int32");if(c.shape.length===t.shape.length){let u=F3(e,t,n,c);return e.disposeIntermediateTensorInfo(c),u}return c}function $3(e,t,n,r){let a=[n];if(E.assertAxesAreInnerMostDims("arg"+r.charAt(0).toUpperCase()+r.slice(1),a,t.shape.length),!J().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=E.computeOutAndReduceShapes(t.shape,a),l=_.sizeFromShape(o),c=fe({inputs:{x:t},backend:e,attrs:{shape:[-1,l]}});s.push(c);let u=M3(e,c,r);s.push(u);let h=fe({inputs:{x:u},backend:e,attrs:{shape:i}});return s.forEach(d=>e.disposeIntermediateTensorInfo(d)),h}return F3(e,t,r)}function yB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r,i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=dn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),E.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let u=$3(n,l,i[0],"max");return c.forEach(h=>n.disposeIntermediateTensorInfo(h)),u}var gB={kernelName:os,backendName:"webgl",kernelFunc:yB};function xB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s}=r,i=_.parseAxisParam(s,a.shape),o=E.getAxesPermutation(i,a.shape.length),l=a,c=[];o!=null&&(l=dn({inputs:{x:a},backend:n,attrs:{perm:o}}),c.push(l),i=E.getInnerMostAxes(i.length,l.shape.length)),E.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let u=$3(n,l,i[0],"min");return c.forEach(h=>n.disposeIntermediateTensorInfo(h)),u}var wB={kernelName:pu,backendName:"webgl",kernelFunc:xB},bB=wr+` + `}};function $v(e,t,n,a=null){let r=t.shape[0],s=t.shape[1];a!=null&&(r=a.shape[0],s=a.shape[1]);let i=C.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},l=new bB(o,n,a==null),d=[t];a!=null&&d.push(a);let u=e.runWebGLProgram(l,d,"int32");if(u.shape[1]===1)return u;let p=$v(e,t,n,u);return e.disposeIntermediateTensorInfo(u),p}function Dv(e,t,n,a=null){let r=a!=null?a.shape:t.shape,s=r[r.length-1],i=C.computeOptimalWindowSize(s),o=new vB(r,i,n,a==null),l=a==null?[t]:[t,a],d=e.runWebGLProgram(o,l,"int32");if(d.shape.length===t.shape.length){let u=Dv(e,t,n,d);return e.disposeIntermediateTensorInfo(d),u}return d}function Ov(e,t,n,a){let r=[n];if(C.assertAxesAreInnerMostDims("arg"+a.charAt(0).toUpperCase()+a.slice(1),r,t.shape.length),!J().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],[i,o]=C.computeOutAndReduceShapes(t.shape,r),l=w.sizeFromShape(o),d=fe({inputs:{x:t},backend:e,attrs:{shape:[-1,l]}});s.push(d);let u=$v(e,d,a);s.push(u);let p=fe({inputs:{x:u},backend:e,attrs:{shape:i}});return s.forEach(c=>e.disposeIntermediateTensorInfo(c)),p}return Dv(e,t,a)}function wB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=cn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let u=Ov(n,l,i[0],"max");return d.forEach(p=>n.disposeIntermediateTensorInfo(p)),u}var kB={kernelName:os,backendName:"webgl",kernelFunc:wB};function IB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s}=a,i=w.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,d=[];o!=null&&(l=cn({inputs:{x:r},backend:n,attrs:{perm:o}}),d.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let u=Ov(n,l,i[0],"min");return d.forEach(p=>n.disposeIntermediateTensorInfo(p)),u}var SB={kernelName:hu,backendName:"webgl",kernelFunc:IB},NB=ba+` if (abs(x) > 1.) { return NAN; } return asin(x); -`,_B=qe({opSnippet:bB}),vB={kernelName:so,backendName:"webgl",kernelFunc:_B},kB=wr+"return log(x + sqrt(x * x + 1.0));",IB=qe({opSnippet:kB}),SB={kernelName:io,backendName:"webgl",kernelFunc:IB},NB=wr+` +`,TB=qe({opSnippet:NB}),EB={kernelName:so,backendName:"webgl",kernelFunc:TB},CB=ba+"return log(x + sqrt(x * x + 1.0));",RB=qe({opSnippet:CB}),MB={kernelName:io,backendName:"webgl",kernelFunc:RB},FB=ba+` return atan(x); -`,TB=qe({opSnippet:NB}),EB={kernelName:oo,backendName:"webgl",kernelFunc:TB},CB=zW+` +`,$B=qe({opSnippet:FB}),DB={kernelName:oo,backendName:"webgl",kernelFunc:$B},OB=VW+` return atan(a, b); -`,RB=` +`,zB=` vec4 result = atan(a, b); vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); - `+PW+` + `+jW+` return result; -`,MB=en({opSnippet:CB,packedOpSnippet:RB}),FB={kernelName:uo,backendName:"webgl",kernelFunc:MB},$B=wr+` +`,_B=en({opSnippet:OB,packedOpSnippet:zB}),PB={kernelName:uo,backendName:"webgl",kernelFunc:_B},LB=ba+` if ((x < -1.0) || (x > 1.0)) return NAN; -return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelName:lo,backendName:"webgl",kernelFunc:DB},mc=class{constructor(e,t,n,r=!1,a=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,A=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let k=">=";this.userCode=` +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,WB=qe({opSnippet:LB}),BB={kernelName:lo,backendName:"webgl",kernelFunc:WB},md=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,d=e.dilationWidth,u=e.effectiveFilterHeight,p=e.effectiveFilterWidth,c=e.padInfo.top,h=e.padInfo.left;this.outputShape=e.outShape;let m=t==="avg",f=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,A=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),n){let I=">=";this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${p}); + const ivec2 pads = ivec2(${c}, ${h}); void main() { ivec4 coords = getOutputCoords(); @@ -1368,8 +1368,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam continue; } - for (int wC = 0; wC < ${h}; - wC += ${c}) { + for (int wC = 0; wC < ${p}; + wC += ${d}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { @@ -1382,16 +1382,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${k} currMinMaxValue) { + if (value ${I} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${r?a?f:A:`wR * ${h} + wC`}; + minMaxPosition = ${a?r?f:A:`wR * ${p} + wC`}; } } } setOutput(float(minMaxPosition)); } - `;return}let g="max",x=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(x="avgValue / count");let v=Math.floor(s/4)*4,w=s%4,b=` + `;return}let g="max",x=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(x="avgValue / count");let k=Math.floor(s/4)*4,b=s%4,v=` if (${m}) { avgValue += dot(values, ones); } else { @@ -1399,7 +1399,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } `;this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${p}); + const ivec2 pads = ivec2(${c}, ${h}); const float initializationValue = ${y}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); @@ -1436,21 +1436,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam continue; } - for (int wC = 0; wC < ${v}; wC += 4) { - int xC = xCCorner + wC * ${c}; + for (int wC = 0; wC < ${k}; wC += 4) { + int xC = xCCorner + wC * ${d}; vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), - getValue(batch, xR, xC + 2 * ${c}, d), - getValue(batch, xR, xC + 3 * ${c}, d) + getValue(batch, xR, xC + ${d}, d), + getValue(batch, xR, xC + 2 * ${d}, d), + getValue(batch, xR, xC + 3 * ${d}, d) ); - ${b} + ${v} } - int xC = xCCorner + ${v}; - if (${w===1}) { + int xC = xCCorner + ${k}; + if (${b===1}) { vec4 values = vec4( getValue(batch, xR, xC, d), initializationValue, @@ -1458,30 +1458,30 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam initializationValue ); - ${b} - } else if (${w===2}) { + ${v} + } else if (${b===2}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), + getValue(batch, xR, xC + ${d}, d), initializationValue, initializationValue ); - ${b} - } else if (${w===3}) { + ${v} + } else if (${b===3}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), - getValue(batch, xR, xC + 2 * ${c}, d), + getValue(batch, xR, xC + ${d}, d), + getValue(batch, xR, xC + 2 * ${d}, d), initializationValue ); - ${b} + ${v} } } setOutput(${x}); } - `}},mA=class{constructor(e,t,n,r=!1,a=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,A=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let g=t==="avg",x="0.0";if(g||(x="-1.0 / 1e-20"),n){let C=">=";this.userCode=` + `}},m1=class{constructor(e,t,n,a=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&n)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,d=e.dilationDepth,u=e.dilationHeight,p=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,A=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let g=t==="avg",x="0.0";if(g||(x="-1.0 / 1e-20"),n){let R=">=";this.userCode=` const ivec3 strides = ivec3(${i}, ${o}, ${l}); const ivec3 pads = ivec3(${f}, ${A}, ${y}); @@ -1502,15 +1502,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float minMaxValueFound = 0.0; int minMaxPosition = 0; - for (int wD = 0; wD < ${d}; - wD += ${c}) { + for (int wD = 0; wD < ${c}; + wD += ${d}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${h}; wR += ${u}) { int xR = xRCorner + wR; @@ -1519,7 +1519,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } for (int wC = 0; wC < ${m}; - wC += ${h}) { + wC += ${p}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { @@ -1532,10 +1532,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${C} currMinMaxValue) { + if (value ${R} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${r?a?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${m} + + minMaxPosition = ${a?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${h} * ${m} + wR * ${m} + wC`}; } } @@ -1543,11 +1543,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let v="max",w=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(w="avgValue / count");let b=Math.floor(s/4)*4,k=s%4,N=` + `;return}let k="max",b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(b="avgValue / count");let v=Math.floor(s/4)*4,I=s%4,T=` if (${g}) { avgValue += dot(values, ones); } else { - minMaxValue = ${v}(values, minMaxValue); + minMaxValue = ${k}(values, minMaxValue); } `;this.userCode=` const ivec3 strides = @@ -1582,15 +1582,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float avgValue = 0.0; count = 0.0; - for (int wD = 0; wD < ${d}; - wD += ${c}) { + for (int wD = 0; wD < ${c}; + wD += ${d}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${h}; wR += ${u}) { int xR = xRCorner + wR; @@ -1598,21 +1598,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam continue; } - for (int wC = 0; wC < ${b}; wC += 4) { - int xC = xCCorner + wC * ${h}; + for (int wC = 0; wC < ${v}; wC += 4) { + int xC = xCCorner + wC * ${p}; vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), - getValue(batch, xD, xR, xC + 2 * ${h}, ch), - getValue(batch, xD, xR, xC + 3 * ${h}, ch) + getValue(batch, xD, xR, xC + ${p}, ch), + getValue(batch, xD, xR, xC + 2 * ${p}, ch), + getValue(batch, xD, xR, xC + 3 * ${p}, ch) ); - ${N} + ${T} } - int xC = xCCorner + ${b}; - if (${k===1}) { + int xC = xCCorner + ${v}; + if (${I===1}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), initializationValue, @@ -1620,33 +1620,33 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam initializationValue ); - ${N} - } else if (${k===2}) { + ${T} + } else if (${I===2}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), + getValue(batch, xD, xR, xC + ${p}, ch), initializationValue, initializationValue ); - ${N} - } else if (${k===3}) { + ${T} + } else if (${I===3}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), - getValue(batch, xD, xR, xC + ${h}, ch), - getValue(batch, xD, xR, xC + 2 * ${h}, ch), + getValue(batch, xD, xR, xC + ${p}, ch), + getValue(batch, xD, xR, xC + 2 * ${p}, ch), initializationValue ); - ${N} + ${T} } } - setOutput(${w}); + setOutput(${b}); } } - `}};function zB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t;Sl(a,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=r,c=1;_.assert(E.eitherStridesOrDilationsAreOne(i,c),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l);if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:a},backend:n});let h=new mc(u,"avg",!1);return n.runWebGLProgram(h,[a],"float32")}var PB={kernelName:ls,backendName:"webgl",kernelFunc:zB};function LB(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:c}=r,u=[1,1,1],h=E.computePool3DInfo(a.shape,s,i,u,o,l,c),d=new mA(h,"avg",!1);return n.runWebGLProgram(d,[a],"float32")}var WB={kernelName:fu,backendName:"webgl",kernelFunc:LB},BB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=o-1-e.padInfo.top,u=l-1-e.padInfo.left,h=1/(t*n);this.userCode=` - const ivec2 pads = ivec2(${c}, ${u}); - const float avgMultiplier = float(${h}); + `}};function VB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;Nl(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l);if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:r},backend:n});let p=new md(u,"avg",!1);return n.runWebGLProgram(p,[r],"float32")}var jB={kernelName:ls,backendName:"webgl",kernelFunc:VB};function UB(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:d}=a,u=[1,1,1],p=C.computePool3DInfo(r.shape,s,i,u,o,l,d),c=new m1(p,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}var HB={kernelName:fu,backendName:"webgl",kernelFunc:UB},GB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,d=o-1-e.padInfo.top,u=l-1-e.padInfo.left,p=1/(t*n);this.userCode=` + const ivec2 pads = ivec2(${d}, ${u}); + const float avgMultiplier = float(${p}); void main() { ivec4 coords = getOutputCoords(); @@ -1662,7 +1662,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float dotProd = 0.0; for (int wR = 0; wR < ${o}; wR += ${s}) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -1671,7 +1671,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam for (int wC = 0; wC < ${l}; wC+= ${i}) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -1686,8 +1686,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},VB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=u-1-e.padInfo.front,m=h-1-e.padInfo.top,f=d-1-e.padInfo.left,A=1/(t*n*r);this.userCode=` - const ivec3 pads = ivec3(${p}, ${m}, ${f}); + `}},qB=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,d=e.dilationWidth,u=e.effectiveFilterDepth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,h=u-1-e.padInfo.front,m=p-1-e.padInfo.top,f=c-1-e.padInfo.left,A=1/(t*n*a);this.userCode=` + const ivec3 pads = ivec3(${h}, ${m}, ${f}); const float avgMultiplier = float(${A}); void main() { @@ -1707,14 +1707,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam for (int wD = 0; wD < ${u}; wD += ${o}) { - float dyD = float(dyDCorner + wD) / ${a}.0; + float dyD = float(dyDCorner + wD) / ${r}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); - for (int wR = 0; wR < ${h}; + for (int wR = 0; wR < ${p}; wR += ${l}) { float dyR = float(dyRCorner + wR) / ${s}.0; @@ -1724,8 +1724,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${d}; - wC += ${c}) { + for (int wC = 0; wC < ${c}; + wC += ${d}) { float dyC = float(dyCCorner + wC) / ${i}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || @@ -1742,7 +1742,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}};function jB(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=r,h=[1,1,1],d=E.computePool3DInfo(i.shape,o,l,h,c,u),p=new VB(d);return n.runWebGLProgram(p,[a],i.dtype)}var UB={kernelName:Nh,backendName:"webgl",kernelFunc:jB};function HB(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s;Sl([a,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:c}=r,u=E.computePool2DInfo(i.shape,o,l,1,c),h=new BB(u);return n.runWebGLProgram(h,[a],i.dtype)}var GB={kernelName:Sh,backendName:"webgl",kernelFunc:HB};function qB(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;return xp({a,b:s,transposeA:i,transposeB:o,backend:n})}var XB={kernelName:us,backendName:"webgl",kernelFunc:qB},KB=class{constructor(e,t,n,r,a,s){this.outputShape=[],this.variableNames=["x","mean","variance"],E.assertAndGetBroadcastShape(e,t),E.assertAndGetBroadcastShape(e,n);let i="0.0";r!=null&&(E.assertAndGetBroadcastShape(e,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";a!=null&&(E.assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}};function XB(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:d,dimRoundingMode:u}=a,p=[1,1,1],c=C.computePool3DInfo(i.shape,o,l,p,d,u),h=new qB(c);return n.runWebGLProgram(h,[r],i.dtype)}var KB={kernelName:Tp,backendName:"webgl",kernelFunc:XB};function ZB(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,input:s}=t,i=s;Nl([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:d}=a,u=C.computePool2DInfo(i.shape,o,l,1,d),p=new GB(u);return n.runWebGLProgram(p,[r],i.dtype)}var YB={kernelName:Np,backendName:"webgl",kernelFunc:ZB};function JB(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;return xh({a:r,b:s,transposeA:i,transposeB:o,backend:n})}var QB={kernelName:us,backendName:"webgl",kernelFunc:JB},eV=class{constructor(e,t,n,a,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,n);let i="0.0";a!=null&&(C.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";r!=null&&(C.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -1752,7 +1752,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float inv = scale * inversesqrt(variance + float(${s})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } - `}},ZB=class{constructor(e,t,n,r,a,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],E.assertAndGetBroadcastShape(e,t),E.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";r!=null&&(E.assertAndGetBroadcastShape(e,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";a!=null&&(E.assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` + `}},tV=class{constructor(e,t,n,a,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,n);let i="vec4(0.0)";a!=null&&(C.assertAndGetBroadcastShape(e,a),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";r!=null&&(C.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${i}; vec4 scale = ${o}; @@ -1765,7 +1765,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput((x - mean) * inv + offset); } - `}},YB=({inputs:e,backend:t,attrs:n})=>{let{x:r,mean:a,variance:s,offset:i,scale:o}=e;_.assert(a.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),_.assert(i==null||a.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),_.assert(o==null||a.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;l==null&&(l=.001);let c=[r,a,s],u=null;i!=null&&(u=i.shape,c.push(i));let h=null;o!=null&&(h=o.shape,c.push(o));let d=J().getBool("WEBGL_PACK_NORMALIZATION")?new ZB(r.shape,a.shape,s.shape,u,h,l):new KB(r.shape,a.shape,s.shape,u,h,l);return t.runWebGLProgram(d,c,c[0].dtype)},JB={kernelName:bs,backendName:"webgl",kernelFunc:YB},eV=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=`uniform int start[${this.rank}];`,r=QB(this.rank),a,s=e.map((i,o)=>`sourceLoc.${AA[o]} = start[${o}] + coords.${AA[o]};`);a=` + `}},nV=({inputs:e,backend:t,attrs:n})=>{let{x:a,mean:r,variance:s,offset:i,scale:o}=e;w.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),w.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),w.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;l==null&&(l=.001);let d=[a,r,s],u=null;i!=null&&(u=i.shape,d.push(i));let p=null;o!=null&&(p=o.shape,d.push(o));let c=J().getBool("WEBGL_PACK_NORMALIZATION")?new tV(a.shape,r.shape,s.shape,u,p,l):new eV(a.shape,r.shape,s.shape,u,p,l);return t.runWebGLProgram(c,d,d[0].dtype)},aV={kernelName:vs,backendName:"webgl",kernelFunc:nV},sV=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=`uniform int start[${this.rank}];`,a=rV(this.rank),r,s=e.map((i,o)=>`sourceLoc.${A1[o]} = start[${o}] + coords.${A1[o]};`);r=` ${t} sourceLoc; ${t} coords = getOutputCoords(); ${s.join(` @@ -1773,28 +1773,28 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam `,this.userCode=` ${n} void main() { - ${a} - setOutput(getSource(${r})); + ${r} + setOutput(getSource(${a})); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},AA=["x","y","z","w","u","v"];function QB(e){if(e===1)return"sourceLoc";if(e<=6)return AA.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var tV=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=hn("coords",this.rank),r=hn("sourceLoc",this.rank),a=this.rank===1?"sourceLoc":`vec2(${r.slice(-2).join()})`,s=`getChannel(getSource(${r.join()}), ${a})`,i=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}},A1=["x","y","z","w","u","v"];function rV(e){if(e===1)return"sourceLoc";if(e<=6)return A1.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var iV=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;let t=lt(this.rank),n=pn("coords",this.rank),a=pn("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${a.slice(-2).join()})`,s=`getChannel(getSource(${a.join()}), ${r})`,i=` result.x = ${s}; if (++${n[this.rank-1]} < ${e[this.rank-1]}) { - ++${r[this.rank-1]}; + ++${a[this.rank-1]}; result.y = ${s}; - --${r[this.rank-1]}; + --${a[this.rank-1]}; } `,o=this.rank===1?"":` --${n[this.rank-1]}; if (++${n[this.rank-2]} < ${e[this.rank-2]}) { - ++${r[this.rank-2]}; + ++${a[this.rank-2]}; result.z = ${s}; if (++${n[this.rank-1]} < ${e[this.rank-1]}) { - ++${r[this.rank-1]}; + ++${a[this.rank-1]}; result.w = ${s}; } } `,l=this.rank<=4?`sourceLoc = coords + - ${t}(${e.map((c,u)=>`start[${u}]`).join()});`:e.map((c,u)=>`${r[u]} = ${n[u]} + start[${u}];`).join(` + ${t}(${e.map((d,u)=>`start[${u}]`).join()});`:e.map((d,u)=>`${a[u]} = ${n[u]} + start[${u}];`).join(` `);this.userCode=` uniform int start[${this.rank}]; void main() { @@ -1806,7 +1806,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam ${o} setOutput(result); } - `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function nV(e,t,n,r){let a=r.texData.get(e.dataId),s=r.makeTensorInfo(n,e.dtype),i=r.texData.get(s.dataId);Object.assign(i,a),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=sn.computeFlatOffset(t,_.computeStrides(e.shape));a.slice&&(o+=a.slice.flatOffset),i.slice={flatOffset:o,origDataId:a.slice&&a.slice.origDataId||e.dataId};let l=r.dataRefCount.get(i.slice.origDataId)||1;return r.dataRefCount.set(i.slice.origDataId,l+1),s}function Ac(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,size:i}=r,[o,l]=sn.parseSliceParams(a,s,i);if(sn.assertParamsValid(a,o,l),_.sizeFromShape(l)===0)return n.makeTensorInfo(l,a.dtype,[]);if(n.shouldExecuteOnCPU([a])||a.dtype==="string"){let h=n.texData.get(a.dataId),d=qL(h.values,o,l,a.shape,a.dtype);return n.makeTensorInfo(l,a.dtype,d)}let{isPacked:c}=n.texData.get(a.dataId),u=sn.isSliceContinous(a.shape,o,l);if(c||!u){let h=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new tV(l):new eV(l),d=h.getCustomSetupFunc(o);return n.runWebGLProgram(h,[a],a.dtype,d)}return n.uploadToGPU(a.dataId),nV(a,o,l,n)}var rV={kernelName:Ho,backendName:"webgl",kernelFunc:Ac},aV=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,crops:i}=r;_.assert(a.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((g,x)=>g*x),l=E.getReshaped(a.shape,s,o),c=E.getPermuted(l.length,s.length),u=E.getReshapedPermuted(a.shape,s,o),h=E.getSliceBeginCoords(i,s.length),d=E.getSliceSize(u,i,s.length),p=[],m=fe({inputs:{x:a},backend:n,attrs:{shape:l}}),f=dn({inputs:{x:m},backend:n,attrs:{perm:c}}),A=fe({inputs:{x:f},backend:n,attrs:{shape:u}}),y=Ac({inputs:{x:A},backend:n,attrs:{begin:h,size:d}});return p.push(m),p.push(f),p.push(A),p.forEach(g=>n.disposeIntermediateTensorInfo(g)),y},sV={kernelName:mu,backendName:"webgl",kernelFunc:aV};function iV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i}=r,o=n.readSync(a.dataId),l=n.readSync(s.dataId),c=l3(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,c)}var oV={kernelName:Th,backendName:"webgl",kernelFunc:iV},lV="return float(a != b);",D3=en({opSnippet:lV,dtype:"bool"}),uV={kernelName:Fo,backendName:"webgl",kernelFunc:D3};function yc(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.texData.get(r.dataId);return Pn({inputs:{x:a.complexTensorInfos.real},backend:n})}var cV={kernelName:Zh,backendName:"webgl",kernelFunc:yc},hV="return float(int(x));";function dV(e,t){let n=new Wa(e.shape,hV),r=t.runWebGLProgram(n,[e],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}function yA(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dtype:s}=r;if(s==="complex64"){if(a.dtype==="complex64")return Pn({inputs:{x:a},backend:n});let i=Et(a.shape),o=yA({inputs:{x:a},backend:n,attrs:{dtype:"float32"}}),l=Ba({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),l}if(a.dtype==="complex64"){let i=yc({inputs:{input:a},backend:n}),o=yA({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!_.hasEncodingLoss(a.dtype,s)){let i=Pn({inputs:{x:a},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return dV(a,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",_.getTypedArrayFromDType("bool",1)),o=D3({inputs:{a,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${s}`)}var pV={kernelName:cs,backendName:"webgl",kernelFunc:yA},O3="return ceil(x);",fV=qe({opSnippet:O3,packedOpSnippet:O3,cpuKernelImpl:EL}),mV={kernelName:hs,backendName:"webgl",kernelFunc:fV},AV=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){if(e.length!==this.rank)throw Error(`The rank (${this.rank}) of the program must match the length of start (${e.length})`);return(t,n)=>{this.startLoc==null&&(this.startLoc=t.getUniformLocationNoThrow(n,"start"),this.startLoc==null)||t.gl.uniform1iv(this.startLoc,e)}}};function oV(e,t,n,a){let r=a.texData.get(e.dataId),s=a.makeTensorInfo(n,e.dtype),i=a.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=sn.computeFlatOffset(t,w.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let l=a.dataRefCount.get(i.slice.origDataId)||1;return a.dataRefCount.set(i.slice.origDataId,l+1),s}function Ad(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,size:i}=a,[o,l]=sn.parseSliceParams(r,s,i);if(sn.assertParamsValid(r,o,l),w.sizeFromShape(l)===0)return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||r.dtype==="string"){let p=n.texData.get(r.dataId),c=JL(p.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,c)}let{isPacked:d}=n.texData.get(r.dataId),u=sn.isSliceContinous(r.shape,o,l);if(d||!u){let p=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new iV(l):new sV(l),c=p.getCustomSetupFunc(o);return n.runWebGLProgram(p,[r],r.dtype,c)}return n.uploadToGPU(r.dataId),oV(r,o,l,n)}var lV={kernelName:Ho,backendName:"webgl",kernelFunc:Ad},uV=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,crops:i}=a;w.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((g,x)=>g*x),l=C.getReshaped(r.shape,s,o),d=C.getPermuted(l.length,s.length),u=C.getReshapedPermuted(r.shape,s,o),p=C.getSliceBeginCoords(i,s.length),c=C.getSliceSize(u,i,s.length),h=[],m=fe({inputs:{x:r},backend:n,attrs:{shape:l}}),f=cn({inputs:{x:m},backend:n,attrs:{perm:d}}),A=fe({inputs:{x:f},backend:n,attrs:{shape:u}}),y=Ad({inputs:{x:A},backend:n,attrs:{begin:p,size:c}});return h.push(m),h.push(f),h.push(A),h.forEach(g=>n.disposeIntermediateTensorInfo(g)),y},dV={kernelName:mu,backendName:"webgl",kernelFunc:uV};function pV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i}=a,o=n.readSync(r.dataId),l=n.readSync(s.dataId),d=uv(o,l,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,d)}var cV={kernelName:Ep,backendName:"webgl",kernelFunc:pV},hV="return float(a != b);",zv=en({opSnippet:hV,dtype:"bool"}),fV={kernelName:$o,backendName:"webgl",kernelFunc:zv};function yd(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Pn({inputs:{x:r.complexTensorInfos.real},backend:n})}var mV={kernelName:Zp,backendName:"webgl",kernelFunc:yd},AV="return float(int(x));";function yV(e,t){let n=new Pr(e.shape,AV),a=t.runWebGLProgram(n,[e],"int32");return{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}function y1(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dtype:s}=a;if(s==="complex64"){if(r.dtype==="complex64")return Pn({inputs:{x:r},backend:n});let i=Ct(r.shape),o=y1({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),l=Lr({inputs:{real:o,imag:i},backend:n});return i.dispose(),n.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=yd({inputs:{input:r},backend:n}),o=y1({inputs:{x:i},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(i),o}if(!w.hasEncodingLoss(r.dtype,s)){let i=Pn({inputs:{x:r},backend:n});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(s==="int32")return yV(r,n);if(s==="bool"){let i=n.makeTensorInfo([],"bool",w.getTypedArrayFromDType("bool",1)),o=zv({inputs:{a:r,b:i},backend:n});return n.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var gV={kernelName:ds,backendName:"webgl",kernelFunc:y1},_v="return ceil(x);",xV=qe({opSnippet:_v,packedOpSnippet:_v,cpuKernelImpl:DL}),bV={kernelName:ps,backendName:"webgl",kernelFunc:xV},vV=class{constructor(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1819,7 +1819,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput(clamp(value, minVal, maxVal)); } - `}getCustomSetupFunc(e,t){return(n,r)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(r,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(r,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},yV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}},wV=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` uniform float minVal; uniform float maxVal; @@ -1833,7 +1833,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } - `}getCustomSetupFunc(e,t){return(n,r)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(r,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(r,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function gV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{clipValueMin:s,clipValueMax:i}=r,o;J().getBool("WEBGL_PACK_CLIP")?o=new yV(a.shape):o=new AV(a.shape);let l=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[a],a.dtype,l)}var xV={kernelName:Sa,backendName:"webgl",kernelFunc:gV},wV=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e,t){return(n,a)=>{this.minLoc==null&&(this.minLoc=n.getUniformLocationNoThrow(a,"minVal"),this.maxLoc=n.getUniformLocationNoThrow(a,"maxVal")),n.gl.uniform1f(this.minLoc,e),n.gl.uniform1f(this.maxLoc,t)}}};function kV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o;J().getBool("WEBGL_PACK_CLIP")?o=new wV(r.shape):o=new vV(r.shape);let l=o.getCustomSetupFunc(s,i);return n.runWebGLProgram(o,[r],r.dtype,l)}var IV={kernelName:Ir,backendName:"webgl",kernelFunc:kV},SV=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -1846,7 +1846,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } - `}};function z3(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function bV(e){let{inputs:t,backend:n}=e,{x:r}=t,a=n.texData.get(r.dataId),s=new wV(r.shape),i=[z3(r,a.complexTensorInfos.real),z3(r,a.complexTensorInfos.imag)];return n.runWebGLProgram(s,i,i[0].dtype)}var _V={kernelName:Au,backendName:"webgl",kernelFunc:bV},vV=class{constructor(e){this.outputShape=[],this.outputShape=E.computeOutShape(e,1),this.variableNames=e.map((s,i)=>`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let s=1;s`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m`T${f}`);let o=new Array(e.length-1);o[0]=e[0][t];for(let m=1;m= ${o[m-1]}) { return getChannel( - getT${m}(${bp(i,l,f)}), - vec2(${bp(c,l,f)})); - }`}let d=o.length,p=o[o.length-1];h+=` + getT${m}(${vh(i,l,f)}), + vec2(${vh(d,l,f)})); + }`}let c=o.length,h=o[o.length-1];p+=` return getChannel( - getT${d}(${bp(i,l,p)}), - vec2(${bp(c,l,p)}));`,this.userCode=` + getT${c}(${vh(i,l,h)}), + vec2(${vh(d,l,h)}));`,this.userCode=` float getValue(${i.map(m=>"int "+m)}) { - ${h} + ${p} } void main() { - ${a} coords = getOutputCoords(); + ${r} coords = getOutputCoords(); vec4 result = vec4(getValue(${s}), 0., 0., 0.); - ${s[r-1]} = ${s[r-1]} + 1; - if (${s[r-1]} < ${n[r-1]}) { + ${s[a-1]} = ${s[a-1]} + 1; + if (${s[a-1]} < ${n[a-1]}) { result.g = getValue(${s}); } - ${s[r-2]} = ${s[r-2]} + 1; - if (${s[r-2]} < ${n[r-2]}) { + ${s[a-2]} = ${s[a-2]} + 1; + if (${s[a-2]} < ${n[a-2]}) { result.a = getValue(${s}); } - ${s[r-1]} = ${s[r-1]} - 1; - if (${s[r-2]} < ${n[r-2]} && - ${s[r-1]} < ${n[r-1]}) { + ${s[a-1]} = ${s[a-1]} - 1; + if (${s[a-2]} < ${n[a-2]} && + ${s[a-1]} < ${n[a-1]}) { result.b = getValue(${s}); } setOutput(result); } - `}};function bp(e,t,n){let r=e.indexOf(t);return e.map((a,s)=>s===r?`${a} - ${n}`:a).join()}function _p(e){let{inputs:t,backend:n}=e,{input:r}=t,a=n.texData.get(r.dataId);return Pn({inputs:{x:a.complexTensorInfos.imag},backend:n})}var IV={kernelName:jh,backendName:"webgl",kernelFunc:_p};function Dl(e,t,n){let r=e[0].dtype;if(r==="complex64"){let u=e.map(f=>yc({inputs:{input:f},backend:n})),h=e.map(f=>_p({inputs:{input:f},backend:n})),d=Dl(u,t,n),p=Dl(h,t,n),m=Ba({inputs:{real:d,imag:p},backend:n});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),h.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}let a=n.shouldExecuteOnCPU(e);if(r==="string"&&(a=!0),a){let u=e.map(y=>{let g=_.sizeFromShape(y.shape.slice(t));return fe({inputs:{x:y},backend:n,attrs:{shape:[-1,g]}})}),h=u.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),d=E.computeOutShape(u.map(y=>y.shape),1),p=u[0].shape[0]===1,m=CL(h,d,r,p),f=E.computeOutShape(e.map(y=>y.shape),t),A=n.makeTensorInfo(f,r,m);return u.forEach(y=>n.disposeIntermediateTensorInfo(y)),A}if(e.length>J().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let u=Math.floor(e.length/2),h=Dl(e.slice(0,u),t,n),d=Dl(e.slice(u),t,n),p=Dl([h,d],t,n);return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),p}if(J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let u=new kV(e.map(h=>h.shape),t);return n.runWebGLProgram(u,e,r)}let{tensors2D:s,outShape:i}=SV(e,t,n),o=new vV(s.map(u=>u.shape)),l=n.runWebGLProgram(o,s,r);s.forEach(u=>n.disposeIntermediateTensorInfo(u));let c=fe({inputs:{x:l},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(l),c}function SV(e,t,n){let r=E.computeOutShape(e.map(a=>a.shape),t);return{tensors2D:e.map(a=>fe({inputs:{x:a},attrs:{shape:[-1,_.sizeFromShape(a.shape.slice(t))]},backend:n})),outShape:r}}function P3(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r,s=_.parseAxisParam(a,t[0].shape)[0],i=E.computeOutShape(t.map(c=>c.shape),s);if(_.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(c=>_.sizeFromShape(c.shape)>0);if(o.length===1)return Pn({inputs:{x:o[0]},backend:n});let l=o.map(c=>c.shape);return E.assertParamsConsistent(l,s),Dl(o,s,n)}var NV={kernelName:co,backendName:"webgl",kernelFunc:P3},L3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",A=f?1:2,y=f?2:3,g=f?3:1,x="",v="";n&&(r?x=`float activation(float a) { + `}};function vh(e,t,n){let a=e.indexOf(t);return e.map((r,s)=>s===a?`${r} - ${n}`:r).join()}function wh(e){let{inputs:t,backend:n}=e,{input:a}=t,r=n.texData.get(a.dataId);return Pn({inputs:{x:r.complexTensorInfos.imag},backend:n})}var RV={kernelName:jp,backendName:"webgl",kernelFunc:wh};function Ol(e,t,n){let a=e[0].dtype;if(a==="complex64"){let u=e.map(f=>yd({inputs:{input:f},backend:n})),p=e.map(f=>wh({inputs:{input:f},backend:n})),c=Ol(u,t,n),h=Ol(p,t,n),m=Lr({inputs:{real:c,imag:h},backend:n});return u.forEach(f=>n.disposeIntermediateTensorInfo(f)),p.forEach(f=>n.disposeIntermediateTensorInfo(f)),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}let r=n.shouldExecuteOnCPU(e);if(a==="string"&&(r=!0),r){let u=e.map(y=>{let g=w.sizeFromShape(y.shape.slice(t));return fe({inputs:{x:y},backend:n,attrs:{shape:[-1,g]}})}),p=u.map(y=>({vals:n.readSync(y.dataId),shape:y.shape})),c=C.computeOutShape(u.map(y=>y.shape),1),h=u[0].shape[0]===1,m=OL(p,c,a,h),f=C.computeOutShape(e.map(y=>y.shape),t),A=n.makeTensorInfo(f,a,m);return u.forEach(y=>n.disposeIntermediateTensorInfo(y)),A}if(e.length>J().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let u=Math.floor(e.length/2),p=Ol(e.slice(0,u),t,n),c=Ol(e.slice(u),t,n),h=Ol([p,c],t,n);return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),h}if(J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){let u=new CV(e.map(p=>p.shape),t);return n.runWebGLProgram(u,e,a)}let{tensors2D:s,outShape:i}=MV(e,t,n),o=new EV(s.map(u=>u.shape)),l=n.runWebGLProgram(o,s,a);s.forEach(u=>n.disposeIntermediateTensorInfo(u));let d=fe({inputs:{x:l},attrs:{shape:i},backend:n});return n.disposeIntermediateTensorInfo(l),d}function MV(e,t,n){let a=C.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>fe({inputs:{x:r},attrs:{shape:[-1,w.sizeFromShape(r.shape.slice(t))]},backend:n})),outShape:a}}function Lv(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a,s=w.parseAxisParam(r,t[0].shape)[0],i=C.computeOutShape(t.map(d=>d.shape),s);if(w.sizeFromShape(i)===0)return n.makeTensorInfo(i,t[0].dtype,[]);let o=t.filter(d=>w.sizeFromShape(d.shape)>0);if(o.length===1)return Pn({inputs:{x:o[0]},backend:n});let l=o.map(d=>d.shape);return C.assertParamsConsistent(l,s),Ol(o,s,n)}var FV={kernelName:po,backendName:"webgl",kernelFunc:Lv},Wv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,d=e.dilationHeight,u=e.dilationWidth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",A=f?1:2,y=f?2:3,g=f?3:1,x="",k="";n&&(a?x=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} - }`:a?x=`float activation(float a) { + }`:r?x=`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${n} }`:x=` float activation(float x) { ${n} } - `,v="result = activation(result);");let w=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,k="result = activation(result);");let b=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${x} const ivec2 strides = ivec2(${o}, ${l}); @@ -1921,21 +1921,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${h}; wR++) { - int xR = xRCorner + wR * ${c}; + for (int wR = 0; wR < ${p}; wR++) { + int xR = xRCorner + wR * ${d}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int wC = 0; wC < ${d}; wC++) { + for (int wC = 0; wC < ${c}; wC++) { int xC = xCCorner + wC * ${u}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } - for (int d1 = 0; d1 < ${p}; d1 += 4) { + for (int d1 = 0; d1 < ${h}; d1 += 4) { vec4 wValues = vec4( getW(wR, wC, d1, d2), getW(wR, wC, d1 + 1, d2), @@ -1966,53 +1966,53 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam if (${f}) { dotProd += - getX(batch, xR, xC, ${p}) * - getW(wR, wC, ${p}, d2); + getX(batch, xR, xC, ${h}) * + getW(wR, wC, ${h}, d2); } else { dotProd += - getX(batch, ${p}, xR, xC) * - getW(wR, wC, ${p}, d2); + getX(batch, ${h}, xR, xC) * + getW(wR, wC, ${h}, d2); } } else if (${m===2}) { vec2 wValues = vec2( - getW(wR, wC, ${p}, d2), - getW(wR, wC, ${p} + 1, d2) + getW(wR, wC, ${h}, d2), + getW(wR, wC, ${h} + 1, d2) ); if (${f}) { vec2 xValues = vec2( - getX(batch, xR, xC, ${p}), - getX(batch, xR, xC, ${p} + 1) + getX(batch, xR, xC, ${h}), + getX(batch, xR, xC, ${h} + 1) ); dotProd += dot(xValues, wValues); } else { vec2 xValues = vec2( - getX(batch, ${p}, xR, xC), - getX(batch, ${p} + 1, xR, xC) + getX(batch, ${h}, xR, xC), + getX(batch, ${h} + 1, xR, xC) ); dotProd += dot(xValues, wValues); } } else if (${m===3}) { vec3 wValues = vec3( - getW(wR, wC, ${p}, d2), - getW(wR, wC, ${p} + 1, d2), - getW(wR, wC, ${p} + 2, d2) + getW(wR, wC, ${h}, d2), + getW(wR, wC, ${h} + 1, d2), + getW(wR, wC, ${h} + 2, d2) ); if (${f}) { vec3 xValues = vec3( - getX(batch, xR, xC, ${p}), - getX(batch, xR, xC, ${p} + 1), - getX(batch, xR, xC, ${p} + 2) + getX(batch, xR, xC, ${h}), + getX(batch, xR, xC, ${h} + 1), + getX(batch, xR, xC, ${h} + 2) ); dotProd += dot(xValues, wValues); } else { vec3 xValues = vec3( - getX(batch, ${p}, xR, xC), - getX(batch, ${p} + 1, xR, xC), - getX(batch, ${p} + 2, xR, xC) + getX(batch, ${h}, xR, xC), + getX(batch, ${h} + 1, xR, xC), + getX(batch, ${h} + 2, xR, xC) ); dotProd += dot(xValues, wValues); } @@ -2022,13 +2022,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } float result = dotProd; - ${w} - ${v} + ${b} + ${k} setOutput(result); } - `}},TV=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,r=e.padInfo.left,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` - const ivec3 strides = ivec3(${a}, ${s}, ${i}); - const ivec3 pads = ivec3(${t}, ${n}, ${r}); + `}},$V=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,n=e.padInfo.top,a=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,d=e.dilationWidth,u=e.filterDepth,p=e.filterHeight,c=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` + const ivec3 strides = ivec3(${r}, ${s}, ${i}); + const ivec3 pads = ivec3(${t}, ${n}, ${a}); void main() { ivec5 coords = getOutputCoords(); @@ -2051,21 +2051,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam continue; } - for (int wR = 0; wR < ${h}; wR++) { + for (int wR = 0; wR < ${p}; wR++) { int xR = xRCorner + wR * ${l}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${c}; + for (int wC = 0; wC < ${c}; wC++) { + int xC = xCCorner + wC * ${d}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } - for (int d1 = 0; d1 < ${p}; d1 += 4) { + for (int d1 = 0; d1 < ${h}; d1 += 4) { vec4 xValues = vec4( getX(batch, xF, xR, xC, d1), getX(batch, xF, xR, xC, d1 + 1), @@ -2084,28 +2084,28 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam if (${m===1}) { dotProd += - getX(batch, xF, xR, xC, ${p}) * - getW(wF, wR, wC, ${p}, d2); + getX(batch, xF, xR, xC, ${h}) * + getW(wF, wR, wC, ${h}, d2); } else if (${m===2}) { vec2 xValues = vec2( - getX(batch, xF, xR, xC, ${p}), - getX(batch, xF, xR, xC, ${p} + 1) + getX(batch, xF, xR, xC, ${h}), + getX(batch, xF, xR, xC, ${h} + 1) ); vec2 wValues = vec2( - getW(wF, wR, wC, ${p}, d2), - getW(wF, wR, wC, ${p} + 1, d2) + getW(wF, wR, wC, ${h}, d2), + getW(wF, wR, wC, ${h} + 1, d2) ); dotProd += dot(xValues, wValues); } else if (${m===3}) { vec3 xValues = vec3( - getX(batch, xF, xR, xC, ${p}), - getX(batch, xF, xR, xC, ${p} + 1), - getX(batch, xF, xR, xC, ${p} + 2) + getX(batch, xF, xR, xC, ${h}), + getX(batch, xF, xR, xC, ${h} + 1), + getX(batch, xF, xR, xC, ${h} + 2) ); vec3 wValues = vec3( - getW(wF, wR, wC, ${p}, d2), - getW(wF, wR, wC, ${p} + 1, d2), - getW(wF, wR, wC, ${p} + 2, d2) + getW(wF, wR, wC, ${h}, d2), + getW(wF, wR, wC, ${h} + 1, d2), + getW(wF, wR, wC, ${h} + 2, d2) ); dotProd += dot(xValues, wValues); } @@ -2114,31 +2114,31 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},EV=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:r,inChannels:a,strideWidth:s,strideHeight:i,padInfo:o,outWidth:l,dilationWidth:c,dilationHeight:u,dataFormat:h}=n,{left:d,top:p}=o,m=a*r,f=cn(),A=h==="channelsLast",y=A?0:1,g=A?1:2,x="";for(let v=0;v<=1;v++)for(let w=0;w<=1;w++)x+=` - blockIndex = rc.y + ${w}; - pos = rc.x + ${v}; + `}},DV=class{constructor(e,t,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;let{filterWidth:a,inChannels:r,strideWidth:s,strideHeight:i,padInfo:o,outWidth:l,dilationWidth:d,dilationHeight:u,dataFormat:p}=n,{left:c,top:h}=o,m=r*a,f=dn(),A=p==="channelsLast",y=A?0:1,g=A?1:2,x="";for(let k=0;k<=1;k++)for(let b=0;b<=1;b++)x+=` + blockIndex = rc.y + ${b}; + pos = rc.x + ${k}; if(blockIndex < ${e[1]} && pos < ${e[0]}) { - offsetY = int(blockIndex / (${l})) * ${i} - ${p}; + offsetY = int(blockIndex / (${l})) * ${i} - ${h}; d0 = offsetY + ${u} * (pos / ${m}); if(d0 < ${t[y]} && d0 >= 0) { - offsetX = int(mod(float(blockIndex), ${l}.) * ${s}. - ${d}.); - d1 = offsetX + ${c} * (int(mod(float(pos), ${m}.) / ${a}.)); + offsetX = int(mod(float(blockIndex), ${l}.) * ${s}. - ${c}.); + d1 = offsetX + ${d} * (int(mod(float(pos), ${m}.) / ${r}.)); if(d1 < ${t[g]} && d1 >= 0) { - ch = int(mod(float(pos), ${a}.)); + ch = int(mod(float(pos), ${r}.)); if (${A}) { innerDims = vec2(d1, ch); - result[${v*2+w}] = getChannel( + result[${k*2+b}] = getChannel( getA(d0, int(innerDims.x), int(innerDims.y)), innerDims); } else { innerDims = vec2(d0, d1); - result[${v*2+w}] = getChannel( + result[${k*2+b}] = getChannel( getA(ch, int(innerDims.x), int(innerDims.y)), innerDims); } @@ -2158,7 +2158,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam ${f.output} = result; } - `}};function W3({x:e,filter:t,convInfo:n,backend:r,bias:a=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,c=r.texData.get(e.dataId),u=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p=n.dataFormat==="channelsLast",m=!1,f=!1,A,y=[],g=(h===1||d===1)&&u>E3,x=l[2]%2!=0&&!!c.isPacked;if(g||!J().getBool("WEBGL_LAZILY_UNPACK")||!J().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let v=p?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],w=fe({inputs:{x:e},backend:r,attrs:{shape:[1,v,n.inChannels]}}),b=fe({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}}),k=xp({a:w,b,transposeA:m,transposeB:f,backend:r,bias:a,activation:o,preluActivationWeights:s,leakyreluAlpha:i});A=fe({inputs:{x:k},backend:r,attrs:{shape:n.outShape}}),y.push(w),y.push(b),y.push(k)}else{let v=p?l[0]*l[1]*(l[2]+1):l[0]*l[2]*(l[3]+1),w={dataId:e.dataId,shape:[1,v,n.inChannels],dtype:e.dtype},b=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,_.assert(uc(c.shape,w.shape),()=>`packed reshape ${c.shape} to ${w.shape} isn't free`);let k=fe({inputs:{x:t},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(k);let N=xp({a:w,b:k,backend:r,transposeA:m,transposeB:f,bias:a,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),C=r.texData.get(N.dataId);_.assert(C.isPacked,()=>"batchMatMul result is expected to be packed"),c.shape=b,C.shape=n.outShape,A=Pn({inputs:{x:N},backend:r}),A.shape=n.outShape,y.push(N)}for(let v of y)r.disposeIntermediateTensorInfo(v);return A}function B3({x:e,filter:t,convInfo:n,backend:r,bias:a=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:c,inChannels:u,outWidth:h,outHeight:d,dataFormat:p}=n,m=p==="channelsLast",f=l*c*u,A=d*h,y=[f,A],g=!0,x=!1,v=[],w=fe({inputs:{x:e},backend:r,attrs:{shape:e.shape.slice(1)}}),b=fe({inputs:{x:t},backend:r,attrs:{shape:[1,f,_.sizeFromShape(t.shape)/f]}});v.push(w),v.push(b);let k=new EV(y,w.shape,n),N=r.runWebGLProgram(k,[w],"float32"),C=fe({inputs:{x:N},backend:r,attrs:{shape:[1,y[0],y[1]]}});v.push(N),v.push(C);let F=a!=null,O=s!=null,z=o==="leakyrelu",V=o?Ap(o,!0):null,j=new k3(C.shape,b.shape,[1,A,n.outChannels],g,x,F,V,O,z),U=[C,b];if(a&&U.push(a),O&&U.push(s),z){let Y=r.makeTensorInfo([],"float32",_.createScalarValue(i,"float32"));U.push(Y),v.push(Y)}let X=r.runWebGLProgram(j,U,"float32"),G=m?[1,d,h,n.outChannels]:[1,n.outChannels,d,h],ee=fe({inputs:{x:X},backend:r,attrs:{shape:G}});v.push(X);for(let Y of v)r.disposeIntermediateTensorInfo(Y);return ee}function CV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=r,h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,s.shape,i,c,o,u,!1,h),p;if(d.filterHeight===1&&d.filterWidth===1&&d.dilationHeight===1&&d.dilationWidth===1&&d.strideHeight===1&&d.strideWidth===1&&(d.padInfo.type==="SAME"||d.padInfo.type==="VALID"))p=W3({x:a,filter:s,convInfo:d,backend:n});else if(J().getBool("WEBGL_CONV_IM2COL")&&a.shape[0]===1)p=B3({x:a,filter:s,convInfo:d,backend:n});else{let f=new L3(d);p=n.runWebGLProgram(f,[a,s],"float32")}let m=fe({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),m}var RV={kernelName:ds,backendName:"webgl",kernelFunc:CV},MV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,a=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` + `}};function Bv({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,d=a.texData.get(e.dataId),u=n.inChannels,p=l[0]*l[1]*l[2],c=n.outChannels,h=n.dataFormat==="channelsLast",m=!1,f=!1,A,y=[],g=(p===1||c===1)&&u>Rv,x=l[2]%2!=0&&!!d.isPacked;if(g||!J().getBool("WEBGL_LAZILY_UNPACK")||!J().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!x){let k=h?l[0]*l[1]*l[2]:l[0]*l[2]*l[3],b=fe({inputs:{x:e},backend:a,attrs:{shape:[1,k,n.inChannels]}}),v=fe({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}}),I=xh({a:b,b:v,transposeA:m,transposeB:f,backend:a,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});A=fe({inputs:{x:I},backend:a,attrs:{shape:n.outShape}}),y.push(b),y.push(v),y.push(I)}else{let k=h?l[0]*l[1]*(l[2]+1):l[0]*l[2]*(l[3]+1),b={dataId:e.dataId,shape:[1,k,n.inChannels],dtype:e.dtype},v=d.shape;d.shape=d.shape.slice(),d.shape[d.shape.length-2]++,w.assert(ud(d.shape,b.shape),()=>`packed reshape ${d.shape} to ${b.shape} isn't free`);let I=fe({inputs:{x:t},backend:a,attrs:{shape:[1,n.inChannels,n.outChannels]}});y.push(I);let T=xh({a:b,b:I,backend:a,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),R=a.texData.get(T.dataId);w.assert(R.isPacked,()=>"batchMatMul result is expected to be packed"),d.shape=v,R.shape=n.outShape,A=Pn({inputs:{x:T},backend:a}),A.shape=n.outShape,y.push(T)}for(let k of y)a.disposeIntermediateTensorInfo(k);return A}function Vv({x:e,filter:t,convInfo:n,backend:a,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:d,inChannels:u,outWidth:p,outHeight:c,dataFormat:h}=n,m=h==="channelsLast",f=l*d*u,A=c*p,y=[f,A],g=!0,x=!1,k=[],b=fe({inputs:{x:e},backend:a,attrs:{shape:e.shape.slice(1)}}),v=fe({inputs:{x:t},backend:a,attrs:{shape:[1,f,w.sizeFromShape(t.shape)/f]}});k.push(b),k.push(v);let I=new DV(y,b.shape,n),T=a.runWebGLProgram(I,[b],"float32"),R=fe({inputs:{x:T},backend:a,attrs:{shape:[1,y[0],y[1]]}});k.push(T),k.push(R);let $=r!=null,z=s!=null,_=o==="leakyrelu",V=o?Ah(o,!0):null,j=new Sv(R.shape,v.shape,[1,A,n.outChannels],g,x,$,V,z,_),U=[R,v];if(r&&U.push(r),z&&U.push(s),_){let Y=a.makeTensorInfo([],"float32",w.createScalarValue(i,"float32"));U.push(Y),k.push(Y)}let X=a.runWebGLProgram(j,U,"float32"),G=m?[1,c,p,n.outChannels]:[1,n.outChannels,c,p],ee=fe({inputs:{x:X},backend:a,attrs:{shape:G}});k.push(X);for(let Y of k)a.disposeIntermediateTensorInfo(Y);return ee}function OV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:d,dimRoundingMode:u}=a,p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!1,p),h;if(c.filterHeight===1&&c.filterWidth===1&&c.dilationHeight===1&&c.dilationWidth===1&&c.strideHeight===1&&c.strideWidth===1&&(c.padInfo.type==="SAME"||c.padInfo.type==="VALID"))h=Bv({x:r,filter:s,convInfo:c,backend:n});else if(J().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)h=Vv({x:r,filter:s,convInfo:c,backend:n});else{let f=new Wv(c);h=n.runWebGLProgram(f,[r,s],"float32")}let m=fe({inputs:{x:h},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(h),m}var zV={kernelName:cs,backendName:"webgl",kernelFunc:OV},_V=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2172,14 +2172,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam for (int b = 0; b < ${e.batchSize}; b++) { for (int yR = 0; yR < ${e.outHeight}; yR++) { - int xR = wR + yR * ${t} - ${r}; + int xR = wR + yR * ${t} - ${a}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${n} - ${a}; + int xC = wC + yC * ${n} - ${r}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2200,7 +2200,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},FV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=s?1:2,c=s?2:3,u=s?3:1;this.userCode=` + `}},PV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=s?1:2,d=s?2:3,u=s?3:1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -2208,7 +2208,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam int batch = coords[0]; int d1 = coords[${u}]; - ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - pads; + ivec2 dyCorner = ivec2(coords[${l}], coords[${d}]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; @@ -2216,7 +2216,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR < ${t}; wR++) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -2226,7 +2226,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${n}; wC++) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -2253,7 +2253,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},$V=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,a=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` + `}},LV=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` void main() { ivec5 coords = getOutputCoords(); int wF = coords.x; @@ -2266,7 +2266,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam for (int b = 0; b < ${e.batchSize}; b++) { for (int yF = 0; yF < ${e.outDepth}; yF++) { - int xF = wF + yF * ${t} - ${a}; + int xF = wF + yF * ${t} - ${r}; if (xF < 0 || xF >= ${e.inDepth}) { continue; @@ -2280,7 +2280,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${r} - ${i}; + int xC = wC + yC * ${a} - ${i}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2295,8 +2295,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},DV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,a=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,c=r-1-e.padInfo.left;this.userCode=` - const ivec3 pads = ivec3(${o}, ${l}, ${c}); + `}},WV=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,n=e.filterHeight,a=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,d=a-1-e.padInfo.left;this.userCode=` + const ivec3 pads = ivec3(${o}, ${l}, ${d}); void main() { ivec5 coords = getOutputCoords(); @@ -2311,7 +2311,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float dotProd = 0.0; for (int wF = 0; wF < ${t}; wF++) { - float dyF = float(dyFCorner + wF) / ${a}.0; + float dyF = float(dyFCorner + wF) / ${r}.0; if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { continue; @@ -2331,7 +2331,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam int wRPerm = ${n} - 1 - wR; - for (int wC = 0; wC < ${r}; wC++) { + for (int wC = 0; wC < ${a}; wC++) { float dyC = float(dyCCorner + wC) / ${i}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || @@ -2340,7 +2340,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } int idyC = int(dyC); - int wCPerm = ${r} - 1 - wC; + int wCPerm = ${a} - 1 - wC; for (int d2 = 0; d2 < ${e.outChannels}; d2++) { float xValue = getDy(batch, idyF, idyR, idyC, d2); @@ -2352,12 +2352,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}};function OV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:c,filterShape:u}=r,h=E.convertConv2DDataFormat(l),d=E.computeConv2DInfo(a.shape,u,i,1,o,c,!1,h),p=new MV(d);return n.runWebGLProgram(p,[a,s],"float32")}var zV={kernelName:Ch,backendName:"webgl",kernelFunc:OV};function PV(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:c,dimRoundingMode:u}=r,h=E.convertConv2DDataFormat(c),d=E.computeConv2DInfo(i,s.shape,o,1,l,u,!1,h),p=new FV(d);return n.runWebGLProgram(p,[a,s],"float32")}var LV={kernelName:ps,backendName:"webgl",kernelFunc:PV};function WV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dilations:l}=r,c=E.computeConv3DInfo(a.shape,s.shape,i,l,o),u=new TV(c);return n.runWebGLProgram(u,[a,s],"float32")}var BV={kernelName:yu,backendName:"webgl",kernelFunc:WV};function VV(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,pad:o,filterShape:l}=r,c=E.computeConv3DInfo(a.shape,l,i,1,o),u=new $V(c);return n.runWebGLProgram(u,[a,s],"float32")}var jV={kernelName:Rh,backendName:"webgl",kernelFunc:VV};function UV(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{pad:i,strides:o,inputShape:l}=r,c=E.computeConv3DInfo(l,s.shape,o,1,i),u=new DV(c);return n.runWebGLProgram(u,[a,s],"float32")}var HV={kernelName:Mh,backendName:"webgl",kernelFunc:UV},GV=v3+` + `}};function BV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:d,filterShape:u}=a,p=C.convertConv2DDataFormat(l),c=C.computeConv2DInfo(r.shape,u,i,1,o,d,!1,p),h=new _V(c);return n.runWebGLProgram(h,[r,s],"float32")}var VV={kernelName:Rp,backendName:"webgl",kernelFunc:BV};function jV(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:d,dimRoundingMode:u}=a,p=C.convertConv2DDataFormat(d),c=C.computeConv2DInfo(i,s.shape,o,1,l,u,!1,p),h=new PV(c);return n.runWebGLProgram(h,[r,s],"float32")}var UV={kernelName:hs,backendName:"webgl",kernelFunc:jV};function HV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,d=C.computeConv3DInfo(r.shape,s.shape,i,l,o),u=new $V(d);return n.runWebGLProgram(u,[r,s],"float32")}var GV={kernelName:yu,backendName:"webgl",kernelFunc:HV};function qV(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=a,d=C.computeConv3DInfo(r.shape,l,i,1,o),u=new LV(d);return n.runWebGLProgram(u,[r,s],"float32")}var XV={kernelName:Mp,backendName:"webgl",kernelFunc:qV};function KV(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:l}=a,d=C.computeConv3DInfo(l,s.shape,o,1,i),u=new WV(d);return n.runWebGLProgram(u,[r,s],"float32")}var ZV={kernelName:Fp,backendName:"webgl",kernelFunc:KV},YV=Iv+` return cos(x); -`,qV=qe({opSnippet:GV}),XV={kernelName:fs,backendName:"webgl",kernelFunc:qV},KV=` +`,JV=qe({opSnippet:YV}),QV={kernelName:fs,backendName:"webgl",kernelFunc:JV},ej=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; -`,ZV=qe({opSnippet:KV}),YV={kernelName:ho,backendName:"webgl",kernelFunc:ZV},JV=class{constructor(e,t,n,r,a){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[c]=t,[u,h]=n;this.outputShape=[c,u,h,l];let d=r==="bilinear"?1:0,[p,m]=[`${i-1}.0`,`${o-1}.0`],[f,A,y]=u>1?[`${(i-1)/(u-1)}`,"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[g,x,v]=h>1?[`${(o-1)/(h-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` +`,tj=qe({opSnippet:ej}),nj={kernelName:co,backendName:"webgl",kernelFunc:tj},aj=class{constructor(e,t,n,a,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[d]=t,[u,p]=n;this.outputShape=[d,u,p,l];let c=a==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,A,y]=u>1?[`${(i-1)/(u-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[g,x,k]=p>1?[`${(o-1)/(p-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` const float height_ratio = float(${f}); const float width_ratio = float(${g}); void main() { @@ -2383,18 +2383,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float width_scale = ${x}; float in_y = ${y}; - if( in_y < 0.0 || in_y > ${p} ) { - setOutput(float(${a})); + if( in_y < 0.0 || in_y > ${h} ) { + setOutput(float(${r})); return; } - float in_x = ${v}; + float in_x = ${k}; if( in_x < 0.0 || in_x > ${m} ) { - setOutput(float(${a})); + setOutput(float(${r})); return; } vec2 sourceFracIndexCR = vec2(in_x,in_y); - if(${d} == 1) { + if(${c} == 1) { // Compute the four integer indices. ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); @@ -2418,21 +2418,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput(newValue); } } - `}},QV=e=>{let{inputs:t,backend:n,attrs:r}=e,{image:a,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:c}=r,u=new JV(a.shape,s.shape,o,l,c);return n.runWebGLProgram(u,[a,s,i],"float32")},ej={kernelName:po,backendName:"webgl",kernelFunc:QV},U3=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let r=e.length,a=t?"0.0":`getX(${V3(r,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` + `}},rj=e=>{let{inputs:t,backend:n,attrs:a}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:d}=a,u=new aj(r.shape,s.shape,o,l,d);return n.runWebGLProgram(u,[r,s,i],"float32")},sj={kernelName:ho,backendName:"webgl",kernelFunc:rj},Hv=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=e;let a=e.length,r=t?"0.0":`getX(${jv(a,"coords")})`,s=e[e.length-1],i="",o="";t?(i=n?`end != ${s-1}`:"end != 0",o=n?"end + 1":"end - 1"):(i=n?`end + pow2 < ${s}`:"end >= pow2",o=n?"end + pow2":"end - pow2"),this.userCode=` uniform float index; void main() { - ${lt(r)} coords = getOutputCoords(); - int end = ${j3(r,"coords")}; - float val = ${a}; + ${lt(a)} coords = getOutputCoords(); + int end = ${Uv(a,"coords")}; + float val = ${r}; int pow2 = int(pow(2.0, index)); if (${i}) { int idx = ${o}; - ${j3(r,"coords")} = idx; - val += getX(${V3(r,"coords")}); + ${Uv(a,"coords")} = idx; + val += getX(${jv(a,"coords")}); } setOutput(val); } - `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function V3(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function j3(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function tj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,exclusive:i,reverse:o}=r,l=a.shape.length,c=E.getAxesPermutation([s],l),u=a;c!=null&&(u=dn({inputs:{x:a},backend:n,attrs:{perm:c}}));let h=E.getInnerMostAxes(1,l)[0];if(h!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${a.shape.length-1} but got axis=${s}`);let d=u.shape[h],p=Pn({inputs:{x:u},backend:n});for(let m=0;m<=Math.ceil(Math.log2(d))-1;m++){let f=new U3(u.shape,!1,o),A=f.getCustomSetupFunc(m),y=p;p=n.runWebGLProgram(f,[p],p.dtype,A),n.disposeIntermediateTensorInfo(y)}if(i){let m=new U3(u.shape,i,o),f=p;p=n.runWebGLProgram(m,[p],p.dtype),n.disposeIntermediateTensorInfo(f)}if(c!=null){let m=E.getUndoAxesPermutation(c),f=dn({inputs:{x:p},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(u),f}return p}var nj={kernelName:ms,backendName:"webgl",kernelFunc:tj};function rj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:i,binaryOutput:o}=r;if(a.shape.length===1){let l=n.readSync(a.dataId),c=n.readSync(s.dataId),u=l3(l,c,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}else if(a.shape.length===2){let l=n.bufferSync(a),c=n.bufferSync(s),u=TL(l,c,i,o);return n.makeTensorInfo(u.shape,s.dtype,u.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${a.shape.length}.`)}var aj={kernelName:Fh,backendName:"webgl",kernelFunc:rj},sj=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.index==null&&(this.index=t.getUniformLocation(n,"index")),t.gl.uniform1f(this.index,e)}}};function jv(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.x, ${t}.y`;if(e===3)return`${t}.x, ${t}.y, ${t}.z`;if(e===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function Uv(e,t){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw Error(`Cumulative sum for rank ${e} is not yet supported`)}function ij(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=a,l=r.shape.length,d=C.getAxesPermutation([s],l),u=r;d!=null&&(u=cn({inputs:{x:r},backend:n,attrs:{perm:d}}));let p=C.getInnerMostAxes(1,l)[0];if(p!==l-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${r.shape.length-1} but got axis=${s}`);let c=u.shape[p],h=Pn({inputs:{x:u},backend:n});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let f=new Hv(u.shape,!1,o),A=f.getCustomSetupFunc(m),y=h;h=n.runWebGLProgram(f,[h],h.dtype,A),n.disposeIntermediateTensorInfo(y)}if(i){let m=new Hv(u.shape,i,o),f=h;h=n.runWebGLProgram(m,[h],h.dtype),n.disposeIntermediateTensorInfo(f)}if(d!=null){let m=C.getUndoAxesPermutation(d),f=cn({inputs:{x:h},backend:n,attrs:{perm:m}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(u),f}return h}var oj={kernelName:ms,backendName:"webgl",kernelFunc:ij};function lj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=a;if(r.shape.length===1){let l=n.readSync(r.dataId),d=n.readSync(s.dataId),u=uv(l,d,s.dtype,s.shape,i);return n.makeTensorInfo([i],s.dtype,u)}else if(r.shape.length===2){let l=n.bufferSync(r),d=n.bufferSync(s),u=$L(l,d,i,o);return n.makeTensorInfo(u.shape,s.dtype,u.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var uj={kernelName:$p,backendName:"webgl",kernelFunc:lj},dj=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -2451,20 +2451,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float result = ${this.getInputSamplingString()}; setOutput(result); } - `}getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function ij(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockSize:s,dataFormat:i}=r;_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=i==="NHWC"?a.shape[1]:a.shape[2],c=i==="NHWC"?a.shape[2]:a.shape[3],u=i==="NHWC"?a.shape[3]:a.shape[1],h=l*s,d=c*s,p=u/(s*s),m=i==="NHWC"?[o,h,d,p]:[o,p,h,d],f=new sj(m,s,i);return n.runWebGLProgram(f,[a],a.dtype)}var oj={kernelName:fo,backendName:"webgl",kernelFunc:ij},H3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,l=e.padInfo.left,c=e.strideHeight,u=e.strideWidth,h=e.dilationHeight,d=e.dilationWidth,p=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,A="",y="";n&&(r?A=`float activation(float a) { + `}getHeightCoordString(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"}getWidthCoordString(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"}getDepthCoordString(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"}getOutputDepthSize(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function pj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockSize:s,dataFormat:i}=a;w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],d=i==="NHWC"?r.shape[2]:r.shape[3],u=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=d*s,h=u/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=new dj(m,s,i);return n.runWebGLProgram(f,[r],r.dtype)}var cj={kernelName:fo,backendName:"webgl",kernelFunc:pj},Gv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let s=e.inHeight,i=e.inWidth,o=e.padInfo.top,l=e.padInfo.left,d=e.strideHeight,u=e.strideWidth,p=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,m=e.filterWidth,f=e.outChannels/e.inChannels,A="",y="";n&&(a?A=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${n} - }`:a?A=`float activation(float a) { + }`:r?A=`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${n} }`:A=` float activation(float x) { ${n} } - `,y="result = activation(result);");let g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,y="result = activation(result);");let g=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${A} - const ivec2 strides = ivec2(${c}, ${u}); + const ivec2 strides = ivec2(${d}, ${u}); const ivec2 pads = ivec2(${o}, ${l}); void main() { @@ -2482,15 +2482,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. - for (int wR = 0; wR < ${p}; wR++) { - int xR = xRCorner + wR * ${h}; + for (int wR = 0; wR < ${h}; wR++) { + int xR = xRCorner + wR * ${p}; if (xR < 0 || xR >= ${s}) { continue; } for (int wC = 0; wC < ${m}; wC++) { - int xC = xCCorner + wC * ${d}; + int xC = xCCorner + wC * ${c}; if (xC < 0 || xC >= ${i}) { continue; @@ -2507,30 +2507,30 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam ${y} setOutput(result); } - `}},G3=class{constructor(e,t=!1,n=null,r=!1,a=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,l=e.padInfo.top,c=e.padInfo.left,u=e.strideHeight,h=e.strideWidth,d=e.dilationHeight,p=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,A=f,y=` + `}},qv=class{constructor(e,t=!1,n=null,a=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.outShape;let s=e.outChannels/e.inChannels,i=e.inHeight,o=e.inWidth,l=e.padInfo.top,d=e.padInfo.left,u=e.strideHeight,p=e.strideWidth,c=e.dilationHeight,h=e.dilationWidth,m=e.filterHeight,f=e.filterWidth,A=f,y=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let w=0;w=0 && xR < ${i}) { - `;for(let b=0;b= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - `,p===1&&k>0?y+=` - xC${k} = vec4(xTexelC${k-2}.zw, xTexelC${k}.xy); + `,h===1&&I>0?y+=` + xC${I} = vec4(xTexelC${I-2}.zw, xTexelC${I}.xy); `:y+=` xCOffset = xC + 1 - 2; @@ -2543,120 +2543,120 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam previous.zw = vec2(0.0); } - xC${k} = vec4(previous.zw, xTexelC${k}.xy); + xC${I} = vec4(previous.zw, xTexelC${I}.xy); } else { - xC${k} = vec4(0.0, 0.0, xTexelC${k}.xy); + xC${I} = vec4(0.0, 0.0, xTexelC${I}.xy); } `):y+=` if (xC >= 0 && xC < ${o}) { - xTexelC${k} = getX(batch, xR, xC, d1); + xTexelC${I} = getX(batch, xR, xC, d1); if (xC + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - xC${k} = xTexelC${k}; - `,k+1= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - `,p>1&&(y+=` + `,h>1&&(y+=` xCOffset -= 2; if (xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); } `),y+=` - xC${k+1} = vec4(xTexelC${k}.zw, xTexelC${k+2}.xy); - `):N===1?y+=` - xC${k+1} = xTexelC${k}; + xC${I+1} = vec4(xTexelC${I}.zw, xTexelC${I+2}.xy); + `):T===1?y+=` + xC${I+1} = xTexelC${I}; `:y+=` - xCOffset = xC + ${N}; + xCOffset = xC + ${T}; if (xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - xC${k+1} = xTexelC${k+2}; - `}}else k= 0 && xCOffset < ${o}) { - xTexelC${k} = getX(batch, xR, xCOffset, d1); + xTexelC${I} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } if(xC + 1 >= 0 && xC + 1 < ${o}) { - xTexelC${k+2} = getX(batch, xR, xC + 1, d1); + xTexelC${I+2} = getX(batch, xR, xC + 1, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xC + 2 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.0); + xTexelC${I+2}.zw = vec2(0.0); } } - xC${k} = vec4(xTexelC${k}.zw, xTexelC${k+2}.zw); - `,k+1= 0 && xCOffset < ${o}) { final = getX(batch, xR, xCOffset, d1); } - xC${k+1} = vec4(xTexelC${k+2}.xy, final.xy); + xC${I+1} = vec4(xTexelC${I+2}.xy, final.xy); `)):(y+=` if(xC >= 0 && xC < ${o}) { - xTexelC${k} = getX(batch, xR, xC, d1); + xTexelC${I} = getX(batch, xR, xC, d1); if (xC + 1 >= ${o}) { - xTexelC${k}.zw = vec2(0.0); + xTexelC${I}.zw = vec2(0.0); } } - xCOffset = xC + ${h}; + xCOffset = xC + ${p}; if(xCOffset >= 0 && xCOffset < ${o}) { - xTexelC${k+2} = getX(batch, xR, xCOffset, d1); + xTexelC${I+2} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= ${o}) { - xTexelC${k+2}.zw = vec2(0.); + xTexelC${I+2}.zw = vec2(0.); } } - xC${k} = vec4( - xTexelC${k}.xy, xTexelC${k+2}.xy); - `,k+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let h=E.computeConv2DInfo(a.shape,s.shape,i,u,o,c,!0),d;return J().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?d=new G3(h):d=new H3(h),n.runWebGLProgram(d,[a,s],"float32")}var uj={kernelName:As,backendName:"webgl",kernelFunc:lj},cj=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,a=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` + `}};function hj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l,dimRoundingMode:d}=a,u=l;u==null&&(u=[1,1]),w.assert(C.eitherStridesOrDilationsAreOne(i,u),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!0),c;return J().getBool("WEBGL_PACK_DEPTHWISECONV")&&p.strideWidth<=2&&p.outChannels/p.inChannels==1?c=new qv(p):c=new Gv(p),n.runWebGLProgram(c,[r,s],"float32")}var fj={kernelName:As,backendName:"webgl",kernelFunc:hj},mj=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,n=e.strideWidth,a=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2693,14 +2693,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // TO DO: Vec4 over the batch size for (int b = 0; b < ${e.batchSize}; b++) { for (int yR = 0; yR < ${e.outHeight}; yR++) { - int xR = wR + yR * ${t} - ${r}; + int xR = wR + yR * ${t} - ${a}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC < ${e.outWidth}; yC++) { - int xC = wC + yC * ${n} - ${a}; + int xC = wC + yC * ${n} - ${r}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2714,7 +2714,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},hj=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,a=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` + `}},Aj=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,n=e.filterWidth,a=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${s}, ${i}); void main() { @@ -2728,7 +2728,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float dotProd = 0.0; for (int wR = 0; wR < ${t}; wR++) { - float dyR = float(dyRCorner + wR) / ${r}.0; + float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; @@ -2738,7 +2738,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${n}; wC++) { - float dyC = float(dyCCorner + wC) / ${a}.0; + float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -2759,15 +2759,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}};function dj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:c,filterShape:u}=r,h=E.computeConv2DInfo(a.shape,u,i,o,l,c,!0),d=new cj(h);return n.runWebGLProgram(d,[a,s],"float32")}var pj={kernelName:$h,backendName:"webgl",kernelFunc:dj};function fj(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:c,inputShape:u}=r,h=E.computeConv2DInfo(u,s.shape,i,o,l,c,!0),d=new hj(h);return n.runWebGLProgram(d,[a,s],"float32")}var mj={kernelName:Dh,backendName:"webgl",kernelFunc:fj},Aj=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` + `}};function yj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:d,filterShape:u}=a,p=C.computeConv2DInfo(r.shape,u,i,o,l,d,!0),c=new mj(p);return n.runWebGLProgram(c,[r,s],"float32")}var gj={kernelName:Dp,backendName:"webgl",kernelFunc:yj};function xj(e){let{inputs:t,backend:n,attrs:a}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:d,inputShape:u}=a,p=C.computeConv2DInfo(u,s.shape,i,o,l,d,!0),c=new Aj(p);return n.runWebGLProgram(c,[r,s],"float32")}var bj={kernelName:Op,backendName:"webgl",kernelFunc:xj},vj=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` void main() { ivec2 coords = getOutputCoords(); float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; setOutput(val); } - `}};function yj(e){let{inputs:t,backend:n}=e,{x:r}=t,a=[...r.shape,...r.shape],s=_.sizeFromShape(r.shape),i=fe({inputs:{x:r},backend:n,attrs:{shape:[s]}}),o=new Aj(s),l=n.runWebGLProgram(o,[i],i.dtype),c=fe({inputs:{x:l},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),c}var gj={kernelName:Oh,backendName:"webgl",kernelFunc:yj},xj=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:r,strideHeight:a,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:c}=e,{top:u,left:h}=r;this.userCode=` - const ivec2 strides = ivec2(${a}, ${s}); - const ivec2 pads = ivec2(${u}, ${h}); + `}};function wj(e){let{inputs:t,backend:n}=e,{x:a}=t,r=[...a.shape,...a.shape],s=w.sizeFromShape(a.shape),i=fe({inputs:{x:a},backend:n,attrs:{shape:[s]}}),o=new vj(s),l=n.runWebGLProgram(o,[i],i.dtype),d=fe({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),d}var kj={kernelName:zp,backendName:"webgl",kernelFunc:wj},Ij=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:n,padInfo:a,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:d}=e,{top:u,left:p}=a;this.userCode=` + const ivec2 strides = ivec2(${r}, ${s}); + const ivec2 pads = ivec2(${u}, ${p}); const float neg_infinity = -3.4e38; void main() { @@ -2785,7 +2785,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam if (hIn >= 0 && hIn < ${t}) { for (int w = 0; w < ${o}; w++) { - int wIn = wBeg + w * ${c}; + int wIn = wBeg + w * ${d}; if (wIn >= 0 && wIn < ${n}) { float xVal = getX(batch, hIn, wIn, d1); @@ -2803,7 +2803,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float result = curVal; setOutput(result); } - `}};function wj(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s}=t,{strides:i,pad:o,dilations:l}=r,c=E.computeDilation2DInfo(a.shape,s.shape,i,o,"NHWC",l),u,h=new xj(c);u=n.runWebGLProgram(h,[a,s],"float32");let d=fe({inputs:{x:u},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(u),d}var bj={kernelName:gu,backendName:"webgl",kernelFunc:wj};function _j(e){let{inputs:t,backend:n,attrs:r}=e,{equation:a}=r,s=t,{allDims:i,summedDims:o,idDims:l}=E.decodeEinsumEquation(a,s.length);E.checkEinsumDimSizes(i.length,l,s);let{path:c,steps:u}=E.getEinsumComputePath(o,l),h=u.length,d=null,p=i.length,m=[];for(let f=0;f=0&&(d=gp({inputs:{x:d},backend:n,attrs:{axis:c[f]-(i.length-p),keepDims:!1}}),m.push(d)),p--)}for(let f of m)f!==d&&n.disposeIntermediateTensorInfo(f);return d}var vj={kernelName:Lh,backendName:"webgl",kernelFunc:_j},kj="return (x >= 0.0) ? x : (exp(x) - 1.0);",Ij=` + `}};function Sj(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=a,d=C.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),u,p=new Ij(d);u=n.runWebGLProgram(p,[r,s],"float32");let c=fe({inputs:{x:u},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(u),c}var Nj={kernelName:gu,backendName:"webgl",kernelFunc:Sj};function Tj(e){let{inputs:t,backend:n,attrs:a}=e,{equation:r}=a,s=t,{allDims:i,summedDims:o,idDims:l}=C.decodeEinsumEquation(r,s.length);C.checkEinsumDimSizes(i.length,l,s);let{path:d,steps:u}=C.getEinsumComputePath(o,l),p=u.length,c=null,h=i.length,m=[];for(let f=0;f=0&&(c=gh({inputs:{x:c},backend:n,attrs:{axis:d[f]-(i.length-h),keepDims:!1}}),m.push(c)),h--)}for(let f of m)f!==c&&n.disposeIntermediateTensorInfo(f);return c}var Ej={kernelName:Lp,backendName:"webgl",kernelFunc:Tj},Cj="return (x >= 0.0) ? x : (exp(x) - 1.0);",Rj=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -2812,41 +2812,41 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,Sj=qe({opSnippet:kj,packedOpSnippet:Ij}),Nj={kernelName:mo,backendName:"webgl",kernelFunc:Sj},Tj="return (b >= 1.0) ? a : a * (b + 1.0);",Ej=` +`,Mj=qe({opSnippet:Cj,packedOpSnippet:Rj}),Fj={kernelName:mo,backendName:"webgl",kernelFunc:Mj},$j="return (b >= 1.0) ? a : a * (b + 1.0);",Dj=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); -`,Cj=e=>{let{inputs:t,backend:n}=e,{dy:r,y:a}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fc(Ej,r.shape,a.shape):new $l(Tj,r.shape,a.shape);return n.runWebGLProgram(s,[r,a],r.dtype)},Rj={kernelName:Wh,backendName:"webgl",kernelFunc:Cj},Mj=` +`,Oj=e=>{let{inputs:t,backend:n}=e,{dy:a,y:r}=t,s=J().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new fd(Dj,a.shape,r.shape):new Dl($j,a.shape,r.shape);return n.runWebGLProgram(s,[a,r],a.dtype)},zj={kernelName:Wp,backendName:"webgl",kernelFunc:Oj},_j=` return vec4(equal(a, b)); -`,Fj="return float(a == b);",$j=en({opSnippet:Fj,packedOpSnippet:Mj,dtype:"bool"}),Dj={kernelName:yo,backendName:"webgl",kernelFunc:$j},Oj=` +`,Pj="return float(a == b);",Lj=en({opSnippet:Pj,packedOpSnippet:_j,dtype:"bool"}),Wj={kernelName:yo,backendName:"webgl",kernelFunc:Lj},Bj=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - float p = ${E.ERF_P}; - float a1 = ${E.ERF_A1}; - float a2 = ${E.ERF_A2}; - float a3 = ${E.ERF_A3}; - float a4 = ${E.ERF_A4}; - float a5 = ${E.ERF_A5}; + float p = ${C.ERF_P}; + float a1 = ${C.ERF_A1}; + float a2 = ${C.ERF_A2}; + float a3 = ${C.ERF_A3}; + float a4 = ${C.ERF_A4}; + float a5 = ${C.ERF_A5}; float sign = sign(x); x = abs(x); float t = 1.0 / (1.0 + p * x); return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); -`,zj=qe({opSnippet:Oj}),Pj={kernelName:Ao,backendName:"webgl",kernelFunc:zj},q3="return exp(x);",X3=qe({opSnippet:q3,packedOpSnippet:q3,cpuKernelImpl:RL}),Lj={kernelName:gs,backendName:"webgl",kernelFunc:X3};function gA(e){let{inputs:t,attrs:n,backend:r}=e,{dim:a}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=a;return a<0&&(_.assert(-(i+1)<=a,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+a+1),o.splice(l,0,1),fe({inputs:{x:s},backend:r,attrs:{shape:o}})}var Wj={kernelName:go,backendName:"webgl",kernelFunc:gA},K3="return exp(x) - 1.0;",Bj=qe({opSnippet:K3,packedOpSnippet:K3,cpuKernelImpl:ML}),Vj={kernelName:xo,backendName:"webgl",kernelFunc:Bj},Z3=class{constructor(e,t,n){this.variableNames=["real","imag"];let r=t[1];this.outputShape=t;let a=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${r}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` - const float exponentMultiplier = ${a}; +`,Vj=qe({opSnippet:Bj}),jj={kernelName:Ao,backendName:"webgl",kernelFunc:Vj},Xv="return exp(x);",Kv=qe({opSnippet:Xv,packedOpSnippet:Xv,cpuKernelImpl:zL}),Uj={kernelName:gs,backendName:"webgl",kernelFunc:Kv};function g1(e){let{inputs:t,attrs:n,backend:a}=e,{dim:r}=n,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(w.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),fe({inputs:{x:s},backend:a,attrs:{shape:o}})}var Hj={kernelName:go,backendName:"webgl",kernelFunc:g1},Zv="return exp(x) - 1.0;",Gj=qe({opSnippet:Zv,packedOpSnippet:Zv,cpuKernelImpl:_L}),qj={kernelName:xo,backendName:"webgl",kernelFunc:Gj},Yv=class{constructor(e,t,n){this.variableNames=["real","imag"];let a=t[1];this.outputShape=t;let r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${a}.0`:"1.0",i;if(e==="real")i="return real * expR - imag * expI;";else if(e==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` + const float exponentMultiplier = ${r}; float unaryOpComplex(float real, float expR, float imag, float expI) { ${i} } float mulMatDFT(int batch, int index) { - float indexRatio = float(index) / float(${r}); + float indexRatio = float(index) / float(${a}); float exponentMultiplierTimesIndexRatio = exponentMultiplier * indexRatio; float result = 0.0; - for (int i = 0; i < ${r}; i++) { + for (int i = 0; i < ${a}; i++) { // x = (-2|2 * PI / N) * index * i; float x = exponentMultiplierTimesIndexRatio * float(i); float expR = cos(x); @@ -2865,13 +2865,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } - `}};function Y3(e,t,n){let r=n.texData.get(e.dataId),a=_.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=a/s,o=fe({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),l=o.shape,c=new Z3("real",l,t),u=new Z3("imag",l,t),h=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:l},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:l}],d=n.runWebGLProgram(c,h,"float32"),p=n.runWebGLProgram(u,h,"float32"),m=Ba({inputs:{real:d,imag:p},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p);let f=fe({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function jj(e){let{inputs:t,backend:n}=e,{input:r}=t;return Y3(r,!1,n)}var Uj={kernelName:Bh,backendName:"webgl",kernelFunc:jj},Hj=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` + `}};function Jv(e,t,n){let a=n.texData.get(e.dataId),r=w.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=fe({inputs:{x:e},backend:n,attrs:{shape:[i,s]}}),l=o.shape,d=new Yv("real",l,t),u=new Yv("imag",l,t),p=[{dataId:a.complexTensorInfos.real.dataId,dtype:a.complexTensorInfos.real.dtype,shape:l},{dataId:a.complexTensorInfos.imag.dataId,dtype:a.complexTensorInfos.imag.dtype,shape:l}],c=n.runWebGLProgram(d,p,"float32"),h=n.runWebGLProgram(u,p,"float32"),m=Lr({inputs:{real:c,imag:h},backend:n});n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h);let f=fe({inputs:{x:m},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(m),f}function Xj(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jv(a,!1,n)}var Kj={kernelName:Bp,backendName:"webgl",kernelFunc:Xj},Zj=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` uniform float value; void main() { // Input can be obtained from uniform value. setOutput(value); } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function xA(e){let{backend:t,attrs:n}=e,{shape:r,value:a}=n,{dtype:s}=n;if(s=s||_.inferDtype(a),s==="string"){let i=_.getArrayFromDType(s,_.sizeFromShape(r));return i.fill(a),t.makeTensorInfo(r,s,i)}else{let i=new Hj(r,a),o=i.getCustomSetupFunc(a);return t.runWebGLProgram(i,[],s,o)}}var Gj={kernelName:xu,backendName:"webgl",kernelFunc:xA},qj=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}};function x1(e){let{backend:t,attrs:n}=e,{shape:a,value:r}=n,{dtype:s}=n;if(s=s||w.inferDtype(r),s==="string"){let i=w.getArrayFromDType(s,w.sizeFromShape(a));return i.fill(r),t.makeTensorInfo(a,s,i)}else{let i=new Zj(a,r),o=i.getCustomSetupFunc(r);return t.runWebGLProgram(i,[],s,o)}}var Yj={kernelName:xu,backendName:"webgl",kernelFunc:x1},Jj=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int x = coords[2]; @@ -2885,7 +2885,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(outputValue); } - `}},Xj={kernelName:wo,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,r=t,a=new qj(n.shape);return r.runWebGLProgram(a,[n],n.dtype)}},J3="return floor(x);",Kj=qe({opSnippet:J3,packedOpSnippet:J3,cpuKernelImpl:FL}),Zj={kernelName:xs,backendName:"webgl",kernelFunc:Kj},Yj=` + `}},Qj={kernelName:bo,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:n}=e,a=t,r=new Jj(n.shape);return a.runWebGLProgram(r,[n],n.dtype)}},Qv="return floor(x);",eU=qe({opSnippet:Qv,packedOpSnippet:Qv,cpuKernelImpl:PL}),tU={kernelName:xs,backendName:"webgl",kernelFunc:eU},nU=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -2895,7 +2895,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } else { return NAN; } -`,Jj=` +`,aU=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -2916,13 +2916,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); -`,Qj=en({opSnippet:Yj,packedOpSnippet:Jj,dtype:"int32"}),eU={kernelName:ws,backendName:"webgl",kernelFunc:Qj},tU=class{constructor(e){this.variableNames=["A"];let t=cn(),[n,r]=e;this.outputShape=e,this.userCode=` +`,rU=en({opSnippet:nU,packedOpSnippet:aU,dtype:"int32"}),sU={kernelName:bs,backendName:"webgl",kernelFunc:rU},iU=class{constructor(e){this.variableNames=["A"];let t=dn(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; int texC = coords[1]; int depth = coords[2]; - vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}.0, ${n}.0); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${a}.0, ${n}.0); vec4 values = ${t.texture2D}(A, uv); float value; @@ -2938,7 +2938,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput(floor(value * 255.0 + 0.5)); } - `}},nU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=cn(),[n,r]=e;this.outputShape=e,this.userCode=` + `}},oU=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=dn(),[n,a]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -2953,7 +2953,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam depth = coords[2] + col; vec2 uv = (vec2(texC, texR) + halfCR) / - vec2(${r}.0, ${n}.0); + vec2(${a}.0, ${n}.0); vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { @@ -2972,10 +2972,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam ${t.output} = result; } - `}},aU={kernelName:rd,backendName:"webgl",kernelFunc:rU},Ol;function rU(e){let{inputs:t,backend:n,attrs:r}=e,{pixels:a}=t,{numChannels:s}=r,i=typeof HTMLVideoElement!="undefined"&&a instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&a instanceof HTMLImageElement,[l,c]=i?[a.videoWidth,a.videoHeight]:[a.width,a.height],u=[c,l],h=[c,l,s];(o||i)&&(Ol==null&&(Ol=document.createElement("canvas").getContext("2d")),Ol.canvas.width=l,Ol.canvas.height=c,Ol.drawImage(a,0,0,l,c),a=Ol.canvas);let d=n.makeTensorInfo(u,"int32");n.texData.get(d.dataId).usage=Jn.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),a);let p=J().getBool("WEBGL_PACK")?new nU(h):new tU(h),m=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),m}function sU(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=r,f=E.convertConv2DDataFormat(u),A=E.computeConv2DInfo(a.shape,s.shape,l,h,c,d,!1,f),y,g=[];if(A.filterHeight===1&&A.filterWidth===1&&A.dilationHeight===1&&A.dilationWidth===1&&A.strideHeight===1&&A.strideWidth===1&&(A.padInfo.type==="SAME"||A.padInfo.type==="VALID"))y=W3({x:a,filter:s,convInfo:A,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:m});else if(J().getBool("WEBGL_CONV_IM2COL")&&a.shape[0]===1)y=B3({x:a,filter:s,convInfo:A,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:m});else{let v=i!=null,w=o!=null,b=p==="leakyrelu",k=p?Ap(p,!1):null,N=new L3(A,v,k,w,b),C=[a,s];if(i&&C.push(i),o&&C.push(o),b){let F=n.makeTensorInfo([],"float32",_.createScalarValue(m,"float32"));C.push(F),g.push(F)}y=n.runWebGLProgram(N,C,"float32")}let x=fe({inputs:{x:y},backend:n,attrs:{shape:A.outShape}});return g.push(y),g.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var iU={kernelName:ti,backendName:"webgl",kernelFunc:sU};function oU(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=r,m=[],f=u;f==null&&(f=[1,1]),_.assert(E.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let A=E.computeConv2DInfo(a.shape,s.shape,l,f,c,h,!0),y=J().getBool("WEBGL_PACK_DEPTHWISECONV")&&A.strideWidth<=2&&A.outChannels/A.inChannels==1,g=d?Ap(d,y):null,x=[a,s],v=i!=null,w=o!=null,b=d==="leakyrelu";if(v&&x.push(i),w&&x.push(o),b){let C=n.makeTensorInfo([],"float32",_.createScalarValue(p,"float32"));x.push(C),m.push(C)}let k;y?k=new G3(A,v,g,w,b):k=new H3(A,v,g,w,b);let N=n.runWebGLProgram(k,x,"float32");return m.forEach(C=>n.disposeIntermediateTensorInfo(C)),N}var lU={kernelName:ni,backendName:"webgl",kernelFunc:oU},uU=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let r=lt(t.length),a=lt(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` - ${r} strides = ${r}(${this.strides}); + `}},uU={kernelName:ac,backendName:"webgl",kernelFunc:lU},zl;function lU(e){let{inputs:t,backend:n,attrs:a}=e,{pixels:r}=t,{numChannels:s}=a,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[l,d]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],u=[d,l],p=[d,l,s];(o||i)&&(zl==null&&(zl=document.createElement("canvas").getContext("2d")),zl.canvas.width=l,zl.canvas.height=d,zl.drawImage(r,0,0,l,d),r=zl.canvas);let c=n.makeTensorInfo(u,"int32");n.texData.get(c.dataId).usage=Jn.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(c.dataId),r);let h=J().getBool("WEBGL_PACK")?new oU(p):new iU(p),m=n.runWebGLProgram(h,[c],"int32");return n.disposeData(c.dataId),m}function dU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dataFormat:u,dilations:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=a,f=C.convertConv2DDataFormat(u),A=C.computeConv2DInfo(r.shape,s.shape,l,p,d,c,!1,f),y,g=[];if(A.filterHeight===1&&A.filterWidth===1&&A.dilationHeight===1&&A.dilationWidth===1&&A.strideHeight===1&&A.strideWidth===1&&(A.padInfo.type==="SAME"||A.padInfo.type==="VALID"))y=Bv({x:r,filter:s,convInfo:A,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(J().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)y=Vv({x:r,filter:s,convInfo:A,backend:n,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let k=i!=null,b=o!=null,v=h==="leakyrelu",I=h?Ah(h,!1):null,T=new Wv(A,k,I,b,v),R=[r,s];if(i&&R.push(i),o&&R.push(o),v){let $=n.makeTensorInfo([],"float32",w.createScalarValue(m,"float32"));R.push($),g.push($)}y=n.runWebGLProgram(T,R,"float32")}let x=fe({inputs:{x:y},backend:n,attrs:{shape:A.outShape}});return g.push(y),g.forEach(k=>n.disposeIntermediateTensorInfo(k)),x}var pU={kernelName:ti,backendName:"webgl",kernelFunc:dU};function cU(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dimRoundingMode:p,activation:c,leakyreluAlpha:h}=a,m=[],f=u;f==null&&(f=[1,1]),w.assert(C.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let A=C.computeConv2DInfo(r.shape,s.shape,l,f,d,p,!0),y=J().getBool("WEBGL_PACK_DEPTHWISECONV")&&A.strideWidth<=2&&A.outChannels/A.inChannels==1,g=c?Ah(c,y):null,x=[r,s],k=i!=null,b=o!=null,v=c==="leakyrelu";if(k&&x.push(i),b&&x.push(o),v){let R=n.makeTensorInfo([],"float32",w.createScalarValue(h,"float32"));x.push(R),m.push(R)}let I;y?I=new qv(A,k,g,b,v):I=new Gv(A,k,g,b,v);let T=n.runWebGLProgram(I,x,"float32");return m.forEach(R=>n.disposeIntermediateTensorInfo(R)),T}var hU={kernelName:ni,backendName:"webgl",kernelFunc:cU},fU=class{constructor(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;let a=lt(t.length),r=lt(n.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode=` + ${a} strides = ${a}(${this.strides}); void main() { - ${a} coords = getOutputCoords(); + ${r} coords = getOutputCoords(); int flattenIndex = 0; for (int j = 0; j < ${this.sliceDim}; j++) { int index = round(getIndices(coords[0], j)); @@ -2983,21 +2983,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(getX(flattenIndex, coords[1])); } - `}};function cU(e){let{inputs:t,backend:n}=e,{params:r,indices:a}=t,s=a.shape,i=s[s.length-1],[o,l,c,u]=E.prepareAndValidate(r,a),h=fe({inputs:{x:a},backend:n,attrs:{shape:[l,i]}}),d=fe({inputs:{x:r},backend:n,attrs:{shape:[_.sizeFromShape(r.shape)/c,c]}}),p=new uU(i,u,[l,c]),m=n.runWebGLProgram(p,[d,h],d.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(m),f}var hU={kernelName:_o,backendName:"webgl",kernelFunc:cU},pU=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=lt(this.rank),r=dU(e,2);this.userCode=` + `}};function mU(e){let{inputs:t,backend:n}=e,{params:a,indices:r}=t,s=r.shape,i=s[s.length-1],[o,l,d,u]=C.prepareAndValidate(a,r),p=fe({inputs:{x:r},backend:n,attrs:{shape:[l,i]}}),c=fe({inputs:{x:a},backend:n,attrs:{shape:[w.sizeFromShape(a.shape)/d,d]}}),h=new fU(i,u,[l,d]),m=n.runWebGLProgram(h,[c,p],c.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(m),f}var AU={kernelName:wo,backendName:"webgl",kernelFunc:mU},gU=class{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let n=lt(this.rank),a=yU(e,2);this.userCode=` void main() { ${n} resRC = getOutputCoords(); - setOutput(getA(${r})); + setOutput(getA(${a})); } - `}};function dU(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[];for(let a=0;an.disposeIntermediateTensorInfo(w)),n.makeTensorInfo(c.outputShape,v.dtype,v.values)}let f=new pU(d.shape,m),A=n.runWebGLProgram(f,[d,p],d.dtype);h.push(A);let y=fe({inputs:{x:A},backend:n,attrs:{shape:c.outputShape}});return h.forEach(g=>n.disposeIntermediateTensorInfo(g)),y}var mU={kernelName:bo,backendName:"webgl",kernelFunc:fU},AU="return float(a > b);",yU=` + `}};function yU(e,t){let n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let r=0;rn.disposeIntermediateTensorInfo(b)),n.makeTensorInfo(d.outputShape,k.dtype,k.values)}let f=new gU(c.shape,m),A=n.runWebGLProgram(f,[c,h],c.dtype);p.push(A);let y=fe({inputs:{x:A},backend:n,attrs:{shape:d.outputShape}});return p.forEach(g=>n.disposeIntermediateTensorInfo(g)),y}var bU={kernelName:vo,backendName:"webgl",kernelFunc:xU},vU="return float(a > b);",wU=` return vec4(greaterThan(a, b)); -`,gU=en({opSnippet:AU,packedOpSnippet:yU,cpuKernelImpl:DL,dtype:"bool"}),xU={kernelName:vo,backendName:"webgl",kernelFunc:gU},wU="return float(a >= b);",bU=` +`,kU=en({opSnippet:vU,packedOpSnippet:wU,cpuKernelImpl:WL,dtype:"bool"}),IU={kernelName:ko,backendName:"webgl",kernelFunc:kU},SU="return float(a >= b);",NU=` return vec4(greaterThanEqual(a, b)); -`,_U=en({opSnippet:wU,packedOpSnippet:bU,dtype:"bool"}),vU={kernelName:_s,backendName:"webgl",kernelFunc:_U};function kU(e){let{inputs:t,backend:n}=e,{input:r}=t;return Y3(r,!0,n)}var IU={kernelName:Vh,backendName:"webgl",kernelFunc:kU},SU="return float(!isnan(x) && !isinf(x));",NU=qe({opSnippet:SU,dtype:"bool"}),TU={kernelName:ko,backendName:"webgl",kernelFunc:NU},EU="return float(isinf(x));",CU=qe({opSnippet:EU,dtype:"bool"}),RU={kernelName:Io,backendName:"webgl",kernelFunc:CU},MU="return float(isnan(x));",FU=qe({opSnippet:MU,dtype:"bool"}),$U={kernelName:So,backendName:"webgl",kernelFunc:FU},DU="return float(a < b);",OU=` +`,TU=en({opSnippet:SU,packedOpSnippet:NU,dtype:"bool"}),EU={kernelName:ws,backendName:"webgl",kernelFunc:TU};function CU(e){let{inputs:t,backend:n}=e,{input:a}=t;return Jv(a,!0,n)}var RU={kernelName:Vp,backendName:"webgl",kernelFunc:CU},MU="return float(!isnan(x) && !isinf(x));",FU=qe({opSnippet:MU,dtype:"bool"}),$U={kernelName:Io,backendName:"webgl",kernelFunc:FU},DU="return float(isinf(x));",OU=qe({opSnippet:DU,dtype:"bool"}),zU={kernelName:So,backendName:"webgl",kernelFunc:OU},_U="return float(isnan(x));",PU=qe({opSnippet:_U,dtype:"bool"}),LU={kernelName:No,backendName:"webgl",kernelFunc:PU},WU="return float(a < b);",BU=` return vec4(lessThan(a, b)); -`,zU=en({opSnippet:DU,packedOpSnippet:OU,cpuKernelImpl:OL,dtype:"bool"}),PU={kernelName:No,backendName:"webgl",kernelFunc:zU},LU="return float(a <= b);",WU=` +`,VU=en({opSnippet:WU,packedOpSnippet:BU,cpuKernelImpl:BL,dtype:"bool"}),jU={kernelName:To,backendName:"webgl",kernelFunc:VU},UU="return float(a <= b);",HU=` return vec4(lessThanEqual(a, b)); -`,BU=en({opSnippet:LU,packedOpSnippet:WU,dtype:"bool"}),VU={kernelName:To,backendName:"webgl",kernelFunc:BU};function jU(e){let{backend:t,attrs:n}=e,{start:r,stop:a,num:s}=n,i=zL(r,a,s);return t.makeTensorInfo([i.length],"float32",i)}var UU={kernelName:Uh,backendName:"webgl",kernelFunc:jU},HU=`if (x < 0.0) return NAN; - return log(x);`,GU=` +`,GU=en({opSnippet:UU,packedOpSnippet:HU,dtype:"bool"}),qU={kernelName:Eo,backendName:"webgl",kernelFunc:GU};function XU(e){let{backend:t,attrs:n}=e,{start:a,stop:r,num:s}=n,i=VL(a,r,s);return t.makeTensorInfo([i.length],"float32",i)}var KU={kernelName:Up,backendName:"webgl",kernelFunc:XU},ZU=`if (x < 0.0) return NAN; + return log(x);`,YU=` vec4 result = log(x); vec4 isNaN = vec4(lessThan(x, vec4(0.0))); result.r = isNaN.r == 1.0 ? NAN : result.r; @@ -3006,16 +3006,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam result.a = isNaN.a == 1.0 ? NAN : result.a; return result; -`,qU=qe({opSnippet:HU,packedOpSnippet:GU,cpuKernelImpl:PL}),XU={kernelName:Is,backendName:"webgl",kernelFunc:qU},KU="return log(1.0 + x);",ZU=qe({opSnippet:KU}),YU={kernelName:Eo,backendName:"webgl",kernelFunc:ZU},JU="return float(a >= 1.0 && b >= 1.0);",QU=` +`,JU=qe({opSnippet:ZU,packedOpSnippet:YU,cpuKernelImpl:jL}),QU={kernelName:Ss,backendName:"webgl",kernelFunc:JU},eH="return log(1.0 + x);",tH=qe({opSnippet:eH}),nH={kernelName:Co,backendName:"webgl",kernelFunc:tH},aH="return float(a >= 1.0 && b >= 1.0);",rH=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); -`,eH=en({opSnippet:JU,packedOpSnippet:QU,dtype:"bool"}),tH={kernelName:Co,backendName:"webgl",kernelFunc:eH},nH="return float(!(x >= 1.0));",rH=qe({opSnippet:nH}),aH={kernelName:wu,backendName:"webgl",kernelFunc:rH},sH="return float(a >= 1.0 || b >= 1.0);",iH=` +`,sH=en({opSnippet:aH,packedOpSnippet:rH,dtype:"bool"}),iH={kernelName:Ro,backendName:"webgl",kernelFunc:sH},oH="return float(!(x >= 1.0));",lH=qe({opSnippet:oH}),uH={kernelName:bu,backendName:"webgl",kernelFunc:lH},dH="return float(a >= 1.0 || b >= 1.0);",pH=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); -`,oH=en({opSnippet:sH,packedOpSnippet:iH,dtype:"bool"}),lH={kernelName:bu,backendName:"webgl",kernelFunc:oH},uH=class{constructor(e,t,n,r,a){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${r}) * sum`;a===.5?o=`inversesqrt(${l})`:a===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${a}));`,this.userCode=` +`,cH=en({opSnippet:dH,packedOpSnippet:pH,dtype:"bool"}),hH={kernelName:vu,backendName:"webgl",kernelFunc:cH},fH=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3034,7 +3034,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float val = x * ${o}; setOutput(val); } - `}},cH=class{constructor(e,t,n,r,a){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${r}) * sum`;a===.5?o=`inversesqrt(${l})`:a===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${a}));`,this.userCode=` + `}},mH=class{constructor(e,t,n,a,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${n}) + float(${a}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords.x; @@ -3096,7 +3096,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam vec4 result = xAtOutputCoords * ${o}; setOutput(result); } - `}},hH=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=r,c=J().getBool("WEBGL_PACK_NORMALIZATION")?new cH(a.shape,s,i,o,l):new uH(a.shape,s,i,o,l);return n.runWebGLProgram(c,[a],a.dtype)},dH={kernelName:_u,backendName:"webgl",kernelFunc:hH},pH=class{constructor(e,t,n,r,a){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=a,this.userCode=` + `}},AH=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=a,d=J().getBool("WEBGL_PACK_NORMALIZATION")?new mH(r.shape,s,i,o,l):new fH(r.shape,s,i,o,l);return n.runWebGLProgram(d,[r],r.dtype)},yH={kernelName:wu,backendName:"webgl",kernelFunc:AH},gH=class{constructor(e,t,n,a,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=a,this.beta=r,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3125,19 +3125,19 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } } - norm = float(${r}) * norm + float(${n}); + norm = float(${a}) * norm + float(${n}); for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ if (k < depthBegin){ continue; } else if (k >= depthBegin && k < depthEnd){ - float dyi = -2.0 * float(${r}) - * float(${a}) + float dyi = -2.0 * float(${a}) + * float(${r}) * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d) / norm; if (k == d) { - dyi += pow(norm, -1.0 * ${a}); + dyi += pow(norm, -1.0 * ${r}); } if (k == coords[3]) { dyi *= getDy(b, r, c, d); @@ -3151,14 +3151,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(result); } - `}},fH=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:c,beta:u}=r,h=new pH(a.shape,o,l,c,u);return n.runWebGLProgram(h,[a,s,i],a.dtype)},mH={kernelName:Hh,backendName:"webgl",kernelFunc:fH};function AH(e,t,n,r){let a=_.sizeFromShape(t),s=_.sizeFromShape(e.shape)/a,i=fe({inputs:{x:e},attrs:{shape:[s,a]},backend:r}),o=Si(i,e.dtype,"max",r),l=fe({inputs:{x:o},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),l}function Q3(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{reductionIndices:s,keepDims:i}=r,o=a.shape.length,l=_.parseAxisParam(s,a.shape),c=l,u=E.getAxesPermutation(c,o),h=u!=null,d=n.shouldExecuteOnCPU([a]),p=a;if(h){if(d){let g=n.texData.get(p.dataId).values,x=new Array(o);for(let b=0;b{let{inputs:t,backend:n,attrs:a}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:d,beta:u}=a,p=new gH(r.shape,o,l,d,u);return n.runWebGLProgram(p,[r,s,i],r.dtype)},bH={kernelName:Hp,backendName:"webgl",kernelFunc:xH};function vH(e,t,n,a){let r=w.sizeFromShape(t),s=w.sizeFromShape(e.shape)/r,i=fe({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Ni(i,e.dtype,"max",a),l=fe({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}function e6(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=a,o=r.shape.length,l=w.parseAxisParam(s,r.shape),d=l,u=C.getAxesPermutation(d,o),p=u!=null,c=n.shouldExecuteOnCPU([r]),h=r;if(p){if(c){let g=n.texData.get(h.dataId).values,x=new Array(o);for(let v=0;v`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`);let u=E.computePool2DInfo(a.shape,s,i,c,o,l);if(u.filterWidth===1&&u.filterHeight===1&&_.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:a},backend:n});let h=new mc(u,"max",!1);return n.runWebGLProgram(h,[a],a.dtype)}var vH={kernelName:Ts,backendName:"webgl",kernelFunc:_H};function kH(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:c}=r,u=[1,1,1],h=E.computePool3DInfo(a.shape,s,i,u,o,c,l),d=new mA(h,"max",!1);return n.runWebGLProgram(d,[a],a.dtype)}var IH={kernelName:vu,backendName:"webgl",kernelFunc:kH},SH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,r=e.dilationHeight,a=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=a-1-e.padInfo.top,o=s-1-e.padInfo.left,l=a*s-1;this.userCode=` +`,SH=en({opSnippet:kH,packedOpSnippet:IH,cpuKernelImpl:HL}),NH={kernelName:Ts,backendName:"webgl",kernelFunc:SH};function TH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t;Nl(r,"maxPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=a,d=1;w.assert(C.eitherStridesOrDilationsAreOne(i,d),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let u=C.computePool2DInfo(r.shape,s,i,d,o,l);if(u.filterWidth===1&&u.filterHeight===1&&w.arraysEqual(u.inShape,u.outShape))return Pn({inputs:{x:r},backend:n});let p=new md(u,"max",!1);return n.runWebGLProgram(p,[r],r.dtype)}var EH={kernelName:Es,backendName:"webgl",kernelFunc:TH};function CH(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:d}=a,u=[1,1,1],p=C.computePool3DInfo(r.shape,s,i,u,o,d,l),c=new m1(p,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}var RH={kernelName:ku,backendName:"webgl",kernelFunc:CH},MH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,n=e.strideWidth,a=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=s-1-e.padInfo.left,l=r*s-1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { @@ -3173,8 +3173,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${a}; - wR += ${r}) { + for (int wR = 0; wR < ${r}; + wR += ${a}) { float dyR = float(dyRCorner + wR) / ${t}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { @@ -3204,8 +3204,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}},NH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,a=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=c-1-e.padInfo.left,p=o*l*c-1;this.userCode=` - const ivec3 pads = ivec3(${u}, ${h}, ${d}); + `}},FH=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,n=e.strideHeight,a=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,d=e.effectiveFilterWidth,u=o-1-e.padInfo.front,p=l-1-e.padInfo.top,c=d-1-e.padInfo.left,h=o*l*d-1;this.userCode=` + const ivec3 pads = ivec3(${u}, ${p}, ${c}); void main() { ivec5 coords = getOutputCoords(); @@ -3223,7 +3223,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam float dotProd = 0.0; for (int wD = 0; wD < ${o}; - wD += ${a}) { + wD += ${r}) { float dyD = float(dyDCorner + wD) / ${t}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { @@ -3241,9 +3241,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${c}; + for (int wC = 0; wC < ${d}; wC += ${i}) { - float dyC = float(dyCCorner + wC) / ${r}.0; + float dyC = float(dyCCorner + wC) / ${a}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { @@ -3252,14 +3252,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam int idyC = int(dyC); float dyValue = getDy(batch, idyD, idyR, idyC, ch); - int maxPosValue = ${p} - + int maxPosValue = ${h} - int(getMaxPos(batch, idyD, idyR, idyC, ch)); // Get the current value, check it against the value from the // position matrix. int curPosValue = - wD * ${l} * ${c} + - wR * ${c} + wC; + wD * ${l} * ${d} + + wR * ${d} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; @@ -3268,14 +3268,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam } setOutput(dotProd); } - `}};function TH(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s}=t,i=s,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=r,h=[1,1,1],d=E.computePool3DInfo(i.shape,o,l,h,c,u),p=new mA(d,"max",!0),m=n.runWebGLProgram(p,[i],i.dtype),f=new NH(d),A=n.runWebGLProgram(f,[a,m],i.dtype);return n.disposeIntermediateTensorInfo(m),A}var EH={kernelName:qh,backendName:"webgl",kernelFunc:TH};function CH(e){let{inputs:t,backend:n,attrs:r}=e,{dy:a,input:s,output:i}=t,o=s;Sl([s,i],"maxPoolGrad");let{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=r,d=E.computePool2DInfo(o.shape,l,c,1,u,h),p=!0,m=new mc(d,"max",p),f=n.runWebGLProgram(m,[o],o.dtype),A=new SH(d),y=n.runWebGLProgram(A,[a,f],o.dtype);return n.disposeIntermediateTensorInfo(f),y}var RH={kernelName:Gh,backendName:"webgl",kernelFunc:CH};function MH(e,t,n,r){let a=new mc(n,"max",!1),s=r.runWebGLProgram(a,[e],"float32");a=new mc(n,"max",!0,!0,t);let i=r.runWebGLProgram(a,[e],"float32");return[s,i]}var FH={kernelName:Xh,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{filterSize:a,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;_.assert(r.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);let c=[1,1];_.assert(E.eitherStridesOrDilationsAreOne(s,c),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${c}'`);let u=E.computePool2DInfo(r.shape,a,s,c,i),[h,d]=MH(r,o,u,l);return[h,d]}};function $H(e,t,n,r){let a=_.sizeFromShape(t),s=_.sizeFromShape(e.shape)/a,i=fe({inputs:{x:e},attrs:{shape:[s,a]},backend:r}),o=Si(i,"float32","mean",r),l=fe({inputs:{x:o},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),l}var DH={kernelName:Es,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:r}=e,{keepDims:a,axis:s}=t,i=n,o=r.shape.length,l=_.parseAxisParam(s,r.shape),c=l,u=E.getAxesPermutation(c,o),h=u!=null,d=i.shouldExecuteOnCPU([r]),p=[],m=r;if(h){if(d){let x=i.texData.get(m.dataId).values,v=new Array(o);for(let k=0;k{let{x:a}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=n;w.assert(a.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${a.shape.length}.`);let d=[1,1];w.assert(C.eitherStridesOrDilationsAreOne(s,d),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${d}'`);let u=C.computePool2DInfo(a.shape,r,s,d,i),[p,c]=_H(a,o,u,l);return[p,c]}};function LH(e,t,n,a){let r=w.sizeFromShape(t),s=w.sizeFromShape(e.shape)/r,i=fe({inputs:{x:e},attrs:{shape:[s,r]},backend:a}),o=Ni(i,"float32","mean",a),l=fe({inputs:{x:o},attrs:{shape:n},backend:a});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}var WH={kernelName:Cs,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{x:a}=e,{keepDims:r,axis:s}=t,i=n,o=a.shape.length,l=w.parseAxisParam(s,a.shape),d=l,u=C.getAxesPermutation(d,o),p=u!=null,c=i.shouldExecuteOnCPU([a]),h=[],m=a;if(p){if(c){let x=i.texData.get(m.dataId).values,k=new Array(o);for(let I=0;Ic[0]+e[u]+c[1]);let r=e.length,a=lt(r),s=t.map(c=>c[0]).join(","),i=t.map((c,u)=>c[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r),l=n==="reflect"?0:1;if(r===1){this.userCode=` +`,HH=en({opSnippet:jH,packedOpSnippet:UH,cpuKernelImpl:GL}),GH={kernelName:Ms,backendName:"webgl",kernelFunc:HH},qH=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((d,u)=>d[0]+e[u]+d[1]);let a=e.length,r=lt(a),s=t.map(d=>d[0]).join(","),i=t.map((d,u)=>d[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a),l=n==="reflect"?0:1;if(a===1){this.userCode=` int start = ${s}; int end = ${i}; @@ -3289,84 +3289,84 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam setOutput(getX(outC - start)); } `;return}this.userCode=` - ${a} start = ${a}(${s}); - ${a} end = ${a}(${i}); + ${r} start = ${r}(${s}); + ${r} end = ${r}(${i}); void main() { - ${a} outC = getOutputCoords(); - for (int i = 0; i < ${r}; i++) { + ${r} outC = getOutputCoords(); + for (int i = 0; i < ${a}; i++) { if (outC[i] < start[i]) { outC[i] = start[i] * 2 - outC[i] - ${l}; } else if(outC[i] >= end[i]) { outC[i] = (end[i] - 1) * 2 - outC[i] + ${l}; } } - ${a} coords = outC - start; + ${r} coords = outC - start; setOutput(getX(${o})); } - `}},jH=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((p,m)=>p[0]+e[m]+p[1]);let r=e.length,a=lt(r),s=t.map(p=>p[0]).join(","),i=t.map((p,m)=>p[0]+e[m]).join(","),o=hn("rc",r),l=hn("source",r),c=`${o[r-1]} < ${this.outputShape[r-1]}`,u=r===1?"source":`vec2(${l.slice(-2).join()})`,h=n==="reflect"?0:1,d="";if(r===1){let p=` - ${a} source = rc; + `}},XH=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let a=e.length,r=lt(a),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=pn("rc",a),l=pn("source",a),d=`${o[a-1]} < ${this.outputShape[a-1]}`,u=a===1?"source":`vec2(${l.slice(-2).join()})`,p=n==="reflect"?0:1,c="";if(a===1){let h=` + ${r} source = rc; if (source < start) { - source = start * 2 - source - ${h}; + source = start * 2 - source - ${p}; } else if (source >= end) { - source = (end - 1) * 2 - source + ${h}; + source = (end - 1) * 2 - source + ${p}; } source -= start; - `;d=` - ${a} rc = outputLoc; - ${p} + `;c=` + ${r} rc = outputLoc; + ${h} result[0] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[1] = getChannel(getX(${l.join()}), ${u}); } - `}else{let p=` - ${a} source = rc; - ${a} lt = ${a}(lessThan(source, start)); - ${a} gte = ${a}(greaterThanEqual(source, end)); - ${a} orig = 1 - (lt + gte); + `}else{let h=` + ${r} source = rc; + ${r} lt = ${r}(lessThan(source, start)); + ${r} gte = ${r}(greaterThanEqual(source, end)); + ${r} orig = 1 - (lt + gte); source = orig * source + - lt * (start * 2 - source - ${h}) + - gte * ((end - 1) * 2 - source + ${h}); + lt * (start * 2 - source - ${p}) + + gte * ((end - 1) * 2 - source + ${p}); source -= start; - `;d=` - ${a} rc = outputLoc; - ${p} + `;c=` + ${r} rc = outputLoc; + ${h} result[0] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[1] = getChannel(getX(${l.join()}), ${u}); } rc = outputLoc; - ${o[r-2]} += 1; - if(${o[r-2]} < ${this.outputShape[r-2]}) { - ${p} + ${o[a-2]} += 1; + if(${o[a-2]} < ${this.outputShape[a-2]}) { + ${h} result[2] = getChannel(getX(${l.join()}), ${u}); - ${o[r-1]} += 1; - if(${c}) { - ${p} + ${o[a-1]} += 1; + if(${d}) { + ${h} result[3] = getChannel(getX(${l.join()}), ${u}); } } `}this.userCode=` - const ${a} start = ${a}(${s}); - const ${a} end = ${a}(${i}); + const ${r} start = ${r}(${s}); + const ${r} end = ${r}(${i}); void main() { - ${a} outputLoc = getOutputCoords(); + ${r} outputLoc = getOutputCoords(); vec4 result = vec4(0.); - ${d} + ${c} setOutput(result); } - `}},UH=({inputs:e,backend:t,attrs:n})=>{let{x:r}=e,{paddings:a,mode:s}=n,i=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new jH(r.shape,a,s):new VH(r.shape,a,s);return t.runWebGLProgram(i,[r],r.dtype)},HH={kernelName:Ms,backendName:"webgl",kernelFunc:UH},GH=`if (b == 0.0) return NAN; - return mod(a, b);`,qH=` + `}},KH=({inputs:e,backend:t,attrs:n})=>{let{x:a}=e,{paddings:r,mode:s}=n,i=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new XH(a.shape,r,s):new qH(a.shape,r,s);return t.runWebGLProgram(i,[a],a.dtype)},ZH={kernelName:Fs,backendName:"webgl",kernelFunc:KH},YH=`if (b == 0.0) return NAN; + return mod(a, b);`,JH=` vec4 result = mod(a, b); vec4 isNaN = vec4(equal(b, vec4(0.0))); - `+mp+` + `+mh+` return result; -`,XH=en({opSnippet:GH,packedOpSnippet:qH}),KH={kernelName:Ro,backendName:"webgl",kernelFunc:XH},ZH=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` +`,QH=en({opSnippet:YH,packedOpSnippet:JH}),eG={kernelName:Mo,backendName:"webgl",kernelFunc:QH},tG=class{constructor(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode=` uniform float seed; void main() { @@ -3388,11 +3388,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,DB=qe({opSnippet:$B}),OB={kernelNam // If no other event happened, last event happened. setOutput(float(${t-1})); } - `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},YH=` + `}getCustomSetupFunc(e){return(t,n)=>{this.seedLoc==null&&(this.seedLoc=t.getUniformLocation(n,"seed")),t.gl.uniform1f(this.seedLoc,e)}}},nG=` if (a == b) { return 1.0; }; -return a / b;`,JH=` +return a / b;`,aG=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -3410,14 +3410,14 @@ return a / b;`,JH=` } return result; -`,e7=en({opSnippet:YH,packedOpSnippet:JH,checkOutOfBounds:!0}),QH={kernelName:ys,backendName:"webgl",kernelFunc:e7},t7="return a - b;",n7=en({opSnippet:t7,packedOpSnippet:t7,supportsComplex:!0,cpuKernelImpl:ZL}),eG={kernelName:Zs,backendName:"webgl",kernelFunc:n7};function r7(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{dim:s}=r,i=_.parseAxisParam([s],a.shape),o=Q3({inputs:{x:a},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=E.expandShapeToKeepDim(o.shape,i),c=fe({inputs:{x:o},backend:n,attrs:{shape:l}}),u=n7({inputs:{a,b:c},backend:n}),h=X3({inputs:{x:u},backend:n}),d=gp({inputs:{x:h},backend:n,attrs:{axis:i,keepDims:!1}}),p=fe({inputs:{x:d},backend:n,attrs:{shape:l}}),m=e7({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),m}var tG={kernelName:Xs,backendName:"webgl",kernelFunc:r7};function nG(e){let{inputs:t,backend:n,attrs:r}=e,{logits:a}=t,{numSamples:s,seed:i,normalized:o}=r,l=o?a:r7({inputs:{logits:a},backend:n,attrs:{dim:a.shape.length-1}}),c=l.shape[0],u=l.shape[1],h=new ZH(c,u,s),d=h.getCustomSetupFunc(i),p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}var rG={kernelName:Kh,backendName:"webgl",kernelFunc:nG},a7="return -x;";function aG(e){let{inputs:t,backend:n}=e,{x:r}=t;if(n.shouldExecuteOnCPU([r])){let s=n.texData.get(r.dataId),[i,o]=jL(s.values,r.shape,r.dtype);return n.makeTensorInfo(o,r.dtype,i)}let a;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?a=new Ml(r.shape,a7):a=new Wa(r.shape,a7),n.runWebGLProgram(a,[r],r.dtype)}var sG={kernelName:Mo,backendName:"webgl",kernelFunc:aG},iG=Wr.nonMaxSuppressionV3Impl;function oG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=r,c=n.readSync(a.dataId),u=n.readSync(s.dataId),{selectedIndices:h}=iG(c,u,i,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}var lG={kernelName:$o,backendName:"webgl",kernelFunc:oG},uG=Wr.nonMaxSuppressionV4Impl;function cG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:c}=r,u=n.readSync(a.dataId),h=n.readSync(s.dataId),{selectedIndices:d,validOutputs:p}=uG(u,h,i,o,l,c);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}var hG={kernelName:Do,backendName:"webgl",kernelFunc:cG},dG=Wr.nonMaxSuppressionV5Impl;function pG(e){E.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:r}=e,{boxes:a,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=r,u=n.readSync(a.dataId),h=n.readSync(s.dataId),d=i,p=o,m=l,f=c,{selectedIndices:A,selectedScores:y}=dG(u,h,d,p,m,f);return[n.makeTensorInfo([A.length],"int32",new Int32Array(A)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var fG={kernelName:Oo,backendName:"webgl",kernelFunc:pG},mG=class{constructor(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` +`,t6=en({opSnippet:nG,packedOpSnippet:aG,checkOutOfBounds:!0}),rG={kernelName:ys,backendName:"webgl",kernelFunc:t6},n6="return a - b;",a6=en({opSnippet:n6,packedOpSnippet:n6,supportsComplex:!0,cpuKernelImpl:tW}),sG={kernelName:Zs,backendName:"webgl",kernelFunc:a6};function r6(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{dim:s}=a,i=w.parseAxisParam([s],r.shape),o=e6({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=C.expandShapeToKeepDim(o.shape,i),d=fe({inputs:{x:o},backend:n,attrs:{shape:l}}),u=a6({inputs:{a:r,b:d},backend:n}),p=Kv({inputs:{x:u},backend:n}),c=gh({inputs:{x:p},backend:n,attrs:{axis:i,keepDims:!1}}),h=fe({inputs:{x:c},backend:n,attrs:{shape:l}}),m=t6({inputs:{a:p,b:h},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),m}var iG={kernelName:Xs,backendName:"webgl",kernelFunc:r6};function oG(e){let{inputs:t,backend:n,attrs:a}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=a,l=o?r:r6({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),d=l.shape[0],u=l.shape[1],p=new tG(d,u,s),c=p.getCustomSetupFunc(i),h=n.runWebGLProgram(p,[l],"int32",c);return o||n.disposeIntermediateTensorInfo(l),h}var lG={kernelName:Kp,backendName:"webgl",kernelFunc:oG},s6="return -x;";function uG(e){let{inputs:t,backend:n}=e,{x:a}=t;if(n.shouldExecuteOnCPU([a])){let s=n.texData.get(a.dataId),[i,o]=XL(s.values,a.shape,a.dtype);return n.makeTensorInfo(o,a.dtype,i)}let r;return J().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Fl(a.shape,s6):r=new Pr(a.shape,s6),n.runWebGLProgram(r,[a],a.dtype)}var dG={kernelName:Fo,backendName:"webgl",kernelFunc:uG},pG=Wa.nonMaxSuppressionV3Impl;function cG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=a,d=n.readSync(r.dataId),u=n.readSync(s.dataId),{selectedIndices:p}=pG(d,u,i,o,l);return n.makeTensorInfo([p.length],"int32",new Int32Array(p))}var hG={kernelName:Do,backendName:"webgl",kernelFunc:cG},fG=Wa.nonMaxSuppressionV4Impl;function mG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:d}=a,u=n.readSync(r.dataId),p=n.readSync(s.dataId),{selectedIndices:c,validOutputs:h}=fG(u,p,i,o,l,d);return[n.makeTensorInfo([c.length],"int32",new Int32Array(c)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}var AG={kernelName:Oo,backendName:"webgl",kernelFunc:mG},yG=Wa.nonMaxSuppressionV5Impl;function gG(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:n,attrs:a}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:d}=a,u=n.readSync(r.dataId),p=n.readSync(s.dataId),c=i,h=o,m=l,f=d,{selectedIndices:A,selectedScores:y}=yG(u,p,c,h,m,f);return[n.makeTensorInfo([A.length],"int32",new Int32Array(A)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var xG={kernelName:zo,backendName:"webgl",kernelFunc:gG},bG=class{constructor(e,t,n,a){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); - setOutput(mix(float(${r}), float(${n}), + setOutput(mix(float(${a}), float(${n}), float(index == coords.y))); } - `}},AG=e=>{let{inputs:t,backend:n,attrs:r}=e,{indices:a}=t,{depth:s,onValue:i,offValue:o}=r,l=_.sizeFromShape(a.shape),c=new mG(l,s,i,o),u=fe({inputs:{x:a},backend:n,attrs:{shape:[l]}}),h=n.runWebGLProgram(c,[u],a.dtype);n.disposeIntermediateTensorInfo(u);let d=[...a.shape,s],p=fe({inputs:{x:h},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(h),p},yG={kernelName:$s,backendName:"webgl",kernelFunc:AG};function vp(e){let{inputs:t,backend:n}=e,{x:r}=t;if(r.dtype==="complex64"){let a=yc({inputs:{input:r},backend:n}),s=vp({inputs:{x:a},backend:n}),i=_p({inputs:{input:r},backend:n}),o=vp({inputs:{x:i},backend:n}),l=Ba({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return xA({attrs:{shape:r.shape,dtype:r.dtype,value:r.dtype==="string"?"":0},backend:n})}var gG={kernelName:Qo,backendName:"webgl",kernelFunc:vp};function s7(e){let{inputs:t,backend:n}=e,{x:r}=t;if(r.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(r.dtype==="complex64"){let a=yc({inputs:{input:r},backend:n}),s=s7({inputs:{x:a},backend:n}),i=_p({inputs:{input:r},backend:n}),o=vp({inputs:{x:i},backend:n}),l=Ba({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return xA({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:n})}var xG={kernelName:zo,backendName:"webgl",kernelFunc:s7};function wG(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r;if(t.length===1)return gA({inputs:{input:t[0]},backend:n,attrs:{dim:a}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=gA({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=P3({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),c}var bG={kernelName:Po,backendName:"webgl",kernelFunc:wG},_G=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((l,c)=>l[0]+e[c]+l[1]);let r=e.length,a=lt(r),s=t.map(l=>l[0]).join(","),i=t.map((l,c)=>l[0]+e[c]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);if(r===1){this.userCode=` + `}},vG=e=>{let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=w.sizeFromShape(r.shape),d=new bG(l,s,i,o),u=fe({inputs:{x:r},backend:n,attrs:{shape:[l]}}),p=n.runWebGLProgram(d,[u],r.dtype);n.disposeIntermediateTensorInfo(u);let c=[...r.shape,s],h=fe({inputs:{x:p},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(p),h},wG={kernelName:Ds,backendName:"webgl",kernelFunc:vG};function kh(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="complex64"){let r=yd({inputs:{input:a},backend:n}),s=kh({inputs:{x:r},backend:n}),i=wh({inputs:{input:a},backend:n}),o=kh({inputs:{x:i},backend:n}),l=Lr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return x1({attrs:{shape:a.shape,dtype:a.dtype,value:a.dtype==="string"?"":0},backend:n})}var kG={kernelName:Qo,backendName:"webgl",kernelFunc:kh};function i6(e){let{inputs:t,backend:n}=e,{x:a}=t;if(a.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(a.dtype==="complex64"){let r=yd({inputs:{input:a},backend:n}),s=i6({inputs:{x:r},backend:n}),i=wh({inputs:{input:a},backend:n}),o=kh({inputs:{x:i},backend:n}),l=Lr({inputs:{real:s,imag:o},backend:n});return n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}else return x1({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:n})}var IG={kernelName:_o,backendName:"webgl",kernelFunc:i6};function SG(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return g1({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=g1({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=Lv({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeIntermediateTensorInfo(u)),d}var NG={kernelName:Po,backendName:"webgl",kernelFunc:SG},TG=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((l,d)=>l[0]+e[d]+l[1]);let a=e.length,r=lt(a),s=t.map(l=>l[0]).join(","),i=t.map((l,d)=>l[0]+e[d]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);if(a===1){this.userCode=` int start = ${s}; int end = ${i}; uniform float value; @@ -3431,45 +3431,45 @@ return a / b;`,JH=` } } `;return}this.userCode=` - ${a} start = ${a}(${s}); - ${a} end = ${a}(${i}); + ${r} start = ${r}(${s}); + ${r} end = ${r}(${i}); uniform float value; void main() { - ${a} outC = getOutputCoords(); + ${r} outC = getOutputCoords(); if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { setOutput(value); } else { - ${a} coords = outC - start; + ${r} coords = outC - start; setOutput(getX(${o})); } } - `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},vG=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let r=e.length,a=lt(r),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=hn("rc",r),l=hn("source",r),c=`${o[r-1]} < ${this.outputShape[r-1]}`,u=r===1?"source":`vec2(${l.slice(-2).join()})`,h=[`${a} rc = outputLoc;`,`${o[r-1]} += 1; - if(${c}) { - `,r===1?"":`} + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},EG=class{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let a=e.length,r=lt(a),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=pn("rc",a),l=pn("source",a),d=`${o[a-1]} < ${this.outputShape[a-1]}`,u=a===1?"source":`vec2(${l.slice(-2).join()})`,p=[`${r} rc = outputLoc;`,`${o[a-1]} += 1; + if(${d}) { + `,a===1?"":`} rc = outputLoc; - ${o[r-2]} += 1; - if(${o[r-2]} < ${this.outputShape[r-2]}) {`,r===1?"":` ${o[r-1]} += 1; - if(${c}) {`],d=r===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",p="";for(let m=0,f=r===1?2:4;m= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=a===1?2:4;m{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},i7=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{paddings:s,constantValue:i}=r,o=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new vG(a.shape,s,i):new _G(a.shape,s,i),l=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[a],a.dtype,l)},kG={kernelName:Ds,backendName:"webgl",kernelFunc:i7},IG=` + `}getCustomSetupFunc(e){return(t,n)=>{this.valueLoc==null&&(this.valueLoc=t.getUniformLocationNoThrow(n,"value")),t.gl.uniform1f(this.valueLoc,e)}}},o6=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{paddings:s,constantValue:i}=a,o=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new EG(r.shape,s,i):new TG(r.shape,s,i),l=o.getCustomSetupFunc(i);return n.runWebGLProgram(o,[r],r.dtype,l)},CG={kernelName:Os,backendName:"webgl",kernelFunc:o6},RG=` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -3478,7 +3478,7 @@ return a / b;`,JH=` } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); -`,SG=` +`,MG=` // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -3492,11 +3492,11 @@ return a / b;`,JH=` result.a = isExpZero.a ? 1.0 : result.a; vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b)); - `+mp+` + `+mh+` return result; -`,NG=en({opSnippet:IG,packedOpSnippet:SG}),TG={kernelName:Os,backendName:"webgl",kernelFunc:NG};function EG(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{axis:s,keepDims:i}=r,o=a.shape.length,l=[],c=_.parseAxisParam(s,a.shape),u=c,h=E.getAxesPermutation(u,o),d=a;h!=null&&(d=dn({inputs:{x:a},backend:n,attrs:{perm:h}}),u=E.getInnerMostAxes(u.length,o),l.push(d)),E.assertAxesAreInnerMostDims("prod",u,o);let p;if(n.shouldExecuteOnCPU([d])){let m=n.texData.get(d.dataId).values,{outVals:f,outShape:A,outDtype:y}=UL(d.shape,d.dtype,m,u);p=n.makeTensorInfo(A,y,f)}else{let[m,f]=E.computeOutAndReduceShapes(d.shape,u),A=_.sizeFromShape(f),y=fe({inputs:{x:d},backend:n,attrs:{shape:[-1,A]}}),g=ld(a.dtype),x=Si(y,g,"prod",n);p=fe({inputs:{x},backend:n,attrs:{shape:m}}),l.push(y),l.push(x)}if(i){l.push(p);let m=E.expandShapeToKeepDim(p.shape,c);p=fe({inputs:{x:p},backend:n,attrs:{shape:m}})}return l.forEach(m=>n.disposeIntermediateTensorInfo(m)),p}var CG={kernelName:Lo,backendName:"webgl",kernelFunc:EG},o7=e=>{let{backend:t,attrs:n}=e,{start:r,stop:a,step:s,dtype:i}=n,o=HL(r,a,s,i);return t.makeTensorInfo([o.length],i,o)},RG={kernelName:ku,backendName:"webgl",kernelFunc:o7},MG="return 1.0 / x;",FG=qe({opSnippet:MG}),$G={kernelName:Wo,backendName:"webgl",kernelFunc:FG},DG=wr+` +`,FG=en({opSnippet:RG,packedOpSnippet:MG}),$G={kernelName:zs,backendName:"webgl",kernelFunc:FG};function DG(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{axis:s,keepDims:i}=a,o=r.shape.length,l=[],d=w.parseAxisParam(s,r.shape),u=d,p=C.getAxesPermutation(u,o),c=r;p!=null&&(c=cn({inputs:{x:r},backend:n,attrs:{perm:p}}),u=C.getInnerMostAxes(u.length,o),l.push(c)),C.assertAxesAreInnerMostDims("prod",u,o);let h;if(n.shouldExecuteOnCPU([c])){let m=n.texData.get(c.dataId).values,{outVals:f,outShape:A,outDtype:y}=KL(c.shape,c.dtype,m,u);h=n.makeTensorInfo(A,y,f)}else{let[m,f]=C.computeOutAndReduceShapes(c.shape,u),A=w.sizeFromShape(f),y=fe({inputs:{x:c},backend:n,attrs:{shape:[-1,A]}}),g=lc(r.dtype),x=Ni(y,g,"prod",n);h=fe({inputs:{x},backend:n,attrs:{shape:m}}),l.push(y),l.push(x)}if(i){l.push(h);let m=C.expandShapeToKeepDim(h.shape,d);h=fe({inputs:{x:h},backend:n,attrs:{shape:m}})}return l.forEach(m=>n.disposeIntermediateTensorInfo(m)),h}var OG={kernelName:Lo,backendName:"webgl",kernelFunc:DG},l6=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=ZL(a,r,s,i);return t.makeTensorInfo([o.length],i,o)},zG={kernelName:Iu,backendName:"webgl",kernelFunc:l6},_G="return 1.0 / x;",PG=qe({opSnippet:_G}),LG={kernelName:Wo,backendName:"webgl",kernelFunc:PG},WG=ba+` return (x < 0.0) ? 0.0 : x; -`,OG=` +`,BG=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3506,9 +3506,9 @@ return a / b;`,JH=` result.a = isNaN.a ? x.a : result.a; return result; -`,zG=qe({opSnippet:DG,packedOpSnippet:OG}),PG={kernelName:Ps,backendName:"webgl",kernelFunc:zG},LG=wr+` +`,VG=qe({opSnippet:WG,packedOpSnippet:BG}),jG={kernelName:Ps,backendName:"webgl",kernelFunc:VG},UG=ba+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,WG=` +`,HG=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -3518,10 +3518,10 @@ return a / b;`,JH=` result.a = isNaN.a ? x.a : result.a; return result; -`,BG=qe({opSnippet:LG,packedOpSnippet:WG}),VG={kernelName:Ws,backendName:"webgl",kernelFunc:BG},jG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h;a?h="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":h="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` +`,GG=qe({opSnippet:UG,packedOpSnippet:HG}),qG={kernelName:Ws,backendName:"webgl",kernelFunc:GG},XG=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":p="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/u[0]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3531,7 +3531,7 @@ return a / b;`,JH=` ivec2 yRC = coords.yz; // Fractional source index. - vec2 sourceFracIndexRC = ${h}; + vec2 sourceFracIndexRC = ${p}; // Compute the four integer indices. ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); @@ -3551,11 +3551,11 @@ return a / b;`,JH=` setOutput(newValue); } - `}},UG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h;a?h="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":h="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},KG=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p;r?p="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":p="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0]/u[0]}, - ${c[1]/u[1]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}, + ${d[1]/u[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -3571,7 +3571,7 @@ return a / b;`,JH=` ivec3 yRC = coords.yzz + ivec3(0, 0, 1); // Fractional source index. - vec3 sourceFracIndexRC = ${h}; + vec3 sourceFracIndexRC = ${p}; // Compute the four integer indices. ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); @@ -3628,7 +3628,7 @@ return a / b;`,JH=` setOutput(newValue); } - `}};function HG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,u=J().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new UG(a.shape,l,c,s,i):new jG(a.shape,l,c,s,i);return n.runWebGLProgram(u,[a],"float32")}var GG={kernelName:Ls,backendName:"webgl",kernelFunc:HG},qG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,r,a]=t,[,s,i]=e,o=[n&&s>1?r-1:r,n&&i>1?a-1:a],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,p=Math.ceil(h)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function ZG(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,u=J().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new KG(r.shape,l,d,s,i):new XG(r.shape,l,d,s,i);return n.runWebGLProgram(u,[r],"float32")}var YG={kernelName:Ls,backendName:"webgl",kernelFunc:ZG},JG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],d=o[0]/l[0],u=o[1]/l[1],p=1/d,c=1/u,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3638,13 +3638,13 @@ return a / b;`,JH=` float accumulator = 0.0; - const float heightScale = float(${c}); + const float heightScale = float(${d}); const float widthScale = float(${u}); - const float invHeightScale = float(${h}); - const float invWidthScale = float(${d}); + const float invHeightScale = float(${p}); + const float invWidthScale = float(${c}); - const int winHeight = int(${p}); + const int winHeight = int(${h}); const int winWidth = int(${m}); // Compute bounds for where in dy we will look @@ -3673,13 +3673,13 @@ return a / b;`,JH=` float dxR = float(dyR) * heightScale; int topDxRIndex = int(floor(dxR)); - int bottomDxRIndex = int(min(ceil(dxR), ${r-1}.0)); + int bottomDxRIndex = int(min(ceil(dxR), ${a-1}.0)); float dxRLerp = dxR - float(topDxRIndex); float inverseDxRLerp = 1.0 - dxRLerp; float dxC = float(dyC) * widthScale; int leftDxCIndex = int(floor(dxC)); - int rightDxCIndex = int(min(ceil(dxC), ${a-1}.0)); + int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0)); float dxCLerp = dxC - float(leftDxCIndex); float inverseDxCLerp = 1.0 - dxCLerp; @@ -3709,10 +3709,10 @@ return a / b;`,JH=` setOutput(accumulator); } - `}};function XG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a,dy:s}=t,{alignCorners:i}=r,o=new qG(s.shape,a.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var KG={kernelName:Jh,backendName:"webgl",kernelFunc:XG},ZG=class{constructor(e,t,n,r,a){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let c=[r&&t>1?i-1:i,r&&n>1?o-1:o],u=[r&&t>1?t-1:t,r&&n>1?n-1:n],h=r?"0.5":"0.0",d;a?d="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":d="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};function QG(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new JG(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var eq={kernelName:Jp,backendName:"webgl",kernelFunc:QG},tq=class{constructor(e,t,n,a,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,n,l];let d=[a&&t>1?i-1:i,a&&n>1?o-1:o],u=[a&&t>1?t-1:t,a&&n>1?n-1:n],p=a?"0.5":"0.0",c;r?c="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/u[0]}, - ${c[1]/u[1]}); + ${d[0]/u[0]}, + ${d[1]/u[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -3722,16 +3722,16 @@ return a / b;`,JH=` ivec2 yRC = coords.yz; // Fractional source index. - vec2 sourceFracIndexRC = ${d}; + vec2 sourceFracIndexRC = ${c}; // Compute the coordinators of nearest neighbor point. ivec2 sourceNearestRC = ivec2( - min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h}))); + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${p}))); float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); setOutput(newValue); } - `}};function YG(e){let{inputs:t,backend:n,attrs:r}=e,{images:a}=t,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,u=new ZG(a.shape,l,c,s,i);return n.runWebGLProgram(u,[a],a.dtype)}var JG={kernelName:Iu,backendName:"webgl",kernelFunc:YG},QG=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,r,a]=t,[,s,i]=e,o=[n&&s>1?r-1:r,n&&i>1?a-1:a],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,p=Math.ceil(h)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function nq(e){let{inputs:t,backend:n,attrs:a}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,u=new tq(r.shape,l,d,s,i);return n.runWebGLProgram(u,[r],r.dtype)}var aq={kernelName:Su,backendName:"webgl",kernelFunc:nq},rq=class{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,a,r]=t,[,s,i]=e,o=[n&&s>1?a-1:a,n&&i>1?r-1:r],l=[n&&s>1?s-1:s,n&&i>1?i-1:i],d=o[0]/l[0],u=o[1]/l[1],p=1/d,c=1/u,h=Math.ceil(p)*2+2,m=Math.ceil(c)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3741,13 +3741,13 @@ return a / b;`,JH=` float accumulator = 0.0; - const float heightScale = float(${c}); + const float heightScale = float(${d}); const float widthScale = float(${u}); - const float invHeightScale = float(${h}); - const float invWidthScale = float(${d}); + const float invHeightScale = float(${p}); + const float invWidthScale = float(${c}); - const int winHeight = int(${p}); + const int winHeight = int(${h}); const int winWidth = int(${m}); // Compute bounds for where in dy we will look @@ -3783,12 +3783,12 @@ return a / b;`,JH=` (float(dyC) / float(${l[1]})); int sourceNearestRow = int(min( - float(int(${r}) - 1), + float(int(${a}) - 1), ${n} ? float(round(sourceFracRow)) : float(floor(sourceFracRow)))); int sourceNearestCol = int(min( - float(int(${a}) - 1), + float(int(${r}) - 1), ${n} ? float(round(sourceFracCol)) : float(floor(sourceFracCol)))); @@ -3801,23 +3801,23 @@ return a / b;`,JH=` setOutput(accumulator); } - `}};function eq(e){let{inputs:t,backend:n,attrs:r}=e,{images:a,dy:s}=t,{alignCorners:i}=r,o=new QG(s.shape,a.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var tq={kernelName:Yh,backendName:"webgl",kernelFunc:eq},nq=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` + `}};function sq(e){let{inputs:t,backend:n,attrs:a}=e,{images:r,dy:s}=t,{alignCorners:i}=a,o=new rq(s.shape,r.shape,i);return n.runWebGLProgram(o,[s],s.dtype)}var iq={kernelName:Yp,backendName:"webgl",kernelFunc:sq},oq=class{constructor(e,t){this.variableNames=["x"];let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,n===1){this.userCode=` void main() { int coord = getOutputCoords(); setOutput(getX(${e[0]} - coord - 1)); } - `;return}let r=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,a=e.map((i,o)=>r(o)).join(","),s=lt(n);this.userCode=` + `;return}let a=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,r=e.map((i,o)=>a(o)).join(","),s=lt(n);this.userCode=` void main() { ${s} coords = getOutputCoords(); - setOutput(getX(${a})); + setOutput(getX(${r})); } - `}},rq=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let r=hn("rc",n),a=`${r[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${r[n-2]} + 1 < ${this.outputShape[n-2]}`,i=lt(n);n===1?this.userCode=` + `}},lq=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;let a=pn("rc",n),r=`${a[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${a[n-2]} + 1 < ${this.outputShape[n-2]}`,i=lt(n);n===1?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); result.r = getChannel(getX(${e[0]} - rc - 1), ${e[0]} - rc - 1); - if(${a}){ + if(${r}){ result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), ${e[0]} - (rc + 1) - 1); } @@ -3827,19 +3827,19 @@ return a / b;`,JH=` void main() { ${i} rc = getOutputCoords(); vec4 result = vec4(0.); - result.r = ${o(r.slice())}; - if(${a}){ - result.g = ${l(r.slice())}; + result.r = ${o(a.slice())}; + if(${r}){ + result.g = ${l(a.slice())}; } if(${s}) { - result.b = ${c(r.slice())}; - if(${a}) { - result.a = ${u(r.slice())}; + result.b = ${d(a.slice())}; + if(${r}) { + result.a = ${u(a.slice())}; } } setOutput(result); } - `;function o(p){return h(p)}function l(p){return p[n-1]="("+p[n-1]+" + 1)",h(p)}function c(p){return p[n-2]="("+p[n-2]+" + 1)",h(p)}function u(p){return p[n-1]="("+p[n-1]+" + 1)",p[n-2]="("+p[n-2]+" + 1)",h(p)}function h(p){let m=e.map((y,g)=>d(g,p)),f=m.join(","),A=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${A}))`}function d(p,m){return t.indexOf(p)!==-1&&e[p]!==1?`${e[p]} - ${m[p]} - 1`:`${m[p]}`}}};function aq(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r,i=a.shape.length,o=_.parseAxisParam(s,a.shape);if(i===0)return Pn({inputs:{x:a},backend:n});let l=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new rq(a.shape,o):new nq(a.shape,o);return n.runWebGLProgram(l,[a],a.dtype)}var sq={kernelName:Bs,backendName:"webgl",kernelFunc:aq},iq=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],r=e[2];this.outputShape=e;let a="";typeof t=="number"?a=`float outputValue = ${t.toFixed(2)};`:a=` + `;function o(h){return p(h)}function l(h){return h[n-1]="("+h[n-1]+" + 1)",p(h)}function d(h){return h[n-2]="("+h[n-2]+" + 1)",p(h)}function u(h){return h[n-1]="("+h[n-1]+" + 1)",h[n-2]="("+h[n-2]+" + 1)",p(h)}function p(h){let m=e.map((y,g)=>c(g,h)),f=m.join(","),A=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${A}))`}function c(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function uq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=r.shape.length,o=w.parseAxisParam(s,r.shape);if(i===0)return Pn({inputs:{x:r},backend:n});let l=J().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new lq(r.shape,o):new oq(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}var dq={kernelName:Bs,backendName:"webgl",kernelFunc:uq},pq=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[];let n=e[1],a=e[2];this.outputShape=e;let r="";typeof t=="number"?r=`float outputValue = ${t.toFixed(2)};`:r=` vec3 fill = vec3(${t.join(",")}); float outputValue = fill[coords[3]];`,this.userCode=` uniform vec4 params; @@ -3853,13 +3853,13 @@ return a / b;`,JH=` (float(y) - params[1]) * params[3]; int coordX = int(round(coordXFloat + params[0])); int coordY = int(round(coordYFloat + params[1])); - ${a} - if(coordX >= 0 && coordX < ${r} && coordY >= 0 && coordY < ${n}) { + ${r} + if(coordX >= 0 && coordX < ${a} && coordY >= 0 && coordY < ${n}) { outputValue = getImage(coords[0], coordY, coordX, coords[3]); } setOutput(outputValue); } - `}getCustomSetupFunc(e,t,n,r){return(a,s)=>{this.paramsLoc==null&&(this.paramsLoc=a.getUniformLocationNoThrow(s,"params")),a.gl.uniform4f(this.paramsLoc,e,t,n,r)}}},oq={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:r}=e,{radians:a,fillValue:s,center:i}=t,o=n,l=new iq(r.shape,s),[c,u]=E.getImageCenter(i,r.shape[1],r.shape[2]),h=l.getCustomSetupFunc(c,u,Math.sin(a),Math.cos(a));return o.runWebGLProgram(l,[r],r.dtype,h)}},lq=` + `}getCustomSetupFunc(e,t,n,a){return(r,s)=>{this.paramsLoc==null&&(this.paramsLoc=r.getUniformLocationNoThrow(s,"params")),r.gl.uniform4f(this.paramsLoc,e,t,n,a)}}},cq={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{let{image:a}=e,{radians:r,fillValue:s,center:i}=t,o=n,l=new pq(a.shape,s),[d,u]=C.getImageCenter(i,a.shape[1],a.shape[2]),p=l.getCustomSetupFunc(d,u,Math.sin(r),Math.cos(r));return o.runWebGLProgram(l,[a],a.dtype,p)}},hq=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -3874,8 +3874,8 @@ return a / b;`,JH=` return base + 1.0; } } -`,uq=qe({opSnippet:lq}),cq={kernelName:Vs,backendName:"webgl",kernelFunc:uq},hq="return inversesqrt(x);",dq=qe({opSnippet:hq,cpuKernelImpl:GL}),pq={kernelName:js,backendName:"webgl",kernelFunc:dq},l7=class{constructor(e,t,n,r,a,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=lt(a.length),l=lt(s.length),c="";n===1?c="i":n===2&&(c="i, j");let u=`getIndices(${c})`,h="";r===1?h="i":r===2&&(h="i, coords[1]");let d=`getUpdates(${h})`,p=t>1?"strides[j]":"strides";this.userCode=` - ${o} strides = ${o}(${a}); +`,fq=qe({opSnippet:hq}),mq={kernelName:Vs,backendName:"webgl",kernelFunc:fq},Aq="return inversesqrt(x);",yq=qe({opSnippet:Aq,cpuKernelImpl:YL}),gq={kernelName:js,backendName:"webgl",kernelFunc:yq},u6=class{constructor(e,t,n,a,r,s,i=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let o=lt(r.length),l=lt(s.length),d="";n===1?d="i":n===2&&(d="i, j");let u=`getIndices(${d})`,p="";a===1?p="i":a===2&&(p="i, coords[1]");let c=`getUpdates(${p})`,h=t>1?"strides[j]":"strides";this.userCode=` + ${o} strides = ${o}(${r}); void main() { ${l} coords = getOutputCoords(); @@ -3885,40 +3885,40 @@ return a / b;`,JH=` int flattenedIndex = 0; for (int j = 0; j < ${t}; j++) { int index = round(${u}); - flattenedIndex += index * ${p}; + flattenedIndex += index * ${h}; } if (flattenedIndex == coords[0]) { - sum += ${d}; + sum += ${c}; found = true; } } setOutput(mix(getDefaultValue(), sum, float(found))); } - `}};function fq(e){let{inputs:t,backend:n,attrs:r}=e,{indices:a,updates:s}=t,{shape:i}=r,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=E.calculateShapes(s,a,i),d=[h/c,c];if(h===0)return n.makeTensorInfo(i,a.dtype);let p=fe({inputs:{x:a},backend:n,attrs:{shape:[l,o]}}),m=fe({inputs:{x:s},backend:n,attrs:{shape:[l,c]}}),f=n.makeTensorInfo([],"float32",new Float32Array([0])),A=new l7(l,o,p.shape.length,m.shape.length,u,d),y=n.runWebGLProgram(A,[m,p,f],m.dtype),g=fe({inputs:{x:y},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(f),g}var mq={kernelName:Vo,backendName:"webgl",kernelFunc:fq},Aq=class{constructor(e,t,n){this.variableNames=["c","a","b"],this.outputShape=t;let r,a;if(n>4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)a="resRC",r="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let c=0;c4)throw Error(`Where for rank ${n} is not yet supported`);if(n===1)r="resRC",a="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let d=0;d= 1.0) { - setOutput(getA(${a})); + setOutput(getA(${r})); } else { - setOutput(getB(${a})); + setOutput(getB(${r})); } } - `}};function yq(e){let{inputs:t,backend:n}=e,{condition:r,t:a,e:s}=t,i=new Aq(r.shape.length,a.shape,a.shape.length);return n.runWebGLProgram(i,[r,a,s],ir(a.dtype,s.dtype))}var gq={kernelName:jo,backendName:"webgl",kernelFunc:yq},xq=` + `}};function wq(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=new vq(a.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(i,[a,r,s],ia(r.dtype,s.dtype))}var kq={kernelName:jo,backendName:"webgl",kernelFunc:wq},Iq=` // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. // see: https://arxiv.org/abs/1706.02515 - float scaleAlpha = ${E.SELU_SCALEALPHA}; - float scale = ${E.SELU_SCALE}; + float scaleAlpha = ${C.SELU_SCALEALPHA}; + float scale = ${C.SELU_SCALE}; return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); -`,wq=qe({opSnippet:xq}),bq={kernelName:Uo,backendName:"webgl",kernelFunc:wq},_q="return 1.0 / (1.0 + exp(-1.0 * x));",vq=qe({opSnippet:_q}),kq={kernelName:Hs,backendName:"webgl",kernelFunc:vq},Iq=` +`,Sq=qe({opSnippet:Iq}),Nq={kernelName:Uo,backendName:"webgl",kernelFunc:Sq},Tq="return 1.0 / (1.0 + exp(-1.0 * x));",Eq=qe({opSnippet:Tq}),Cq={kernelName:Hs,backendName:"webgl",kernelFunc:Eq},Rq=` if (isnan(x)) { return 0.0; } return sign(x); -`,Sq=qe({opSnippet:Iq}),Nq={kernelName:qo,backendName:"webgl",kernelFunc:Sq},Tq=v3+` +`,Mq=qe({opSnippet:Rq}),Fq={kernelName:qo,backendName:"webgl",kernelFunc:Mq},$q=Iv+` return sin(x); -`,Eq=qe({opSnippet:Tq}),Cq={kernelName:Us,backendName:"webgl",kernelFunc:Eq},Rq=` +`,Dq=qe({opSnippet:$q}),Oq={kernelName:Us,backendName:"webgl",kernelFunc:Dq},zq=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; -`,Mq=qe({opSnippet:Rq}),Fq={kernelName:Go,backendName:"webgl",kernelFunc:Mq},$q=` +`,_q=qe({opSnippet:zq}),Pq={kernelName:Go,backendName:"webgl",kernelFunc:_q},Lq=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -3938,25 +3938,25 @@ return a / b;`,JH=` result = log(exp_x + 1.0); } return result; -`,Dq=qe({opSnippet:$q}),Oq={kernelName:Xo,backendName:"webgl",kernelFunc:Dq},zq=e=>{let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{blockShape:s,paddings:i}=r;_.assert(a.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,g)=>y*g),l=[[0,0]];l.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),A},Pq={kernelName:Su,backendName:"webgl",kernelFunc:zq};function Lq(e){let{inputs:t,backend:n}=e,{inputIndices:r,inputShape:a,newShape:s}=t;if(r.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${r.shape}`);if(a.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${a.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(a.dataId)),o=n.readSync(r.dataId),l=Array.from(n.readSync(s.dataId)),[c,u,h]=XL(o,r.shape,r.dtype,i,l);return[n.makeTensorInfo(u,r.dtype,c),n.makeTensorInfo([h.length],s.dtype,new Int32Array(h))]}var Wq={kernelName:Qh,backendName:"webgl",kernelFunc:Lq};function Bq(e){let{inputs:t,backend:n,attrs:r}=e,{sparseIndices:a,sparseValues:s,defaultValue:i}=t,{outputShape:o}=r,{sliceRank:l,numUpdates:c,strides:u,outputSize:h}=E.calculateShapes(s,a,o),d=!1,p=new l7(c,l,a.shape.length,s.shape.length,u,[h,1],d),m=n.runWebGLProgram(p,[s,a,i],s.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var Vq={kernelName:ed,backendName:"webgl",kernelFunc:Bq};function jq(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{numOrSizeSplits:s,axis:i}=r,o=_.parseAxisParam(i,a.shape)[0],l=E.prepareSplitSize(a,s,o),c=a.shape.length,u=new Array(c).fill(0),h=a.shape.slice();return l.map(d=>{let p=[...h];p[o]=d;let m=Ac({inputs:{x:a},backend:n,attrs:{begin:u,size:p}});return u[o]+=d,m})}var Uq={kernelName:Ko,backendName:"webgl",kernelFunc:jq},Hq="return sqrt(x);",Gq=qe({opSnippet:Hq}),qq={kernelName:Gs,backendName:"webgl",kernelFunc:Gq},Xq="return x * x;",Kq=qe({opSnippet:Xq}),Zq={kernelName:Nu,backendName:"webgl",kernelFunc:Kq},u7="return (a - b) * (a - b);",Yq=en({opSnippet:u7,packedOpSnippet:u7}),Jq={kernelName:Ks,backendName:"webgl",kernelFunc:Yq};function Qq({inputs:e,attrs:t,backend:n}){let{x:r}=e,a=wr+` +`,Wq=qe({opSnippet:Lq}),Bq={kernelName:Xo,backendName:"webgl",kernelFunc:Wq},Vq=e=>{let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{blockShape:s,paddings:i}=a;w.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,g)=>y*g),l=[[0,0]];l.push(...i);for(let y=1+s.length;yn.disposeIntermediateTensorInfo(y)),A},jq={kernelName:Nu,backendName:"webgl",kernelFunc:Vq};function Uq(e){let{inputs:t,backend:n}=e,{inputIndices:a,inputShape:r,newShape:s}=t;if(a.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${a.shape}`);if(r.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=Array.from(n.readSync(r.dataId)),o=n.readSync(a.dataId),l=Array.from(n.readSync(s.dataId)),[d,u,p]=QL(o,a.shape,a.dtype,i,l);return[n.makeTensorInfo(u,a.dtype,d),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}var Hq={kernelName:Qp,backendName:"webgl",kernelFunc:Uq};function Gq(e){let{inputs:t,backend:n,attrs:a}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=a,{sliceRank:l,numUpdates:d,strides:u,outputSize:p}=C.calculateShapes(s,r,o),c=!1,h=new u6(d,l,r.shape.length,s.shape.length,u,[p,1],c),m=n.runWebGLProgram(h,[s,r,i],s.dtype),f=fe({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),f}var qq={kernelName:ec,backendName:"webgl",kernelFunc:Gq};function Xq(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=w.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),d=r.shape.length,u=new Array(d).fill(0),p=r.shape.slice();return l.map(c=>{let h=[...p];h[o]=c;let m=Ad({inputs:{x:r},backend:n,attrs:{begin:u,size:h}});return u[o]+=c,m})}var Kq={kernelName:Ko,backendName:"webgl",kernelFunc:Xq},Zq="return sqrt(x);",Yq=qe({opSnippet:Zq}),Jq={kernelName:Gs,backendName:"webgl",kernelFunc:Yq},Qq="return x * x;",eX=qe({opSnippet:Qq}),tX={kernelName:Tu,backendName:"webgl",kernelFunc:eX},d6="return (a - b) * (a - b);",nX=en({opSnippet:d6,packedOpSnippet:d6}),aX={kernelName:Ks,backendName:"webgl",kernelFunc:nX};function rX({inputs:e,attrs:t,backend:n}){let{x:a}=e,r=ba+` return x > 0.0 ? 1.0 : float(${t.alpha}); - `,s=new Wa(r.shape,a);return n.runWebGLProgram(s,[r],r.dtype)}var eX={kernelName:Ta,backendName:"webgl",kernelFunc:Qq},tX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let r=n.length,a=lt(n.length),s=lt(n.length),i="";if(r===1)i="coords * strides + begin";else{let o=0;i=n.map((l,c)=>(o++,n.length===1?`coords * strides[${c}] + begin[${c}]`:`coords[${o-1}] * strides[${c}] + begin[${c}]`)).join(",")}this.userCode=` - ${a} begin = ${a}(${e}); - ${a} strides = ${a}(${t}); + `,s=new Pr(a.shape,r);return n.runWebGLProgram(s,[a],a.dtype)}var sX={kernelName:Nr,backendName:"webgl",kernelFunc:rX},iX=class{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;let a=n.length,r=lt(n.length),s=lt(n.length),i="";if(a===1)i="coords * strides + begin";else{let o=0;i=n.map((l,d)=>(o++,n.length===1?`coords * strides[${d}] + begin[${d}]`:`coords[${o-1}] * strides[${d}] + begin[${d}]`)).join(",")}this.userCode=` + ${r} begin = ${r}(${e}); + ${r} strides = ${r}(${t}); void main() { ${s} coords = getOutputCoords(); setOutput(getX(${i})); } - `}};function nX(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r,{nonStrided:p,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(a.shape,s,i,o,l,c,u,h,d),x=fe({inputs:{x:a},backend:n,attrs:{shape:y}}),v;if(p){let b=Ac({inputs:{x},backend:n,attrs:{begin:m,size:A}});v=fe({inputs:{x:b},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(b)}else if(g.some(b=>b===0))v=n.makeTensorInfo(g,a.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let b=n.texData.get(x.dataId).values,k=We(x.shape,x.dtype,b),N=KL(g,k,f,m);v=n.makeTensorInfo(g,x.dtype,N.values)}else{let b=new tX(m,f,g);v=n.runWebGLProgram(b,[x],x.dtype)}let w=fe({inputs:{x:v},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(v),w}var rX={kernelName:Zo,backendName:"webgl",kernelFunc:nX},aX="return tan(x);",sX=qe({opSnippet:aX}),iX={kernelName:Ys,backendName:"webgl",kernelFunc:sX},oX=` + `}};function oX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a,{nonStrided:h,$begin:m,$strides:f,size:A,newShape:y,outShape:g}=sn.sliceInfo(r.shape,s,i,o,l,d,u,p,c),x=fe({inputs:{x:r},backend:n,attrs:{shape:y}}),k;if(h){let v=Ad({inputs:{x},backend:n,attrs:{begin:m,size:A}});k=fe({inputs:{x:v},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(v)}else if(g.some(v=>v===0))k=n.makeTensorInfo(g,r.dtype,[]);else if(n.shouldExecuteOnCPU([x])){let v=n.texData.get(x.dataId).values,I=We(x.shape,x.dtype,v),T=eW(g,I,f,m);k=n.makeTensorInfo(g,x.dtype,T.values)}else{let v=new iX(m,f,g);k=n.runWebGLProgram(v,[x],x.dtype)}let b=fe({inputs:{x:k},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(k),b}var lX={kernelName:Zo,backendName:"webgl",kernelFunc:oX},uX="return tan(x);",dX=qe({opSnippet:uX}),pX={kernelName:Ys,backendName:"webgl",kernelFunc:dX},cX=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); -`,lX=qe({opSnippet:oX}),uX={kernelName:Js,backendName:"webgl",kernelFunc:lX},hX=class{constructor(e,t){this.variableNames=["A"];let n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[];for(let a=0;a5){let o=n.readSync(a.dataId).map(u=>_.decodeString(u)),l=We(a.shape,a.dtype,o),c=YL(l,s);return n.makeTensorInfo(c.shape,c.dtype,c.values)}let i=new hX(a.shape,s);return n.runWebGLProgram(i,[a],a.dtype)}var dX={kernelName:Na,backendName:"webgl",kernelFunc:c7};function pX(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{k:s,sorted:i}=r,o=n.readSync(a.dataId),[l,c]=JL(o,a.shape,a.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}var fX={kernelName:Yo,backendName:"webgl",kernelFunc:pX},mX=class{constructor(e,t,n,r,a,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(r){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` + `}};function mX(e){let t=e.length;if(t>5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${e[0]})`;let n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],a=[];for(let r=0;r5){let o=n.readSync(r.dataId).map(u=>w.decodeString(u)),l=We(r.shape,r.dtype,o),d=nW(l,s);return n.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new AX(r.shape,s);return n.runWebGLProgram(i,[r],r.dtype)}var yX={kernelName:Sr,backendName:"webgl",kernelFunc:p6};function gX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{k:s,sorted:i}=a,o=n.readSync(r.dataId),[l,d]=aW(o,r.shape,r.dtype,s,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(d.shape,d.dtype,d.values)]}var xX={kernelName:Yo,backendName:"webgl",kernelFunc:gX},bX=class{constructor(e,t,n,a,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=n==="nearest"?1:2,o;switch(a){case"constant":o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4;break;default:o=1;break}this.userCode=` float mapCoord(float outCoord, float len) { float inCoord = outCoord; if(${o} == 2) { @@ -4013,7 +4013,7 @@ return a / b;`,JH=` if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) { outputValue = getImage(batch, coordY, coordX, channel); } else { - outputValue = float(${a}); + outputValue = float(${r}); } return outputValue; } @@ -4037,7 +4037,7 @@ return a / b;`,JH=` float c2 = getTransforms(batch, 7); float projection = c1 * xf + c2 * yf + 1.0; if (projection == 0.0) { - outputValue = float(${a}); + outputValue = float(${r}); } else { float inX = (a1 * xf + a2 * yf + a3) / projection; float inY = (b1 * xf + b2 * yf + b3) / projection; @@ -4068,26 +4068,26 @@ return a / b;`,JH=` } setOutput(outputValue); } - `}};function AX(e){let{inputs:t,backend:n,attrs:r}=e,{image:a,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:c}=r,[u,h,d,p]=a.shape,[m,f]=c!=null?c:[h,d],A=[u,m,f,p],y=new mX(h,d,i,o,l,A);return n.runWebGLProgram(y,[a,s],"float32")}var yX={kernelName:td,backendName:"webgl",kernelFunc:AX};function gX(e){let{inputs:t,attrs:n,backend:r}=e,{axis:a}=n,{x:s}=t;Sl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=r.readSync(s.dataId),{outputValues:o,outputShape:l,indices:c}=QL(i,a,s.shape,s.dtype);return[r.makeTensorInfo(l,s.dtype,o),r.makeTensorInfo([c.length],"int32",c)]}var xX={kernelName:nd,backendName:"webgl",kernelFunc:gX};function wX(e){let{inputs:t,backend:n,attrs:r}=e,{value:a}=t,{axis:s}=r;s<0&&(s+=a.shape.length);let i=a,o=i.shape.length,l=a.shape[s],c=new Array(o-1),u=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var bX={kernelName:Jo,backendName:"webgl",kernelFunc:wX},_X=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,r=e.batchSize,a=e.inSize,s=e.numSegments,i=s*Math.ceil(a/n);this.outputShape=[r,i];let o="0.0",l="sumValue",c=Math.floor(n/4)*4,u=n%4,h=` + `}};function vX(e){let{inputs:t,backend:n,attrs:a}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:d}=a,[u,p,c,h]=r.shape,[m,f]=d!=null?d:[p,c],A=[u,m,f,h],y=new bX(p,c,i,o,l,A);return n.runWebGLProgram(y,[r,s],"float32")}var wX={kernelName:tc,backendName:"webgl",kernelFunc:vX};function kX(e){let{inputs:t,attrs:n,backend:a}=e,{axis:r}=n,{x:s}=t;Nl(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=a.readSync(s.dataId),{outputValues:o,outputShape:l,indices:d}=rW(i,r,s.shape,s.dtype);return[a.makeTensorInfo(l,s.dtype,o),a.makeTensorInfo([d.length],"int32",d)]}var IX={kernelName:nc,backendName:"webgl",kernelFunc:kX};function SX(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],d=new Array(o-1),u=0;for(let f=0;fn.disposeIntermediateTensorInfo(f)),m}var NX={kernelName:Jo,backendName:"webgl",kernelFunc:SX},TX=class{constructor(e,t){this.variableNames=["x","segmentIds"];let n=e.windowSize,a=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/n);this.outputShape=[a,i];let o="0.0",l="sumValue",d=Math.floor(n/4)*4,u=n%4,p=` sumValue += dot(values, segFilter); - `,d="";a%n>0&&(d=` - if (inIdx < 0 || inIdx >= ${a}) { + `,c="";r%n>0&&(c=` + if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } - `);let p="";a%n>0&&(p=` - if (inIdx < 0 || inIdx >= ${a}) { + `);let h="";r%n>0&&(h=` + if (inIdx < 0 || inIdx >= ${r}) { return -1.0; } `),this.userCode=` const float initializationValue = ${o}; float getValue(int batch, int inIdx) { - ${d} + ${c} return getX(batch, inIdx); } float getSegmentIdAtIndex(int inIdx) { - ${p} + ${h} return getSegmentIds(inIdx); } @@ -4101,7 +4101,7 @@ return a / b;`,JH=` float sumValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${d}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), @@ -4117,10 +4117,10 @@ return a / b;`,JH=` int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 ); - ${h} + ${p} } - int inIdx = inOffset + ${c}; + int inIdx = inOffset + ${d}; if (${u===1}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4138,7 +4138,7 @@ return a / b;`,JH=` 0 ); - ${h} + ${p} } else if (${u===2}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4154,7 +4154,7 @@ return a / b;`,JH=` 0 ); - ${h} + ${p} } else if (${u===3}) { vec4 values = vec4( getValue(batch, inIdx), @@ -4170,30 +4170,30 @@ return a / b;`,JH=` 0 ); - ${h} + ${p} } setOutput(${l}); } - `}};function vX(e){let{inputs:t,backend:n,attrs:r}=e,{x:a,segmentIds:s}=t,{numSegments:i}=r,o=a.shape.length,l=[],c=0,u=E.getAxesPermutation([c],o),h=a;u!=null&&(h=dn({inputs:{x:a},backend:n,attrs:{perm:u}}),l.push(h),c=E.getInnerMostAxes(1,o)[0]);let d=E.segment_util.computeOutShape(h.shape,c,i),p=_.sizeFromShape([h.shape[c]]),m=fe({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(m);let f=ld(a.dtype),A=(v,w,b,k,N)=>{let C=v.shape[0],F=v.shape[1],O=E.segment_util.segOpComputeOptimalWindowSize(F,N),z={windowSize:O,inSize:F,batchSize:C,numSegments:N},V=new _X(z,w),j=n.compileAndRun(V,[v,b],k);if(l.push(j),j.shape[1]===N)return j;let U=o7({backend:n,attrs:{start:0,stop:N,step:1,dtype:"float32"}}),X=c7({inputs:{x:U},backend:n,attrs:{reps:[F/O]}});return l.push(U),l.push(X),A(j,w,X,k,N)},y=A(m,"unsortedSegmentSum",s,f,i),g=fe({inputs:{x:y},backend:n,attrs:{shape:d}}),x=g;if(u!=null){l.push(g);let v=E.getUndoAxesPermutation(u);x=dn({inputs:{x},backend:n,attrs:{perm:v}})}return l.forEach(v=>n.disposeIntermediateTensorInfo(v)),x}var kX={kernelName:Tu,backendName:"webgl",kernelFunc:vX},IX=[dH,mH,YW,QW,nB,sB,oB,cB,dB,fB,gB,wB,vB,SB,FB,EB,OB,WB,PB,UB,GB,XB,JB,sV,oV,pV,mV,xV,_V,MW,NV,zV,LV,RV,jV,HV,BV,XV,YV,ej,nj,aj,oj,pj,mj,uj,gj,bj,vj,Nj,Rj,Dj,Pj,Lj,Wj,Vj,Uj,Gj,Xj,Zj,eU,aU,iU,lU,hU,mU,xU,vU,RW,IU,IV,TU,RU,$U,$W,PU,VU,UU,YU,XU,tH,aH,lH,yH,IH,vH,EH,RH,FH,bH,DH,zH,BH,HH,KH,rG,LW,sG,lG,hG,fG,uV,yG,xG,bG,kG,TG,OW,CG,RG,cV,QH,$G,VG,PG,BW,GG,KG,JG,tq,sq,oq,cq,pq,mq,gq,bq,kq,Nq,Cq,Fq,rV,tG,Oq,Pq,Wq,Vq,Uq,qq,Zq,Jq,eX,rX,eG,XW,iX,uX,dX,fX,yX,KW,xX,bX,kX,gG];for(let e of IX)ri(e);var In;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(In||(In={}));var gc;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(gc||(gc={}));var h7;function SX(e){h7=e.wasm.cwrap(ei,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function NX(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s,bias:i,preluActivationWeights:o}=t;if(a.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=r,d=n.dataIdMap.get(a.dataId).id,p=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let N=n.dataIdMap.get(i.dataId);if(N.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${N.shape.length}.`);m=N.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,A=gc[u];if(A==null)throw new Error(`${u} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?a.shape[2]:a.shape[1],g=c?s.shape[1]:s.shape[2],x=a.shape[0],v=n.makeOutput([x,y,g],a.dtype),w=n.dataIdMap.get(v.dataId).id,b=new Uint8Array(new Int32Array(a.shape).buffer),k=new Uint8Array(new Int32Array(s.shape).buffer);return h7(d,b,a.shape.length,p,k,s.shape.length,l,c,A,m,f,h||0,w),v}var TX={kernelName:ei,backendName:"wasm",setupFunc:SX,kernelFunc:NX};function pn(e){let t;function n(a){t=a.wasm.cwrap(e,null,["number","number"])}function r(a){let{backend:s,inputs:{x:i}}=a,o=s.dataIdMap.get(i.dataId).id,l=s.makeOutput(i.shape,i.dtype),c=s.dataIdMap.get(l.dataId).id;return _.sizeFromShape(l.shape)===0||t(o,c),l}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:r}}var EX=pn(eo);function fn(e,t,n){let r;function a(i){r=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:c,b:u}=l,h=o.dataIdMap.get(c.dataId).id,d=o.dataIdMap.get(u.dataId).id,p=n!=null?n:c.dtype,m=E.assertAndGetBroadcastShape(c.shape,u.shape),f=o.makeOutput(m,p);if(_.sizeFromShape(m)===0)return f;let A=new Uint8Array(new Int32Array(c.shape).buffer),y=new Uint8Array(new Int32Array(u.shape).buffer),g=o.dataIdMap.get(f.dataId).id,x=()=>r(h,A,c.shape.length,d,y,u.shape.length,In[c.dtype],g);if(t&&c.dtype==="float32")return x(),f;let v=E.getBroadcastDims(c.shape,m),w=E.getBroadcastDims(u.shape,m),b=v.every((N,C)=>N===C),k=w.every((N,C)=>N===C);if(b&&k)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${c.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:a,kernelFunc:s}}var CX=!0,RX=fn(Ia,CX),d7;function MX(e){d7=e.wasm.cwrap(is,null,["array","number","number","number"])}function FX(e){let{inputs:t,backend:n}=e,r=n.makeOutput(t[0].shape,t[0].dtype);if(_.sizeFromShape(r.shape)===0)return r;let a=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(a).buffer),i=n.dataIdMap.get(r.dataId).id;return d7(s,a.length,In[r.dtype],i),r}var $X={kernelName:is,backendName:"wasm",setupFunc:MX,kernelFunc:FX};function kp(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype),a=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(r).set(a),r}var DX={kernelName:vs,backendName:"wasm",kernelFunc:kp},p7;function OX(e){p7=e.wasm.cwrap(Qs,null,["number","array","number","number","number","array","number"])}function Ip(e){let{inputs:t,backend:n,attrs:r}=e,[a,s]=PX(t.x.shape,r.perm),i=!0;for(let m=0;m=a&&(s===-1||r[s]>r[i])&&(s=i);r[s]=a}return[n,r]}var LX={kernelName:Qs,backendName:"wasm",kernelFunc:Ip,setupFunc:OX};function Va(e,t,n){let r=e.shape,a=e.shape.length,s=_.parseAxisParam(t,r),i=s,o=E.getAxesPermutation(i,a),l=null,c=!1;if(o!=null){let u=new Array(a);for(let d=0;d`new shape: ${i}, old shape: ${r.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(r.dataId),{dataId:r.dataId,shape:i,dtype:r.dtype}}var JX={kernelName:Bo,backendName:"wasm",kernelFunc:br},g7;function QX(e){g7=e.wasm.cwrap(us,null,["number","array","number","number","array","number","number","number","number"])}function eK(e){let{inputs:t,backend:n,attrs:r}=e,{a,b:s}=t,{transposeA:i,transposeB:o}=r;if(a.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=a.shape.length,c=s.shape.length,u=i?a.shape[l-2]:a.shape[l-1],h=o?s.shape[c-1]:s.shape[c-2],d=i?a.shape[l-1]:a.shape[l-2],p=o?s.shape[c-2]:s.shape[c-1],m=a.shape.slice(0,-2),f=s.shape.slice(0,-2),A=_.sizeFromShape(m),y=_.sizeFromShape(f),g=A===y||A===1||y===1;_.assert(l>=2&&c>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?a.shape.slice(0,-2):s.shape.slice(0,-2)).concat([d,p]);_.assert(u===h,()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${a.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let v=i?[A,u,d]:[A,d,u],w=o?[y,p,h]:[y,h,p],b=br({inputs:{x:a},backend:n,attrs:{shape:v}}),k=br({inputs:{x:s},backend:n,attrs:{shape:w}}),N=n.dataIdMap.get(b.dataId).id,C=n.dataIdMap.get(k.dataId).id,F=i?b.shape[2]:b.shape[1],O=o?k.shape[1]:k.shape[2],z=Math.max(A,y),V=n.makeOutput([z,F,O],b.dtype),j=n.dataIdMap.get(V.dataId).id,U=new Uint8Array(new Int32Array(b.shape).buffer),X=new Uint8Array(new Int32Array(k.shape).buffer);return g7(N,U,b.shape.length,C,X,k.shape.length,i,o,j),n.disposeData(b.dataId),n.disposeData(k.dataId),V.shape=x,V}var tK={kernelName:us,backendName:"wasm",setupFunc:QX,kernelFunc:eK};function Sp(e){let{inputs:{x:t},attrs:{dtype:n},backend:r}=e,a=r.makeOutput(t.shape,n),s=r.typedArrayFromHeap(t);return r.typedArrayFromHeap(a).set(s),a}var nK={kernelName:cs,backendName:"wasm",kernelFunc:Sp},rK=pn(hs),x7;function aK(e){x7=e.wasm.cwrap(Sa,null,["number","number","number","number"])}function sK(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{clipValueMin:s,clipValueMax:i}=r,o=n.dataIdMap.get(a.dataId).id,l=n.makeOutput(a.shape,a.dtype),c=n.dataIdMap.get(l.dataId).id;return x7(o,s,i,c),l}var iK={kernelName:Sa,backendName:"wasm",setupFunc:aK,kernelFunc:sK};function w7(e){let{inputs:t,backend:n}=e,r=_.parseAxisParam(e.attrs.axis,t[0].shape)[0],a=E.computeOutShape(t.map(p=>p.shape),r),s=t.filter(p=>_.sizeFromShape(p.shape)>0);if(s.length===1)return kp({inputs:{x:s[0]},backend:n});let i=n.makeOutput(a,t[0].dtype);if(_.sizeFromShape(a)===0)return i;let o=s.map(p=>p.shape);if(E.assertParamsConsistent(o,r),s[0].dtype==="string"){let p=s.map(x=>{let v=_.sizeFromShape(x.shape.slice(r));return br({inputs:{x},backend:n,attrs:{shape:[-1,v]}})}),m=p.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));a=E.computeOutShape(p.map(x=>x.shape),1);let f=p[0].shape[0]===1,A=Vm(m,a,t[0].dtype,f),y=E.computeOutShape(s.map(x=>x.shape),r);i.shape=y;let g=n.dataIdMap.get(i.dataId);return g.stringBytes=E.fromStringArrayToUint8(A),p.forEach(x=>n.disposeData(x.dataId)),i}let l=_.sizeFromShape(s[0].shape.slice(0,r)),c=0,u=s.map(p=>{let m=_.sizeFromShape(p.shape.slice(r));return c+=m,m}),h=s.map(p=>n.typedArrayFromHeap(p)),d=n.typedArrayFromHeap(i);for(let p=0;p`cumsum does not support ${a.dtype} tensors in the WASM backend`);let c=E.getAxesPermutation([s],l),u=a;c!==null&&(u=Ip({inputs:{x:a},attrs:{perm:c},backend:n}));let h=E.getInnerMostAxes(1,l)[0];E.assertAxesAreInnerMostDims("cumsum",[h],l);let d=n.makeOutput(u.shape,u.dtype),p=u.shape[h],m=n.dataIdMap.get(u.dataId).id,f=n.dataIdMap.get(d.dataId).id;k7(m,i?1:0,o?1:0,p,f,In[a.dtype]);let A=d;if(c!==null){let y=E.getUndoAxesPermutation(c);A=Ip({inputs:{x:d},attrs:{perm:y},backend:n}),n.disposeData(u.dataId),n.disposeData(d.dataId)}return A}var wK={kernelName:ms,backendName:"wasm",setupFunc:gK,kernelFunc:xK},I7;function bK(e){I7=e.wasm.cwrap(fo,null,["number","number","number","array","number","array","array","number","number"])}function _K(e){let{backend:t,inputs:n,attrs:r}=e,{x:a}=n,{blockSize:s,dataFormat:i}=r;_.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=a.shape[0],l=i==="NHWC"?a.shape[1]:a.shape[2],c=i==="NHWC"?a.shape[2]:a.shape[3],u=i==="NHWC"?a.shape[3]:a.shape[1],h=l*s,d=c*s,p=u/(s*s),m=i==="NHWC"?[o,h,d,p]:[o,p,h,d],f=t.makeOutput(m,"float32"),A=t.dataIdMap.get(a.dataId).id,y=new Uint8Array(new Int32Array(_.computeStrides(a.shape)).buffer),g=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(_.computeStrides(m)).buffer),v=t.dataIdMap.get(f.dataId).id;return I7(A,s,i==="NHWC"?1:0,y,a.shape.length-1,g,x,m.length,v),f}var vK={kernelName:fo,backendName:"wasm",setupFunc:bK,kernelFunc:_K},S7;function kK(e){S7=e.wasm.cwrap(As,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function IK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s}=t,i=r.dataIdMap.get(a.dataId).id,o=r.dataIdMap.get(s.dataId).id,{strides:l,dilations:c,pad:u,dimRoundingMode:h}=n,d=c==null?[1,1]:c,p=E.computeConv2DInfo(a.shape,s.shape,l,d,u,h,!0),m=p.filterHeight,f=p.filterWidth,A=p.padInfo.top,y=p.padInfo.right,g=p.padInfo.bottom,x=p.padInfo.left,v=p.dilationHeight,w=p.dilationWidth,b=p.strideHeight,k=p.strideWidth,N=p.inChannels,C=p.outChannels,F=p.padInfo.type==="SAME"?1:0;if(p.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);let O=r.makeOutput(p.outShape,"float32"),z=r.dataIdMap.get(O.dataId).id;return S7(i,a.shape[0],a.shape[1],a.shape[2],o,m,f,A,y,g,x,F,v,w,b,k,N,C,z),O}var SK={kernelName:As,backendName:"wasm",setupFunc:kK,kernelFunc:IK},NK=!1,TK=fn(yo,NK,"bool"),EK=pn(gs);function bA(e){let{inputs:t,attrs:n,backend:r}=e,{input:a}=t,{dim:s}=n,i=a.shape.length,o=a.shape.slice(),l=s;return s<0&&(_.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),br({inputs:{x:a},backend:r,attrs:{shape:o}})}var CK={kernelName:go,backendName:"wasm",kernelFunc:bA};function RK(e){let{attrs:{shape:t,value:n,dtype:r},backend:a}=e,s=a.makeOutput(t,r);return a.typedArrayFromHeap(s).fill(n),s}var MK={kernelName:xu,backendName:"wasm",kernelFunc:RK},N7;function FK(e){N7=e.wasm.cwrap(wo,null,["number","number","number","number","number","number"])}function $K(e){let{inputs:t,backend:n}=e,{image:r}=t,a=n.makeOutput(r.shape,r.dtype),s=n.dataIdMap.get(r.dataId).id,i=n.dataIdMap.get(a.dataId).id,[o,l,c,u]=r.shape;return N7(s,o,l,c,u,i),a}var DK={kernelName:wo,backendName:"wasm",kernelFunc:$K,setupFunc:FK},OK=pn(xs),zK=!1,PK=fn(ws,zK),T7;function LK(e){T7=e.wasm.cwrap(bs,null,["number","number","number","number","number","number","number"])}function WK(e){let{backend:t,inputs:n,attrs:r}=e,{varianceEpsilon:a}=r,{x:s,mean:i,variance:o,offset:l,scale:c}=n,u=t.dataIdMap.get(s.dataId).id,h=t.dataIdMap.get(i.dataId).id,d=t.dataIdMap.get(o.dataId).id,p=l!=null?t.dataIdMap.get(l.dataId).id:0,m=c!=null?t.dataIdMap.get(c.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(_.sizeFromShape(s.shape)===0)return f;let A=t.dataIdMap.get(f.dataId).id;return T7(u,h,d,p,m,a,A),f}var BK={kernelName:bs,backendName:"wasm",setupFunc:LK,kernelFunc:WK},E7;function VK(e){E7=e.wasm.cwrap(ti,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function jK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dataFormat:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=n,f=E.computeConv2DInfo(a.shape,s.shape,l,u,c,d),A=gc[p];if(A==null)throw new Error(`${p} activation not yet supported for FusedConv2D in the wasm backend.`);let y=r.dataIdMap.get(a.dataId).id,g=r.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Q=r.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);v=Q.id}let w=f.filterHeight,b=f.filterWidth,k=f.padInfo.top,N=f.padInfo.right,C=f.padInfo.bottom,F=f.padInfo.left,O=f.dilationHeight,z=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(h!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);let ae=r.makeOutput(f.outShape,"float32"),te=r.dataIdMap.get(ae.dataId).id,ie=o==null?0:r.dataIdMap.get(o.dataId).id;return E7(y,G,ee,Y,g,w,b,v,k,N,C,F,X,O,z,V,j,U,x,A,ie,m||0,te),ae}var UK={kernelName:ti,backendName:"wasm",setupFunc:VK,kernelFunc:jK},C7;function HK(e){C7=e.wasm.cwrap(ni,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function GK(e){let{inputs:t,attrs:n,backend:r}=e,{x:a,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dataFormat:h,dimRoundingMode:d,activation:p,leakyreluAlpha:m}=n,f=E.computeConv2DInfo(a.shape,s.shape,l,u,c,d,!0),A=gc[p];if(A==null)throw new Error(`${p} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=r.dataIdMap.get(a.dataId).id,g=r.dataIdMap.get(s.dataId).id,x=f.outChannels,v=0;if(i!=null){let Q=r.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);v=Q.id}let w=f.filterHeight,b=f.filterWidth,k=f.padInfo.top,N=f.padInfo.right,C=f.padInfo.bottom,F=f.padInfo.left,O=f.dilationHeight,z=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(h!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${h}'. Please use 'NHWC'.`);let ae=r.makeOutput(f.outShape,"float32"),te=r.dataIdMap.get(ae.dataId).id,ie=o==null?0:r.dataIdMap.get(o.dataId).id;return C7(y,G,ee,Y,g,w,b,v,k,N,C,F,X,O,z,V,j,U,x,A,ie,m||0,te),ae}var qK={kernelName:ni,backendName:"wasm",setupFunc:HK,kernelFunc:GK},R7;function XK(e){R7=e.wasm.cwrap(_o,null,["number","number","number","number","number","number","array","number"])}function KK(e){let{backend:t,inputs:n}=e,{params:r,indices:a}=n,[s,i,o,l]=Lf.prepareAndValidate(r,a),c=t.makeOutput(s,r.dtype);if(i===0)return c;let u=a.shape,h=u[u.length-1],d=t.dataIdMap.get(r.dataId).id,p=t.dataIdMap.get(a.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(c.dataId).id;return R7(d,In[r.dtype],p,i,h,o,m,f),c}var ZK={kernelName:_o,backendName:"wasm",setupFunc:XK,kernelFunc:KK},M7;function YK(e){M7=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function JK(e){let{backend:t,inputs:n,attrs:r}=e,{x:a,indices:s}=n,{axis:i,batchDims:o}=r,l=_.parseAxisParam(i,a.shape)[0],c=E.segment_util.collectGatherOpShapeInfo(a,s,l,o),u=br({inputs:{x:a},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:t}),h=_.sizeFromShape(s.shape),d=br({inputs:{x:s},attrs:{shape:[c.batchSize,h/c.batchSize]},backend:t}),p=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize],m=t.makeOutput(p,a.dtype);if(_.sizeFromShape(a.shape)===0)return m;let f=u.shape.length-1,A=t.dataIdMap.get(u.dataId).id,y=t.dataIdMap.get(d.dataId).id,g=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(_.computeStrides(u.shape)).buffer),v=new Uint8Array(new Int32Array(_.computeStrides(p)).buffer);return M7(A,In[a.dtype],x,f,y,c.batchSize,v,g),t.disposeData(u.dataId),t.disposeData(d.dataId),m.shape=c.outputShape,m}var QK={kernelName:bo,backendName:"wasm",setupFunc:YK,kernelFunc:JK},eZ=!1,tZ=fn(vo,eZ,"bool"),nZ=!1,rZ=fn(_s,nZ,"bool"),F7;function aZ(e){F7=e.wasm.cwrap(ks,null,["number","number","number"])}function sZ(e){let{inputs:{x:t},attrs:{alpha:n},backend:r}=e,a=r.dataIdMap.get(t.dataId).id,s=r.makeOutput(t.shape,t.dtype);if(_.sizeFromShape(t.shape)!==0){let i=r.dataIdMap.get(s.dataId).id;F7(a,n,i)}return s}var iZ={kernelName:ks,backendName:"wasm",setupFunc:aZ,kernelFunc:sZ},oZ=!1,lZ=fn(No,oZ,"bool"),uZ=!1,cZ=fn(To,uZ,"bool"),hZ=pn(Is),dZ=!1,pZ=fn(Co,dZ,"bool"),$7;function fZ(e){$7=e.wasm.cwrap(Ss,null,["number, number, number"])}function mZ(e){let{backend:t,inputs:n,attrs:r}=e,{reductionIndices:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:c,axes:u,originalAxes:h,inputWasTransposed:d}=Va(i,a,t);if(d){let g=t.dataIdMap.get(c.dataId).id;l=c,o=g}let p=l.shape.length;E.assertAxesAreInnerMostDims("max",u,p);let[m,f]=E.computeOutAndReduceShapes(l.shape,u),A=_.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(_.sizeFromShape(l.shape)!==0){let g=t.dataIdMap.get(y.dataId).id;$7(o,A,g)}if(d&&t.disposeData(c.dataId),s){let g=E.expandShapeToKeepDim(y.shape,h);y.shape=g}return y}var AZ={kernelName:Ss,backendName:"wasm",setupFunc:fZ,kernelFunc:mZ},yZ=!1,gZ=fn(Ns,yZ),D7;function xZ(e){D7=e.wasm.cwrap(Ts,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function wZ(e){let{inputs:t,attrs:n,backend:r}=e,a=t.x,s=r.dataIdMap.get(a.dataId).id,{filterSize:i,strides:o,pad:l,dimRoundingMode:c}=n,u=E.computePool2DInfo(a.shape,i,o,1,l,c),h=u.filterHeight,d=u.filterWidth,p=u.padInfo.top,m=u.padInfo.right,f=u.padInfo.bottom,A=u.padInfo.left,y=u.dilationHeight,g=u.dilationWidth,x=u.strideHeight,v=u.strideWidth,w=u.inChannels,b=u.outChannels;if(u.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${u.dataFormat}'. Please use 'channelsLast'.`);let k=r.makeOutput(u.outShape,"float32"),N=r.dataIdMap.get(k.dataId).id;return D7(s,a.shape[0],a.shape[1],a.shape[2],h,d,p,m,f,A,y,g,x,v,w,b,N),k}var bZ={kernelName:Ts,backendName:"wasm",setupFunc:xZ,kernelFunc:wZ},O7;function _Z(e){O7=e.wasm.cwrap(Es,null,["number, number, number"])}function vZ(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let v=t.dataIdMap.get(u.dataId).id;v!==o&&(c=u,l=v,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("mean",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=c;c.dtype!=="float32"&&(g=Sp({backend:t,inputs:{x:c},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(g.dataId).id);let x=t.makeOutput(f,"float32");if(_.sizeFromShape(c.shape)!==0){let v=t.dataIdMap.get(x.dataId).id;O7(l,y,v)}if(p&&t.disposeData(u.dataId),s){let v=E.expandShapeToKeepDim(x.shape,d);x.shape=v}return c.dtype!=="float32"&&t.disposeData(g.dataId),x}var kZ={kernelName:Es,backendName:"wasm",setupFunc:_Z,kernelFunc:vZ},z7;function IZ(e){z7=e.wasm.cwrap(Cs,null,["number, number, number"])}function SZ(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t);if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x)}let m=c.shape.length;E.assertAxesAreInnerMostDims("min",h,m);let[f,A]=E.computeOutAndReduceShapes(c.shape,h),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;z7(l,y,x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var NZ={kernelName:Cs,backendName:"wasm",setupFunc:IZ,kernelFunc:SZ},TZ=!1,EZ=fn(Rs,TZ),_A;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(_A||(_A={}));var P7;function CZ(e){P7=e.wasm.cwrap(Ms,null,["number","array","number","number","array","array","number","number"])}function RZ(e){let{inputs:{x:t},backend:n,attrs:{paddings:r,mode:a}}=e,s=r.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),u=r.map(m=>m[0]),h=r.map(m=>m[1]),d=new Uint8Array(new Int32Array(u).buffer),p=new Uint8Array(new Int32Array(h).buffer);return P7(i,c,t.shape.length,In[t.dtype],d,p,_A[a],l),o}var MZ={kernelName:Ms,backendName:"wasm",kernelFunc:RZ,setupFunc:CZ},FZ=!0,$Z=fn(Fs,FZ),DZ=pn(Mo);function vA(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),r=n[0],a=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:r,selectedSize:a,pSelectedScores:s,pValidOutputs:i}}var L7;function OZ(e){L7=e.wasm.cwrap($o,"number",["number","number","number","number","number"])}function zZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i}=r,{boxes:o,scores:l}=n,c=t.dataIdMap.get(o.dataId).id,u=t.dataIdMap.get(l.dataId).id,h=L7(c,u,s,a,i),{pSelectedIndices:d,selectedSize:p,pSelectedScores:m,pValidOutputs:f}=vA(t,h);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([p],"int32",d)}var PZ={kernelName:$o,backendName:"wasm",setupFunc:OZ,kernelFunc:zZ},W7;function LZ(e){W7=e.wasm.cwrap(Do,"number",["number","number","number","number","number","bool"])}function WZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=r,{boxes:l,scores:c}=n,u=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(c.dataId).id,d=W7(u,h,s,a,i,o),{pSelectedIndices:p,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=vA(t,d);t.wasm._free(f);let y=t.makeOutput([m],"int32",p),g=t.makeOutput([],"int32",A);return[y,g]}var BZ={kernelName:Do,backendName:"wasm",setupFunc:LZ,kernelFunc:WZ},B7;function VZ(e){B7=e.wasm.cwrap(Oo,"number",["number","number","number","number","number","number"])}function jZ(e){let{backend:t,inputs:n,attrs:r}=e,{iouThreshold:a,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=r,{boxes:l,scores:c}=n,u=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(c.dataId).id,d=B7(u,h,s,a,i,o),{pSelectedIndices:p,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=vA(t,d);t.wasm._free(A);let y=t.makeOutput([m],"int32",p),g=t.makeOutput([m],"float32",f);return[y,g]}var UZ={kernelName:Oo,backendName:"wasm",setupFunc:VZ,kernelFunc:jZ},HZ=!1,GZ=fn(Fo,HZ,"bool"),V7;function qZ(e){V7=e.wasm.cwrap($s,null,["number","number","number","number","number"])}function XZ(e){let{inputs:t,backend:n,attrs:r}=e,{indices:a}=t,{depth:s,onValue:i,offValue:o}=r,l=n.makeOutput([...a.shape,s],"int32"),c=n.dataIdMap.get(l.dataId).id,u=n.dataIdMap.get(a.dataId).id;return V7(u,s,i,o,c),l}var KZ={kernelName:$s,backendName:"wasm",setupFunc:qZ,kernelFunc:XZ};function ZZ(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(1),r}var YZ={kernelName:zo,backendName:"wasm",kernelFunc:ZZ};function JZ(e){let{inputs:t,backend:n,attrs:r}=e,{axis:a}=r;if(t.length===1)return bA({inputs:{input:t[0]},backend:n,attrs:{dim:a}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{_.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),_.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let h=bA({inputs:{input:u},backend:n,attrs:{dim:a}});return o.push(h),h}),c=w7({inputs:l,backend:n,attrs:{axis:a}});return o.forEach(u=>n.disposeData(u.dataId)),c}var QZ={kernelName:Po,backendName:"wasm",kernelFunc:JZ},j7;function eY(e){j7=e.wasm.cwrap(Ds,null,["number","array","number","number","array","array","number","number"])}function tY(e){let{inputs:{x:t},backend:n,attrs:{paddings:r,constantValue:a}}=e,s=r.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),u=r.map(m=>m[0]),h=r.map(m=>m[1]),d=new Uint8Array(new Int32Array(u).buffer),p=new Uint8Array(new Int32Array(h).buffer);return j7(i,c,t.shape.length,In[t.dtype],d,p,a,l),o}var nY={kernelName:Ds,backendName:"wasm",kernelFunc:tY,setupFunc:eY},rY=!1,aY=fn(Os,rY),U7;function sY(e){U7=e.wasm.cwrap(zs,null,["number","number","number"])}function iY(e){let{inputs:t,backend:n}=e,{x:r,alpha:a}=t,s=n.dataIdMap.get(r.dataId).id,i=n.dataIdMap.get(a.dataId).id,o=n.makeOutput(r.shape,"float32"),l=n.dataIdMap.get(o.dataId).id;return U7(s,i,l),o}var oY={kernelName:zs,backendName:"wasm",setupFunc:sY,kernelFunc:iY},H7;function lY(e){H7=e.wasm.cwrap(Lo,null,["number","number","number","number"])}function uY(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("prod",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;H7(l,y,In[g.dtype],x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var cY={kernelName:Lo,backendName:"wasm",setupFunc:lY,kernelFunc:uY},hY=e=>{let{backend:t,attrs:n}=e,{start:r,stop:a,step:s,dtype:i}=n,o=Hm(r,a,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},dY={kernelName:ku,backendName:"wasm",kernelFunc:hY},pY=!0,fY=fn(ys,pY),mY=pn(Ps),AY=pn(Ws),G7;function yY(e){G7=e.wasm.cwrap(Ls,null,["number","number","number","number","number","number","number","number","number","number"])}function gY(e){let{backend:t,inputs:n,attrs:r}=e,{images:a}=n,{alignCorners:s,halfPixelCenters:i,size:o}=r,[l,c]=o,[u,h,d,p]=a.shape,m=[u,l,c,p],f=t.dataIdMap.get(a.dataId),A;f.dtype!=="float32"&&(A=Sp({backend:t,inputs:{x:a},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(A.dataId));let y=f.id,g=t.makeOutput(m,"float32");if(_.sizeFromShape(a.shape)===0)return g;let x=t.dataIdMap.get(g.dataId).id;return G7(y,u,h,d,p,l,c,s?1:0,i?1:0,x),A!=null&&t.disposeData(A.dataId),g}var xY={kernelName:Ls,backendName:"wasm",setupFunc:yY,kernelFunc:gY},q7;function wY(e){q7=e.wasm.cwrap(Bs,null,["number","array","number","array","number","number"])}function bY(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{dims:s}=r,i=_.parseAxisParam(s,a.shape);if(a.shape.length===0)return kp({inputs:{x:a},backend:n});let o=n.makeOutput(a.shape,a.dtype),l=n.dataIdMap.get(a.dataId).id,c=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(i).buffer),h=new Uint8Array(new Int32Array(a.shape).buffer);q7(l,u,i.length,h,a.shape.length,c);let d=br({inputs:{x:o},attrs:{shape:a.shape},backend:n});return n.disposeData(o.dataId),d}var _Y={kernelName:Bs,backendName:"wasm",kernelFunc:bY,setupFunc:wY},X7;function vY(e){X7=e.wasm.cwrap(el,null,["number","number","number","number","number","number","number","number","array","number","number"])}function kY(e){let{inputs:t,backend:n,attrs:r}=e,{image:a}=t,{radians:s,fillValue:i,center:o}=r,l=n.makeOutput(a.shape,a.dtype),c=n.dataIdMap.get(a.dataId).id,u=n.dataIdMap.get(l.dataId).id,[h,d,p,m]=a.shape,[f,A]=E.getImageCenter(o,d,p),y=i===0,g=255,x=typeof i=="number"?[i,i,i,y?0:g]:[...i,g],v=new Uint8Array(new Int32Array(x).buffer);return X7(c,h,d,p,m,s,f,A,v,x.length,u),l}var IY={kernelName:el,backendName:"wasm",kernelFunc:kY,setupFunc:vY},SY=pn(Vs),NY=pn(js),K7;function TY(e){K7=e.wasm.cwrap(Vo,null,["number","number","number","number","number","number","array","number","number"])}function EY(e){let{backend:t,inputs:n,attrs:r}=e,{indices:a,updates:s}=n,{shape:i}=r,o=t.makeOutput(i,s.dtype);if(_.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:c,sliceSize:u,strides:h,outputSize:d}=Wf.calculateShapes(s,a,i),p=t.dataIdMap.get(a.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(h).buffer),A=t.dataIdMap.get(o.dataId).id;return K7(p,m,In[s.dtype],l,c,u,f,d,A),o}var CY={kernelName:Vo,backendName:"wasm",setupFunc:TY,kernelFunc:EY},Z7;function RY(e){Z7=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function MY(e){let{inputs:t,backend:n}=e,{condition:r,t:a,e:s}=t,i=n.dataIdMap.get(r.dataId).id,o=n.dataIdMap.get(a.dataId).id,l=n.dataIdMap.get(s.dataId).id,c=n.makeOutput(a.shape,a.dtype),u=n.dataIdMap.get(c.dataId).id,h=r.shape.length,d=a.shape.length,p=h===0||h>1||d===1?1:_.sizeFromShape(a.shape.slice(1));return Z7(i,o,l,p,u),c}var FY={kernelName:jo,backendName:"wasm",kernelFunc:MY,setupFunc:RY},Y7;function $Y(e){Y7=e.wasm.cwrap(Hs,null,["number","number"])}function DY(e){let{backend:t,inputs:{x:n}}=e,r=t.dataIdMap.get(n.dataId).id,a=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(a.dataId).id;return _.sizeFromShape(a.shape)===0||Y7(r,s),a}var OY={kernelName:"Sigmoid",backendName:"wasm",setupFunc:$Y,kernelFunc:DY},zY=pn(Us);function Np(e){let{inputs:{x:t},attrs:{begin:n,size:r},backend:a}=e,[s,i]=sn.parseSliceParams(t,n,r),o=sn.isSliceContinous(t.shape,s,i),l=a.readSync(t.dataId),c=a.makeOutput(i,t.dtype),u=_.computeStrides(t.shape),h=a.dataIdMap.get(c.dataId);if(o){let m=sn.computeFlatOffset(s,u);return t.dtype==="string"?h.stringBytes=l.slice(m,m+_.sizeFromShape(i)):a.typedArrayFromHeap(c).set(l.subarray(m,m+_.sizeFromShape(i))),c}if(t.dtype==="string"){let m=tp(l,s,i,t.shape,t.dtype);return h.stringBytes=m,c}let d=a.typedArrayFromHeap(c),p=t.shape.length;if(p===2)PY(l,u[0],d,s,i);else if(p===3)LY(l,u[0],u[1],d,s,i);else if(p===4)WY(l,u[0],u[1],u[2],d,s,i);else{let m=tp(l,s,i,t.shape,t.dtype);d.set(m)}return c}function PY(e,t,n,r,a){let s=0,i=r[0],o=r[1],l=i+a[0];for(let c=i;c{let d=[...u];d[o]=h;let p=Np({inputs:{x:a},attrs:{begin:c,size:d},backend:r});return c[o]+=h,p})}var GY={kernelName:Ko,backendName:"wasm",kernelFunc:HY},qY=pn(Gs),XY=pn(Nu),KY=!0,ZY=fn(Ks,KY),Q7;function YY(e){Q7=e.wasm.cwrap(Ta,null,["number","number","number"])}function JY(e){let{backend:t,inputs:n,attrs:r}=e,{alpha:a}=r,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return Q7(i,a,l),o}var QY={kernelName:Ta,backendName:"wasm",setupFunc:YY,kernelFunc:JY},ev;function eJ(e){ev=e.wasm.cwrap(Zo,null,["number","array","number","array","array","array","array","array","number","number"])}function tJ(e){let{backend:t,inputs:n,attrs:r}=e,{x:a}=n,{begin:s,end:i,strides:o}=r;o==null&&(o=new Array(s.length));let{beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=r,p=E.slice_util.maskToAxes(u);if(p.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(u!==0&&h!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(u!==0&&d!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=a.shape.length-s.length,f=E.slice_util.maskToAxes(h),A=a.shape.slice();f.forEach(F=>{s[F]=0,i[F]=1,A.splice(F,0,1)});let y=br({inputs:{x:a},attrs:{shape:A},backend:t}),{begin:g,end:x,strides:v}=E.slice_util.getNormalizedAxes(y.shape,p,m,s,i,o,l,c,u);s=g,i=x,o=v;let w=E.slice_util.maskToAxes(d);w.forEach(F=>{i[F]=s[F]+1,o[F]=1});let b=E.slice_util.computeOutShape(s,i,o),k=b.filter((F,O)=>w.indexOf(O)===-1);if(o.every(F=>F===1)){let F=Np({inputs:{x:y},attrs:{begin:s,size:b},backend:t});t.disposeData(y.dataId);let O=br({inputs:{x:F},attrs:{shape:k},backend:t});return t.disposeData(F.dataId),O}let N=t.makeOutput(k,"float32");if(!k.some(F=>F===0)){let F=t.dataIdMap.get(y.dataId).id,O=new Uint8Array(new Int32Array(_.computeStrides(y.shape)).buffer),z=new Uint8Array(new Int32Array(s).buffer),V=new Uint8Array(new Int32Array(i).buffer),j=new Uint8Array(new Int32Array(o).buffer),U=new Uint8Array(new Int32Array(k).buffer),X=new Uint8Array(new Int32Array(_.computeStrides(k)).buffer),G=t.dataIdMap.get(N.dataId).id;ev(F,O,y.shape.length,z,V,j,U,X,k.length,G)}t.disposeData(y.dataId);let C=br({inputs:{x:N},attrs:{shape:k},backend:t});return t.disposeData(N.dataId),C}var nJ={kernelName:Zo,backendName:"wasm",setupFunc:eJ,kernelFunc:tJ},rJ=!0,aJ=fn(Zs,rJ),tv;function sJ(e){tv=e.wasm.cwrap(qs,null,["number, number, number"])}function iJ(e){let{backend:t,inputs:n,attrs:r}=e,{axis:a,keepDims:s}=r,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,c=i,{transposed:u,axes:h,originalAxes:d,inputWasTransposed:p}=Va(i,a,t),m=h;if(p){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(c=u,l=x,m=E.getInnerMostAxes(m.length,c.shape.length))}E.assertAxesAreInnerMostDims("sum",m,c.shape.length);let[f,A]=E.computeOutAndReduceShapes(c.shape,m),y=_.sizeFromShape(A),g=t.makeOutput(f,c.dtype);if(_.sizeFromShape(c.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;tv(l,y,x)}if(p&&t.disposeData(u.dataId),s){let x=E.expandShapeToKeepDim(g.shape,d);g.shape=x}return g}var oJ={kernelName:qs,backendName:"wasm",setupFunc:sJ,kernelFunc:iJ},lJ=pn(Ys),uJ=pn(Js),nv;function cJ(e){nv=e.wasm.cwrap(Na,null,["number","array","number","array","number","number"])}function hJ(e){let{inputs:t,backend:n,attrs:r}=e,{x:a}=t,s=n.dataIdMap.get(a.dataId).id,{reps:i}=r,o=new Array(a.shape.length);for(let d=0;d{let{x:r}=e,{k:a,sorted:s}=n,i=t.dataIdMap.get(r.dataId).id,o=new Uint8Array(new Int32Array(r.shape).buffer),l=r.shape.slice();l[l.length-1]=a;let c=t.makeOutput(l,r.dtype),u=t.dataIdMap.get(c.dataId).id,h=t.makeOutput(l,"int32"),d=t.dataIdMap.get(h.dataId).id;return rv(i,o,r.shape.length,In[r.dtype],a,s,u,d),[c,h]},mJ={kernelName:Yo,backendName:"wasm",setupFunc:pJ,kernelFunc:fJ};function AJ(e){let{inputs:t,backend:n,attrs:r}=e,{value:a}=t,{axis:s}=r;s<0&&(s+=a.shape.length);let i=a.shape[s],o=a.shape.length,l=new Array(o-1),c=0;for(let p=0;p({dataId:p,dtype:m,shape:l}))}var yJ={kernelName:Jo,backendName:"wasm",kernelFunc:AJ};function gJ(e){let{inputs:{x:t},backend:n}=e,r=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(r).fill(0),r}var xJ={kernelName:Qo,backendName:"wasm",kernelFunc:gJ},wJ=[EX,RX,$X,VX,HX,XX,YX,tK,nK,rK,iK,oK,cK,pK,fK,yK,wK,vK,SK,TK,EK,CK,MK,DK,OK,PK,TX,BK,UK,qK,ZK,QK,tZ,rZ,DX,iZ,lZ,cZ,hZ,pZ,AZ,gZ,bZ,kZ,NZ,EZ,MZ,$Z,DZ,PZ,BZ,UZ,GZ,KZ,YZ,QZ,nY,aY,oY,cY,dY,fY,mY,AY,JX,xY,_Y,IY,NY,SY,CY,FY,OY,zY,BY,UY,GY,qY,XY,ZY,QY,nJ,aJ,oJ,lJ,uJ,dJ,mJ,LX,yJ,xJ];for(let e of wJ)ri(e);var kA=J();kA.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])));kA.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(kA.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var av=Yi(Xk()),bJ='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',_J=Yi(Kk()),sv=class extends cu{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new _h(this,aa())}write(e,t,n){let r={id:this.dataIdNextNumber++};return this.move(r,e,t,n,1),r}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=_.now();return e(),{kernelMs:_.now()-t}}move(e,t,n,r,a){let s=this.dataIdNextNumber++;if(r==="string"){let c=t;this.dataIdMap.set(e,{id:s,stringBytes:c,shape:n,dtype:r,memoryOffset:null,refCount:a});return}let i=_.sizeFromShape(n),o=i*_.bytesPerElement(r),l=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:n,dtype:r,refCount:a}),this.wasm.tfjs.registerTensor(s,i,l),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),l)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:r,stringBytes:a}=this.dataIdMap.get(e);if(n==="string")return a;let s=this.wasm.HEAPU8.slice(t,t+_.sizeFromShape(r)*_.bytesPerElement(n));return vJ(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let r;if(n==null)r=this.write(null,e,t);else{let a=this.dataIdNextNumber++;r={id:a},this.dataIdMap.set(r,{id:a,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=_.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,s,n)}return{dataId:r,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let r=this.wasm.HEAPU8.buffer,{memoryOffset:a}=this.dataIdMap.get(n),s=_.sizeFromShape(e);switch(t){case"float32":return new Float32Array(r,a,s);case"int32":return new Int32Array(r,a,s);case"bool":return new Uint8Array(r,a,s);default:throw new Error(`Unknown dtype ${t}`)}}};function kJ(e){return(t,n)=>(_.fetch(e,{credentials:"same-origin"}).then(r=>{r.ok||t.env.a(`failed to load wasm binary file at '${e}'`),r.arrayBuffer().then(a=>{WebAssembly.instantiate(a,t).then(s=>{n(s.instance,s.module)})})}),{})}function iv(e,t,n){if(Tp!=null)return Tp;let r="tfjs-backend-wasm.wasm";return e&&t?r="tfjs-backend-wasm-threaded-simd.wasm":e&&(r="tfjs-backend-wasm-simd.wasm"),xc!=null&&xc[r]!=null?xc[r]:n+r}async function IJ(){let[e,t]=await Promise.all([J().getAsync("WASM_HAS_SIMD_SUPPORT"),J().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,r)=>{let a={};a.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let c=bJ,u=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(u)}return o.endsWith(".wasm")?iv(e,t,wc!=null?wc:l):l+o},IA&&(a.instantiateWasm=kJ(iv(e,t,wc!=null?wc:"")));let s=!1;a.onAbort=()=>{s||bc||(bc=!0,r({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&Tp==null?(a.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+av.default.toString()],{type:"text/javascript"}),i=(0,av.default)(a)):i=(0,_J.default)(a),i.then(o=>{s=!0,bc=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},n({wasm:o})})})}function vJ(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var SJ=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Tp=null,wc=null,xc={},bc=!1,IA=!1;function NJ(e,t=!1){if(Gf("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),bc)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Tp=e,IA=t}function TJ(e,t=!1){if(bc)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")wc=e;else{xc=e;let n=SJ.filter(r=>xc[r]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}IA=t}var ov="3.5.0",EJ=2;ul("wasm",async()=>{let{wasm:e}=await IJ();return new sv(e)},EJ);Z().prototype.abs=function(){return this.throwIfDisposed(),Dt(this)};Z().prototype.acos=function(){return this.throwIfDisposed(),Xf(this)};Z().prototype.acosh=function(){return this.throwIfDisposed(),Kf(this)};Z().prototype.add=function(e){return this.throwIfDisposed(),se(this,e)};Z().prototype.all=function(e,t){return this.throwIfDisposed(),Ad(this,e,t)};Z().prototype.any=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)};Z().prototype.argMax=function(e){return this.throwIfDisposed(),Bu(this,e)};Z().prototype.argMin=function(e){return this.throwIfDisposed(),Zf(this,e)};Z().prototype.asScalar=function(){return this.throwIfDisposed(),M(this.size===1,()=>"The array must have only 1 element."),H(this,[])};Z().prototype.asType=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.as1D=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.as2D=function(e,t){return this.throwIfDisposed(),H(this,[e,t])};Z().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),H(this,[e,t,n])};Z().prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),H(this,[e,t,n,r])};Z().prototype.as5D=function(e,t,n,r,a){return this.throwIfDisposed(),H(this,[e,t,n,r,a])};Z().prototype.asin=function(){return this.throwIfDisposed(),Yf(this)};Z().prototype.asinh=function(){return this.throwIfDisposed(),Jf(this)};Z().prototype.atan=function(){return this.throwIfDisposed(),Qf(this)};Z().prototype.atan2=function(e){return this.throwIfDisposed(),em(this,e)};Z().prototype.atanh=function(){return this.throwIfDisposed(),tm(this)};Z().prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),ju(this,e,t,n,r)};Z().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Uu(this,e,t)};Z().prototype.batchNorm=function(e,t,n,r,a){return this.throwIfDisposed(),hi(this,e,t,n,r,a)};Z().prototype.broadcastTo=function(e){return this.throwIfDisposed(),hl(this,e)};Z().prototype.cast=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.ceil=function(){return this.throwIfDisposed(),sm(this)};Z().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),vn(this,e,t)};Z().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Le&&(e=[e]),ot([this,...e],t)};Z().prototype.conv1d=function(e,t,n,r,a,s){return this.throwIfDisposed(),gd(this,e,t,n,r,a,s)};Z().prototype.conv2dTranspose=function(e,t,n,r,a){return this.throwIfDisposed(),xd(this,e,t,n,r,a)};Z().prototype.conv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),sa(this,e,t,n,r,a,s)};Z().prototype.cos=function(){return this.throwIfDisposed(),Hu(this)};Z().prototype.cosh=function(){return this.throwIfDisposed(),wd(this)};Z().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),bd(this,e,t,n)};Z().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),lm(this,e,t)};Z().prototype.depthwiseConv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),pl(this,e,t,n,r,a,s)};Z().prototype.dilation2d=function(e,t,n,r,a){return this.throwIfDisposed(),um(this,e,t,n,r,a)};Z().prototype.divNoNan=function(e){return this.throwIfDisposed(),cm(this,e)};Z().prototype.div=function(e){return this.throwIfDisposed(),ge(this,e)};Z().prototype.dot=function(e){return this.throwIfDisposed(),Fw(this,e)};Z().prototype.elu=function(){return this.throwIfDisposed(),fl(this)};Z().prototype.equal=function(e){return this.throwIfDisposed(),$a(this,e)};Z().prototype.erf=function(){return this.throwIfDisposed(),hm(this)};Z().prototype.exp=function(){return this.throwIfDisposed(),qn(this)};Z().prototype.expandDims=function(e){return this.throwIfDisposed(),on(this,e)};Z().prototype.expm1=function(){return this.throwIfDisposed(),dm(this)};Z().prototype.fft=function(){return this.throwIfDisposed(),tc(this)};Z().prototype.flatten=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.floor=function(){return this.throwIfDisposed(),ml(this)};Z().prototype.floorDiv=function(e){return this.throwIfDisposed(),fd(this,e)};Z().prototype.gather=function(e,t){return this.throwIfDisposed(),di(this,e,t)};Z().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Oa(this,e)};Z().prototype.greater=function(e){return this.throwIfDisposed(),or(this,e)};Z().prototype.ifft=function(){return this.throwIfDisposed(),xl(this)};Z().prototype.irfft=function(){return this.throwIfDisposed(),Pd(this)};Z().prototype.isFinite=function(){return this.throwIfDisposed(),Dw(this)};Z().prototype.isInf=function(){return this.throwIfDisposed(),Ow(this)};Z().prototype.isNaN=function(){return this.throwIfDisposed(),fm(this)};Z().prototype.leakyRelu=function(e){return this.throwIfDisposed(),qu(this,e)};Z().prototype.lessEqual=function(e){return this.throwIfDisposed(),pi(this,e)};Z().prototype.less=function(e){return this.throwIfDisposed(),vd(this,e)};Z().prototype.localResponseNormalization=function(e,t,n,r){return this.throwIfDisposed(),mm(this,e,t,n,r)};Z().prototype.logSigmoid=function(){return this.throwIfDisposed(),Lw(this)};Z().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Sd(this,e)};Z().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),gm(this,e,t)};Z().prototype.log=function(){return this.throwIfDisposed(),Mn(this)};Z().prototype.log1p=function(){return this.throwIfDisposed(),kd(this)};Z().prototype.logicalAnd=function(e){return this.throwIfDisposed(),lr(this,e)};Z().prototype.logicalNot=function(){return this.throwIfDisposed(),Xu(this)};Z().prototype.logicalOr=function(e){return this.throwIfDisposed(),Nd(this,e)};Z().prototype.logicalXor=function(e){return this.throwIfDisposed(),jw(this,e)};Z().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Be(this,e,t,n)};Z().prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),Ku(this,e,t,n,r)};Z().prototype.max=function(e,t){return this.throwIfDisposed(),Xn(this,e,t)};Z().prototype.maximum=function(e){return this.throwIfDisposed(),Pr(this,e)};Z().prototype.mean=function(e,t){return this.throwIfDisposed(),vt(this,e,t)};Z().prototype.min=function(e,t){return this.throwIfDisposed(),Al(this,e,t)};Z().prototype.minimum=function(e){return this.throwIfDisposed(),yl(this,e)};Z().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),wm(this,e,t)};Z().prototype.mod=function(e){return this.throwIfDisposed(),bm(this,e)};Z().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};Z().prototype.neg=function(){return this.throwIfDisposed(),_t(this)};Z().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Vd(this,e,t,n)};Z().prototype.notEqual=function(e){return this.throwIfDisposed(),Ai(this,e)};Z().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),ol(this,e,t,n)};Z().prototype.onesLike=function(){return this.throwIfDisposed(),$n(this)};Z().prototype.pad=function(e,t){return this.throwIfDisposed(),ia(this,e,t)};Z().prototype.pool=function(e,t,n,r,a){return this.throwIfDisposed(),Gw(this,e,t,n,r,a)};Z().prototype.pow=function(e){return this.throwIfDisposed(),oa(this,e)};Z().prototype.prelu=function(e){return this.throwIfDisposed(),Yu(this,e)};Z().prototype.prod=function(e,t){return this.throwIfDisposed(),Ed(this,e,t)};Z().prototype.reciprocal=function(){return this.throwIfDisposed(),km(this)};Z().prototype.relu=function(){return this.throwIfDisposed(),Lr(this)};Z().prototype.relu6=function(){return this.throwIfDisposed(),Rd(this)};Z().prototype.reshapeAs=function(e){return this.throwIfDisposed(),H(this,e.shape)};Z().prototype.reshape=function(e){return this.throwIfDisposed(),H(this,e)};Z().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),cb(this,e,t,n)};Z().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),hb(this,e,t,n)};Z().prototype.reverse=function(e){return this.throwIfDisposed(),Dn(this,e)};Z().prototype.rfft=function(){return this.throwIfDisposed(),nc(this)};Z().prototype.round=function(){return this.throwIfDisposed(),Im(this)};Z().prototype.rsqrt=function(){return this.throwIfDisposed(),Md(this)};Z().prototype.selu=function(){return this.throwIfDisposed(),Fd(this)};Z().prototype.separableConv2d=function(e,t,n,r,a,s){return this.throwIfDisposed(),Sm(this,e,t,n,r,a,s)};Z().prototype.sigmoid=function(){return this.throwIfDisposed(),_n(this)};Z().prototype.sign=function(){return this.throwIfDisposed(),Nm(this)};Z().prototype.sin=function(){return this.throwIfDisposed(),$d(this)};Z().prototype.sinh=function(){return this.throwIfDisposed(),Dd(this)};Z().prototype.slice=function(e,t){return this.throwIfDisposed(),Re(this,e,t)};Z().prototype.softmax=function(e){return this.throwIfDisposed(),ec(this,e)};Z().prototype.softplus=function(){return this.throwIfDisposed(),fi(this)};Z().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Zu(this,e,t)};Z().prototype.split=function(e,t){return this.throwIfDisposed(),ln(this,e,t)};Z().prototype.sqrt=function(){return this.throwIfDisposed(),Jt(this)};Z().prototype.square=function(){return this.throwIfDisposed(),st(this)};Z().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Ld(this,e)};Z().prototype.squeeze=function(e){return this.throwIfDisposed(),za(this,e)};Z().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Le?[this,e]:[this,...e];return On(n,t)};Z().prototype.step=function(e){return this.throwIfDisposed(),wl(this,e)};Z().prototype.stridedSlice=function(e,t,n,r,a,s,i,o){return this.throwIfDisposed(),Em(this,e,t,n,r,a,s,i,o)};Z().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};Z().prototype.sum=function(e,t){return this.throwIfDisposed(),Ne(this,e,t)};Z().prototype.tan=function(){return this.throwIfDisposed(),Cm(this)};Z().prototype.tanh=function(){return this.throwIfDisposed(),ci(this)};Z().prototype.tile=function(e){return this.throwIfDisposed(),Da(this,e)};Z().prototype.toBool=function(){return this.throwIfDisposed(),Ae(this,"bool")};Z().prototype.toFloat=function(){return this.throwIfDisposed(),Ae(this,"float32")};Z().prototype.toInt=function(){return this.throwIfDisposed(),Ae(this,"int32")};Z().prototype.topk=function(e,t){return this.throwIfDisposed(),Rm(this,e,t)};Z().prototype.transpose=function(e){return this.throwIfDisposed(),Ze(this,e)};Z().prototype.unique=function(e){return this.throwIfDisposed(),Bd(this,e)};Z().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Mm(this,e,t)};Z().prototype.unstack=function(e){return this.throwIfDisposed(),ur(this,e)};Z().prototype.where=function(e,t){return this.throwIfDisposed(),kn(e,this,t)};Z().prototype.zerosLike=function(){return this.throwIfDisposed(),Ue(this)};var lv={kernelName:eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,wl(Ae(n,"float32"),-1))}}},CJ={kernelName:to,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=st(Ae(n,"float32")),a=Jt(ye(ke(1),r));return _t(ge(e,a))}}}},RJ={kernelName:no,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=Jt(ye(st(Ae(n,"float32")),1));return ge(e,r)}}}},MJ={kernelName:Ia,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=e,i=Ot(n.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,n.shape)},b:()=>{let s=e,i=Ot(r.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,r.shape)}}}},FJ={kernelName:is,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((r,a)=>{n[a]=()=>e.clone()}),n}},$J={kernelName:os,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},DJ={kernelName:pu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},OJ={kernelName:so,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Jt(ye(ke(1),st(Ae(n,"float32")))))}}},zJ={kernelName:io,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=Jt(se(ke(1),st(Ae(n,"float32"))));return ge(e,r)}}}},PJ={kernelName:uo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=se(st(n),st(r)),i=B(e,ge(r,s)),o=Ot(n.shape,a);return o.length>0&&(i=Ne(i,o)),H(i,n.shape)},b:()=>{let s=se(st(n),st(r)),i=_t(B(e,ge(n,s))),o=Ot(r.shape,a);return o.length>0&&(i=Ne(i,o)),H(i,r.shape)}}}},LJ={kernelName:oo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(st(Ae(n,"float32")),1))}}},WJ={kernelName:lo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,ye(ke(1),st(Ae(n,"float32"))))}}};function BJ(e,t,n,r,a,s){let i=R(e,"dy","avgPool3dGrad"),o=R(t,"input","avgPool3dGrad"),l=i,c=o,u=!1;o.rank===4&&(u=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),c=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),M(l.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),M(c.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`),s!=null&&M(Bt(a),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${a}.`);let h={dy:l,input:c},d={filterSize:n,strides:r,pad:a,dimRoundingMode:s},p=$.runKernel(Nh,h,d);return u?H(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var VJ=D({avgPool3dGrad_:BJ}),jJ={kernelName:fu,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{filterSize:a,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>VJ(e,r,a,s,i,o)}}};function UJ(e,t,n,r,a){let s=R(e,"dy","avgPoolGrad"),i=R(t,"input","avgPoolGrad");M(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,l=s,c=!1;i.rank===3&&(c=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),M(l.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),M(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let u={dy:l,input:o},h={filterSize:n,strides:r,pad:a},d=$.runKernel(Sh,u,h);return c?H(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var HJ=D({avgPoolGrad_:UJ}),GJ={kernelName:ls,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{filterSize:a,strides:s,pad:i}=n;return{x:()=>HJ(e,r,a,s,i)}}},qJ={kernelName:us,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[r,a]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>Be(e,a,!1,!0),b:()=>Be(r,e,!0,!1)}:!s&&i?{a:()=>Be(e,a,!1,!1),b:()=>Be(e,r,!0,!1)}:s&&!i?{a:()=>Be(a,e,!1,!0),b:()=>Be(r,e,!1,!1)}:{a:()=>Be(a,e,!0,!0),b:()=>Be(e,r,!0,!0)}}},XJ={kernelName:mu,gradFunc:(e,t,n)=>{let{blockShape:r,crops:a}=n;return{x:()=>Zu(e,r,a)}}},KJ={kernelName:Sx,gradFunc:(e,t,n)=>{let r=n,a=r.inputShape,s=r.shape,i=Array.from(s);for(let l=a.length-1;l>=0;l--)if(a[l]===s[l])i[l]=1;else if(a[l]!==1)throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${s}].`);let o=[];for(let l=0;l1&&o.push(l);return{x:()=>Ne(e,o,!0)}}},ZJ={kernelName:cs,gradFunc:e=>({x:()=>e.clone()})},YJ={kernelName:hs,gradFunc:e=>({x:()=>Ue(e)})},JJ={kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{clipValueMin:a,clipValueMax:s}=n;return{x:()=>kn(lr(Oa(r,a),pi(r,s)),e,Ue(e))}}},QJ={kernelName:Au,inputsToSave:["x"],gradFunc:lv.gradFunc},eQ={kernelName:co,saveAllInputs:!0,gradFunc:(e,t,n)=>{let r=t.map(o=>o.shape),{axis:a}=n,s=sr(a,t[0].shape)[0],i=r.map(o=>o[s]);return ln(e,i,s).map(o=>()=>o)}},tQ={kernelName:ds,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,{dilations:s,strides:i,pad:o,dataFormat:l}=n;return M(Fa(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>im(r.shape,e,a,i,o,l),filter:()=>Om(r,e,a.shape,i,o,l)}}},nQ={kernelName:ps,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>sa(e,a,s,i,o,1,l),filter:()=>Om(e,r,a.shape,s,i,o,l)}}};function rQ(e,t,n,r,a){let s=e;e.rank===4&&(s=H(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),M(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),M(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),M(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),M(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),M(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},l={strides:r,pad:a,filterShape:n};return $.runKernel(Rh,o,l)}var aQ=D({conv3DBackpropFilter_:rQ}),sQ={kernelName:yu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:r,strides:a,pad:s}=n;M(Fa(r),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${r}'`);let[i,o]=t;return{x:()=>Cw(i.shape,e,o,a,s),filter:()=>aQ(i,e,o.shape,a,s)}}},iQ={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(_t($d(Ae(n,"float32"))),e)}}},oQ={kernelName:ho,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Dd(Ae(n,"float32")),e)}}},lQ={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{axis:a,exclusive:s,reverse:i}=n;return{x:()=>{let o=Vw([a],r.rank),l=bd(e,a,s,!i);return o!=null&&(l=Ze(l,o)),l}}}},uQ={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:r,strides:a,pad:s,dimRoundingMode:i}=n,o=r==null?[1,1]:r;M(Fa(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[l,c]=t;return M(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),M(c.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`),M(l.shape[3]===c.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`),M(Or(a,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${o}'.`),i!=null&&M(Bt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>rb(l.shape,e,c,a,s,r,i),filter:()=>nb(l,e,c.shape,a,s,r,i)}}},cQ={kernelName:gu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[r,a]=t,s={x:r,filter:a,dy:e},i={x:r,filter:a,dy:e};return{x:()=>$.runKernel(zh,s,n),filter:()=>$.runKernel(Ph,i,n)}}},hQ={kernelName:mo,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,r={dy:e,y:n};return{x:()=>$.runKernel(Wh,r)}}},dQ={kernelName:Ao,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,r=B(qn(_t(st(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,r)}}},pQ={kernelName:gs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},fQ={kernelName:go,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>H(e,n.shape)}}},mQ={kernelName:xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,qn(n))}}},AQ={kernelName:xs,gradFunc:e=>({x:()=>Ue(e)})},yQ={kernelName:ws,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=ge(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);i.length>0&&(s=H(Ne(s,i),r.shape));let o=st(r);return _t(ge(s,Ae(o,"float32")))}}}},gQ={kernelName:bs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:r}=n,[a,s,i,o]=t,l=o==null?ke(1):o,c=Ot(s.shape,a.shape),u=[];if(s.rank===1){for(let f=0;fs.rank===1?H(B(B(e,Da(H(p,[1,1,1,s.shape[0]]),u)),l),a.shape):H(B(B(e,p),l),a.shape),mean:()=>{let f=B(B(p,ke(-1)),d);return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)},variance:()=>{let f=B(B(m,h),d);return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)},scale:()=>{let f=B(h,p),A=B(e,f);return s.rank===1&&(A=Ne(A,c)),H(A,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Ne(f,c)),H(f,s.shape)}}}},xQ={kernelName:bo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[r,a]=t,{axis:s}=n,i=sr(s,r.shape)[0];return{x:()=>{let o=r.shape,l=a.size,c=o.slice(0,i),u=c.length,h=o.slice(s,o.length).slice(1),d=h.length,p=uv(0,u),m=uv(u+1,u+1+d),f=cv([c,[l],h]),A=H(e,f),y=H(a,[l]),g=cv([[u],p,m]),x=Ze(A,g),v=Mm(x,y,r.shape[i]),w=ym(g);return v=Ze(v,w),v},indices:()=>a}}};function uv(e,t){let n=[];for(let r=e;r{let[n,r]=t;return{a:()=>Ue(n),b:()=>Ue(r)}}},bQ={kernelName:vs,gradFunc:e=>({x:()=>Ae(e,"float32")})},_Q={kernelName:ko,gradFunc:e=>({x:()=>Ue(e)})},vQ={kernelName:Io,gradFunc:e=>({x:()=>Ue(e)})},kQ={kernelName:So,gradFunc:e=>({x:()=>Ue(e)})},IQ={kernelName:ks,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{alpha:a}=n,s=or(r,0);return{x:()=>kn(s,e,B(e,a))}}},SQ={kernelName:Eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(n,1))}}},NQ={kernelName:Is,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Ae(n,"float32"))}}},TQ={kernelName:Nx,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r]=t,{axis:a}=n;return{logits:()=>{let s=!0,i=qn(r);return ye(e,B(Ne(e,a,s),i))}}}};function EQ(e,t,n,r=5,a=1,s=1,i=.5){let o={x:e,y:t,dy:n},l={depthRadius:r,bias:a,alpha:s,beta:i};return $.runKernel(Hh,o,l)}var CQ=D({localResponseNormalizationBackprop_:EQ}),RQ={kernelName:_u,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;return{x:()=>CQ(r,a,e,s,i,o,l)}}};function hv(e,t,n,r){return t.rankB(e,Ae($a(n,t),e.dtype))}}var dv={kernelName:Ss,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let r=n,{reductionIndices:a}=r,s=t[0],i=t[1],o=sr(a,s.shape),l=hv(e,i,s,o);return{x:()=>l.x()}}},MQ={kernelName:Ns,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t;return{a:()=>B(e,Ae(Oa(n,r),"float32")),b:()=>B(e,Ae(vd(n,r),"float32"))}}};function FQ(e,t,n,r,a,s,i){let o=R(e,"dy","maxPool3dGrad"),l=R(t,"input","maxPool3dGrad"),c=R(n,"output","maxPool3dGrad"),u=o,h=l,d=c,p=!1;l.rank===4&&(p=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=H(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=H(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),M(u.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`),M(h.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`),M(d.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`),i!=null&&M(Bt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:u,input:h,output:d},f={filterSize:r,strides:a,pad:s,dimRoundingMode:i},A=$.runKernel(qh,m,f);return p?H(A,[A.shape[1],A.shape[2],A.shape[3],A.shape[4]]):A}var $Q=D({maxPool3dGrad_:FQ}),DQ={kernelName:vu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>$Q(e,r,a,s,i,o,l)}}};function OQ(e,t,n,r,a,s,i){let o=R(e,"dy","maxPoolGrad"),l=R(t,"input","maxPoolGrad"),c=R(n,"output","maxPoolGrad");M(l.rank===o.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`),M(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),M(l.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),i!=null&&M(Bt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let u={dy:o,input:l,output:c},h={filterSize:r,strides:a,pad:s,dimRoundingMode:i};return $.runKernel(Gh,u,h)}var zQ=D({maxPoolGrad_:OQ}),PQ={kernelName:Ts,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r,a]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>zQ(e,r,a,s,i,o)}}},LQ={kernelName:Es,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{axis:a}=n,s=sr(a,r.shape),i=Bw(r.shape,s)[1],o=Nt(i);return{x:()=>{let l=r.shape.slice();s.forEach(u=>{l[u]=1});let c=H(e,l);return ge(B(c,Fn(r.shape,"float32")),o)}}}},WQ={kernelName:Cs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let r=n,{axis:a}=r,[s,i]=t,o=sr(a,s.shape),l=hv(e,i,s,o);return{x:()=>l.x()}}},BQ={kernelName:Rs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t;return{a:()=>B(e,Ae(pi(n,r),"float32")),b:()=>B(e,Ae(or(n,r),"float32"))}}},VQ={kernelName:Ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let r=t[0],{paddings:a}=n,s=a.map(i=>i[0]);return{x:()=>Re(e,s,r.shape)}}},jQ={kernelName:Ro,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=Ot(n.shape,a);return s.length>0?H(Ne(e,s),n.shape):e},b:()=>{let s=B(e,_t(ml(ge(n,r)))),i=Ot(r.shape,a);return i.length>0?H(Ne(s,i),r.shape):s}}}},UQ={kernelName:Fs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=B(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);return i.length>0?H(Ne(s,i),r.shape):s}}}},HQ={kernelName:Mo,gradFunc:e=>({x:()=>_t(e)})},GQ={kernelName:$s,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>Et(n.shape,"float32")}}},qQ={kernelName:zo,gradFunc:e=>({x:()=>Ue(e)})},XQ={kernelName:Po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:r}=n;return ur(e,r).map(a=>()=>a)}},pv={kernelName:Ds,inputsToSave:["x"],gradFunc:(e,t,n)=>{let r=t[0],{paddings:a}=n,s=a.map(i=>i[0]);return{x:()=>Re(e,s,r.shape)}}},KQ={kernelName:Os,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,r,a]=t,s=n,i=r,o=dt(s.shape,i.shape);return{a:()=>{let l=Ae(i,"float32"),c=B(e,B(l,oa(s,ye(l,ke(1))))),u=Ot(s.shape,o);return u.length>0&&(c=Ne(c,u)),H(c,s.shape)},b:()=>{let l=or(s,0),c=kn(l,Mn(s),Ue(s)),u=B(e,B(a,c)),h=Ot(i.shape,o);return h.length>0&&(u=Ne(u,h)),H(u,i.shape)}}}},ZQ={kernelName:zs,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,r]=t,a=or(n,0);return{x:()=>kn(a,e,B(e,r)),alpha:()=>{let s=kn(a,Ue(e),B(e,n)),i=Ot(r.shape,e.shape);return i.length>0&&(s=Ne(s,i)),H(s,r.shape)}}}},YQ={kernelName:ys,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=ge(e,Ae(r,"float32")),i=Ot(n.shape,a);return i.length>0?H(Ne(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=Ot(r.shape,a);i.length>0&&(s=H(Ne(s,i),r.shape));let o=st(r);return _t(ge(s,Ae(o,"float32")))}}}},JQ={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,_t(st(n)))}}},QQ={kernelName:Ws,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,r=B(pi(n,6),wl(n));return{x:()=>B(e,Ae(r,"float32"))}}},eee={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Ae(wl(n),"float32"))}}},tee={kernelName:Bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>H(e,n.shape)}}},nee={kernelName:Ls,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[r]=t,a={dy:e,images:r};return{images:()=>$.runKernel(Jh,a,n)}}},ree={kernelName:Iu,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[r]=t,a={dy:e,images:r};return{images:()=>$.runKernel(Yh,a,n)}}},aee={kernelName:Bs,gradFunc:(e,t,n)=>{let{dims:r}=n,a=sr(r,e.shape);return{x:()=>Dn(e,a)}}},see={kernelName:Vs,gradFunc:e=>({x:()=>Ue(e)})},iee={kernelName:js,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>_t(ge(e,B(oa(n,1.5),2)))}}},oee={kernelName:jo,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>Ae(Ue(n),"float32"),t:()=>B(e,Ae(n,e.dtype)),e:()=>B(e,Ae(Xu(n),e.dtype))}}},lee={kernelName:Uo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let r=or(n,ke(0)),a=ke(mb),s=ke(Ab),i=B(e,s),o=B(B(e,a),qn(Ae(n,"float32")));return kn(r,i,o)}}}},uee={kernelName:Hs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(ke(1),n)))}}},cee={kernelName:qo,gradFunc:e=>({x:()=>Ue(e)})},hee={kernelName:Us,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Hu(Ae(n,"float32")),e)}}},dee={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(wd(Ae(n,"float32")),e)}}},pee={kernelName:Ho,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{begin:a,size:s}=n,i=r.shape,[o,l]=dw(r,a,s),c=[];for(let u=0;uia(e,c)}}},fee={kernelName:Xs,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[r]=t,{dim:a}=n,s=!0,i=B(e,r);return{logits:()=>ye(i,B(Ne(i,[a],s),r))}}},mee={kernelName:Xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,_n(n))}}},fv={kernelName:Su,gradFunc:(e,t,n)=>{let{blockShape:r,paddings:a}=n;return{x:()=>Uu(e,r,a)}}},mv={kernelName:Ko,gradFunc:(e,t,n)=>{let{axis:r}=n;return{x:()=>ot(e,r)}}},Aee={kernelName:Gs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,B(Jt(Ae(n,"float32")),2))}}},yee={kernelName:Nu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(Ae(n,"float32"),2))}}},gee={kernelName:Ks,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=ke(2);return{a:()=>B(e,B(a,ye(n,r))),b:()=>B(e,B(a,ye(r,n)))}}},xee={kernelName:Ta,gradFunc:e=>({x:()=>Ue(e)})},wee={kernelName:Zs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,r]=t,a=dt(n.shape,r.shape);return{a:()=>{let s=e,i=Ot(n.shape,a);return i.length>0&&(s=Ne(s,i)),H(s,n.shape)},b:()=>{let s=e,i=Ot(r.shape,a);return i.length>0&&(s=Ne(s,i)),H(_t(s),r.shape)}}}},bee={kernelName:qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,a=r.shape.slice(),{axis:s}=n;sr(s,r.shape).forEach(l=>{a[l]=1});let i=H(e,a),o=B(i,Fn(r.shape,"float32"));return{x:()=>o}}},_ee={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,st(Hu(n)))}}},vee={kernelName:Js,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(ke(1),st(n)),e)}}},kee={kernelName:Na,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[r]=t,{reps:a}=n;return{x:()=>{let s=Ue(r);if(r.rank===1)for(let i=0;i{let r=n,{perm:a}=r,s=ym(a);return{x:()=>Ze(e,s)}}},See={kernelName:Jo,gradFunc:(e,t,n)=>{let r=n,{axis:a}=r;return{value:()=>On(e,a)}}},Tee={kernelName:Tu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Nee(e,n)}}};function Nee(e,t){let n=Pr(t,Ue(t)),r=di(e,n),a=Oa(t,ke(0,"int32")),s=r.rank-a.rank;for(let o=0;o({x:()=>Ue(e)})},Cee=[lv,CJ,RJ,MJ,FJ,$J,DJ,OJ,zJ,PJ,LJ,WJ,jJ,GJ,qJ,XJ,KJ,ZJ,YJ,JJ,QJ,eQ,nQ,tQ,sQ,iQ,oQ,lQ,uQ,cQ,YQ,hQ,dQ,pQ,fQ,mQ,yQ,AQ,gQ,xQ,wQ,bQ,_Q,vQ,kQ,IQ,SQ,NQ,TQ,RQ,dv,dv,MQ,DQ,PQ,LQ,WQ,BQ,VQ,jQ,UQ,HQ,GQ,qQ,XQ,pv,pv,KQ,ZQ,JQ,QQ,eee,tee,nee,ree,aee,see,iee,oee,lee,uee,cee,hee,dee,pee,fee,mee,fv,fv,mv,mv,Aee,gee,yee,xee,wee,bee,_ee,vee,kee,Iee,See,Tee,Eee];for(let e of Cee)Tx(e);var Av={};Me(Av,{maxNorm:()=>Ree,minMaxNorm:()=>$ee,nonNeg:()=>Fee,unitNorm:()=>Mee});var SA;function zt(){return SA==null&&(SA=xw().epsilon()),SA}function _r(){return"channelsLast"}var ha=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,ha.prototype)}},vr=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,vr.prototype)}},W=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,W.prototype)}},De=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,De.prototype)}},yv=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,yv.prototype)}};function Ni(e,t){if(Array.isArray(e)){let n=[];for(let r=0;rn.toUpperCase())}var cr={};function NA(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function TA(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>TA(t));else{let t=Object.keys(e);for(let n of t){let r=e[n];r!=null&&typeof r=="object"&&(!Array.isArray(r)&&r.type==="ndarray"&&typeof r.value=="number"?e[n]=r.value:TA(r))}}}function _c(e,t={},n={},r="object",a=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in cr)i=cr[s];else if(i=t[s],i==null)throw new W(`Unknown ${r}: ${e}. This may be due to one of the following reasons: -1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. -2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}else{let s=e;if(s.className==null||s.config==null)throw new W(`${r}: Improper config format: ${JSON.stringify(s)}. -'className' and 'config' must set.`);let i=s.className,o,l;if(i in n?[o,l]=n[i]:i in cr?[o,l]=cr.className:i in t&&([o,l]=t[i]),o==null)throw new W(`Unknown ${r}: ${i}. This may be due to one of the following reasons: -1. The ${r} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. -2. The custom ${r} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(l!=null){let c={};for(let p of Object.keys(cr))c[p]=cr[p];for(let p of Object.keys(n))c[p]=n[p];let u=s.config;u.customObjects=c;let h=Object.assign({},cr);for(let p of Object.keys(n))cr[p]=n[p];TA(s.config);let d=l(o,s.config,n,a);return cr=Object.assign({},h),d}else{let c=Object.assign({},cr);for(let h of Object.keys(n))cr[h]=n[h];let u=new o(s.config);return cr=Object.assign({},c),u}}}function Dee(e,t){return et?1:0}function Ep(e,t){return-1*Dee(e,t)}function ja(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function Oee(e){if(e==null)throw new W(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Ei(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new W(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function EA(e,t,n=0,r=Infinity){return jr(n>=0),jr(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(a=>typeof a===t)}function Ut(e,t){Array.isArray(e)?(_.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,r)=>Ut(n,`element ${r+1} of ${t}`))):_.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${xv(e)}.`)}function xv(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>xv(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function zee(e,t){let n=_.now(),r;return(...a)=>{let s=_.now();return s-nJt(Ne(B(e,e),t,!0)))}var vc=class extends re.Serializable{getConfig(){return{}}},RA=class extends vc{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=CA(e,this.axis),n=vn(t,0,this.maxValue);return B(e,ge(n,se(zt(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};RA.className="MaxNorm";re.registerClass(RA);var MA=class extends vc{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>ge(e,se(zt(),CA(e,this.axis))))}getConfig(){return{axis:this.axis}}};MA.className="UnitNorm";re.registerClass(MA);var FA=class extends vc{apply(e){return Lr(e)}};FA.className="NonNeg";re.registerClass(FA);var $A=class extends vc{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=CA(e,this.axis),n=se(B(this.rate,vn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,ge(n,se(zt(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};$A.className="MinMaxNorm";re.registerClass($A);var bv={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Pt(e){return NA(e)}function _v(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"constraint")}function Lt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in bv?bv[e]:e,config:{}};return _v(t)}else return e instanceof vc?e:_v(e)}function Ree(e){return new RA(e)}function Mee(e){return new MA(e)}function Fee(){return new FA}function $ee(e){return new $A(e)}var vv={};Me(vv,{constant:()=>Wee,glorotNormal:()=>qee,glorotUniform:()=>Gee,heNormal:()=>Xee,heUniform:()=>Kee,identity:()=>Uee,leCunNormal:()=>Zee,leCunUniform:()=>Yee,ones:()=>Lee,orthogonal:()=>Jee,randomNormal:()=>Vee,randomUniform:()=>Bee,truncatedNormal:()=>jee,varianceScaling:()=>Hee,zeros:()=>Pee});var Qee=["channelsFirst","channelsLast"],ete=["nearest","bilinear"],tte=["valid","same","causal"],nte=["max","avg"],rte=["sum","mul","concat","ave"],zl=new Map;function Tt(e){Ei(Qee,"DataFormat",e)}function ate(e){Ei(ete,"InterpolationFormat",e)}function Qn(e){Ei(tte,"PaddingMode",e)}function kv(e){Ei(nte,"PoolMode",e)}var kc=[],Iv="/";function Ci(e,t){kc.push(e);try{let n=t();return kc.pop(),n}catch(n){throw kc.pop(),n}}function ste(){return kc.length===0?"":kc.join(Iv)+Iv}function Nv(e){if(!Sv(e))throw new Error("Not a valid tensor name: '"+e+"'");return ste()+e}function Tv(e){if(!Sv(e))throw new Error("Not a valid tensor name: '"+e+"'");zl.has(e)||zl.set(e,0);let t=zl.get(e);if(zl.set(e,zl.get(e)+1),t>0){let n=`${e}_${t}`;return zl.set(n,1),n}else return e}var ite=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Sv(e){return!!e.match(ite)}function ote(e){return e===parseInt(e.toString(),10)}function Ua(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let r=1;for(let a=t;a{if(e.shape.length!==2)throw new W(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Sc(e,1);return DA(n,[1,t,1])})}function ute(e){let t=[Ua(e.shape)];return e.reshape(t)}function cte(e){if(e.rank<=1)throw new W(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],Ua(e.shape,1)];return e.reshape(t)}function Ri(e,t,n){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:return Tm(e,[t,0],[n,e.shape[1]]);case 3:return zd(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Qu(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Re(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Re(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new W(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function OA(e,t,n){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:return Tm(e,[0,t],[e.shape[0],n]);case 3:return zd(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Qu(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function Cp(e,t,n,r){return L(()=>{switch(e.rank){case 1:return Od(e,t,n);case 2:switch(r){case 1:return Ri(e,t,n);case 2:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}case 3:switch(r){case 1:return Ri(e,t,n);case 2:return zd(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}case 4:switch(r){case 1:return Ri(e,t,n);case 2:return Qu(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Qu(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return OA(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${r}`)}default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function zA(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),ot(e,t)}function Cv(e,t){switch(e.rank){case 1:return Nw([e,t]);case 2:return dl([e,t],0);case 3:return Tw([e,t],0);case 4:return Ew([e,t],0);default:throw new W(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function DA(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new W(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Da(e,t)}function Rp(e,t=0,n=1,r,a){return qw(e,t,n,r,a)}function Ur(e,t,n,r){if(e.rank<2||t.rank<2)throw new De(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let a=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(a!==s)throw new De(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let a=!1,s=!1;return Pa.matMul({a:e,b:t,transposeA:a,transposeB:s,bias:r?PA(e.rank,r,_r()):null,activation:n})}else{let a=e.shape.slice(),s=a.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),l=i.pop(),c=[...i,o],u=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(u).reshape([l,-1]);let h=[...a,...c],d=!1,p=!1;return Pa.matMul({a:e,b:t,transposeA:d,transposeB:p,bias:r?PA(e.rank,r,_r()):null,activation:n}).reshape(h)}}function Rv(e,t,n){return L(()=>(Array.isArray(t)?t=nn(t,"int32"):t=t.toInt(),di(e,t,n)))}function Nc(e){return B(e,e)}function PA(e,t,n){let r=t.shape;if(t.rank!==1&&t.rank!==e)throw new W(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1,1,1]):t.reshape([1,r[3],r[0],r[1],r[2]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,1,1,r[0]]):t.reshape([1].concat(r))}else if(e===4){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1,1]):t.reshape([1,r[2],r[0],r[1]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,1,r[0]]):t.reshape([1].concat(r))}else if(e===3){if(n==="channelsFirst")return r.length===1?t.reshape([1,r[0],1]):t.reshape([1,r[1],r[0]]);if(n==="channelsLast")return r.length===1?t.reshape([1,1,r[0]]):t.reshape([1].concat(r))}else if(e<3)return t;throw new W(`Unsupported input rank by biasAdd: ${t.rank}`)}function Ir(e,t,n){return L(()=>(n==null&&(n=_r()),Tt(n),e.add(PA(e.rank,t,n))))}function hte(e,t=1){if(t!==1)throw new De(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return fl(e)}function dte(e){return L(()=>ge(e,Dt(e).add(1)))}function Mv(e,t,n,r){return L(()=>eb(e,t,n,r))}function pte(e){return L(()=>{let t=se(.5,B(.2,e));return vn(t,0,1)})}function Tc(e,t,n=!1){return n?e():t()}var fte=["fanIn","fanOut","fanAvg"],mte=["normal","uniform","truncatedNormal"];function Ate(e){Ei(fte,"FanMode",e)}function yte(e){Ei(mte,"Distribution",e)}var hr=class extends re.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},LA=class extends hr{apply(e,t){return Et(e,t)}};LA.className="Zeros";re.registerClass(LA);var Mp=class extends hr{apply(e,t){return Fn(e,t)}};Mp.className="Ones";re.registerClass(Mp);var WA=class extends hr{constructor(e){super();if(typeof e!="object")throw new W(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new W(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return L(()=>B(ke(this.value),Fn(e,t)))}getConfig(){return{value:this.value}}};WA.className="Constant";re.registerClass(WA);var BA=class extends hr{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return gl(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};BA.className="RandomUniform";re.registerClass(BA);var VA=class extends hr{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`randomNormal does not support dType ${t}.`);return Rp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};VA.className="RandomNormal";re.registerClass(VA);var jA=class extends hr{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`truncatedNormal does not support dType ${t}.`);return Wd(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};jA.className="TruncatedNormal";re.registerClass(jA);var UA=class extends hr{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return L(()=>{if(e.length!==2||e[0]!==e[1])throw new W("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,pm(e[0]))})}getConfig(){return{gain:this.gain}}};UA.className="Identity";re.registerClass(UA);function gte(e,t="channelsLast"){let n,r;if(Tt(t),e.length===2)n=e[0],r=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let a=Ua(e,2);n=e[1]*a,r=e[0]*a}else if(t==="channelsLast"){let a=Ua(e,0,e.length-2);n=e[e.length-2]*a,r=e[e.length-1]*a}}else{let a=Ua(e);n=Math.sqrt(a),r=Math.sqrt(a)}return[n,r]}var Nn=class extends hr{constructor(e){super();if(e.scale<0)throw new W(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,Ate(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,yte(this.distribution),this.seed=e.seed}apply(e,t){let n=gte(e),r=n[0],a=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,r):this.mode==="fanOut"?s/=Math.max(1,a):s/=Math.max(1,(r+a)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new De(`${this.getClassName()} does not support dType ${t}.`);return Wd(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return gl(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Nn.className="VarianceScaling";re.registerClass(Nn);var Fp=class extends Nn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Fp.className="GlorotUniform";re.registerClass(Fp);var $p=class extends Nn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};$p.className="GlorotNormal";re.registerClass($p);var Dp=class extends Nn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Dp.className="HeNormal";re.registerClass(Dp);var Op=class extends Nn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Op.className="HeUniform";re.registerClass(Op);var zp=class extends Nn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};zp.className="LeCunNormal";re.registerClass(zp);var Pp=class extends Nn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Nn.className}};Pp.className="LeCunNormal";re.registerClass(Pp);var HA=class extends hr{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new De("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return L(()=>{if(e.length<2)throw new De("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,r=Rp(n,0,1,"float32"),a=pb.gramSchmidt(r);return e[0]>e[1]&&(a=a.transpose()),B(this.gain,a)})}getConfig(){return{gain:this.gain,seed:this.seed}}};HA.className="Orthogonal";re.registerClass(HA);var Fv={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function $v(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"initializer")}function kt(e){return NA(e)}function At(e){if(typeof e=="string"){let t=e in Fv?Fv[e]:e;if(t==="GlorotNormal")return new $p;if(t==="GlorotUniform")return new Fp;if(t==="HeNormal")return new Dp;if(t==="HeUniform")return new Op;if(t==="LeCunNormal")return new zp;if(t==="LeCunUniform")return new Pp;{let n={};return n.className=t,n.config={},$v(n)}}else return e instanceof hr?e:$v(e)}function Pee(){return new LA}function Lee(){return new Mp}function Wee(e){return new WA(e)}function Bee(e){return new BA(e)}function Vee(e){return new VA(e)}function jee(e){return new jA(e)}function Uee(e){return new UA(e)}function Hee(e){return new Nn(e)}function Gee(e){return new Fp(e)}function qee(e){return new $p(e)}function Xee(e){return new Dp(e)}function Kee(e){return new Op(e)}function Zee(e){return new zp(e)}function Yee(e){return new Pp(e)}function Jee(e){return new HA(e)}var Dv={};Me(Dv,{Layer:()=>Ge,RNN:()=>Hr,RNNCell:()=>Ec,activation:()=>Dte,add:()=>Ute,alphaDropout:()=>Nne,average:()=>Hte,averagePooling1d:()=>GA,averagePooling2d:()=>qA,averagePooling3d:()=>XA,avgPool1d:()=>ene,avgPool2d:()=>nne,avgPool3d:()=>ane,avgPooling1d:()=>tne,avgPooling2d:()=>rne,avgPooling3d:()=>sne,batchNormalization:()=>Yte,bidirectional:()=>xne,concatenate:()=>Gte,conv1d:()=>Ste,conv2d:()=>Nte,conv2dTranspose:()=>Tte,conv3d:()=>Ete,conv3dTranspose:()=>Cte,convLstm2d:()=>mne,convLstm2dCell:()=>Ane,cropping2D:()=>Mte,dense:()=>Ote,depthwiseConv2d:()=>$te,dot:()=>Zte,dropout:()=>zte,elu:()=>wte,embedding:()=>jte,flatten:()=>Lte,gaussianDropout:()=>Sne,gaussianNoise:()=>Ine,globalAveragePooling1d:()=>ine,globalAveragePooling2d:()=>one,globalMaxPool1d:()=>bne,globalMaxPool2d:()=>_ne,globalMaxPooling1d:()=>zv,globalMaxPooling2d:()=>Pv,gru:()=>une,gruCell:()=>cne,input:()=>Ov,inputLayer:()=>xte,layerNormalization:()=>Jte,leakyReLU:()=>_te,lstm:()=>hne,lstmCell:()=>dne,masking:()=>Tne,maxPool1d:()=>vne,maxPool2d:()=>kne,maxPooling1d:()=>Lv,maxPooling2d:()=>Wv,maxPooling3d:()=>lne,maximum:()=>qte,minimum:()=>Xte,multiply:()=>Kte,permute:()=>Vte,prelu:()=>vte,reLU:()=>bte,repeatVector:()=>Wte,reshape:()=>Bte,rnn:()=>yne,separableConv2d:()=>Rte,simpleRNN:()=>pne,simpleRNNCell:()=>fne,softmax:()=>kte,spatialDropout1d:()=>Pte,stackedRNNCells:()=>gne,thresholdedReLU:()=>Ite,timeDistributed:()=>wne,upSampling2d:()=>Fte,zeroPadding2d:()=>Qte});var Ene=0;function Bv(){return Ene++}var Lp={};function Wp(e=""){return e in Lp||(Lp[e]=0),Lp[e]+=1,e+Lp[e].toString()}function KA(e){return Array.isArray(e)&&Array.isArray(e[0])}function Bp(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function ze(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new W(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function rt(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new W(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function Vp(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((r,a)=>r*a);return t}var Vv="Variable",jv=class{constructor(e,t="float32",n=Vv,r=!0,a=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=Bv(),n=n==null?Vv:n,this.originalName=Nv(n),this.name=Tv(this.originalName),this.trainable_=r,this.constraint=a,this.val=Kw(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),Cne(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function Cne(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function ZA(e){return e.map(t=>t.read())}function YA(e){e.forEach(t=>{t[0].write(t[1])})}var Rt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Sr=class{constructor(e,t,n,r,a,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=r,this.callArgs=a,this.outputTensorIndex=i,this.id=Bv(),s!=null&&(this.originalName=Nv(s),this.name=Tv(this.originalName)),this.rank=t.length}},Rne=0,jp=class{constructor(e,t){this.callArgs=t,this.id=Rne++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},Mne=0,Ge=class extends re.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Mne++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=da(n)+"_"+Wp(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let a=null;e.batchSize!=null&&(a=e.batchSize),n=[a].concat(e.inputShape)}this.batchInputShape=n;let r=e.dtype;r==null&&(r=e.inputDType),r==null&&(r="float32"),this.dtype=r}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new vr(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new W(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return Sn(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return Sn(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new ha(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new ha(`Layer ${this.name} is not connected, no input to return.`);return Sn(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new ha(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new ha(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Sn(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=ft(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=ft(this.inputSpec);if(e.length!==t.length)throw new W(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;na.maxNDim)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${a.maxNDim}, found ndim=${s}`);if(a.minNDim!=null&&s=0?i[l]:i[i.length+l];if(c!=null&&[c,null].indexOf(u)===-1)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected axis ${l} of input shape to have value ${c} but got shape ${i}.`)}}if(a.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of ft(e))s.push(i.shape);this.build(Sn(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&a&&(this._refCount=1)}if(this.assertInputCompatibility(e),a){let s=this.call(e,t),i=ft(s),o=[];for(let l of i)n.indexOf(l)!==-1&&(l=l.clone()),o.push(l);if(s=Sn(o),this.activityRegularizer!=null)throw new De("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=Fne(e),i=this.computeOutputShape(s),o,l=$ne(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((c,u)=>new Sr(l,c,this,ft(e),t,this.name,u)):o=new Sr(l,i,this,ft(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new De("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,r)=>{n!=null&&e[r]!=null&&e[r]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new ha(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new ha(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new vr(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Vp(this.weights)}build(e){this.built=!0}getWeights(e=!1){return ZA(e?this.trainableWeights:this.weights)}setWeights(e){L(()=>{let t=this.weights;if(t.length!==e.length)throw new W(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],r=ZA(t);for(let a=0;aa.apply(l.read())),s==null&&(s=!0),s?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=ft(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,r,a,s,i=null){let o=ft(e);t=ft(t),n=ft(n),r=ft(r),a=Bp(a),s=Bp(s);let l=[],c=[],u=[];for(let h of o)l.push(h.sourceLayer),c.push(h.nodeIndex),u.push(h.tensorIndex);new jp({outboundLayer:this,inboundLayers:l,nodeIndices:c,tensorIndices:u,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:a,outputShapes:s},i);for(let h=0;he.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function Fne(e){e=ft(e);let t=[];for(let n of e)t.push(n.shape);return Sn(t)}function $ne(e){return"float32"}function Uv(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let r=t.inboundNodes[n];if(r.inboundLayers.length===0)return r.inputTensors;{let a=[];for(let s=0;s0){let a=await Promise.all(t);for(let s=0;sse(this.totals[r],B(a,n)));this.totals[r]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:L(()=>{let r=B(ge(1,this.seen),this.totals[n]);t[n]=r,this.totals[n].dispose(),Vt(t[n])}))}},Kv=class extends Wl{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let a in this.history){let s=this.history[a];for(let i=0;inew Zv(n,t))}var dr=class{constructor(){}static registerCallbackConstructor(e,t){_.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),dr.checkForDuplicate(t),dr.constructors[e]==null&&(dr.constructors[e]=[]),dr.constructors[e].push(t)}static checkForDuplicate(e){for(let t in dr.constructors)dr.constructors[+t].forEach(n=>{if(n===e)throw new W("Duplicate callback constructor.")})}static clear(){dr.constructors={}}static createCallbacks(e){let t=[];for(let n in dr.constructors){let r=+n;e>=r&&t.push(...dr.constructors[r])}return t.map(n=>new n)}};dr.constructors={};function Jv(e,t,n,r,a,s,i,o,l){let c=new Kv,u=[new One,...dr.createCallbacks(t)];e!=null&&u.push(...e),u.push(c);let h=new Xv(u);return h.setParams({epochs:n,initialEpoch:r,samples:a,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:c}}function Nr(e,t={},n=!1){return _c(e,re.SerializationMap.getMap().classNameMap,t,"layer",n)}function Up(e,t){return L(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Ne(Nc(e),t,!0),r=Gu(n.shape,zt()),a=Jt(Pr(n,r));return ge(e,a)})}function Mi(e,t){return L(()=>vt(Nc(ye(t,e)),-1))}function Hp(e,t){return L(()=>vt(Dt(ye(t,e)),-1))}function Bl(e,t){return L(()=>{let n=ye(e,t),r=vn(Dt(e),zt(),Number.MAX_VALUE),a=Dt(ge(n,r));return B(100,vt(a,-1))})}function zne(e,t){return L(()=>{let n=vn(t,zt(),Number.MAX_VALUE),r=Mn(se(1,n)),a=vn(e,zt(),Number.MAX_VALUE),s=Mn(se(1,a));return vt(Nc(ye(r,s)),-1)})}function Pne(e,t){return L(()=>{let n=Pr(0,ye(1,B(e,t)));return vt(Nc(n),-1)})}function Lne(e,t){return L(()=>{let n=Pr(0,ye(1,B(e,t)));return vt(n,-1)})}function Wne(e,t){return L(()=>{let n=Ne(B(e,t),-1),r=Xn(B(ye(1,e),t),-1);return Pr(0,se(1,ye(r,n)))})}function Bne(e,t){return L(()=>{let n=Math.log(2),r=ye(t,e),a=ye(se(r,fi(B(-2,r))),n);return vt(a,-1)})}function Cc(e,t,n=!1){return L(()=>{if(n)t=ec(t);else{let r=Ne(t,t.shape.length-1,!0);t=ge(t,r)}return t=vn(t,zt(),1-zt()),_t(Ne(B(e.toFloat(),Mn(t)),t.shape.length-1))})}function Gp(e,t,n=!1){return L(()=>{let r=ml(ute(e)).toInt();t=vn(t,zt(),1-zt());let a=t.shape,s=ol(r,a[a.length-1]).reshape(a);return Cc(s,t,n)})}function Vne(e,t){if(!_.arraysEqual(e.shape,t.shape))throw new W(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return L(()=>{let n=t.relu(),r=t.abs().neg();return n.sub(t.mul(e)).add(r.exp().log1p())})}function qp(e,t){return L(()=>{let n;return n=vn(t,zt(),1-zt()),n=Mn(ge(n,ye(1,n))),vt(Vne(e,n),-1)})}function jne(e,t){return L(()=>{let n=vn(e,zt(),1),r=vn(t,zt(),1);return Ne(B(e,Mn(ge(n,r))),-1)})}function Une(e,t){return L(()=>{let n=Mn(se(zt(),t));return vt(ye(t,B(e,n)),-1)})}function JA(e,t){return L(()=>{let n=Up(e,-1),r=Up(t,-1),a=B(n,r);return _t(Ne(a,-1))})}var Xp={meanSquaredError:Mi,meanAbsoluteError:Hp,meanAbsolutePercentageError:Bl,meanSquaredLogarithmicError:zne,squaredHinge:Pne,hinge:Lne,categoricalHinge:Wne,logcosh:Bne,categoricalCrossentropy:Cc,sparseCategoricalCrossentropy:Gp,binaryCrossentropy:qp,kullbackLeiblerDivergence:jne,poisson:Une,cosineProximity:JA};function QA(e){if(typeof e=="string"){if(e in Xp)return Xp[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new W(t)}else return e}function ey(e,t){return L(()=>{let n=B(.5,$n(t)),r=Ic(or(t,n),e.dtype);return vt($a(e,r),-1)})}function ty(e,t){return L(()=>Ic($a(Bu(e,-1),Bu(t,-1)),"float32"))}function Qv(e,t){return L(()=>lr(e.equal(1),t.equal(1)).sum().cast("float32"))}function Hne(e,t){return L(()=>lr(e.equal(1),t.equal(0)).sum().cast("float32"))}function Gne(e,t){return L(()=>lr(e.equal(0),t.equal(1)).sum().cast("float32"))}function e6(e,t){return L(()=>{let n=Qv(e,t),r=Gne(e,t),a=n.add(r);return kn(or(a,0),n.div(a),0).cast("float32")})}function qne(e,t){return L(()=>{let n=Qv(e,t),r=Hne(e,t),a=n.add(r);return kn(or(a,0),n.div(a),0).cast("float32")})}function t6(e,t){return qp(e,t)}function n6(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),$a(e,t).asType("float32")}var Xne=Mi,Kne=Mi,Zne=Hp,Yne=Hp,Jne=Bl,Qne=Bl,ny=Cc,ere=JA,r6=Gp,Kp={binaryAccuracy:ey,categoricalAccuracy:ty,precision:e6,categoricalCrossentropy:ny,sparseCategoricalCrossentropy:r6,mse:Xne,MSE:Kne,mae:Zne,MAE:Yne,mape:Jne,MAPE:Qne,cosine:ere};function tre(e){if(typeof e=="string"&&e in Kp)return Kp[e];if(typeof e!="string"&&e!=null)return e;throw new W(`Unknown metric ${e}`)}function Zp(e){if(jr(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(Xp))if(Xp[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(Kp))if(Kp[n]===e){t=n;break}return t!==void 0?t:e.name}}function nre(e){let t={Adagrad:()=>gi.adagrad(.01),Adadelta:()=>gi.adadelta(1,.95,zt()),Adam:()=>gi.adam(.001,.9,.999,zt()),Adamax:()=>gi.adamax(.002,.9,.999,zt(),0),RMSProp:()=>gi.rmsprop(.001,.9,0,zt()),SGD:()=>gi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new W(`Unknown Optimizer ${e}`)}var a6=1*1024*1024;function s6(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!ry(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let r=JSON.stringify(e);r.length>a6&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${r.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${a6}.`)}}function ry(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!ry(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!ry(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function ore(e,t,n,r=console.log){let a=are(e),s=["Layer (type)","Output shape","Param #"];a?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(u=>Math.floor(t*u)));let i;if(!a){s.push("Receives inputs"),i=[];for(let u in e.nodesByDepth)i.push(...e.nodesByDepth[u])}r("_".repeat(t)),Yp(s,n,r),r("=".repeat(t));let o=e.layers;for(let u=0;u1||a.length===1&&a[0].inboundLayers.length>1){t=!1;break}r.push(...a)}if(t)for(let a of e.layers){let s=!1;for(let i of a.inboundNodes)if(r.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function Yp(e,t,n=console.log){let r="";for(let a=0;a0&&(r=r.slice(0,r.length-1)+" "),r+=e[a],r=r.slice(0,t[a]),r+=" ".repeat(t[a]-r.length);n(r)}function sre(e,t,n){let r;try{r=JSON.stringify(e.outputShape)}catch(o){r="multiple"}let a=e.name,s=e.getClassName(),i=[`${a} (${s})`,r,e.countParams().toString()];Yp(i,t,n)}function ire(e,t,n,r){let a;try{a=JSON.stringify(e.outputShape)}catch(u){a="multiple"}let s=[];for(let u of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(u)===-1))for(let h=0;hm.name),l=[],c=t.names();for(let m of o)c.indexOf(m)!==-1?l.push(t.getValue(m)):l.push(null);r!=null&&(r.maxNumTensors=-Infinity,r.minNumTensors=Infinity);let u=o.join(",")+"|"+t.names().join(","),h,d;if(iy[u]==null){let m=ure(i,t);h=m.sorted,d=m.recipientCounts,iy[u]=h,o6[u]=d}h=iy[u],d={},a||Object.assign(d,o6[u]);let p=new Fi(t);for(let m=0;mr.maxNumTensors&&(r.maxNumTensors=C),C0,()=>"Expected at least one fetch, got none");let n=[],r={};if(e.length===1){let a=l6(e[0],t);n=a.sorted,r=a.recipientMap}else{let a=new Set;for(let s of e){let{sorted:i,recipientMap:o}=l6(s,t);for(let l of i)a.has(l.name)||(n.push(l),a.add(l.name));for(let l in o)r[l]==null&&(r[l]=new Set),o[l].forEach(c=>r[l].add(c))}}return{sorted:n,recipientCounts:hre(r)}}function hre(e){let t={};for(let n in e)t[n]=e[n].size;return t}function l6(e,t){let n=new Set,r=[],a={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let l=i[i.length-1]===s.length-1;if(o.inputs.length===0||l)s.pop(),r.push(o),n.add(o.name),l&&i.pop();else{i.push(s.length-1);for(let c of o.inputs)a[c.name]==null&&(a[c.name]=new Set),a[c.name].add(o.name),!n.has(c.name)&&s.push(c)}}return{sorted:r,recipientMap:a}}function cre(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let r=0;ry.name)}`);ja(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let g=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;this.outputLayers.push(g),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(v)}for(let y of this.inputs){let g=y.sourceLayer,x=y.nodeIndex,v=y.tensorIndex;jr(x===0,"input layer has >1 nodes"),jr(v===0,"input layer has >1 tensors"),this.inputLayers.push(g),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(v)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},r={},a={},s={},i=[],o=(y,g,x,v,w,b)=>{(v==null||w==null||b==null)&&(v=y.sourceLayer,w=y.nodeIndex,b=y.tensorIndex);let k=v.inboundNodes[w];if(x.indexOf(k)!==-1)throw new vr(`The tensor ${y.name} at layer "${v.name}" is part of a cycle.`);if(g.indexOf(k)!==-1)return;this.containerNodes.add(Gr.nodeKey(v,w)),v.id in s||(s[v.id]=Object.keys(s).length),x.indexOf(k)===-1&&x.push(k);let N=k.inboundLayers.length;for(let C=0;C=0;)x.splice(x.indexOf(k),1);i.push(k)},l=[],c=[];for(let y of this.outputs)o(y,l,c);let u=i.slice().reverse();for(let y of u){n[y.id]=y,y.id in t||(t[y.id]=0);let g=t[y.id],x=r[y.outboundLayer.id]==null?0:r[y.outboundLayer.id];g=Math.max(g,x),r[y.outboundLayer.id]=g,a[y.outboundLayer.id]=y.outboundLayer,t[y.id]=g;for(let v=0;vparseInt(y,10)).sort(Ep);this.layers=[];for(let y of p){let g=d[y];g.sort((x,v)=>{let w=s[x.id],b=s[v.id];return wb?1:0});for(let x of g)x instanceof Gr&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=d,p=Object.keys(h).map(y=>parseInt(y,10)).sort(Ep);let m=this.inputs.slice(),f=[];for(let y of p)for(let g of h[y]){let x=g.outboundLayer;if(x!=null){for(let v of g.inputTensors)if(m.indexOf(v)===-1)throw new vr(`Graph disconnected: cannot obtain value for tensor ${v} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let v of g.outputTensors)m.push(v);f.push(x.name)}}this.nodesByDepth=h;let A=this.layers.map(y=>y.name);for(let y of A){let g=A.filter(x=>x===y).length;if(g!==1)throw new vr(`The name "${y}" is used ${g} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(A))}this.outboundNodes=[],this.inboundNodes=[],new jp({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new W("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},r=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new W(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,r++}let a=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)a.push([n[i],e[s]]);else if(t)throw new W(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new W(`${s.length} of ${r} weights are not set: ${s}`)}YA(a)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${sy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=ay(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return L(()=>{e=ft(e);let n=new Fi;for(let r=0;r{e=ft(e);let n;return t==null?n=Ni(null,e.length):n=ft(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=Bp(e);if(t.length!==this.inputLayers.length)throw new W(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(Ep);if(r.length>1)for(let i of r){let o=this.nodesByDepth[i];for(let l of o){let c=l.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(c.id)!==-1)continue;let u=[];for(let m=0;mparseInt(o,10)).sort(Ep);for(let o of r){let l=this.nodesByDepth[o];for(let c of l){let u=c.outboundLayer,h=c.inputTensors,d=c.outputTensors,p=new Array;for(let m of h)m.id in n&&p.push(n[m.id]);if(p.length===h.length){let m={},f,A,y,g;if(c.callArgs!=null&&(m=c.callArgs),p.length===1){let[x,v]=p[0];m.mask==null&&(m.mask=v),y=ft(u.call(x,m)),g=ft(u.computeMask(x,v)),f=[x],A=[v]}else f=p.map(x=>x[0]),A=p.map(x=>x[1]),m.mask==null&&(m.mask=A),y=ft(u.call(f,m)),g=ft(u.computeMask(f,A));if(u.activityRegularizer)throw new De("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply(Sn(y),g)}function l(f){let A=f.name,y=Nr(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(r),a[A]=y,f.inboundNodes.forEach(g=>{if(!(g instanceof Array))throw new W(`Corrupted configuration, expected array for nodeData: ${g}`);i(y,g)})}let c=t.name,u=t.layers;for(let f of u)l(f);for(;!Oee(s);)for(let f of u){let A=a[f.name];if(A.name in s){let y=s[A.name];delete s[A.name];for(let g of y)o(A,g)}}let h=[],d=[],p=t.inputLayers;for(let f of p){let A=f[0],y=f[1],g=f[2];jr(A in a);let x=a[A].inboundNodes[y].outputTensors;h.push(x[g])}let m=t.outputLayers;for(let f of m){let A=f[0],y=f[1],g=f[2];jr(A in a);let x=a[A].inboundNodes[y].outputTensors;d.push(x[g])}return new e({inputs:h,outputs:d,name:c})}get stateful(){if(this._stateful)throw new W("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){L(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function dre(e,t,n){let r=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(a=>null);if(r===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==r)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${r} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let a=[];return t.forEach(s=>{s in e?a.push(e[s]):a.push(null)}),a}else throw new Error(`The model has multiple (${r}) outputs, so ${n} must be either an array with ${r} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function u6(e,t){return dre(e,t,"classWeight")}async function c6(e,t,n,r){if(t!=null||r!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let a=L(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await a.data());Te(a);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),nn(i,"float32")}else return null}function pre(e,t){return B(e,t)}var fre=32;function d6(e,t){let n,r,a=t;n=a.xs,r=a.ys,_.assert(n!=null&&r!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=h6("input",e.inputNames,n),i=h6("output",e.outputNames,r),o=s[0].shape[0];_.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),_.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let l=0;l`Batch size mismatch: input ${e.inputNames[l]} has ${s[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let l=0;l`Batch size mismatch: output ${e.outputNames[l]} has ${i[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function h6(e,t,n){if(n instanceof Le)return[n];if(Array.isArray(n))return _.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let r=[];for(let a of t){if(n[a]==null)throw new W(`The feature data generated by the dataset lacks the required ${e} key '${a}'.`);r.push(n[a])}return r}}function mre(e){if(e.length===3)throw new De("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function yre(e,t,n){let r=n.batchesPerEpoch!=null;if(_.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),_.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),_.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),_.assert(!r||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),_.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let a=n.validationData!=null,s,i;if(a)if(p6(n.validationData))_.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let A=mre(n.validationData);s=A.xs,i=A.ys}let o=e.makeTrainFunction(),l=e.getDedupedMetricsNames(),c;a?c=l.slice().concat(l.map(A=>"val_"+A)):c=l.slice();let u=Yv(n.callbacks,n.yieldEvery),h=n.verbose==null?1:n.verbose,{callbackList:d,history:p}=Jv(u,h,n.epochs,null,null,Are(t,n),null,a,c);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(a){let v;p6(n.validationData)?v=ft(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):v=ft(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?fre:n.validationBatchSize,verbose:0}));for(let w=0;w0)throw new De("Verbose mode is not implemented yet.");_.assert(!r||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=gre(t)?t:await t.iterator(),o=0,l=0;for(;r?l{if(c.value){let{xs:u,ys:h}=d6(e,c.value),d=u.concat(h),p=L(()=>a(d));if(Te(d),l===0)for(let f=0;fse(s[f],B(m,A))),l>0&&Te(y)}Te(p),o+=m,++l}return s}),c.done){r&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let c=0;c0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function Fc(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(r=>Ri(r,t,n-t)):Ri(e,t,n-t)}function ly(e,t){return L(()=>e==null?null:Array.isArray(e)?e.map(n=>ly(n,t)):Rv(e,t.dtype==="int32"?t:t.toInt()))}function uy(e,t){let n=[],r=0,a=null;for(;r=e&&(a=e),n.push([r,a]),r=a;return n}async function wre(e,t,n,r,a,s,i,o,l,c,u,h,d,p,m){a==null&&(a=32),s==null&&(s=1),u==null&&(u=!0),d==null&&(d=0);let f=!1;if(l!=null&&c!=null&&(f=!0),m!=null&&(f=!0,p==null))throw new W("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let A=e.checkNumSamples(n,a,p,"steps_per_epoch"),y;A!=null&&(y=kr(0,A)),i==null&&(i=1);let{callbackList:g,history:x}=Jv(o,i,s,d,A,p,a,f,h);g.setModel(e),e.history=x,await g.onTrainBegin(),e.stopTraining_=!1;for(let v=d;v{let F=k[N][0],O=k[N][1],z=Ri(b,F,O-F);C.batch=N,C.size=O-F;let V=ly(n,z),j=t(V);for(let U=0;U0){if(m=!0,r.validationData.length===2)i=r.validationData[0],o=r.validationData[1];else throw r.validationData.length===3?new De("validationData including sample weights is not supported yet."):new W(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${r.validationData} is invalid.`);let b=!0,k=await e.standardizeUserData(i,o,null,null,b,h);l=k[0],c=k[1],f=l.concat(c)}else if(r.validationSplit!=null&&r.validationSplit>0&&r.validationSplit<1){m=!0;let b=Math.floor(a[0].shape[0]*(1-r.validationSplit)),k=a[0].shape[0];l=Fc(a,b,k),a=Fc(a,0,b),c=Fc(s,b,k),s=Fc(s,0,b),f=l.concat(c)}else r.validationSteps!=null&&(m=!0);let A=a.concat(s).concat(u);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),g=e.getDedupedMetricsNames(),x,v;m?(e.makeTestFunction(),x=e.testFunction,v=g.slice().concat(g.map(b=>"val_"+b))):(x=null,f=[],v=g.slice());let w=Yv(r.callbacks,r.yieldEvery);return await wre(e,y,A,g,h,r.epochs,r.verbose,w,x,f,r.shuffle,v,r.initialEpoch,null,null)}finally{e.isTraining=!1,$i(a,t),$i(s,n),$i(l,i),$i(c,o),u!=null&&Te(u)}}function f6(e){let t=[];e instanceof Le&&(e=[e]);for(let n=0;nn.push(a.id));else if(t!=null)for(let a in t){let s=t[a];n.push(s.id)}let r=[];if(e instanceof Le)n.indexOf(e.id)===-1&&r.push(e);else if(Array.isArray(e))e.forEach(a=>{n.indexOf(a.id)===-1&&r.push(a)});else if(e!=null)for(let a in e){let s=e[a];n.indexOf(s.id)===-1&&r.push(s)}r.forEach(a=>{a.isDisposed||a.dispose()})}function _re(e){return e instanceof Le}function cy(e){return Array.isArray(e)}function m6(e){return!_re(e)&&!cy(e)}function A6(e,t,n,r=!0,a=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(cy(e)&&e.length>0)i=!0;else if(m6(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new W(`Error when checking model ${a} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(m6(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new W(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(cy(e)){if(e=e,e.length!==t.length)throw new W(`Error when checking model ${a}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new W(`The model ${a} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=f6(s),n!=null)for(let i=0;i=0&&c!==u)throw new W(`Error when checking ${a}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function vre(e,t,n){let r=ja(e.map(s=>s.shape[0]));r.sort();let a=ja(t.map(s=>s.shape[0]));if(a.sort(),r.length>1)throw new W(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(a.length>1)throw new W(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(r.length>0&&a.length>0&&!_.arraysEqual(r,a))throw new W(`Input Tensors should have the same number of samples as target Tensors. Found ${r[0]} input sample(s) and ${a[0]} target sample(s).`)}function kre(e,t,n){let r=[Mi,qp,Cc];for(let a=0;a1)throw new W(`The model expects ${t.length} ${a} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(r=>n);{let r=[];for(let a of t){let s=n.hasOwnProperty(a)?n[a]:[];Array.isArray(s)||(s=[s]),r.push(s)}return r}}var Sre="layers-model",pa=class extends Gr{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new W("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");ore(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=nre(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof ua))throw new W("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new W(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(QA(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new W(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>QA(s))}else{let s=QA(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let r=Ire(e.metrics,this.outputNames),a=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ci("metric",()=>{for(let s=0;s{let l="",c,u,h;for(let d of o){if(typeof d=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(d)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===qp?["accuracy","acc"].indexOf(d)!==-1?u=ey:["crossentropy","ce"].indexOf(d)!==-1&&(u=t6):this.lossFunctions[s]===Gp?["accuracy","acc"].indexOf(d)!==-1?u=n6:["crossentropy","ce"].indexOf(d)!==-1&&(u=r6):["accuracy","acc"].indexOf(d)!==-1?u=ty:["crossentropy","ce"].indexOf(d)!==-1&&(u=ny);let f;["accuracy","acc"].indexOf(d)!==-1?f="acc":["crossentropy","ce"].indexOf(d)!==-1&&(f="ce"),h=u,c=l+f}else h=tre(d),c=l+Zp(d);let p;Ci(c,()=>{p=h}),a(s,c,p)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let r=n.batchSize==null?32:n.batchSize;oy(r);let a=!0,s=this.standardizeUserDataXY(e,t,a,r);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,l=this.testLoop(o,i,r,n.verbose,n.steps);return Sn(l)}finally{$i(s[0],e),$i(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),xre(this,e,t)}checkNumSamples(e,t,n,r="steps"){let a;if(n!=null){if(a=null,t!=null)throw new W(`If ${r} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?a=e[0].shape[0]:a=e.shape[0];else throw new W(`Either the input data should have a defined shape, or ${r} shoud be specified.`);return a}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new W("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),r=n?t:[t],a=this.retrieveSymbolicTensors(r),s=new Fi;if(e instanceof Le&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new W(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let r=[];throw t.forEach((a,s)=>{a==null&&r.push(e[s])}),new W(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(r)}`)}return t}predictLoop(e,t=32,n=!1){return L(()=>{let r=this.checkNumSamples(e);if(n)throw new De("Verbose predictLoop() is not implemented yet.");let a=uy(r,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=a[i][0],l=a[i][1],c=Fc(e,o,l),u=[];if(Array.isArray(c))for(let d=0;ds[l].push(o));return Sn(s.map(i=>ot(i,0)))})}predict(e,t={}){let n=f6(e);y6(n,this.inputNames,this.feedInputShapes,!1);try{let r=t.batchSize==null?32:t.batchSize;return oy(r),this.predictLoop(n,r)}finally{$i(n,e)}}predictOnBatch(e){y6(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,r){if(this.optimizer_==null)throw new vr("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let a=[];for(let s=0;s0&&e[0].shape[0]%r!=0)throw new W(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${r}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,r,a=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,a,s);if(n!=null)throw new Error("sample weight is not supported yet.");let l=null;if(r!=null){let c=u6(r,this.outputNames);l=[];for(let u=0;u{let s=this.checkNumSamples(t,n,a,"steps"),i=[];if(r>0)throw new De("Verbose mode is not implemented yet.");if(a!=null)throw new De("steps mode in testLoop() is not implemented yet");{let o=uy(s,n),l=nn(kr(0,s));for(let c=0;c1&&(a+=`_${gv(e.slice(0,n),r)}`),t.push(a)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let c=[];for(let p=0;p1&&p{d=se(d,p)}),d},o=this.collectedTrainableWeights.map(c=>c.read()),l=!0;return[this.optimizer_.minimize(i,l,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>L(()=>{let t=[],n,r=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let l=0;lda(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let r of t)if(typeof n[r]=="string")e[r]=da(n[r]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[da(Zp(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>da(Zp(e)));{let e={};for(let t in this.metrics)e[t]=da(Zp(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Rc(e.optimizer_config),n=Nr(t),r;if(typeof e.loss=="string")r=Ti(e.loss);else if(Array.isArray(e.loss))r=e.loss.map(s=>Ti(s));else if(e.loss!=null){r={};for(let s in e.loss)r[s]=Ti(e.loss[s])}let a;if(Array.isArray(e.metrics))a=e.metrics.map(s=>Ti(s));else if(e.metrics!=null){a={};for(let s in e.metrics)a[s]=Ti(e.metrics[s])}this.compile({loss:r,metrics:a,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=bn.getSaveHandlers(e);if(i.length===0)throw new W(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new W(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new W("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await bn.encodeWeights(this.getNamedWeights(t)),r=!1,a=null,s={modelTopology:this.toJSON(a,r),format:Sre,generatedBy:`TensorFlow.js tfjs-layers v${sy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:l}=await bn.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...l),n.data=bn.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;s6(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){s6(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};pa.className="Model";re.registerClass(pa);var g6=class extends pa{};g6.className="Functional";re.registerClass(g6);async function Nre(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let r=Rc(n),a=Nr(r,t);if(e.weightsManifest!=null){let s=await bn.loadWeights(e.weightsManifest,e.pathPrefix,a.weights.map(o=>o.originalName)),i={};for(let o of a.weights)i[o.originalName]=s[o.originalName];a.loadWeights(i),Te(s)}return a}async function Ere(e,t){if(t==null&&(t={}),typeof e=="string"){let n=bn.getLoadHandlers(e,t);if(n.length===0)n.push(bn.browserHTTPRequest(e,t));else if(n.length>1)throw new W(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return Tre(e,void 0,t)}async function Tre(e,t,n){if(n==null&&(n={}),e.load==null)throw new W("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let r=await e.load(),a=r.modelTopology;a.model_config!=null&&(a=a.model_config);let s=n.strict==null?!0:n.strict,i=r.weightData!=null&&r.weightSpecs!=null&&s,o=Nr(Rc(a),t,i),l=r.trainingConfig;if(l!=null&&o.loadTrainingConfig(l),r.userDefinedMetadata!=null&&o.setUserDefinedMetadata(r.userDefinedMetadata),r.weightData!=null){if(r.weightSpecs==null)throw new W("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:c,optimizerWeights:u}=Cre(r.weightData,r.weightSpecs);o.loadWeights(c,s),o.optimizer!=null&&u.length>0&&await o.optimizer.setWeights(u),Te(c),Te(u.map(h=>h.tensor))}return o}function Cre(e,t){let n=bn.decodeWeights(e,t),r={},a=[];return t.forEach(s=>{s.group==="optimizer"?a.push({name:s.name,tensor:n[s.name]}):r[s.name]=n[s.name]}),{modelWeights:r,optimizerWeights:a}}var Vl=class extends pa{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:Wp("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new W(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof Vl||e instanceof pa,n;if(t){if(n=e,n.outputs.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new W("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new W("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let r=Hv({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(r)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new W(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Uv(this.outputs[0])}this.inboundNodes=[],new jp({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Ni(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(r=>r.shape),outputShapes:this.outputs[0].shape})}else{let r=e.apply(this.outputs[0]);if(Array.isArray(r))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[r],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(rt(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new pa({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new vr("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new vr("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new vr("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new vr("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},r=!1){let a,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new W("Legacy serialization format not supported yet.");a=t}else _.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),a=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof Vl))throw new De(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of a){let l=Nr(o,void 0,r);r&&l.setFastWeightInitDuringBuild(!0),i.add(l)}return i}set stopTraining(e){if(this.model==null)throw new W("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new W("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};Vl.className="Sequential";re.registerClass(Vl);function Rre(e){return new pa(e)}function Mre(e){return new Vl(e)}function Fre(e,t){return t==null&&(t={}),Ere(e,t)}function Ov(e){return Hv(e)}function $re(e,t){dr.registerCallbackConstructor(e,t)}var Tn=class extends re.Serializable{getConfig(){return{}}},x6=class extends Tn{apply(e,t=1){return hte(e,t)}};x6.className="elu";re.registerClass(x6);var w6=class extends Tn{apply(e){return Fd(e)}};w6.className="selu";re.registerClass(w6);var b6=class extends Tn{apply(e){return Lr(e)}};b6.className="relu";re.registerClass(b6);var _6=class extends Tn{apply(e){return L(()=>yl(6,Lr(e)))}};_6.className="relu6";re.registerClass(_6);var v6=class extends Tn{apply(e){return e}};v6.className="linear";re.registerClass(v6);var k6=class extends Tn{apply(e){return _n(e)}};k6.className="sigmoid";re.registerClass(k6);var I6=class extends Tn{apply(e){return pte(e)}};I6.className="hardSigmoid";re.registerClass(I6);var S6=class extends Tn{apply(e){return fi(e)}};S6.className="softplus";re.registerClass(S6);var N6=class extends Tn{apply(e){return dte(e)}};N6.className="softsign";re.registerClass(N6);var T6=class extends Tn{apply(e){return ci(e)}};T6.className="tanh";re.registerClass(T6);var hy=class extends Tn{apply(e,t=-1){return ec(e,t)}};hy.className="softmax";re.registerClass(hy);var E6=class extends Tn{apply(e,t=-1){return Sd(e,t)}};E6.className="logSoftmax";re.registerClass(E6);var C6=class extends Tn{apply(e,t=1){return L(()=>_n(e.mul(t)).mul(e))}};C6.className="swish";re.registerClass(C6);var R6=class extends Tn{apply(e){return L(()=>B(e,ci(fi(e))))}};R6.className="mish";re.registerClass(R6);function qa(e){return e.getClassName()}function dy(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"activation")}function Xa(e){if(e==null){let t={};return t.className="linear",t.config={},dy(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},dy(t)}else return e instanceof Tn?e:dy(e)}function py(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var M6=class extends re.Serializable{},$c=class extends M6{constructor(e){super();py(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return L(()=>{let t=Et([1]);return this.hasL1&&(t=se(t,Ne(B(this.l1,Dt(e))))),this.hasL2&&(t=se(t,Ne(B(this.l2,Nc(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};$c.className="L1L2";re.registerClass($c);function Dre(e){return py(e),new $c({l1:e!=null?e.l1:null,l2:0})}function Ore(e){return py(e),new $c({l2:e!=null?e.l2:null,l1:0})}var F6={l1l2:"L1L2"};function ut(e){return NA(e)}function $6(e,t={}){return _c(e,re.SerializationMap.getMap().classNameMap,t,"regularizer")}function yt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in F6?F6[e]:e,config:{}};return $6(t)}else return e instanceof M6?e:$6(e)}var fy=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=ze(e);let n=Lr(e);return this.maxValue!=null&&(n=vn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};fy.className="ReLU";re.registerClass(fy);var my=class extends Ge{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=ze(e);return qu(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};my.className="LeakyReLU";re.registerClass(my);var Ay=class extends Ge{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=At(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=yt(e.alphaRegularizer),this.alphaConstraint=Lt(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new W(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=rt(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let r of this.sharedAxes)t[r-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let r=1;r(Tt(t),t==="channelsFirst"?Ze(e,[0,2,3,1]):e))}function D6(e,t){return L(()=>(Tt(t),t==="channelsFirst"?Ze(e,[0,2,3,4,1]):e))}function zre(e,t,n,r=1,a="valid",s,i=1){return L(()=>{if(s==null&&(s=_r()),Tt(s),e.shape.length!==3)throw new W(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new W(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new W(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Ze(e,[0,2,1])),a==="causal")throw new De("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=gd(e,t,r,a==="same"?"same":"valid","NWC",i);return n!=null&&(o=Ir(o,n)),o})}function O6(e,t,n,r=[1,1],a="valid",s,i,o=null){return L(()=>{if(s==null&&(s=_r()),Tt(s),e.rank!==3&&e.rank!==4)throw new W(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new W(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=wy(e,s);if(a==="causal")throw new De("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Pa.conv2d({x:l,filter:t,strides:r,pad:a==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(l=Ze(l,[0,3,1,2])),l})}function Pre(e,t,n,r=[1,1,1],a="valid",s,i){return L(()=>{if(s==null&&(s=_r()),Tt(s),e.rank!==4&&e.rank!==5)throw new W(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new W(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=D6(e,s);if(a==="causal")throw new De("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=om(o,t,r,a==="same"?"same":"valid","NDHWC",i),n!=null&&(o=Ir(o,n)),s==="channelsFirst"&&(o=Ze(o,[0,4,1,2,3])),o})}var by=class extends Ge{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",by.verifyArgs(t),this.rank=e,Ut(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new De(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=jl(t.kernelSize,e,"kernelSize"),this.strides=jl(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,Qn(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Tt(this.dataFormat),this.activation=Xa(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=At(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Lt(t.biasConstraint),this.biasRegularizer=yt(t.biasRegularizer),this.activityRegularizer=yt(t.activityRegularizer),this.dilationRate=jl(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new W(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new W(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new W(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(jr("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,3))throw new W(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:qa(this.activation),useBias:this.useBias,biasInitializer:kt(this.biasInitializer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},Dc=class extends by{constructor(e,t){super(e,t);this.kernel=null,Dc.verifyArgs(t),this.filters=t.filters,Ut(this.filters,"filters"),this.kernelInitializer=At(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Lt(t.kernelConstraint),this.kernelRegularizer=yt(t.kernelRegularizer)}build(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],r=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return L(()=>{e=ze(e);let n,r=this.bias==null?null:this.bias.read(),a=wv(this.activation.getClassName());if(a!=null&&this.rank===2)n=O6(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate,a);else{if(this.rank===1)n=zre(e,this.kernel.read(),r,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=O6(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=Pre(e,this.kernel.read(),r,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new De("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=rt(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let a=0;a 0 but got ${JSON.stringify(e.filters)}`)}},Oc=class extends Dc{constructor(e){super(2,e);Oc.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,2))throw new W(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};Oc.className="Conv2D";re.registerClass(Oc);var zc=class extends Dc{constructor(e){super(3,e);zc.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new W(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};zc.className="Conv3D";re.registerClass(zc);var _y=class extends Oc{constructor(e){super(e);if(this.inputSpec=[new Rt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=rt(e),e.length!==4)throw new W("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Rt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=ze(e);if(n.shape.length!==4)throw new W(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let r=n.shape,a=r[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=r[s],l=r[i],c=this.kernelSize[0],u=this.kernelSize[1],h=this.strides[0],d=this.strides[1],p=qr(o,h,c,this.padding),m=qr(l,d,u,this.padding),f=[a,p,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,1]));let A=xd(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(A=Ze(A,[0,3,1,2])),this.bias!=null&&(A=Ir(A,this.bias.read(),this.dataFormat)),this.activation!=null&&(A=this.activation.apply(A)),A})}computeOutputShape(e){e=rt(e);let t=e.slice(),n,r,a;this.dataFormat==="channelsFirst"?(n=1,r=2,a=3):(n=3,r=1,a=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[r]=qr(t[r],o,s,this.padding),t[a]=qr(t[a],l,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};_y.className="Conv2DTranspose";re.registerClass(_y);var vy=class extends zc{constructor(e){super(e);if(this.inputSpec=[new Rt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=rt(e),e.length!==5)throw new W("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Rt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=ze(e);if(n.shape.length!==5)throw new W(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let r=n.shape,a=r[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let l=r[o],c=r[s],u=r[i],h=this.kernelSize[0],d=this.kernelSize[1],p=this.kernelSize[2],m=this.strides[0],f=this.strides[1],A=this.strides[2],y=qr(l,m,h,this.padding),g=qr(c,f,d,this.padding),x=qr(u,A,p,this.padding),v=[a,y,g,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,4,1]));let w=Rw(n,this.kernel.read(),v,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(w=Ze(w,[0,4,1,2,3])),this.bias!==null&&(w=Ir(w,this.bias.read(),this.dataFormat)),this.activation!==null&&(w=this.activation.apply(w)),w})}computeOutputShape(e){e=rt(e);let t=e.slice(),n,r,a,s;this.dataFormat==="channelsFirst"?(n=1,r=2,a=3,s=4):(n=4,r=1,a=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],c=this.strides[0],u=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[r]=qr(t[r],c,i,this.padding),t[a]=qr(t[a],u,o,this.padding),t[s]=qr(t[s],h,l,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};vy.className="Conv3DTranspose";re.registerClass(vy);var z6=class extends Dc{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new W("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new W("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new W(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=yt(t.depthwiseRegularizer),this.depthwiseConstraint=Lt(t.depthwiseConstraint),this.pointwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=yt(t.pointwiseRegularizer),this.pointwiseConstraint=Lt(t.pointwiseConstraint)}build(e){if(e=rt(e),e.length{e=ze(e);let n;if(this.rank===1)throw new De("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Ze(e,[0,2,3,1])),n=Sm(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=Ir(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Ze(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=kt(this.depthwiseInitializer),e.pointwiseInitializer=kt(this.pointwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.pointwiseRegularizer=ut(this.pointwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseConstraint),e.pointwiseConstraint=Pt(this.pointwiseConstraint),e}};z6.className="SeparableConv";var ky=class extends z6{constructor(e){super(2,e)}};ky.className="SeparableConv2D";re.registerClass(ky);var Jp=class extends Dc{constructor(e){super(1,e);Jp.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!EA(e.kernelSize,"number",1,1))throw new W(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};Jp.className="Conv1D";re.registerClass(Jp);var Iy=class extends Ge{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return L(()=>{if(e=ze(e),this.dataFormat==="channelsLast"){let n=Cp(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Cp(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=Cp(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Cp(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Iy.className="Cropping2D";re.registerClass(Iy);var Sy=class extends Ge{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,ate(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return L(()=>{let n=ze(e),r=n.shape;if(this.dataFormat==="channelsFirst"){n=Ze(n,[0,2,3,1]);let a=this.size[0]*r[2],s=this.size[1]*r[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([a,s]):n.resizeBilinear([a,s]);return Ze(i,[0,3,1,2])}else{let a=this.size[0]*r[1],s=this.size[1]*r[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([a,s]):n.resizeBilinear([a,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Sy.className="UpSampling2D";re.registerClass(Sy);function Lre(e,t,n=[1,1],r="valid",a,s){return L(()=>{a==null&&(a=_r()),Tt(a);let i=wy(e,a);if(e.rank!==4)throw new W(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new W(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=pl(i,t,n,r==="same"?"same":"valid","NHWC",s),a==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}var Ny=class extends by{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=At(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Lt(e.depthwiseConstraint),this.depthwiseRegularizer=yt(e.depthwiseRegularizer)}build(e){if(e=rt(e),e.length<4)throw new W(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new W(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],r=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",r,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{e=ze(e);let n=Lre(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=Ir(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],r=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,a=Tr(t,this.kernelSize[0],this.padding,this.strides[0]),s=Tr(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],r,a,s]:[e[0],a,s,r]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=kt(this.depthwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseRegularizer),e}};Ny.className="DepthwiseConv2D";re.registerClass(Ny);function P6(e,t,n,r){if(Array.isArray(e)){if(t!=null||n!=null)throw new W("When inputs is an array, neither initialState or constants should be provided");r!=null&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function a(s){return s==null||Array.isArray(s)?s:[s]}return t=a(t),n=a(n),{inputs:e,initialState:t,constants:n}}function L6(e,t,n,r=!1,a,s,i=!1,o=!1){return L(()=>{let l=t.shape.length;if(l<3)throw new W(`Input should be at least 3D, but is ${l}D.`);let c=[1,0].concat(kr(2,l));if(t=Ze(t,c),s!=null)throw new De("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),a!=null&&(a=a.asType("bool").asType("float32"),a.rank===l-1&&(a=on(a,-1)),a=Ze(a,c)),r&&(t=Dn(t,0),a!=null&&(a=Dn(a,0)));let u=[],h,d=n,p=t.shape[0],m=ur(t),f;a!=null&&(f=ur(a));for(let y=0;ye(g,d));if(a==null)h=x[0],d=x[1];else{let v=L(()=>{let w=f[y],b=$n(w).sub(w),k=x[0].mul(w).add(d[0].mul(b)),N=d.map((C,F)=>x[1][F].mul(w).add(C.mul(b)));return{output:k,newStates:N}});h=v.output,d=v.newStates}o&&u.push(h)}let A;return o&&(A=On(u,1)),[h,A,d]})}var Hr=class extends Ge{constructor(e){super(e);let t;if(e.cell==null)throw new W("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new Qp({cells:e.cell}):t=e.cell,t.stateSize==null)throw new W("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new Rt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return kr(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){KA(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],r;if(this.returnSequences?r=[e[0],e[1],n]:r=[e[0],n],this.returnState){let a=[];for(let s of t)a.push([e[0],s]);return[r].concat(a)}else return r}computeMask(e,t){return L(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let r=this.states.map(a=>null);return[n].concat(r)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new W(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new Rt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ha("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(r=>Et([n,r])):this.states_=[Et([n,this.cell.stateSize])];else if(e==null)Te(this.states_),this.keptStates!=null&&(Te(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(r=>Et([n,r])):this.states_[0]=Et([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):Te(this.states_);for(let r=0;rVt(r.clone()))})}apply(e,t){let n=t==null?null:t.initialState,r=t==null?null:t.constants;t==null&&(t={});let a=P6(e,n,r,this.numConstants);e=a.inputs,n=a.initialState,r=a.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new Rt({shape:o.shape}));i=i.concat(this.stateSpec)}if(r!=null&&(t.constants=r,s=s.concat(r),this.numConstants=r.length),s[0]instanceof Sr){let o=[e].concat(s),l=this.inputSpec.concat(i),c=this.inputSpec;this.inputSpec=l;let u=super.apply(o,t);return this.inputSpec=c,u}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;e=ze(e),a==null&&(this.stateful?a=this.states_:a=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(a.length!==s)throw new W(`RNN Layer has ${s} state(s) but was passed ${a.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:r},o=L6((d,p)=>{let m=this.cell.call([d].concat(p),i);return[m[0],m.slice(1)]},e,a,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],c=o[1],u=o[2];this.stateful&&this.resetStates(u,r);let h=this.returnSequences?c:l;return this.returnState?[h].concat(u):h})}getInitialState(e){return L(()=>{let t=Et(e.shape);return t=Ne(t,[1,2]),t=Sc(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?DA(t,[1,n]):t):this.cell.stateSize>1?[DA(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===Hr.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let r=t.cell,a=Nr(r,n);return new e(Object.assign(t,{cell:a}))}};Hr.className="RNN";re.registerClass(Hr);var Ec=class extends Ge{},e0=class extends Ec{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=rt(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let r=t.training==null?!1:t.training;0$n(e),rate:this.dropout,training:r})),0$n(n),rate:this.recurrentDropout,training:r}));let a,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?a=Ur(B(e,s),this.kernel.read()):a=Ur(e,this.kernel.read()),this.bias!=null&&(a=Ir(a,this.bias.read())),i!=null&&(n=B(n,i));let o=se(a,Ur(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:qa(this.activation),useBias:this.useBias,kernelInitializer:kt(this.kernelInitializer),recurrentInitializer:kt(this.recurrentInitializer),biasInitializer:kt(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),recurrentRegularizer:ut(this.recurrentRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),recurrentConstraint:Pt(this.recurrentConstraint),biasConstraint:Pt(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};e0.className="SimpleRNNCell";re.registerClass(e0);var Ty=class extends Hr{constructor(e){e.cell=new e0(e),super(e)}call(e,t){return L(()=>{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return new e(t)}};Ty.className="SimpleRNN";re.registerClass(Ty);var t0=class extends Ec{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new W("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Xa(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=rt(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,r=e[1];e=e[0],0$n(e),rate:this.dropout,training:n,count:3})),0$n(r),rate:this.recurrentDropout,training:n,count:3}));let a=this.dropoutMask,s=this.recurrentDropoutMask,i,o,l;0{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Ey.className="GRU";re.registerClass(Ey);var Pc=class extends Ec{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Xa(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,Ha([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,Ha([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=rt(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let r;if(this.useBias){if(this.unitForgetBias){let a=this.biasInitializer,s=this.units;r=new(t=class extends hr{apply(i,o){let l=a.apply([s]),c=new Mp().apply([s]),u=a.apply([s*2]);return Cv(Cv(l,c),u)}},t.className="CustomInit",t)}else r=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,r,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new W(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let r=e[1],a=e[2];e=e[0],0$n(e),rate:this.dropout,training:n,count:4})),0$n(r),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,l,c,u;0{this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Cy.className="LSTM";re.registerClass(Cy);var Qp=class extends Ec{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return L(()=>{e=e;let n=e.slice(1),r=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?r.push(n.splice(0,i.stateSize.length)):r.push(n.splice(0,1));r.reverse();let a=[],s;for(let i=0;i{Ci(`RNNCell_${r}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=r=>({className:r.getClassName(),config:r.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let r=[];for(let a of t.cells)r.push(Nr(a,n));return new e({cells:r})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return ZA(e)}setWeights(e){let t=[];for(let n of this.cells){let r=n.weights.length,a=e.splice(r);for(let s=0;sMv(t(),n),i=()=>Tc(s,t,r);return!a||a<=1?Vt(i().clone()):Array(a).fill(void 0).map(i).map(o=>Vt(o.clone()))}var Wre=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{if(this.cell.dropoutMask!=null&&(Te(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Te(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new W("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,r=t==null?null:t.training,a=t==null?null:t.initialState;return super.call(e,{mask:n,training:r,initialState:a})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return L(()=>{let{stateSize:t}=this.cell,n=e.shape,r=this.computeSingleOutputShape(n),a=[r[0],...r.slice(2)],s=Et(a);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ha("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,r=this.computeSingleOutputShape(n),a=[r[0],...r.slice(2)];if(n[0]==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Et(a)):this.states_=[Et(a)];else if(e==null)Te(this.states_),this.keptStates!=null&&(Te(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Et(a)):this.states_[0]=Et(a);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):Te(this.states_);for(let s=0;sVt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:r,padding:a,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",l=e[o?3:2],c=e[o?4:3],u=Tr(l,r[0],a,s[0],i[0]),h=Tr(c,r[1],a,s[1],i[1]);return[...e.slice(0,2),...o?[n,u,h]:[u,h,n]]}};W6.className="ConvRNN2D";var n0=class extends Pc{constructor(e){let{filters:t,kernelSize:n,strides:r,padding:a,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Ut(this.filters,"filters"),this.kernelSize=jl(n,2,"kernelSize"),this.kernelSize.forEach(o=>Ut(o,"kernelSize")),this.strides=jl(r||1,2,"strides"),this.strides.forEach(o=>Ut(o,"strides")),this.padding=a||"valid",Qn(this.padding),this.dataFormat=s||"channelsLast",Tt(this.dataFormat),this.dilationRate=jl(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Ut(o,"dilationRate"))}build(e){var t;e=rt(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[n]}`);let r=e[n],a=4,s=this.kernelSize.concat([r,this.filters*a]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*a]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let l=this.biasInitializer,c=this.filters;o=new(t=class extends hr{apply(u,h){let d=l.apply([c]),p=Fn([c]),m=l.apply([c*2]);return zA([d,p,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*a],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return L(()=>{if(e.length!==3)throw new W(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,r=e[0],a=e[1],s=e[2],i=4;0$n(r),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,l=(Y,ae,te)=>!ae||!ae[te]?Y:B(ae[te],Y),c=l(r,o,0),u=l(r,o,1),h=l(r,o,2),d=l(r,o,3);0$n(a),rate:this.recurrentDropout,training:n,count:i}));let p=this.recurrentDropoutMask,m=l(a,p,0),f=l(a,p,1),A=l(a,p,2),y=l(a,p,3),g=3,[x,v,w,b]=ln(this.kernel.read(),i,g),[k,N,C,F]=this.useBias?ln(this.bias.read(),i):[null,null,null,null];c=this.inputConv(c,x,k,this.padding),u=this.inputConv(u,v,N,this.padding),h=this.inputConv(h,w,C,this.padding),d=this.inputConv(d,b,F,this.padding);let[O,z,V,j]=ln(this.recurrentKernel.read(),i,g);m=this.recurrentConv(m,O),f=this.recurrentConv(f,z),A=this.recurrentConv(A,V),y=this.recurrentConv(y,j);let U=this.recurrentActivation.apply(se(c,m)),X=this.recurrentActivation.apply(se(u,f)),G=se(B(X,s),B(U,this.activation.apply(se(h,A)))),ee=B(this.recurrentActivation.apply(se(d,y)),this.activation.apply(G));return[ee,ee,G]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Wre(e,["units"]),r={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,r)}inputConv(e,t,n,r){let a=sa(e,t,this.strides,r||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?Ir(a,n,this.dataFormat):a}recurrentConv(e,t){return sa(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};n0.className="ConvLSTM2DCell";re.registerClass(n0);var Ry=class extends W6{constructor(e){let t=new n0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};Ry.className="ConvLSTM2D";re.registerClass(Ry);var r0=class extends Ge{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let r=0;r{this.invokeCallHook(e,t);let n=ze(e);if(0Mv(n,this.rate,a,this.seed),()=>n,r)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};r0.className="Dropout";re.registerClass(r0);var My=class extends r0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};My.className="SpatialDropout1D";re.registerClass(My);var Fy=class extends Ge{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Ut(this.units,"units"),this.activation=Xa(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Lt(e.kernelConstraint),this.biasConstraint=Lt(e.biasConstraint),this.kernelRegularizer=yt(e.kernelRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=rt(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=rt(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e),r=wv(this.activation.getClassName()),a;return r!=null?a=Ur(n,this.kernel.read(),r,this.bias?this.bias.read():null):(a=Ur(n,this.kernel.read()),this.bias!=null&&(a=Ir(a,this.bias.read())),this.activation!=null&&(a=this.activation.apply(a))),a})}getConfig(){let e={units:this.units,activation:qa(this.activation),useBias:this.useBias,kernelInitializer:kt(this.kernelInitializer),biasInitializer:kt(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Fy.className="Dense";re.registerClass(Fy);var $y=class extends Ge{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=rt(e);for(let t of e.slice(1))if(t==null)throw new W(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Ua(e,1)]}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let r=[0];for(let a=2;a{this.invokeCallHook(e,t);let n=ze(e);return this.activation.apply(n)})}getConfig(){let e={activation:qa(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};Dy.className="Activation";re.registerClass(Dy);var Oy=class extends Ge{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return L(()=>(e=ze(e),lte(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};Oy.className="RepeatVector";re.registerClass(Oy);var zy=class extends Ge{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=ze(e),r=n.shape,a=r.slice(0,1).concat(this.fixUnknownDimension(r.slice(1),this.targetShape));return n.reshape(a)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};zy.className="Reshape";re.registerClass(zy);var Py=class extends Ge{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=kr(1,e.dims.length+1);if(!_.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Rt({ndim:this.dims.length+1})]}computeOutputShape(e){e=rt(e);let t=e.slice();return this.dims.forEach((n,r)=>{t[r+1]=e[n]}),t}call(e,t){return Ze(ze(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};Py.className="Permute";re.registerClass(Py);var Ly=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=ze(e),r=-1;return Wu(Ai(n,this.maskValue),r)}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e),r=-1,a=!0,s=Wu(Ai(n,this.maskValue),r,a);return n.mul(s.asType(n.dtype))})}};Ly.className="Masking";re.registerClass(Ly);var Wy=class extends Ge{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ft(e.inputLength))}this.inputDim=e.inputDim,Ut(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Ut(this.outputDim,"outputDim"),this.embeddingsInitializer=At(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=yt(e.embeddingsRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.embeddingsConstraint=Lt(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return L(()=>this.maskZero?(e=ze(e),Ai(e,Ue(e))):null)}computeOutputShape(e){if(e=rt(e),this.inputLength==null)return[...e,this.outputDim];let t=ft(this.inputLength);if(t.length!==e.length-1)throw new W(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let r=0;r{this.invokeCallHook(e,t);let n=ze(e);return n.dtype!=="int32"&&(n=Ic(n,"int32")),Rv(this.embeddings.read(),n.as1D()).reshape(rt(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:kt(this.embeddingsInitializer),embeddingsRegularizer:ut(this.embeddingsRegularizer),activityRegularizer:ut(this.activityRegularizer),embeddingsConstraint:Pt(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};Wy.className="Embedding";re.registerClass(Wy);var Di=class extends Ge{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new De}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new W(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let a=1;aa.length);e.indexOf(null)===-1&&ja(r).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return L(()=>{if(e=e,this.reshapeRequired){let n=[],r=e.map(a=>a.rank);if(r.indexOf(null)===-1){let a=Ha(r);for(let s of e){let i=s.rank;for(let o=0;o1){let c=kr(1,l).concat([0]);n.push(Ze(o,c)),a=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(a){if(i==null){let o=s.shape,l=o.length,c=o[l-1],u=[c].concat(o.slice(0,o.length-1));s=Ze(s.reshape([-1,c]),[1,0]).reshape(u)}else if(i>1){let o=[i-1].concat(kr(0,i-1));s=Ze(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let r=1;r{if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an Array");if(!Array.isArray(e))throw new W("`inputs` should be an Array");if(t.length!==e.length)throw new W(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(r=>r==null))return null;t=t.map(r=>r==null?r:on(r,0));let n=t[0];for(let r=1;r{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new W("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return L(()=>zA(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new W("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis;for(let a of t.slice(1)){if(n[r]==null||a[r]==null){n[r]=null;break}n[r]+=a[r]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new W("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new W(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return L(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let r=[];for(let s=0;s3||t.shape.length>3)throw new De("batchDot is not implemented for tensors of 4D or higher rank yet");if(_.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),_.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new De("batchDot is not implemented for complex64-type Tensors yet.");let r=e.shape.length,a=t.shape.length;n==null&&(n=[r-1,a-2]);let s=n;return L(()=>{let i;if(r>a){i=r-a;let l=[];for(let c=0;cr){i=a-r;let l=[];for(let c=0;c0){let l;r>a?l=r+a-3:l=r-1;let c=[];for(let u=l;u"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new De("Dot layer does not support tensors of 4D or higher rank yet.");let r=this.interpretAxes(t,n);if(t[r[0]]!==n[r[1]])throw new W(`Dimension incompatibility: ${t[r[0]]} !== ${n[r[1]]}`)}mergeFunction(e){if(e.length!==2)throw new W(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],r;return Array.isArray(this.axes)?r=this.axes.map((a,s)=>Lc(a,e[s].shape.length)):r=[Lc(this.axes,t.shape.length),Lc(this.axes,n.shape.length)],this.normalize&&(t=Up(t,r[0]),n=Up(n,r[1])),Bre(t,n,r)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[Lc(this.axes,e.length),Lc(this.axes,t.length)],n}computeOutputShape(e){_.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new De("Dot layer does not support tensors of 4D or higher rank yet.");let r=this.interpretAxes(t,n);t.splice(r[0],1),n.splice(r[1],1),n.splice(0,1);let a=t.concat(n);return a.length===1&&a.push(1),a}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};qy.className="Dot";re.registerClass(qy);var Xy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);return Tc(()=>Rp(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};Xy.className="GaussianNoise";re.registerClass(Xy);var Ky=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=ze(e);return this.rate>0&&this.rate<1?Tc(()=>{let r=Math.sqrt(this.rate/(1-this.rate));return n.mul(Rp(n.shape,1,r))},()=>n,t.training||!1):n})}};Ky.className="GaussianDropout";re.registerClass(Ky);var Zy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||ze(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Tc(()=>{let r=ze(e),a=1.6732632423543772,s=1.0507009873554805,i=-a*s,o=Oa(gl(n),this.rate);o=Ic(o,"float32");let l=((1-this.rate)*(1+this.rate*i**2))**-.5,c=-l*i*this.rate;return r.mul(o).add(o.add(-1).mul(i)).mul(l).add(c)},()=>ze(e),t.training||!1)}return e})}};Zy.className="AlphaDropout";re.registerClass(Zy);function Wc(e,t,n,r,a,s=.001){let i;if(e.rank===2)i=vw(e,t,n,r,a,s);else if(e.rank===3)i=kw(e,t,n,r,a,s);else if(e.rank===4)i=Iw(e,t,n,r,a,s);else throw new De(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function Vre(e,t,n,r,a=.001){return L(()=>{let s=Td(e,r),i=s.mean,o=s.variance;return[Wc(e,i,o,n,t,a),i,o]})}function jre(e,t,n,r,a=.001){return L(()=>{let s=Td(e,r),i=s.mean,o=s.variance,l=[];for(let p of kr(0,e.rank))r.indexOf(p)!==-1?l.push(1):l.push(e.shape[p]);let c=i.reshape(l),u=o.reshape(l),h=t==null?null:t.reshape(l),d=n==null?null:n.reshape(l);return[Wc(e,c,u,d,h,a),i,o]})}function Ure(e,t,n,r,a=.001){return _.arraysEqual(r.slice().sort(),kr(0,e.rank-1))?Vre(e,t,n,r,a):jre(e,t,n,r,a)}var Yy=class extends Ge{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.movingMeanInitializer=At(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=At(e.movingVarianceInitializer||"ones"),this.betaConstraint=Lt(e.betaConstraint),this.gammaConstraint=Lt(e.gammaConstraint),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer)}build(e){e=rt(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new W(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Rt({ndim:e.length,axes:{[t]:n}})];let r=[n];this.scale&&(this.gamma=this.addWeight("gamma",r,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",r,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",r,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",r,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training,r=ze(e),a=r.shape,s=a.length,i=kr(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let l=Ni(1,s);l[o]=a[o];let c=i.slice();c.sort();let u=!_.arraysEqual(c,kr(0,s).slice(0,s-1)),h=()=>{if(u){let A=this.movingMean.read().reshape(l),y=this.movingVariance.read().reshape(l),g=this.center?this.beta.read().reshape(l):null,x=this.scale?this.gamma.read().reshape(l):null;return Wc(r,A,y,g,x,this.epsilon)}else return Wc(r,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return h();let[d,p,m]=Ure(r,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(A,y,g)=>{L(()=>{let x=1-g,v=A.read(),w=v.sub(y).mul(x);A.write(v.sub(w))})};return(()=>{f(this.movingMean,p,this.momentum),f(this.movingVariance,m,this.momentum)})(),d})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:kt(this.betaInitializer),gammaInitializer:kt(this.gammaInitializer),movingMeanInitializer:kt(this.movingMeanInitializer),movingVarianceInitializer:kt(this.movingVarianceInitializer),betaRegularizer:ut(this.betaRegularizer),gammaRegularizer:ut(this.gammaRegularizer),betaConstraint:Pt(this.betaConstraint),gammaConstraint:Pt(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Yy.className="BatchNormalization";re.registerClass(Yy);var Jy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=rt(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let a=0;a=t)throw new Error(`Invalid axis: ${a}`);if(this.axis.length!==ja(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(a=>e[a]),r=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,r):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,r):this.beta=null,this.built=!0}call(e,t){let n=ze(e),r=n.shape,a=r.length;return L(()=>{let s=!0,{mean:i,variance:o}=Td(n,this.axis,s),l=Ni(1,a);for(let m of this.axis)l[m]=r[m];let c=m=>m!=null&&m.shape.length!==a&&this.axis!==[a-1]?m.reshape(l):m,u=c(this.gamma.read()),h=c(this.beta.read()),d=[],p=[];for(let m=0;m{if(e.rank!==4)throw new W(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new W("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=_r()),n!=="channelsLast"&&n!=="channelsFirst")throw new W(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let r;return n==="channelsFirst"?r=[[0,0],[0,0],t[0],t[1]]:r=[[0,0],t[0],t[1],[0,0]],ia(e,r)})}var Qy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?_r():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new W(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new W(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new W(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){e=rt(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return L(()=>Hre(ze(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Qy.className="ZeroPadding2D";re.registerClass(Qy);function a0(e,t,n,r,a,s){return L(()=>{Tt(a),kv(s),Qn(r),n==null&&(n=[1,1]),r==null&&(r="valid"),a==null&&(a=_r()),s==null&&(s="max"),e=wy(e,a);let i,o=r==="same"?"same":"valid";return s==="max"?i=Ku(e,t,n,o):i=ju(e,t,n,o),a==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}function B6(e,t,n,r,a,s){return L(()=>{Tt(a),kv(s),Qn(r),n==null&&(n=[1,1,1]),r==null&&(r="valid"),a==null&&(a=_r()),s==null&&(s="max"),e=D6(e,a);let i,o=r==="same"?"same":"valid";return s==="max"?i=xm(e,t,n,o):i=am(e,t,n,o),a==="channelsFirst"&&(i=Ze(i,[0,4,1,2,3])),i})}var V6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new W(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Ut(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new W(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,Qn(this.padding),this.inputSpec=[new Rt({ndim:3})]}computeOutputShape(e){e=rt(e);let t=Tr(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return L(()=>{this.invokeCallHook(e,t),e=Sc(ze(e),2);let n=this.poolingFunction(ze(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return za(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},e2=class extends V6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"max")}};e2.className="MaxPooling1D";re.registerClass(e2);var t2=class extends V6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"avg")}};t2.className="AveragePooling1D";re.registerClass(t2);var j6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new W(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Ut(this.poolSize,"poolSize"),Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),Qn(this.padding),this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=Tr(t,this.poolSize[0],this.padding,this.strides[0]),n=Tr(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(ze(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},n2=class extends j6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"max")}};n2.className="MaxPooling2D";re.registerClass(n2);var r2=class extends j6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),a0(e,t,n,r,a,"avg")}};r2.className="AveragePooling2D";re.registerClass(r2);var U6=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new W(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Ut(this.poolSize,"poolSize"),Ut(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),Qn(this.padding),this.inputSpec=[new Rt({ndim:5})]}computeOutputShape(e){e=rt(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],r=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=Tr(t,this.poolSize[0],this.padding,this.strides[0]),n=Tr(n,this.poolSize[1],this.padding,this.strides[1]),r=Tr(r,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,r]:[e[0],t,n,r,e[4]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(ze(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},a2=class extends U6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),B6(e,t,n,r,a,"max")}};a2.className="MaxPooling3D";re.registerClass(a2);var s2=class extends U6{constructor(e){super(e)}poolingFunction(e,t,n,r,a){return Tt(a),Qn(r),B6(e,t,n,r,a,"avg")}};s2.className="AveragePooling3D";re.registerClass(s2);var H6=class extends Ge{constructor(e){super(e);this.inputSpec=[new Rt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new De}},i2=class extends H6{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=ze(e);return vt(n,1)})}};i2.className="GlobalAveragePooling1D";re.registerClass(i2);var o2=class extends H6{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=ze(e);return Xn(n,1)})}};o2.className="GlobalMaxPooling1D";re.registerClass(o2);var G6=class extends Ge{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Tt(this.dataFormat),this.inputSpec=[new Rt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new De}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},l2=class extends G6{call(e,t){return L(()=>{let n=ze(e);return this.dataFormat==="channelsLast"?vt(n,[1,2]):vt(n,[2,3])})}};l2.className="GlobalAveragePooling2D";re.registerClass(l2);var u2=class extends G6{call(e,t){return L(()=>{let n=ze(e);return this.dataFormat==="channelsLast"?Xn(n,[1,2]):Xn(n,[2,3])})}};u2.className="GlobalMaxPooling2D";re.registerClass(u2);var q6=class extends Ge{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let r=t.layer,a=Nr(r,n);delete t.layer;let s={layer:a};return Object.assign(s,t),new e(s)}},c2=class extends q6{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=rt(e),e.length<3)throw new W(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=rt(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))}call(e,t){return L(()=>(e=ze(e),L6((n,r)=>[ze(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};c2.className="TimeDistributed";re.registerClass(c2);function Gre(e){Ei(rte,"BidirectionalMergeMode",e)}var qre="concat",h2=class extends q6{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Nr(n),t.goBackwards=t.goBackwards!==!0;let r={};if(r.className=e.layer.getClassName(),r.config=t,this.backwardLayer=Nr(r),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?qre:e.mergeMode,Gre(this.mergeMode),e.weights)throw new De("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,r,a;return this.returnState&&(a=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,r=[n]):this.mergeMode==null?r=[n,n.slice()]:r=[n],this.returnState?this.mergeMode==null?r.concat(a).concat(a.slice()):[n].concat(a).concat(a.slice()):Sn(r)}apply(e,t){let n=t==null?null:t.initialState,r=t==null?null:t.constants;t==null&&(t={});let a=P6(e,n,r,this.numConstants);if(e=a.inputs,n=a.initialState,r=a.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&r==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let l=n.length;if(l%2>0)throw new W("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let c=n.map(u=>new Rt({shape:u.shape}));this.forwardLayer.stateSpec=c.slice(0,l/2),this.backwardLayer.stateSpec=c.slice(l/2),i.push(...c)}if(r!=null)throw new De("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Sr;for(let l of s)if(l instanceof Sr!==o)throw new W("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let l=[e].concat(s),c=this.inputSpec.concat(i),u=this.inputSpec;this.inputSpec=c;let h=super.apply(l,t);return this.inputSpec=u,h}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t.initialState,r,a;if(n==null)r=this.forwardLayer.call(e,t),a=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),l=n.slice(n.length/2);r=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),a=this.backwardLayer.call(e,Object.assign(t,{initialState:l}))}let s;this.returnState&&(Array.isArray(r)&&(s=r.slice(1).concat(a.slice(1))),r=r[0],a=a[0]),this.returnSequences&&(a=Dn(a,1));let i;return this.mergeMode==="concat"?i=zA([r,a]):this.mergeMode==="sum"?i=se(r,a):this.mergeMode==="ave"?i=B(.5,se(r,a)):this.mergeMode==="mul"?i=B(r,a):this.mergeMode==null&&(i=[r,a]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ci(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ci(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let r=this.forwardLayer.states.map(a=>null);return Array.isArray(n)?n.concat(r).concat(r):[n].concat(r).concat(r)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Nr(t.layer);if(delete t.layer,t.numConstants!=null)throw new De("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let r=t;return r.layer=n,new e(r)}};h2.className="Bidirectional";re.registerClass(h2);function xte(e){return new Ll(e)}function wte(e){return new yy(e)}function bte(e){return new fy(e)}function _te(e){return new my(e)}function vte(e){return new Ay(e)}function kte(e){return new xy(e)}function Ite(e){return new gy(e)}function Ste(e){return new Jp(e)}function Nte(e){return new Oc(e)}function Tte(e){return new _y(e)}function Ete(e){return new zc(e)}function Cte(e){return new vy(e)}function Rte(e){return new ky(e)}function Mte(e){return new Iy(e)}function Fte(e){return new Sy(e)}function $te(e){return new Ny(e)}function Dte(e){return new Dy(e)}function Ote(e){return new Fy(e)}function zte(e){return new r0(e)}function Pte(e){return new My(e)}function Lte(e){return new $y(e)}function Wte(e){return new Oy(e)}function Bte(e){return new zy(e)}function Vte(e){return new Py(e)}function jte(e){return new Wy(e)}function Ute(e){return new By(e)}function Hte(e){return new jy(e)}function Gte(e){return new Gy(e)}function qte(e){return new Uy(e)}function Xte(e){return new Hy(e)}function Kte(e){return new Vy(e)}function Zte(e){return new qy(e)}function Yte(e){return new Yy(e)}function Jte(e){return new Jy(e)}function Qte(e){return new Qy(e)}function GA(e){return new t2(e)}function ene(e){return GA(e)}function tne(e){return GA(e)}function qA(e){return new r2(e)}function nne(e){return qA(e)}function rne(e){return qA(e)}function XA(e){return new s2(e)}function ane(e){return XA(e)}function sne(e){return XA(e)}function ine(e){return new i2(e)}function one(e){return new l2(e)}function zv(e){return new o2(e)}function Pv(e){return new u2(e)}function Lv(e){return new e2(e)}function Wv(e){return new n2(e)}function lne(e){return new a2(e)}function une(e){return new Ey(e)}function cne(e){return new t0(e)}function hne(e){return new Cy(e)}function dne(e){return new Pc(e)}function pne(e){return new Ty(e)}function fne(e){return new e0(e)}function mne(e){return new Ry(e)}function Ane(e){return new n0(e)}function yne(e){return new Hr(e)}function gne(e){return new Qp(e)}function xne(e){return new h2(e)}function wne(e){return new c2(e)}var bne=zv,_ne=Pv,vne=Lv,kne=Wv;function Ine(e){return new Xy(e)}function Sne(e){return new Ky(e)}function Nne(e){return new Zy(e)}function Tne(e){return new Ly(e)}var X6={};Me(X6,{MAPE:()=>aae,MSE:()=>oae,binaryAccuracy:()=>Xre,binaryCrossentropy:()=>Kre,categoricalAccuracy:()=>Yre,categoricalCrossentropy:()=>Jre,cosineProximity:()=>tae,mape:()=>sae,meanAbsoluteError:()=>nae,meanAbsolutePercentageError:()=>rae,meanSquaredError:()=>iae,mse:()=>lae,precision:()=>Qre,recall:()=>eae,sparseCategoricalAccuracy:()=>Zre});function Xre(e,t){return ey(e,t)}function Kre(e,t){return t6(e,t)}function Zre(e,t){return n6(e,t)}function Yre(e,t){return ty(e,t)}function Jre(e,t){return ny(e,t)}function Qre(e,t){return e6(e,t)}function eae(e,t){return qne(e,t)}function tae(e,t){return JA(e,t)}function nae(e,t){return Hp(e,t)}function rae(e,t){return Bl(e,t)}function aae(e,t){return Bl(e,t)}function sae(e,t){return Bl(e,t)}function iae(e,t){return Mi(e,t)}function oae(e,t){return Mi(e,t)}function lae(e,t){return Mi(e,t)}var K6={};Me(K6,{modelFromJSON:()=>Nre});var Z6={};Me(Z6,{l1:()=>cae,l1l2:()=>uae,l2:()=>hae});function uae(e){return new $c(e)}function cae(e){return Dre(e)}function hae(e){return Ore(e)}var Y6=class extends Wl{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof pa))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function s0(e,t){return et}var Q6=class extends Y6{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new De("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=s0:this.mode==="max"?this.monitorFunc=J6:this.monitor.indexOf("acc")!==-1?this.monitorFunc=J6:this.monitorFunc=s0,this.monitorFunc===s0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===s0?Infinity:-Infinity}async onEpochEnd(e,t){await Ga(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function dae(e){return new Q6(e)}var pae={earlyStopping:dae},Er;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(Er||(Er={}));var e4;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(e4||(e4={}));var d2={};function fae(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};d2[e]=n}function t4(e){return d2[e]}function mae(e){delete d2[e]}function I(e,t,n,r,a){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,l=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return mn(t.inputNames[s.inputIndexStart],n,r,a);if(s.type==="tensors")return t.inputNames.slice(o,l).map(h=>mn(h,n,r,a));let c=mn(t.inputNames.slice(o)[0],n,r,a),u=c.dataSync();return s.type==="number"?u[0]:_.toNestedArray(c.shape,u)}let i=t.attrParams[e];return i&&i.value}function mn(e,t,n,r){let[a,s]=Ln(e);if(r!=null){let o=r.getHashTableHandleByName(a);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[i0(a,o)]);return i!==void 0?t[i0(a,i)][s]:void 0}function Aae(e,t,n){return t[i0(e,n.currentContextId)]}function fa(e,t){let[n,r]=Ln(e);return[i0(n,t&&t.currentContextId),r]}function i0(e,t){return t?`${e}-${t}`:e}function Ln(e){let t=e.split(":");return t.length===1?[e,0]:[t[0],Number(t[t.length-1])]}function o0(e,t,n){let r=I("pad",e,t,n);if(r==="explicit"){r=I("explicitPaddings",e,t,n);let a=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)a[s][0]=r[s*2],a[s][1]=r[s*2+1];return a}return r}function ma(e){return e.kept?e:Dr(e)}var n4={};Me(n4,{json:()=>yae});var yae=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],r4={};Me(r4,{json:()=>gae});var gae=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],a4={};Me(a4,{json:()=>xae});var xae=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],s4={};Me(s4,{json:()=>wae});var wae=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],i4={};Me(i4,{json:()=>bae});var bae=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],o4={};Me(o4,{json:()=>_ae});var _ae=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],l4={};Me(l4,{json:()=>vae});var vae=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],u4={};Me(u4,{json:()=>kae});var kae=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],c4={};Me(c4,{json:()=>Iae});var Iae=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],h4={};Me(h4,{json:()=>Sae});var Sae=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],d4={};Me(d4,{json:()=>Nae});var Nae=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],p4={};Me(p4,{json:()=>Tae});var Tae=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],f4={};Me(f4,{json:()=>Eae});var Eae=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],m4={};Me(m4,{json:()=>Cae});var Cae=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],A4={};Me(A4,{json:()=>Rae});var Rae=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],y4={};Me(y4,{json:()=>Mae});var Mae=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],g4={};Me(g4,{json:()=>Fae});var Fae=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}],w4=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[n4,r4,a4,s4,i4,o4,l4,d4,h4,u4,p4,f4,m4,A4,y4,g4,c4],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,r)=>(n[r.tfOpName]=r,n),{})}transformGraph(e,t={}){let n=e.node,r=[],a=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?r.push(m[f.name]):f.op==="Const"?a.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],l=[],c={},u={};t!=null&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));let h=Object.keys(i);h.forEach(m=>{let f=i[m];f.inputNames.forEach(A=>{let[y]=fa(A);f.inputs.push(i[y]),i[y].children.push(f)})}),Object.keys(u).length===0?h.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(u).forEach(m=>{let[f]=fa(m),A=i[f];A!=null&&(A.signatureKey=u[m],l.push(A))}),Object.keys(c).length>0?Object.keys(c).forEach(m=>{let[f]=fa(m),A=i[f];A&&(A.signatureKey=c[m],o.push(A))}):o=r;let d={};e.library!=null&&e.library.function!=null&&(d=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let p={nodes:i,inputs:o,outputs:l,weights:a,placeholders:r,signature:t,functions:d};return s.length>0&&(p.initNodes=s),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=t4(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(r=>r.startsWith("^")?r.substr(1):r),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((r,a)=>(r[a.name]={type:a.type,inputIndexStart:a.start,inputIndexEnd:a.end},r),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((r,a)=>{let s=a.type,i;switch(a.type){case"string":i=p2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=p2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"string[]":i=b2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=b2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number":i=m2(e.attr,a.tfName,a.defaultValue||0),i===void 0&&!!a.tfDeprecatedName&&(i=m2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number[]":i=w2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=w2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool":i=f2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=f2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool[]":i=v2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=v2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape":i=x2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=x2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape[]":i=_2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=_2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype":i=y2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=y2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype[]":i=g2(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=g2(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"func":i=x4(e.attr,a.tfName,a.defaultValue),i===void 0&&!!a.tfDeprecatedName&&(i=x4(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${a.type} for op: ${e.op}`)}return r[a.name]={value:i,type:s},r},{})),n}mapFunction(e){let t=e.nodeDef,n=[],r=[],a={};t!=null&&(a=t.reduce((c,u)=>(c[u.name]=this.mapNode(u),u.op==="Const"&&r.push(c[u.name]),c),{}));let s=[],i=[];e.signature.inputArg.forEach(c=>{let[u]=fa(c.name),h={name:u,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:A2(c.type),type:"dtype"}},children:[]};h.signatureKey=c.name,s.push(h),a[u]=h}),Object.keys(a).forEach(c=>{let u=a[c];u.inputNames.forEach(h=>{let[d]=fa(h);u.inputs.push(a[d]),a[d].children.push(u)})});let o=e.ret;e.signature.outputArg.forEach(c=>{let[u,h]=fa(o[c.name]),d=a[u];d!=null&&(d.defaultOutput=h,i.push(d))});let l=this.mapArgsToSignature(e);return{nodes:a,inputs:s,outputs:i,weights:r,placeholders:n,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function $ae(e){let t=J().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function b4(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):$ae(e);return t?n:n.toLowerCase()}function p2(e,t,n,r=!1){let a=e[t];return a!=null?b4(a.s,r):n}function f2(e,t,n){let r=e[t];return r?r.b:n}function m2(e,t,n){let r=e[t]||{},a=r.i!=null?r.i:r.f!=null?r.f:n;return typeof a=="number"?a:parseInt(a,10)}function A2(e){switch(typeof e=="string"&&(e=Er[e]),e){case Er.DT_FLOAT:return"float32";case Er.DT_INT32:case Er.DT_INT64:case Er.DT_INT8:case Er.DT_UINT8:return"int32";case Er.DT_BOOL:return"bool";case Er.DT_DOUBLE:return"float32";case Er.DT_STRING:return"string";default:return null}}function x4(e,t,n){let r=e[t];return r&&r.func?r.func.name:n}function y2(e,t,n){let r=e[t];return r&&r.type?A2(r.type):n}function g2(e,t,n){let r=e[t];return r&&r.list&&r.list.type?r.list.type.map(a=>A2(a)):n}function _4(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function x2(e,t,n){let r=e[t];return r&&r.shape?_4(r.shape):n}function w2(e,t,n){let r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(a=>typeof a=="number"?a:parseInt(a,10)):n}function b2(e,t,n,r=!1){let a=e[t];return a&&a.list&&a.list.s?a.list.s.map(s=>b4(s,r)):n}function _2(e,t,n){let r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(a=>_4(a)):n}function v2(e,t,n){let r=e[t];return r&&r.list&&r.list.b?r.list.b:n}var Dae=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(r=>this.getInput(r)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((r,a)=>(r[a]=this.getAttr(a),r),{}))}getInput(e){return mn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return mn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return m2(this.node.rawAttrs,e,t);if(n.s!=null)return p2(this.node.rawAttrs,e,t);if(n.b!=null)return f2(this.node.rawAttrs,e,t);if(n.shape!=null)return x2(this.node.rawAttrs,e,t);if(n.type!=null)return y2(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return w2(this.node.rawAttrs,e,t);if(n.list.s!=null)return b2(this.node.rawAttrs,e,t);if(n.list.shape!=null)return _2(this.node.rawAttrs,e,t);if(n.list.b!=null)return v2(this.node.rawAttrs,e,t);if(n.list.type!=null)return g2(this.node.rawAttrs,e,t)}return t}},Oae=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[se(I("a",e,t,n),I("b",e,t,n))];case"AddN":return[md(I("tensors",e,t,n))];case"FloorMod":case"Mod":return[bm(I("a",e,t,n),I("b",e,t,n))];case"Mul":return[B(I("a",e,t,n),I("b",e,t,n))];case"RealDiv":case"Div":return[ge(I("a",e,t,n),I("b",e,t,n))];case"DivNoNan":return[cm(I("a",e,t,n),I("b",e,t,n))];case"FloorDiv":return[fd(I("a",e,t,n),I("b",e,t,n))];case"Sub":return[ye(I("a",e,t,n),I("b",e,t,n))];case"Minimum":return[yl(I("a",e,t,n),I("b",e,t,n))];case"Maximum":return[Pr(I("a",e,t,n),I("b",e,t,n))];case"Pow":return[oa(I("a",e,t,n),I("b",e,t,n))];case"SquaredDifference":return[Ld(I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},zae=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Dt(I("x",e,t,n))];case"Acos":return[Xf(I("x",e,t,n))];case"Acosh":return[Kf(I("x",e,t,n))];case"Asin":return[Yf(I("x",e,t,n))];case"Asinh":return[Jf(I("x",e,t,n))];case"Atan":return[Qf(I("x",e,t,n))];case"Atan2":return[em(I("x",e,t,n),I("y",e,t,n))];case"Atanh":return[tm(I("x",e,t,n))];case"Ceil":return[sm(I("x",e,t,n))];case"Complex":return[Ea(I("real",e,t,n),I("imag",e,t,n))];case"Cos":return[Hu(I("x",e,t,n))];case"Cosh":return[wd(I("x",e,t,n))];case"Elu":return[fl(I("x",e,t,n))];case"Erf":return[hm(I("x",e,t,n))];case"Exp":return[qn(I("x",e,t,n))];case"Expm1":return[dm(I("x",e,t,n))];case"Floor":return[ml(I("x",e,t,n))];case"Log":return[Mn(I("x",e,t,n))];case"Log1p":return[kd(I("x",e,t,n))];case"Imag":return[_d(I("x",e,t,n))];case"Neg":return[_t(I("x",e,t,n))];case"Reciprocal":return[km(I("x",e,t,n))];case"Real":return[Ju(I("x",e,t,n))];case"Relu":return[Lr(I("x",e,t,n))];case"Round":return[Im(I("x",e,t,n))];case"Selu":return[Fd(I("x",e,t,n))];case"Sigmoid":return[_n(I("x",e,t,n))];case"Sin":return[$d(I("x",e,t,n))];case"Sign":return[Nm(I("x",e,t,n))];case"Sinh":return[Dd(I("x",e,t,n))];case"Softplus":return[fi(I("x",e,t,n))];case"Sqrt":return[Jt(I("x",e,t,n))];case"Square":return[st(I("x",e,t,n))];case"Tanh":return[ci(I("x",e,t,n))];case"Tan":return[Cm(I("x",e,t,n))];case"ClipByValue":return[vn(I("x",e,t,n),I("clipValueMin",e,t,n),I("clipValueMax",e,t,n))];case"Relu6":return[Rd(I("x",e,t,n))];case"Rsqrt":return[Md(mn(e.inputNames[0],t,n))];case"Prod":return[Ed(I("x",e,t,n),I("axes",e,t,n))];case"LeakyRelu":return[qu(I("x",e,t,n),I("alpha",e,t,n))];case"Prelu":return[Yu(I("x",e,t,n),I("alpha",e,t,n))];case"IsNan":return[fm(mn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function pr(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){_.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let r=0;rn+` Shapes ${e} and ${t} must match`)}}}function v4(e){return!(typeof e=="number"||e.some(t=>t<0))}function Bc(e,t,n){let r=k2(e,n),a=!v4(r);if(a&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&t.forEach(s=>{r=k2(s.shape,r)}),!v4(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function k2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let r=0;r=0&&s>=0&&a!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=a>=0?a:s}return n}var Pae=class{constructor(e,t,n,r,a,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=a,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Vt(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.tensor.id))&&t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);let t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(t=>this.read(t))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, - because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),pr(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Vt(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((n,r)=>this.write(n,t[r]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let r=0;r=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,ur(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0,r=e.map(o=>(n+=o,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to + `}};function EX(e){let{inputs:t,backend:n,attrs:a}=e,{x:r,segmentIds:s}=t,{numSegments:i}=a,o=r.shape.length,l=[],d=0,u=C.getAxesPermutation([d],o),p=r;u!=null&&(p=cn({inputs:{x:r},backend:n,attrs:{perm:u}}),l.push(p),d=C.getInnerMostAxes(1,o)[0]);let c=C.segment_util.computeOutShape(p.shape,d,i),h=w.sizeFromShape([p.shape[d]]),m=fe({inputs:{x:p},backend:n,attrs:{shape:[-1,h]}});l.push(m);let f=lc(r.dtype),A=(k,b,v,I,T)=>{let R=k.shape[0],$=k.shape[1],z=C.segment_util.segOpComputeOptimalWindowSize($,T),_={windowSize:z,inSize:$,batchSize:R,numSegments:T},V=new TX(_,b),j=n.compileAndRun(V,[k,v],I);if(l.push(j),j.shape[1]===T)return j;let U=l6({backend:n,attrs:{start:0,stop:T,step:1,dtype:"float32"}}),X=p6({inputs:{x:U},backend:n,attrs:{reps:[$/z]}});return l.push(U),l.push(X),A(j,b,X,I,T)},y=A(m,"unsortedSegmentSum",s,f,i),g=fe({inputs:{x:y},backend:n,attrs:{shape:c}}),x=g;if(u!=null){l.push(g);let k=C.getUndoAxesPermutation(u);x=cn({inputs:{x},backend:n,attrs:{perm:k}})}return l.forEach(k=>n.disposeIntermediateTensorInfo(k)),x}var CX={kernelName:Eu,backendName:"webgl",kernelFunc:EX},RX=[yH,bH,nB,rB,oB,dB,cB,mB,yB,xB,kB,SB,EB,MB,PB,DB,BB,HB,jB,KB,YB,QB,aV,dV,cV,gV,bV,IV,TV,_W,FV,VV,UV,zV,XV,ZV,GV,QV,nj,sj,oj,uj,cj,gj,bj,fj,kj,Nj,Ej,Fj,zj,Wj,jj,Uj,Hj,qj,Kj,Yj,Qj,tU,sU,uU,pU,hU,AU,bU,IU,EU,zW,RU,RV,$U,zU,LU,LW,jU,qU,KU,nH,QU,iH,uH,hH,wH,RH,EH,DH,zH,PH,NH,WH,VH,GH,ZH,eG,lG,UW,dG,hG,AG,xG,fV,wG,IG,NG,CG,$G,BW,OG,zG,mV,rG,LG,qG,jG,GW,YG,eq,aq,iq,dq,cq,mq,gq,bq,kq,Nq,Cq,Fq,Oq,Pq,lV,iG,Bq,jq,Hq,qq,Kq,Jq,tX,aX,sX,lX,sG,QW,pX,fX,yX,xX,wX,eB,IX,NX,CX,kG];for(let e of RX)ai(e);var Sn;(function(e){e[e.float32=0]="float32",e[e.int32=1]="int32",e[e.bool=2]="bool",e[e.string=3]="string",e[e.complex64=4]="complex64"})(Sn||(Sn={}));var gd;(function(e){e[e.linear=0]="linear",e[e.relu=1]="relu",e[e.relu6=2]="relu6",e[e.prelu=3]="prelu",e[e.leakyrelu=4]="leakyrelu",e[e.sigmoid=5]="sigmoid"})(gd||(gd={}));var c6;function MX(e){c6=e.wasm.cwrap(ei,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function FX(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:l,transposeB:d,activation:u,leakyreluAlpha:p}=a,c=n.dataIdMap.get(r.dataId).id,h=n.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let T=n.dataIdMap.get(i.dataId);if(T.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${T.shape.length}.`);m=T.id}let f=o==null?0:n.dataIdMap.get(o.dataId).id,A=gd[u];if(A==null)throw new Error(`${u} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?r.shape[2]:r.shape[1],g=d?s.shape[1]:s.shape[2],x=r.shape[0],k=n.makeOutput([x,y,g],r.dtype),b=n.dataIdMap.get(k.dataId).id,v=new Uint8Array(new Int32Array(r.shape).buffer),I=new Uint8Array(new Int32Array(s.shape).buffer);return c6(c,v,r.shape.length,h,I,s.shape.length,l,d,A,m,f,p||0,b),k}var $X={kernelName:ei,backendName:"wasm",setupFunc:MX,kernelFunc:FX};function hn(e){let t;function n(r){t=r.wasm.cwrap(e,null,["number","number"])}function a(r){let{backend:s,inputs:{x:i}}=r,o=s.dataIdMap.get(i.dataId).id,l=s.makeOutput(i.shape,i.dtype),d=s.dataIdMap.get(l.dataId).id;return w.sizeFromShape(l.shape)===0||t(o,d),l}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:a}}var DX=hn(eo);function fn(e,t,n){let a;function r(i){a=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:d,b:u}=l,p=o.dataIdMap.get(d.dataId).id,c=o.dataIdMap.get(u.dataId).id,h=n!=null?n:d.dtype,m=C.assertAndGetBroadcastShape(d.shape,u.shape),f=o.makeOutput(m,h);if(w.sizeFromShape(m)===0)return f;let A=new Uint8Array(new Int32Array(d.shape).buffer),y=new Uint8Array(new Int32Array(u.shape).buffer),g=o.dataIdMap.get(f.dataId).id,x=()=>a(p,A,d.shape.length,c,y,u.shape.length,Sn[d.dtype],g);if(t&&d.dtype==="float32")return x(),f;let k=C.getBroadcastDims(d.shape,m),b=C.getBroadcastDims(u.shape,m),v=k.every((T,R)=>T===R),I=b.every((T,R)=>T===R);if(v&&I)return x(),f;throw new Error(`Broadcasting along outer dims is not yet supported for ${d.dtype} ${e}.`)}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var OX=!0,zX=fn(kr,OX),h6;function _X(e){h6=e.wasm.cwrap(is,null,["array","number","number","number"])}function PX(e){let{inputs:t,backend:n}=e,a=n.makeOutput(t[0].shape,t[0].dtype);if(w.sizeFromShape(a.shape)===0)return a;let r=t.map(o=>n.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=n.dataIdMap.get(a.dataId).id;return h6(s,r.length,Sn[a.dtype],i),a}var LX={kernelName:is,backendName:"wasm",setupFunc:_X,kernelFunc:PX};function Ih(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype),r=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(a).set(r),a}var WX={kernelName:ks,backendName:"wasm",kernelFunc:Ih},f6;function BX(e){f6=e.wasm.cwrap(Qs,null,["number","array","number","number","number","array","number"])}function Sh(e){let{inputs:t,backend:n,attrs:a}=e,[r,s]=jX(t.x.shape,a.perm),i=!0;for(let m=0;m=r&&(s===-1||a[s]>a[i])&&(s=i);a[s]=r}return[n,a]}var UX={kernelName:Qs,backendName:"wasm",kernelFunc:Sh,setupFunc:BX};function Wr(e,t,n){let a=e.shape,r=e.shape.length,s=w.parseAxisParam(t,a),i=s,o=C.getAxesPermutation(i,r),l=null,d=!1;if(o!=null){let u=new Array(r);for(let c=0;c`new shape: ${i}, old shape: ${a.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}var aK={kernelName:Bo,backendName:"wasm",kernelFunc:va},x6;function rK(e){x6=e.wasm.cwrap(us,null,["number","array","number","number","array","number","number","number","number"])}function sK(e){let{inputs:t,backend:n,attrs:a}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=a;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=r.shape.length,d=s.shape.length,u=i?r.shape[l-2]:r.shape[l-1],p=o?s.shape[d-1]:s.shape[d-2],c=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[d-2]:s.shape[d-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),A=w.sizeFromShape(m),y=w.sizeFromShape(f),g=A===y||A===1||y===1;w.assert(l>=2&&d>=2&&g,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${m}) and (${f}).`);let x=(A>y?r.shape.slice(0,-2):s.shape.slice(0,-2)).concat([c,h]);w.assert(u===p,()=>`Error in matMul: inner shapes (${u}) and (${p}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let k=i?[A,u,c]:[A,c,u],b=o?[y,h,p]:[y,p,h],v=va({inputs:{x:r},backend:n,attrs:{shape:k}}),I=va({inputs:{x:s},backend:n,attrs:{shape:b}}),T=n.dataIdMap.get(v.dataId).id,R=n.dataIdMap.get(I.dataId).id,$=i?v.shape[2]:v.shape[1],z=o?I.shape[1]:I.shape[2],_=Math.max(A,y),V=n.makeOutput([_,$,z],v.dtype),j=n.dataIdMap.get(V.dataId).id,U=new Uint8Array(new Int32Array(v.shape).buffer),X=new Uint8Array(new Int32Array(I.shape).buffer);return x6(T,U,v.shape.length,R,X,I.shape.length,i,o,j),n.disposeData(v.dataId),n.disposeData(I.dataId),V.shape=x,V}var iK={kernelName:us,backendName:"wasm",setupFunc:rK,kernelFunc:sK};function Nh(e){let{inputs:{x:t},attrs:{dtype:n},backend:a}=e,r=a.makeOutput(t.shape,n),s=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(r).set(s),r}var oK={kernelName:ds,backendName:"wasm",kernelFunc:Nh},lK=hn(ps),b6;function uK(e){b6=e.wasm.cwrap(Ir,null,["number","number","number","number"])}function dK(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=a,o=n.dataIdMap.get(r.dataId).id,l=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(l.dataId).id;return b6(o,s,i,d),l}var pK={kernelName:Ir,backendName:"wasm",setupFunc:uK,kernelFunc:dK};function v6(e){let{inputs:t,backend:n}=e,a=w.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=C.computeOutShape(t.map(h=>h.shape),a),s=t.filter(h=>w.sizeFromShape(h.shape)>0);if(s.length===1)return Ih({inputs:{x:s[0]},backend:n});let i=n.makeOutput(r,t[0].dtype);if(w.sizeFromShape(r)===0)return i;let o=s.map(h=>h.shape);if(C.assertParamsConsistent(o,a),s[0].dtype==="string"){let h=s.map(x=>{let k=w.sizeFromShape(x.shape.slice(a));return va({inputs:{x},backend:n,attrs:{shape:[-1,k]}})}),m=h.map(x=>({vals:n.readSync(x.dataId),shape:x.shape}));r=C.computeOutShape(h.map(x=>x.shape),1);let f=h[0].shape[0]===1,A=VA(m,r,t[0].dtype,f),y=C.computeOutShape(s.map(x=>x.shape),a);i.shape=y;let g=n.dataIdMap.get(i.dataId);return g.stringBytes=C.fromStringArrayToUint8(A),h.forEach(x=>n.disposeData(x.dataId)),i}let l=w.sizeFromShape(s[0].shape.slice(0,a)),d=0,u=s.map(h=>{let m=w.sizeFromShape(h.shape.slice(a));return d+=m,m}),p=s.map(h=>n.typedArrayFromHeap(h)),c=n.typedArrayFromHeap(i);for(let h=0;h`cumsum does not support ${r.dtype} tensors in the WASM backend`);let d=C.getAxesPermutation([s],l),u=r;d!==null&&(u=Sh({inputs:{x:r},attrs:{perm:d},backend:n}));let p=C.getInnerMostAxes(1,l)[0];C.assertAxesAreInnerMostDims("cumsum",[p],l);let c=n.makeOutput(u.shape,u.dtype),h=u.shape[p],m=n.dataIdMap.get(u.dataId).id,f=n.dataIdMap.get(c.dataId).id;S6(m,i?1:0,o?1:0,h,f,Sn[r.dtype]);let A=c;if(d!==null){let y=C.getUndoAxesPermutation(d);A=Sh({inputs:{x:c},attrs:{perm:y},backend:n}),n.disposeData(u.dataId),n.disposeData(c.dataId)}return A}var SK={kernelName:ms,backendName:"wasm",setupFunc:kK,kernelFunc:IK},N6;function NK(e){N6=e.wasm.cwrap(fo,null,["number","number","number","array","number","array","array","number","number"])}function TK(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{blockSize:s,dataFormat:i}=a;w.assert(s>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`);let o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],d=i==="NHWC"?r.shape[2]:r.shape[3],u=i==="NHWC"?r.shape[3]:r.shape[1],p=l*s,c=d*s,h=u/(s*s),m=i==="NHWC"?[o,p,c,h]:[o,h,p,c],f=t.makeOutput(m,"float32"),A=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(w.computeStrides(r.shape)).buffer),g=new Uint8Array(new Int32Array(m).buffer),x=new Uint8Array(new Int32Array(w.computeStrides(m)).buffer),k=t.dataIdMap.get(f.dataId).id;return N6(A,s,i==="NHWC"?1:0,y,r.shape.length-1,g,x,m.length,k),f}var EK={kernelName:fo,backendName:"wasm",setupFunc:NK,kernelFunc:TK},T6;function CK(e){T6=e.wasm.cwrap(As,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function RK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s}=t,i=a.dataIdMap.get(r.dataId).id,o=a.dataIdMap.get(s.dataId).id,{strides:l,dilations:d,pad:u,dimRoundingMode:p}=n,c=d==null?[1,1]:d,h=C.computeConv2DInfo(r.shape,s.shape,l,c,u,p,!0),m=h.filterHeight,f=h.filterWidth,A=h.padInfo.top,y=h.padInfo.right,g=h.padInfo.bottom,x=h.padInfo.left,k=h.dilationHeight,b=h.dilationWidth,v=h.strideHeight,I=h.strideWidth,T=h.inChannels,R=h.outChannels,$=h.padInfo.type==="SAME"?1:0;if(h.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${h.dataFormat}'. Please use 'channelsLast'.`);let z=a.makeOutput(h.outShape,"float32"),_=a.dataIdMap.get(z.dataId).id;return T6(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,A,y,g,x,$,k,b,v,I,T,R,_),z}var MK={kernelName:As,backendName:"wasm",setupFunc:CK,kernelFunc:RK},FK=!1,$K=fn(yo,FK,"bool"),DK=hn(gs);function v1(e){let{inputs:t,attrs:n,backend:a}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(w.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),va({inputs:{x:r},backend:a,attrs:{shape:o}})}var OK={kernelName:go,backendName:"wasm",kernelFunc:v1};function zK(e){let{attrs:{shape:t,value:n,dtype:a},backend:r}=e,s=r.makeOutput(t,a);return r.typedArrayFromHeap(s).fill(n),s}var _K={kernelName:xu,backendName:"wasm",kernelFunc:zK},E6;function PK(e){E6=e.wasm.cwrap(bo,null,["number","number","number","number","number","number"])}function LK(e){let{inputs:t,backend:n}=e,{image:a}=t,r=n.makeOutput(a.shape,a.dtype),s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,[o,l,d,u]=a.shape;return E6(s,o,l,d,u,i),r}var WK={kernelName:bo,backendName:"wasm",kernelFunc:LK,setupFunc:PK},BK=hn(xs),VK=!1,jK=fn(bs,VK),C6;function UK(e){C6=e.wasm.cwrap(vs,null,["number","number","number","number","number","number","number"])}function HK(e){let{backend:t,inputs:n,attrs:a}=e,{varianceEpsilon:r}=a,{x:s,mean:i,variance:o,offset:l,scale:d}=n,u=t.dataIdMap.get(s.dataId).id,p=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(o.dataId).id,h=l!=null?t.dataIdMap.get(l.dataId).id:0,m=d!=null?t.dataIdMap.get(d.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(w.sizeFromShape(s.shape)===0)return f;let A=t.dataIdMap.get(f.dataId).id;return C6(u,p,c,h,m,r,A),f}var GK={kernelName:vs,backendName:"wasm",setupFunc:UK,kernelFunc:HK},R6;function qK(e){R6=e.wasm.cwrap(ti,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function XK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=C.computeConv2DInfo(r.shape,s.shape,l,u,d,c),A=gd[h];if(A==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,g=a.dataIdMap.get(s.dataId).id,x=f.outChannels,k=0;if(i!=null){let Q=a.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);k=Q.id}let b=f.filterHeight,v=f.filterWidth,I=f.padInfo.top,T=f.padInfo.right,R=f.padInfo.bottom,$=f.padInfo.left,z=f.dilationHeight,_=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let re=a.makeOutput(f.outShape,"float32"),te=a.dataIdMap.get(re.dataId).id,ie=o==null?0:a.dataIdMap.get(o.dataId).id;return R6(y,G,ee,Y,g,b,v,k,I,T,R,$,X,z,_,V,j,U,x,A,ie,m||0,te),re}var KK={kernelName:ti,backendName:"wasm",setupFunc:qK,kernelFunc:XK},M6;function ZK(e){M6=e.wasm.cwrap(ni,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function YK(e){let{inputs:t,attrs:n,backend:a}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:d,dilations:u,dataFormat:p,dimRoundingMode:c,activation:h,leakyreluAlpha:m}=n,f=C.computeConv2DInfo(r.shape,s.shape,l,u,d,c,!0),A=gd[h];if(A==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=a.dataIdMap.get(r.dataId).id,g=a.dataIdMap.get(s.dataId).id,x=f.outChannels,k=0;if(i!=null){let Q=a.dataIdMap.get(i.dataId);if(Q.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${Q.shape.length}.`);if(Q.shape[0]!==x)throw new Error(`FusedDepthwiseConv2D bias shape (${Q.shape}) does not match the number of output channels (${x})`);k=Q.id}let b=f.filterHeight,v=f.filterWidth,I=f.padInfo.top,T=f.padInfo.right,R=f.padInfo.bottom,$=f.padInfo.left,z=f.dilationHeight,_=f.dilationWidth,V=f.strideHeight,j=f.strideWidth,U=f.inChannels,X=f.padInfo.type==="SAME"?1:0,G=f.batchSize,ee=f.inHeight,Y=f.inWidth;if(p!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${p}'. Please use 'NHWC'.`);let re=a.makeOutput(f.outShape,"float32"),te=a.dataIdMap.get(re.dataId).id,ie=o==null?0:a.dataIdMap.get(o.dataId).id;return M6(y,G,ee,Y,g,b,v,k,I,T,R,$,X,z,_,V,j,U,x,A,ie,m||0,te),re}var JK={kernelName:ni,backendName:"wasm",setupFunc:ZK,kernelFunc:YK},F6;function QK(e){F6=e.wasm.cwrap(wo,null,["number","number","number","number","number","number","array","number"])}function eZ(e){let{backend:t,inputs:n}=e,{params:a,indices:r}=n,[s,i,o,l]=Lm.prepareAndValidate(a,r),d=t.makeOutput(s,a.dtype);if(i===0)return d;let u=r.shape,p=u[u.length-1],c=t.dataIdMap.get(a.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(d.dataId).id;return F6(c,Sn[a.dtype],h,i,p,o,m,f),d}var tZ={kernelName:wo,backendName:"wasm",setupFunc:QK,kernelFunc:eZ},$6;function nZ(e){$6=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function aZ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r,indices:s}=n,{axis:i,batchDims:o}=a,l=w.parseAxisParam(i,r.shape)[0],d=C.segment_util.collectGatherOpShapeInfo(r,s,l,o),u=va({inputs:{x:r},attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]},backend:t}),p=w.sizeFromShape(s.shape),c=va({inputs:{x:s},attrs:{shape:[d.batchSize,p/d.batchSize]},backend:t}),h=[d.batchSize,d.outerSize,p/d.batchSize,d.sliceSize],m=t.makeOutput(h,r.dtype);if(w.sizeFromShape(r.shape)===0)return m;let f=u.shape.length-1,A=t.dataIdMap.get(u.dataId).id,y=t.dataIdMap.get(c.dataId).id,g=t.dataIdMap.get(m.dataId).id,x=new Uint8Array(new Int32Array(w.computeStrides(u.shape)).buffer),k=new Uint8Array(new Int32Array(w.computeStrides(h)).buffer);return $6(A,Sn[r.dtype],x,f,y,d.batchSize,k,g),t.disposeData(u.dataId),t.disposeData(c.dataId),m.shape=d.outputShape,m}var rZ={kernelName:vo,backendName:"wasm",setupFunc:nZ,kernelFunc:aZ},sZ=!1,iZ=fn(ko,sZ,"bool"),oZ=!1,lZ=fn(ws,oZ,"bool"),D6;function uZ(e){D6=e.wasm.cwrap(Is,null,["number","number","number"])}function dZ(e){let{inputs:{x:t},attrs:{alpha:n},backend:a}=e,r=a.dataIdMap.get(t.dataId).id,s=a.makeOutput(t.shape,t.dtype);if(w.sizeFromShape(t.shape)!==0){let i=a.dataIdMap.get(s.dataId).id;D6(r,n,i)}return s}var pZ={kernelName:Is,backendName:"wasm",setupFunc:uZ,kernelFunc:dZ},cZ=!1,hZ=fn(To,cZ,"bool"),fZ=!1,mZ=fn(Eo,fZ,"bool"),AZ=hn(Ss),yZ=!1,gZ=fn(Ro,yZ,"bool"),O6;function xZ(e){O6=e.wasm.cwrap(Ns,null,["number, number, number"])}function bZ(e){let{backend:t,inputs:n,attrs:a}=e,{reductionIndices:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:d,axes:u,originalAxes:p,inputWasTransposed:c}=Wr(i,r,t);if(c){let g=t.dataIdMap.get(d.dataId).id;l=d,o=g}let h=l.shape.length;C.assertAxesAreInnerMostDims("max",u,h);let[m,f]=C.computeOutAndReduceShapes(l.shape,u),A=w.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(w.sizeFromShape(l.shape)!==0){let g=t.dataIdMap.get(y.dataId).id;O6(o,A,g)}if(c&&t.disposeData(d.dataId),s){let g=C.expandShapeToKeepDim(y.shape,p);y.shape=g}return y}var vZ={kernelName:Ns,backendName:"wasm",setupFunc:xZ,kernelFunc:bZ},wZ=!1,kZ=fn(Ts,wZ),z6;function IZ(e){z6=e.wasm.cwrap(Es,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function SZ(e){let{inputs:t,attrs:n,backend:a}=e,r=t.x,s=a.dataIdMap.get(r.dataId).id,{filterSize:i,strides:o,pad:l,dimRoundingMode:d}=n,u=C.computePool2DInfo(r.shape,i,o,1,l,d),p=u.filterHeight,c=u.filterWidth,h=u.padInfo.top,m=u.padInfo.right,f=u.padInfo.bottom,A=u.padInfo.left,y=u.dilationHeight,g=u.dilationWidth,x=u.strideHeight,k=u.strideWidth,b=u.inChannels,v=u.outChannels;if(u.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${u.dataFormat}'. Please use 'channelsLast'.`);let I=a.makeOutput(u.outShape,"float32"),T=a.dataIdMap.get(I.dataId).id;return z6(s,r.shape[0],r.shape[1],r.shape[2],p,c,h,m,f,A,y,g,x,k,b,v,T),I}var NZ={kernelName:Es,backendName:"wasm",setupFunc:IZ,kernelFunc:SZ},_6;function TZ(e){_6=e.wasm.cwrap(Cs,null,["number, number, number"])}function EZ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let k=t.dataIdMap.get(u.dataId).id;k!==o&&(d=u,l=k,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("mean",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=d;d.dtype!=="float32"&&(g=Nh({backend:t,inputs:{x:d},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(g.dataId).id);let x=t.makeOutput(f,"float32");if(w.sizeFromShape(d.shape)!==0){let k=t.dataIdMap.get(x.dataId).id;_6(l,y,k)}if(h&&t.disposeData(u.dataId),s){let k=C.expandShapeToKeepDim(x.shape,c);x.shape=k}return d.dtype!=="float32"&&t.disposeData(g.dataId),x}var CZ={kernelName:Cs,backendName:"wasm",setupFunc:TZ,kernelFunc:EZ},P6;function RZ(e){P6=e.wasm.cwrap(Rs,null,["number, number, number"])}function MZ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t);if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x)}let m=d.shape.length;C.assertAxesAreInnerMostDims("min",p,m);let[f,A]=C.computeOutAndReduceShapes(d.shape,p),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;P6(l,y,x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var FZ={kernelName:Rs,backendName:"wasm",setupFunc:RZ,kernelFunc:MZ},$Z=!1,DZ=fn(Ms,$Z),w1;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(w1||(w1={}));var L6;function OZ(e){L6=e.wasm.cwrap(Fs,null,["number","array","number","number","array","array","number","number"])}function zZ(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,mode:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(t.shape).buffer),u=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(u).buffer),h=new Uint8Array(new Int32Array(p).buffer);return L6(i,d,t.shape.length,Sn[t.dtype],c,h,w1[r],l),o}var _Z={kernelName:Fs,backendName:"wasm",kernelFunc:zZ,setupFunc:OZ},PZ=!0,LZ=fn($s,PZ),WZ=hn(Fo);function k1(e,t){let n=new Int32Array(e.wasm.HEAPU8.buffer,t,4),a=n[0],r=n[1],s=n[2],i=n[3];return e.wasm._free(t),{pSelectedIndices:a,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var W6;function BZ(e){W6=e.wasm.cwrap(Do,"number",["number","number","number","number","number"])}function VZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=a,{boxes:o,scores:l}=n,d=t.dataIdMap.get(o.dataId).id,u=t.dataIdMap.get(l.dataId).id,p=W6(d,u,s,r,i),{pSelectedIndices:c,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=k1(t,p);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",c)}var jZ={kernelName:Do,backendName:"wasm",setupFunc:BZ,kernelFunc:VZ},B6;function UZ(e){B6=e.wasm.cwrap(Oo,"number",["number","number","number","number","number","bool"])}function HZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=a,{boxes:l,scores:d}=n,u=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(d.dataId).id,c=B6(u,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=k1(t,c);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),g=t.makeOutput([],"int32",A);return[y,g]}var GZ={kernelName:Oo,backendName:"wasm",setupFunc:UZ,kernelFunc:HZ},V6;function qZ(e){V6=e.wasm.cwrap(zo,"number",["number","number","number","number","number","number"])}function XZ(e){let{backend:t,inputs:n,attrs:a}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=a,{boxes:l,scores:d}=n,u=t.dataIdMap.get(l.dataId).id,p=t.dataIdMap.get(d.dataId).id,c=V6(u,p,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:A}=k1(t,c);t.wasm._free(A);let y=t.makeOutput([m],"int32",h),g=t.makeOutput([m],"float32",f);return[y,g]}var KZ={kernelName:zo,backendName:"wasm",setupFunc:qZ,kernelFunc:XZ},ZZ=!1,YZ=fn($o,ZZ,"bool"),j6;function JZ(e){j6=e.wasm.cwrap(Ds,null,["number","number","number","number","number"])}function QZ(e){let{inputs:t,backend:n,attrs:a}=e,{indices:r}=t,{depth:s,onValue:i,offValue:o}=a,l=n.makeOutput([...r.shape,s],"int32"),d=n.dataIdMap.get(l.dataId).id,u=n.dataIdMap.get(r.dataId).id;return j6(u,s,i,o,d),l}var eY={kernelName:Ds,backendName:"wasm",setupFunc:JZ,kernelFunc:QZ};function tY(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(1),a}var nY={kernelName:_o,backendName:"wasm",kernelFunc:tY};function aY(e){let{inputs:t,backend:n,attrs:a}=e,{axis:r}=a;if(t.length===1)return v1({inputs:{input:t[0]},backend:n,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(u=>{w.assertShapesMatch(s,u.shape,"All tensors passed to stack must have matching shapes"),w.assert(i===u.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(u=>{let p=v1({inputs:{input:u},backend:n,attrs:{dim:r}});return o.push(p),p}),d=v6({inputs:l,backend:n,attrs:{axis:r}});return o.forEach(u=>n.disposeData(u.dataId)),d}var rY={kernelName:Po,backendName:"wasm",kernelFunc:aY},U6;function sY(e){U6=e.wasm.cwrap(Os,null,["number","array","number","number","array","array","number","number"])}function iY(e){let{inputs:{x:t},backend:n,attrs:{paddings:a,constantValue:r}}=e,s=a.map((m,f)=>m[0]+t.shape[f]+m[1]),i=n.dataIdMap.get(t.dataId).id,o=n.makeOutput(s,t.dtype),l=n.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(t.shape).buffer),u=a.map(m=>m[0]),p=a.map(m=>m[1]),c=new Uint8Array(new Int32Array(u).buffer),h=new Uint8Array(new Int32Array(p).buffer);return U6(i,d,t.shape.length,Sn[t.dtype],c,h,r,l),o}var oY={kernelName:Os,backendName:"wasm",kernelFunc:iY,setupFunc:sY},lY=!1,uY=fn(zs,lY),H6;function dY(e){H6=e.wasm.cwrap(_s,null,["number","number","number"])}function pY(e){let{inputs:t,backend:n}=e,{x:a,alpha:r}=t,s=n.dataIdMap.get(a.dataId).id,i=n.dataIdMap.get(r.dataId).id,o=n.makeOutput(a.shape,"float32"),l=n.dataIdMap.get(o.dataId).id;return H6(s,i,l),o}var cY={kernelName:_s,backendName:"wasm",setupFunc:dY,kernelFunc:pY},G6;function hY(e){G6=e.wasm.cwrap(Lo,null,["number","number","number","number"])}function fY(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("prod",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;G6(l,y,Sn[g.dtype],x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var mY={kernelName:Lo,backendName:"wasm",setupFunc:hY,kernelFunc:fY},AY=e=>{let{backend:t,attrs:n}=e,{start:a,stop:r,step:s,dtype:i}=n,o=HA(a,r,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},yY={kernelName:Iu,backendName:"wasm",kernelFunc:AY},gY=!0,xY=fn(ys,gY),bY=hn(Ps),vY=hn(Ws),q6;function wY(e){q6=e.wasm.cwrap(Ls,null,["number","number","number","number","number","number","number","number","number","number"])}function kY(e){let{backend:t,inputs:n,attrs:a}=e,{images:r}=n,{alignCorners:s,halfPixelCenters:i,size:o}=a,[l,d]=o,[u,p,c,h]=r.shape,m=[u,l,d,h],f=t.dataIdMap.get(r.dataId),A;f.dtype!=="float32"&&(A=Nh({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(A.dataId));let y=f.id,g=t.makeOutput(m,"float32");if(w.sizeFromShape(r.shape)===0)return g;let x=t.dataIdMap.get(g.dataId).id;return q6(y,u,p,c,h,l,d,s?1:0,i?1:0,x),A!=null&&t.disposeData(A.dataId),g}var IY={kernelName:Ls,backendName:"wasm",setupFunc:wY,kernelFunc:kY},X6;function SY(e){X6=e.wasm.cwrap(Bs,null,["number","array","number","array","number","number"])}function NY(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,{dims:s}=a,i=w.parseAxisParam(s,r.shape);if(r.shape.length===0)return Ih({inputs:{x:r},backend:n});let o=n.makeOutput(r.shape,r.dtype),l=n.dataIdMap.get(r.dataId).id,d=n.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(i).buffer),p=new Uint8Array(new Int32Array(r.shape).buffer);X6(l,u,i.length,p,r.shape.length,d);let c=va({inputs:{x:o},attrs:{shape:r.shape},backend:n});return n.disposeData(o.dataId),c}var TY={kernelName:Bs,backendName:"wasm",kernelFunc:NY,setupFunc:SY},K6;function EY(e){K6=e.wasm.cwrap(el,null,["number","number","number","number","number","number","number","number","array","number","number"])}function CY(e){let{inputs:t,backend:n,attrs:a}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=a,l=n.makeOutput(r.shape,r.dtype),d=n.dataIdMap.get(r.dataId).id,u=n.dataIdMap.get(l.dataId).id,[p,c,h,m]=r.shape,[f,A]=C.getImageCenter(o,c,h),y=i===0,g=255,x=typeof i=="number"?[i,i,i,y?0:g]:[...i,g],k=new Uint8Array(new Int32Array(x).buffer);return K6(d,p,c,h,m,s,f,A,k,x.length,u),l}var RY={kernelName:el,backendName:"wasm",kernelFunc:CY,setupFunc:EY},MY=hn(Vs),FY=hn(js),Z6;function $Y(e){Z6=e.wasm.cwrap(Vo,null,["number","number","number","number","number","number","array","number","number"])}function DY(e){let{backend:t,inputs:n,attrs:a}=e,{indices:r,updates:s}=n,{shape:i}=a,o=t.makeOutput(i,s.dtype);if(w.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:d,sliceSize:u,strides:p,outputSize:c}=Wm.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(p).buffer),A=t.dataIdMap.get(o.dataId).id;return Z6(h,m,Sn[s.dtype],l,d,u,f,c,A),o}var OY={kernelName:Vo,backendName:"wasm",setupFunc:$Y,kernelFunc:DY},Y6;function zY(e){Y6=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function _Y(e){let{inputs:t,backend:n}=e,{condition:a,t:r,e:s}=t,i=n.dataIdMap.get(a.dataId).id,o=n.dataIdMap.get(r.dataId).id,l=n.dataIdMap.get(s.dataId).id,d=n.makeOutput(r.shape,r.dtype),u=n.dataIdMap.get(d.dataId).id,p=a.shape.length,c=r.shape.length,h=p===0||p>1||c===1?1:w.sizeFromShape(r.shape.slice(1));return Y6(i,o,l,h,u),d}var PY={kernelName:jo,backendName:"wasm",kernelFunc:_Y,setupFunc:zY},J6;function LY(e){J6=e.wasm.cwrap(Hs,null,["number","number"])}function WY(e){let{backend:t,inputs:{x:n}}=e,a=t.dataIdMap.get(n.dataId).id,r=t.makeOutput(n.shape,n.dtype),s=t.dataIdMap.get(r.dataId).id;return w.sizeFromShape(r.shape)===0||J6(a,s),r}var BY={kernelName:"Sigmoid",backendName:"wasm",setupFunc:LY,kernelFunc:WY},VY=hn(Us);function Th(e){let{inputs:{x:t},attrs:{begin:n,size:a},backend:r}=e,[s,i]=sn.parseSliceParams(t,n,a),o=sn.isSliceContinous(t.shape,s,i),l=r.readSync(t.dataId),d=r.makeOutput(i,t.dtype),u=w.computeStrides(t.shape),p=r.dataIdMap.get(d.dataId);if(o){let m=sn.computeFlatOffset(s,u);return t.dtype==="string"?p.stringBytes=l.slice(m,m+w.sizeFromShape(i)):r.typedArrayFromHeap(d).set(l.subarray(m,m+w.sizeFromShape(i))),d}if(t.dtype==="string"){let m=th(l,s,i,t.shape,t.dtype);return p.stringBytes=m,d}let c=r.typedArrayFromHeap(d),h=t.shape.length;if(h===2)jY(l,u[0],c,s,i);else if(h===3)UY(l,u[0],u[1],c,s,i);else if(h===4)HY(l,u[0],u[1],u[2],c,s,i);else{let m=th(l,s,i,t.shape,t.dtype);c.set(m)}return d}function jY(e,t,n,a,r){let s=0,i=a[0],o=a[1],l=i+r[0];for(let d=i;d{let c=[...u];c[o]=p;let h=Th({inputs:{x:r},attrs:{begin:d,size:c},backend:a});return d[o]+=p,h})}var YY={kernelName:Ko,backendName:"wasm",kernelFunc:ZY},JY=hn(Gs),QY=hn(Tu),eJ=!0,tJ=fn(Ks,eJ),ew;function nJ(e){ew=e.wasm.cwrap(Nr,null,["number","number","number"])}function aJ(e){let{backend:t,inputs:n,attrs:a}=e,{alpha:r}=a,{x:s}=n,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return ew(i,r,l),o}var rJ={kernelName:Nr,backendName:"wasm",setupFunc:nJ,kernelFunc:aJ},tw;function sJ(e){tw=e.wasm.cwrap(Zo,null,["number","array","number","array","array","array","array","array","number","number"])}function iJ(e){let{backend:t,inputs:n,attrs:a}=e,{x:r}=n,{begin:s,end:i,strides:o}=a;o==null&&(o=new Array(s.length));let{beginMask:l,endMask:d,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c}=a,h=C.slice_util.maskToAxes(u);if(h.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(u!==0&&p!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(u!==0&&c!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");let m=r.shape.length-s.length,f=C.slice_util.maskToAxes(p),A=r.shape.slice();f.forEach($=>{s[$]=0,i[$]=1,A.splice($,0,1)});let y=va({inputs:{x:r},attrs:{shape:A},backend:t}),{begin:g,end:x,strides:k}=C.slice_util.getNormalizedAxes(y.shape,h,m,s,i,o,l,d,u);s=g,i=x,o=k;let b=C.slice_util.maskToAxes(c);b.forEach($=>{i[$]=s[$]+1,o[$]=1});let v=C.slice_util.computeOutShape(s,i,o),I=v.filter(($,z)=>b.indexOf(z)===-1);if(o.every($=>$===1)){let $=Th({inputs:{x:y},attrs:{begin:s,size:v},backend:t});t.disposeData(y.dataId);let z=va({inputs:{x:$},attrs:{shape:I},backend:t});return t.disposeData($.dataId),z}let T=t.makeOutput(I,"float32");if(!I.some($=>$===0)){let $=t.dataIdMap.get(y.dataId).id,z=new Uint8Array(new Int32Array(w.computeStrides(y.shape)).buffer),_=new Uint8Array(new Int32Array(s).buffer),V=new Uint8Array(new Int32Array(i).buffer),j=new Uint8Array(new Int32Array(o).buffer),U=new Uint8Array(new Int32Array(I).buffer),X=new Uint8Array(new Int32Array(w.computeStrides(I)).buffer),G=t.dataIdMap.get(T.dataId).id;tw($,z,y.shape.length,_,V,j,U,X,I.length,G)}t.disposeData(y.dataId);let R=va({inputs:{x:T},attrs:{shape:I},backend:t});return t.disposeData(T.dataId),R}var oJ={kernelName:Zo,backendName:"wasm",setupFunc:sJ,kernelFunc:iJ},lJ=!0,uJ=fn(Zs,lJ),nw;function dJ(e){nw=e.wasm.cwrap(qs,null,["number, number, number"])}function pJ(e){let{backend:t,inputs:n,attrs:a}=e,{axis:r,keepDims:s}=a,{x:i}=n,o=t.dataIdMap.get(i.dataId).id,l=o,d=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:h}=Wr(i,r,t),m=p;if(h){let x=t.dataIdMap.get(u.dataId).id;x!==o&&(d=u,l=x,m=C.getInnerMostAxes(m.length,d.shape.length))}C.assertAxesAreInnerMostDims("sum",m,d.shape.length);let[f,A]=C.computeOutAndReduceShapes(d.shape,m),y=w.sizeFromShape(A),g=t.makeOutput(f,d.dtype);if(w.sizeFromShape(d.shape)!==0){let x=t.dataIdMap.get(g.dataId).id;nw(l,y,x)}if(h&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(g.shape,c);g.shape=x}return g}var cJ={kernelName:qs,backendName:"wasm",setupFunc:dJ,kernelFunc:pJ},hJ=hn(Ys),fJ=hn(Js),aw;function mJ(e){aw=e.wasm.cwrap(Sr,null,["number","array","number","array","number","number"])}function AJ(e){let{inputs:t,backend:n,attrs:a}=e,{x:r}=t,s=n.dataIdMap.get(r.dataId).id,{reps:i}=a,o=new Array(r.shape.length);for(let c=0;c{let{x:a}=e,{k:r,sorted:s}=n,i=t.dataIdMap.get(a.dataId).id,o=new Uint8Array(new Int32Array(a.shape).buffer),l=a.shape.slice();l[l.length-1]=r;let d=t.makeOutput(l,a.dtype),u=t.dataIdMap.get(d.dataId).id,p=t.makeOutput(l,"int32"),c=t.dataIdMap.get(p.dataId).id;return rw(i,o,a.shape.length,Sn[a.dtype],r,s,u,c),[d,p]},bJ={kernelName:Yo,backendName:"wasm",setupFunc:gJ,kernelFunc:xJ};function vJ(e){let{inputs:t,backend:n,attrs:a}=e,{value:r}=t,{axis:s}=a;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,l=new Array(o-1),d=0;for(let h=0;h({dataId:h,dtype:m,shape:l}))}var wJ={kernelName:Jo,backendName:"wasm",kernelFunc:vJ};function kJ(e){let{inputs:{x:t},backend:n}=e,a=n.makeOutput(t.shape,t.dtype);return n.typedArrayFromHeap(a).fill(0),a}var IJ={kernelName:Qo,backendName:"wasm",kernelFunc:kJ},SJ=[DX,zX,LX,qX,ZX,QX,nK,iK,oK,lK,pK,cK,mK,gK,xK,wK,SK,EK,MK,$K,DK,OK,_K,WK,BK,jK,$X,GK,KK,JK,tZ,rZ,iZ,lZ,WX,pZ,hZ,mZ,AZ,gZ,vZ,kZ,NZ,CZ,FZ,DZ,_Z,LZ,WZ,jZ,GZ,KZ,YZ,eY,nY,rY,oY,uY,cY,mY,yY,xY,bY,vY,aK,IY,TY,RY,FY,MY,OY,PY,BY,VY,GY,KY,YY,JY,QY,tJ,rJ,oJ,uJ,cJ,hJ,fJ,yJ,bJ,UX,wJ,IJ];for(let e of SJ)ai(e);var I1=J();I1.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])));I1.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(I1.get("IS_NODE"))return!1;try{return new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}});var sw=Yi(Q9()),NJ='var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}',TJ=Yi(eI()),iw=class extends du{constructor(e){super();this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.init(),this.dataIdMap=new wp(this,nr())}write(e,t,n){let a={id:this.dataIdNextNumber++};return this.move(a,e,t,n,1),a}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=w.now();return e(),{kernelMs:w.now()-t}}move(e,t,n,a,r){let s=this.dataIdNextNumber++;if(a==="string"){let d=t;this.dataIdMap.set(e,{id:s,stringBytes:d,shape:n,dtype:a,memoryOffset:null,refCount:r});return}let i=w.sizeFromShape(n),o=i*w.bytesPerElement(a),l=this.wasm._malloc(o);this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:n,dtype:a,refCount:r}),this.wasm.tfjs.registerTensor(s,i,l),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,o),l)}async read(e){return this.readSync(e)}readSync(e){let{memoryOffset:t,dtype:n,shape:a,stringBytes:r}=this.dataIdMap.get(e);if(n==="string")return r;let s=this.wasm.HEAPU8.slice(t,t+w.sizeFromShape(a)*w.bytesPerElement(n));return EJ(s.buffer,n)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let n=this.dataIdMap.get(e);if(n.refCount--,!t&&n.refCount>0)return!1;this.wasm._free(n.memoryOffset),this.wasm.tfjs.disposeData(n.id),this.dataIdMap.delete(e)}return!0}refCount(e){return this.dataIdMap.has(e)?this.dataIdMap.get(e).refCount:0}incRef(e){let t=this.dataIdMap.get(e);t!=null&&t.refCount++}floatPrecision(){return 32}getMemoryOffset(e){return this.dataIdMap.get(e).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(e,t,n){let a;if(n==null)a=this.write(null,e,t);else{let r=this.dataIdNextNumber++;a={id:r},this.dataIdMap.set(a,{id:r,memoryOffset:n,shape:e,dtype:t,refCount:1});let s=w.sizeFromShape(e);this.wasm.tfjs.registerTensor(r,s,n)}return{dataId:a,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:n}){let a=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(n),s=w.sizeFromShape(e);switch(t){case"float32":return new Float32Array(a,r,s);case"int32":return new Int32Array(a,r,s);case"bool":return new Uint8Array(a,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function CJ(e){return(t,n)=>(w.fetch(e,{credentials:"same-origin"}).then(a=>{a.ok||t.env.a(`failed to load wasm binary file at '${e}'`),a.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{n(s.instance,s.module)})})}),{})}function ow(e,t,n){if(Eh!=null)return Eh;let a="tfjs-backend-wasm.wasm";return e&&t?a="tfjs-backend-wasm-threaded-simd.wasm":e&&(a="tfjs-backend-wasm-simd.wasm"),xd!=null&&xd[a]!=null?xd[a]:n+a}async function RJ(){let[e,t]=await Promise.all([J().getAsync("WASM_HAS_SIMD_SUPPORT"),J().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((n,a)=>{let r={};r.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let d=NJ,u=new Blob([d],{type:"application/javascript"});return URL.createObjectURL(u)}return o.endsWith(".wasm")?ow(e,t,bd!=null?bd:l):l+o},S1&&(r.instantiateWasm=CJ(ow(e,t,bd!=null?bd:"")));let s=!1;r.onAbort=()=>{s||vd||(vd=!0,a({message:"Make sure the server can serve the `.wasm` file relative to the bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers"}))};let i;t&&e&&Eh==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+sw.default.toString()],{type:"text/javascript"}),i=(0,sw.default)(r)):i=(0,TJ.default)(r),i.then(o=>{s=!0,vd=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},n({wasm:o})})})}function EJ(e,t){switch(t){case"float32":return new Float32Array(e);case"int32":return new Int32Array(e);case"bool":return new Uint8Array(e);default:throw new Error(`Unknown dtype ${t}`)}}var MJ=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Eh=null,bd=null,xd={},vd=!1,S1=!1;function FJ(e,t=!1){if(Gm("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),vd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Eh=e,S1=t}function $J(e,t=!1){if(vd)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof e=="string")bd=e;else{xd=e;let n=MJ.filter(a=>xd[a]==null);if(n.length>0)throw new Error(`There were no entries found for the following binaries: ${n.join(",")}. Please either call setWasmPaths with a map providing a path for each binary, or with a string indicating the directory where all the binaries can be found.`)}S1=t}var lw="3.5.0",DJ=2;ul("wasm",async()=>{let{wasm:e}=await RJ();return new iw(e)},DJ);Z().prototype.abs=function(){return this.throwIfDisposed(),Ot(this)};Z().prototype.acos=function(){return this.throwIfDisposed(),Xm(this)};Z().prototype.acosh=function(){return this.throwIfDisposed(),Km(this)};Z().prototype.add=function(e){return this.throwIfDisposed(),se(this,e)};Z().prototype.all=function(e,t){return this.throwIfDisposed(),Ac(this,e,t)};Z().prototype.any=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)};Z().prototype.argMax=function(e){return this.throwIfDisposed(),Bu(this,e)};Z().prototype.argMin=function(e){return this.throwIfDisposed(),Zm(this,e)};Z().prototype.asScalar=function(){return this.throwIfDisposed(),F(this.size===1,()=>"The array must have only 1 element."),H(this,[])};Z().prototype.asType=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.as1D=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.as2D=function(e,t){return this.throwIfDisposed(),H(this,[e,t])};Z().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),H(this,[e,t,n])};Z().prototype.as4D=function(e,t,n,a){return this.throwIfDisposed(),H(this,[e,t,n,a])};Z().prototype.as5D=function(e,t,n,a,r){return this.throwIfDisposed(),H(this,[e,t,n,a,r])};Z().prototype.asin=function(){return this.throwIfDisposed(),Ym(this)};Z().prototype.asinh=function(){return this.throwIfDisposed(),Jm(this)};Z().prototype.atan=function(){return this.throwIfDisposed(),Qm(this)};Z().prototype.atan2=function(e){return this.throwIfDisposed(),eA(this,e)};Z().prototype.atanh=function(){return this.throwIfDisposed(),tA(this)};Z().prototype.avgPool=function(e,t,n,a){return this.throwIfDisposed(),ju(this,e,t,n,a)};Z().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Uu(this,e,t)};Z().prototype.batchNorm=function(e,t,n,a,r){return this.throwIfDisposed(),pi(this,e,t,n,a,r)};Z().prototype.broadcastTo=function(e){return this.throwIfDisposed(),pl(this,e)};Z().prototype.cast=function(e){return this.throwIfDisposed(),Ae(this,e)};Z().prototype.ceil=function(){return this.throwIfDisposed(),sA(this)};Z().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),kn(this,e,t)};Z().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Le&&(e=[e]),ot([this,...e],t)};Z().prototype.conv1d=function(e,t,n,a,r,s){return this.throwIfDisposed(),gc(this,e,t,n,a,r,s)};Z().prototype.conv2dTranspose=function(e,t,n,a,r){return this.throwIfDisposed(),xc(this,e,t,n,a,r)};Z().prototype.conv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),ar(this,e,t,n,a,r,s)};Z().prototype.cos=function(){return this.throwIfDisposed(),Hu(this)};Z().prototype.cosh=function(){return this.throwIfDisposed(),bc(this)};Z().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),vc(this,e,t,n)};Z().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),lA(this,e,t)};Z().prototype.depthwiseConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),hl(this,e,t,n,a,r,s)};Z().prototype.dilation2d=function(e,t,n,a,r){return this.throwIfDisposed(),uA(this,e,t,n,a,r)};Z().prototype.divNoNan=function(e){return this.throwIfDisposed(),dA(this,e)};Z().prototype.div=function(e){return this.throwIfDisposed(),ge(this,e)};Z().prototype.dot=function(e){return this.throwIfDisposed(),Db(this,e)};Z().prototype.elu=function(){return this.throwIfDisposed(),fl(this)};Z().prototype.equal=function(e){return this.throwIfDisposed(),Fr(this,e)};Z().prototype.erf=function(){return this.throwIfDisposed(),pA(this)};Z().prototype.exp=function(){return this.throwIfDisposed(),qn(this)};Z().prototype.expandDims=function(e){return this.throwIfDisposed(),on(this,e)};Z().prototype.expm1=function(){return this.throwIfDisposed(),cA(this)};Z().prototype.fft=function(){return this.throwIfDisposed(),td(this)};Z().prototype.flatten=function(){return this.throwIfDisposed(),H(this,[this.size])};Z().prototype.floor=function(){return this.throwIfDisposed(),ml(this)};Z().prototype.floorDiv=function(e){return this.throwIfDisposed(),fc(this,e)};Z().prototype.gather=function(e,t){return this.throwIfDisposed(),ci(this,e,t)};Z().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Dr(this,e)};Z().prototype.greater=function(e){return this.throwIfDisposed(),oa(this,e)};Z().prototype.ifft=function(){return this.throwIfDisposed(),xl(this)};Z().prototype.irfft=function(){return this.throwIfDisposed(),Pc(this)};Z().prototype.isFinite=function(){return this.throwIfDisposed(),zb(this)};Z().prototype.isInf=function(){return this.throwIfDisposed(),_b(this)};Z().prototype.isNaN=function(){return this.throwIfDisposed(),fA(this)};Z().prototype.leakyRelu=function(e){return this.throwIfDisposed(),qu(this,e)};Z().prototype.lessEqual=function(e){return this.throwIfDisposed(),hi(this,e)};Z().prototype.less=function(e){return this.throwIfDisposed(),kc(this,e)};Z().prototype.localResponseNormalization=function(e,t,n,a){return this.throwIfDisposed(),mA(this,e,t,n,a)};Z().prototype.logSigmoid=function(){return this.throwIfDisposed(),Wb(this)};Z().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Nc(this,e)};Z().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),gA(this,e,t)};Z().prototype.log=function(){return this.throwIfDisposed(),Fn(this)};Z().prototype.log1p=function(){return this.throwIfDisposed(),Ic(this)};Z().prototype.logicalAnd=function(e){return this.throwIfDisposed(),la(this,e)};Z().prototype.logicalNot=function(){return this.throwIfDisposed(),Xu(this)};Z().prototype.logicalOr=function(e){return this.throwIfDisposed(),Tc(this,e)};Z().prototype.logicalXor=function(e){return this.throwIfDisposed(),Ub(this,e)};Z().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Be(this,e,t,n)};Z().prototype.maxPool=function(e,t,n,a){return this.throwIfDisposed(),Ku(this,e,t,n,a)};Z().prototype.max=function(e,t){return this.throwIfDisposed(),Xn(this,e,t)};Z().prototype.maximum=function(e){return this.throwIfDisposed(),Pa(this,e)};Z().prototype.mean=function(e,t){return this.throwIfDisposed(),kt(this,e,t)};Z().prototype.min=function(e,t){return this.throwIfDisposed(),Al(this,e,t)};Z().prototype.minimum=function(e){return this.throwIfDisposed(),yl(this,e)};Z().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),bA(this,e,t)};Z().prototype.mod=function(e){return this.throwIfDisposed(),vA(this,e)};Z().prototype.mul=function(e){return this.throwIfDisposed(),B(this,e)};Z().prototype.neg=function(){return this.throwIfDisposed(),wt(this)};Z().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Vc(this,e,t,n)};Z().prototype.notEqual=function(e){return this.throwIfDisposed(),Ai(this,e)};Z().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),ol(this,e,t,n)};Z().prototype.onesLike=function(){return this.throwIfDisposed(),Dn(this)};Z().prototype.pad=function(e,t){return this.throwIfDisposed(),rr(this,e,t)};Z().prototype.pool=function(e,t,n,a,r){return this.throwIfDisposed(),qb(this,e,t,n,a,r)};Z().prototype.pow=function(e){return this.throwIfDisposed(),sr(this,e)};Z().prototype.prelu=function(e){return this.throwIfDisposed(),Yu(this,e)};Z().prototype.prod=function(e,t){return this.throwIfDisposed(),Cc(this,e,t)};Z().prototype.reciprocal=function(){return this.throwIfDisposed(),IA(this)};Z().prototype.relu=function(){return this.throwIfDisposed(),La(this)};Z().prototype.relu6=function(){return this.throwIfDisposed(),Mc(this)};Z().prototype.reshapeAs=function(e){return this.throwIfDisposed(),H(this,e.shape)};Z().prototype.reshape=function(e){return this.throwIfDisposed(),H(this,e)};Z().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),p3(this,e,t,n)};Z().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),c3(this,e,t,n)};Z().prototype.reverse=function(e){return this.throwIfDisposed(),On(this,e)};Z().prototype.rfft=function(){return this.throwIfDisposed(),nd(this)};Z().prototype.round=function(){return this.throwIfDisposed(),SA(this)};Z().prototype.rsqrt=function(){return this.throwIfDisposed(),Fc(this)};Z().prototype.selu=function(){return this.throwIfDisposed(),$c(this)};Z().prototype.separableConv2d=function(e,t,n,a,r,s){return this.throwIfDisposed(),NA(this,e,t,n,a,r,s)};Z().prototype.sigmoid=function(){return this.throwIfDisposed(),wn(this)};Z().prototype.sign=function(){return this.throwIfDisposed(),TA(this)};Z().prototype.sin=function(){return this.throwIfDisposed(),Dc(this)};Z().prototype.sinh=function(){return this.throwIfDisposed(),Oc(this)};Z().prototype.slice=function(e,t){return this.throwIfDisposed(),Me(this,e,t)};Z().prototype.softmax=function(e){return this.throwIfDisposed(),ed(this,e)};Z().prototype.softplus=function(){return this.throwIfDisposed(),fi(this)};Z().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Zu(this,e,t)};Z().prototype.split=function(e,t){return this.throwIfDisposed(),ln(this,e,t)};Z().prototype.sqrt=function(){return this.throwIfDisposed(),Jt(this)};Z().prototype.square=function(){return this.throwIfDisposed(),st(this)};Z().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Lc(this,e)};Z().prototype.squeeze=function(e){return this.throwIfDisposed(),Or(this,e)};Z().prototype.stack=function(e,t){this.throwIfDisposed();let n=e instanceof Le?[this,e]:[this,...e];return zn(n,t)};Z().prototype.step=function(e){return this.throwIfDisposed(),bl(this,e)};Z().prototype.stridedSlice=function(e,t,n,a,r,s,i,o){return this.throwIfDisposed(),CA(this,e,t,n,a,r,s,i,o)};Z().prototype.sub=function(e){return this.throwIfDisposed(),ye(this,e)};Z().prototype.sum=function(e,t){return this.throwIfDisposed(),Te(this,e,t)};Z().prototype.tan=function(){return this.throwIfDisposed(),RA(this)};Z().prototype.tanh=function(){return this.throwIfDisposed(),di(this)};Z().prototype.tile=function(e){return this.throwIfDisposed(),$r(this,e)};Z().prototype.toBool=function(){return this.throwIfDisposed(),Ae(this,"bool")};Z().prototype.toFloat=function(){return this.throwIfDisposed(),Ae(this,"float32")};Z().prototype.toInt=function(){return this.throwIfDisposed(),Ae(this,"int32")};Z().prototype.topk=function(e,t){return this.throwIfDisposed(),MA(this,e,t)};Z().prototype.transpose=function(e){return this.throwIfDisposed(),Ze(this,e)};Z().prototype.unique=function(e){return this.throwIfDisposed(),Bc(this,e)};Z().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),FA(this,e,t)};Z().prototype.unstack=function(e){return this.throwIfDisposed(),ua(this,e)};Z().prototype.where=function(e,t){return this.throwIfDisposed(),In(e,this,t)};Z().prototype.zerosLike=function(){return this.throwIfDisposed(),Ue(this)};var uw={kernelName:eo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,bl(Ae(n,"float32"),-1))}}},OJ={kernelName:to,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=st(Ae(n,"float32")),r=Jt(ye(Ie(1),a));return wt(ge(e,r))}}}},zJ={kernelName:no,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Jt(ye(st(Ae(n,"float32")),1));return ge(e,a)}}}},_J={kernelName:kr,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=e,i=zt(n.shape,r);return i.length>0&&(s=Te(s,i)),H(s,n.shape)},b:()=>{let s=e,i=zt(a.shape,r);return i.length>0&&(s=Te(s,i)),H(s,a.shape)}}}},PJ={kernelName:is,saveAllInputs:!0,gradFunc:(e,t)=>{let n={};return t.forEach((a,r)=>{n[r]=()=>e.clone()}),n}},LJ={kernelName:os,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},WJ={kernelName:hu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Ue(n)}}},BJ={kernelName:so,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Jt(ye(Ie(1),st(Ae(n,"float32")))))}}},VJ={kernelName:io,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=Jt(se(Ie(1),st(Ae(n,"float32"))));return ge(e,a)}}}},jJ={kernelName:uo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=se(st(n),st(a)),i=B(e,ge(a,s)),o=zt(n.shape,r);return o.length>0&&(i=Te(i,o)),H(i,n.shape)},b:()=>{let s=se(st(n),st(a)),i=wt(B(e,ge(n,s))),o=zt(a.shape,r);return o.length>0&&(i=Te(i,o)),H(i,a.shape)}}}},UJ={kernelName:oo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(st(Ae(n,"float32")),1))}}},HJ={kernelName:lo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,ye(Ie(1),st(Ae(n,"float32"))))}}};function GJ(e,t,n,a,r,s){let i=M(e,"dy","avgPool3dGrad"),o=M(t,"input","avgPool3dGrad"),l=i,d=o,u=!1;o.rank===4&&(u=!0,l=H(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),d=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),F(l.rank===5,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),F(d.rank===5,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${d.rank}.`),s!=null&&F(Vt(r),()=>`Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${s} but got pad ${r}.`);let p={dy:l,input:d},c={filterSize:n,strides:a,pad:r,dimRoundingMode:s},h=D.runKernel(Tp,p,c);return u?H(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}var qJ=O({avgPool3dGrad_:GJ}),XJ={kernelName:fu,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i,dimRoundingMode:o}=n;return{x:()=>qJ(e,a,r,s,i,o)}}};function KJ(e,t,n,a,r){let s=M(e,"dy","avgPoolGrad"),i=M(t,"input","avgPoolGrad");F(i.rank===s.rank,()=>`Rank of input (${i.rank}) does not match rank of dy (${s.rank})`);let o=i,l=s,d=!1;i.rank===3&&(d=!0,o=H(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=H(s,[1,s.shape[0],s.shape[1],s.shape[2]])),F(l.rank===4,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),F(o.rank===4,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`);let u={dy:l,input:o},p={filterSize:n,strides:a,pad:r},c=D.runKernel(Np,u,p);return d?H(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var ZJ=O({avgPoolGrad_:KJ}),YJ={kernelName:ls,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{filterSize:r,strides:s,pad:i}=n;return{x:()=>ZJ(e,a,r,s,i)}}},JJ={kernelName:us,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{let[a,r]=t,{transposeA:s,transposeB:i}=n;return!s&&!i?{a:()=>Be(e,r,!1,!0),b:()=>Be(a,e,!0,!1)}:!s&&i?{a:()=>Be(e,r,!1,!1),b:()=>Be(e,a,!0,!1)}:s&&!i?{a:()=>Be(r,e,!1,!0),b:()=>Be(a,e,!1,!1)}:{a:()=>Be(r,e,!0,!0),b:()=>Be(e,a,!0,!0)}}},QJ={kernelName:mu,gradFunc:(e,t,n)=>{let{blockShape:a,crops:r}=n;return{x:()=>Zu(e,a,r)}}},eQ={kernelName:Tx,gradFunc:(e,t,n)=>{let a=n,r=a.inputShape,s=a.shape,i=Array.from(s);for(let l=r.length-1;l>=0;l--)if(r[l]===s[l])i[l]=1;else if(r[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);let o=[];for(let l=0;l1&&o.push(l);return{x:()=>Te(e,o,!0)}}},tQ={kernelName:ds,gradFunc:e=>({x:()=>e.clone()})},nQ={kernelName:ps,gradFunc:e=>({x:()=>Ue(e)})},aQ={kernelName:Ir,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>In(la(Dr(a,r),hi(a,s)),e,Ue(e))}}},rQ={kernelName:Au,inputsToSave:["x"],gradFunc:uw.gradFunc},sQ={kernelName:po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let a=t.map(o=>o.shape),{axis:r}=n,s=sa(r,t[0].shape)[0],i=a.map(o=>o[s]);return ln(e,i,s).map(o=>()=>o)}},iQ={kernelName:cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{dilations:s,strides:i,pad:o,dataFormat:l}=n;return F(Mr(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>iA(a.shape,e,r,i,o,l),filter:()=>zA(a,e,r.shape,i,o,l)}}},oQ={kernelName:hs,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,{strides:s,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>ar(e,r,s,i,o,1,l),filter:()=>zA(e,a,r.shape,s,i,o,l)}}};function lQ(e,t,n,a,r){let s=e;e.rank===4&&(s=H(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;i.rank===4&&(i=H(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),F(s.rank===5,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),F(i.rank===5,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`),F(n.length===5,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),F(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),F(i.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`);let o={x:s,dy:i},l={strides:a,pad:r,filterShape:n};return D.runKernel(Mp,o,l)}var uQ=O({conv3DBackpropFilter_:lQ}),dQ={kernelName:yu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s}=n;F(Mr(a),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`);let[i,o]=t;return{x:()=>Mb(i.shape,e,o,r,s),filter:()=>uQ(i,e,o.shape,r,s)}}},pQ={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(wt(Dc(Ae(n,"float32"))),e)}}},cQ={kernelName:co,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Oc(Ae(n,"float32")),e)}}},hQ={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r,exclusive:s,reverse:i}=n;return{x:()=>{let o=jb([r],a.rank),l=vc(e,r,s,!i);return o!=null&&(l=Ze(l,o)),l}}}},fQ={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let{dilations:a,strides:r,pad:s,dimRoundingMode:i}=n,o=a==null?[1,1]:a;F(Mr(o),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`);let[l,d]=t;return F(l.rank===4,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),F(d.rank===4,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${d.rank}.`),F(l.shape[3]===d.shape[2],()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),F(za(r,o),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`),i!=null&&F(Vt(s),()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`),{x:()=>r3(l.shape,e,d,r,s,a,i),filter:()=>a3(l,e,d.shape,r,s,a,i)}}},mQ={kernelName:gu,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{let[a,r]=t,s={x:a,filter:r,dy:e},i={x:a,filter:r,dy:e};return{x:()=>D.runKernel(_p,s,n),filter:()=>D.runKernel(Pp,i,n)}}},AQ={kernelName:mo,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t,a={dy:e,y:n};return{x:()=>D.runKernel(Wp,a)}}},yQ={kernelName:Ao,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(qn(wt(st(n))),2/Math.sqrt(Math.PI));return{x:()=>B(e,a)}}},gQ={kernelName:gs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,n)}}},xQ={kernelName:go,inputsToSave:["input"],gradFunc:(e,t)=>{let[n]=t;return{input:()=>H(e,n.shape)}}},bQ={kernelName:xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,qn(n))}}},vQ={kernelName:xs,gradFunc:e=>({x:()=>Ue(e)})},wQ={kernelName:bs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=ge(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);i.length>0&&(s=H(Te(s,i),a.shape));let o=st(a);return wt(ge(s,Ae(o,"float32")))}}}},kQ={kernelName:vs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{let{varianceEpsilon:a}=n,[r,s,i,o]=t,l=o==null?Ie(1):o,d=zt(s.shape,r.shape),u=[];if(s.rank===1){for(let f=0;fs.rank===1?H(B(B(e,$r(H(h,[1,1,1,s.shape[0]]),u)),l),r.shape):H(B(B(e,h),l),r.shape),mean:()=>{let f=B(B(h,Ie(-1)),c);return s.rank===1&&(f=Te(f,d)),H(f,s.shape)},variance:()=>{let f=B(B(m,p),c);return s.rank===1&&(f=Te(f,d)),H(f,s.shape)},scale:()=>{let f=B(p,h),A=B(e,f);return s.rank===1&&(A=Te(A,d)),H(A,s.shape)},offset:()=>{let f=e;return s.rank===1&&(f=Te(f,d)),H(f,s.shape)}}}},IQ={kernelName:vo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{let[a,r]=t,{axis:s}=n,i=sa(s,a.shape)[0];return{x:()=>{let o=a.shape,l=r.size,d=o.slice(0,i),u=d.length,p=o.slice(s,o.length).slice(1),c=p.length,h=dw(0,u),m=dw(u+1,u+1+c),f=pw([d,[l],p]),A=H(e,f),y=H(r,[l]),g=pw([[u],h,m]),x=Ze(A,g),k=FA(x,y,a.shape[i]),b=yA(g);return k=Ze(k,b),k},indices:()=>r}}};function dw(e,t){let n=[];for(let a=e;a{let[n,a]=t;return{a:()=>Ue(n),b:()=>Ue(a)}}},NQ={kernelName:ks,gradFunc:e=>({x:()=>Ae(e,"float32")})},TQ={kernelName:Io,gradFunc:e=>({x:()=>Ue(e)})},EQ={kernelName:So,gradFunc:e=>({x:()=>Ue(e)})},CQ={kernelName:No,gradFunc:e=>({x:()=>Ue(e)})},RQ={kernelName:Is,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{alpha:r}=n,s=oa(a,0);return{x:()=>In(s,e,B(e,r))}}},MQ={kernelName:Co,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,se(n,1))}}},FQ={kernelName:Ss,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,Ae(n,"float32"))}}},$Q={kernelName:Ex,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n;return{logits:()=>{let s=!0,i=qn(a);return ye(e,B(Te(e,r,s),i))}}}};function DQ(e,t,n,a=5,r=1,s=1,i=.5){let o={x:e,y:t,dy:n},l={depthRadius:a,bias:r,alpha:s,beta:i};return D.runKernel(Hp,o,l)}var OQ=O({localResponseNormalizationBackprop_:DQ}),zQ={kernelName:wu,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;return{x:()=>OQ(a,r,e,s,i,o,l)}}};function cw(e,t,n,a){return t.rankB(e,Ae(Fr(n,t),e.dtype))}}var hw={kernelName:Ns,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{reductionIndices:r}=a,s=t[0],i=t[1],o=sa(r,s.shape),l=cw(e,i,s,o);return{x:()=>l.x()}}},_Q={kernelName:Ts,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,Ae(Dr(n,a),"float32")),b:()=>B(e,Ae(kc(n,a),"float32"))}}};function PQ(e,t,n,a,r,s,i){let o=M(e,"dy","maxPool3dGrad"),l=M(t,"input","maxPool3dGrad"),d=M(n,"output","maxPool3dGrad"),u=o,p=l,c=d,h=!1;l.rank===4&&(h=!0,u=H(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),p=H(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),c=H(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),F(u.rank===5,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`),F(p.rank===5,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${p.rank}.`),F(c.rank===5,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${c.rank}.`),i!=null&&F(Vt(s),()=>`Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let m={dy:u,input:p,output:c},f={filterSize:a,strides:r,pad:s,dimRoundingMode:i},A=D.runKernel(qp,m,f);return h?H(A,[A.shape[1],A.shape[2],A.shape[3],A.shape[4]]):A}var LQ=O({maxPool3dGrad_:PQ}),WQ={kernelName:ku,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>LQ(e,a,r,s,i,o,l)}}};function BQ(e,t,n,a,r,s,i){let o=M(e,"dy","maxPoolGrad"),l=M(t,"input","maxPoolGrad"),d=M(n,"output","maxPoolGrad");F(l.rank===o.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`),F(o.rank===4,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`),F(l.rank===4,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),i!=null&&F(Vt(s),()=>`Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${i} but got pad ${s}.`);let u={dy:o,input:l,output:d},p={filterSize:a,strides:r,pad:s,dimRoundingMode:i};return D.runKernel(Gp,u,p)}var VQ=O({maxPoolGrad_:BQ}),jQ={kernelName:Es,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a,r]=t,{filterSize:s,strides:i,pad:o}=n;return{x:()=>VQ(e,a,r,s,i,o)}}},UQ={kernelName:Cs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{axis:r}=n,s=sa(r,a.shape),i=Vb(a.shape,s)[1],o=Tt(i);return{x:()=>{let l=a.shape.slice();s.forEach(u=>{l[u]=1});let d=H(e,l);return ge(B(d,$n(a.shape,"float32")),o)}}}},HQ={kernelName:Rs,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{let a=n,{axis:r}=a,[s,i]=t,o=sa(r,s.shape),l=cw(e,i,s,o);return{x:()=>l.x()}}},GQ={kernelName:Ms,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t;return{a:()=>B(e,Ae(hi(n,a),"float32")),b:()=>B(e,Ae(oa(n,a),"float32"))}}},qQ={kernelName:Fs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Me(e,s,a.shape)}}},XQ={kernelName:Mo,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=zt(n.shape,r);return s.length>0?H(Te(e,s),n.shape):e},b:()=>{let s=B(e,wt(ml(ge(n,a)))),i=zt(a.shape,r);return i.length>0?H(Te(s,i),a.shape):s}}}},KQ={kernelName:$s,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=B(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);return i.length>0?H(Te(s,i),a.shape):s}}}},ZQ={kernelName:Fo,gradFunc:e=>({x:()=>wt(e)})},YQ={kernelName:Ds,inputsToSave:["indices"],gradFunc:(e,t)=>{let n=t[0];return{indices:()=>Ct(n.shape,"float32")}}},JQ={kernelName:_o,gradFunc:e=>({x:()=>Ue(e)})},QQ={kernelName:Po,saveAllInputs:!0,gradFunc:(e,t,n)=>{let{axis:a}=n;return ua(e,a).map(r=>()=>r)}},fw={kernelName:Os,inputsToSave:["x"],gradFunc:(e,t,n)=>{let a=t[0],{paddings:r}=n,s=r.map(i=>i[0]);return{x:()=>Me(e,s,a.shape)}}},eee={kernelName:zs,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{let[n,a,r]=t,s=n,i=a,o=ct(s.shape,i.shape);return{a:()=>{let l=Ae(i,"float32"),d=B(e,B(l,sr(s,ye(l,Ie(1))))),u=zt(s.shape,o);return u.length>0&&(d=Te(d,u)),H(d,s.shape)},b:()=>{let l=oa(s,0),d=In(l,Fn(s),Ue(s)),u=B(e,B(r,d)),p=zt(i.shape,o);return p.length>0&&(u=Te(u,p)),H(u,i.shape)}}}},tee={kernelName:_s,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{let[n,a]=t,r=oa(n,0);return{x:()=>In(r,e,B(e,a)),alpha:()=>{let s=In(r,Ue(e),B(e,n)),i=zt(a.shape,e.shape);return i.length>0&&(s=Te(s,i)),H(s,a.shape)}}}},nee={kernelName:ys,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=ge(e,Ae(a,"float32")),i=zt(n.shape,r);return i.length>0?H(Te(s,i),n.shape):s},b:()=>{let s=B(e,Ae(n,"float32")),i=zt(a.shape,r);i.length>0&&(s=H(Te(s,i),a.shape));let o=st(a);return wt(ge(s,Ae(o,"float32")))}}}},aee={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,wt(st(n)))}}},ree={kernelName:Ws,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t,a=B(hi(n,6),bl(n));return{x:()=>B(e,Ae(a,"float32"))}}},see={kernelName:Ps,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,Ae(bl(n),"float32"))}}},iee={kernelName:Bo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>H(e,n.shape)}}},oee={kernelName:Ls,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>D.runKernel(Jp,r,n)}}},lee={kernelName:Su,inputsToSave:["images"],gradFunc:(e,t,n)=>{let[a]=t,r={dy:e,images:a};return{images:()=>D.runKernel(Yp,r,n)}}},uee={kernelName:Bs,gradFunc:(e,t,n)=>{let{dims:a}=n,r=sa(a,e.shape);return{x:()=>On(e,r)}}},dee={kernelName:Vs,gradFunc:e=>({x:()=>Ue(e)})},pee={kernelName:js,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>wt(ge(e,B(sr(n,1.5),2)))}}},cee={kernelName:jo,inputsToSave:["condition"],gradFunc:(e,t)=>{let[n]=t;return{condition:()=>Ae(Ue(n),"float32"),t:()=>B(e,Ae(n,e.dtype)),e:()=>B(e,Ae(Xu(n),e.dtype))}}},hee={kernelName:Uo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>{let a=oa(n,Ie(0)),r=Ie(A3),s=Ie(y3),i=B(e,s),o=B(B(e,r),qn(Ae(n,"float32")));return In(a,i,o)}}}},fee={kernelName:Hs,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(n,ye(Ie(1),n)))}}},mee={kernelName:qo,gradFunc:e=>({x:()=>Ue(e)})},Aee={kernelName:Us,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(Hu(Ae(n,"float32")),e)}}},yee={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(bc(Ae(n,"float32")),e)}}},gee={kernelName:Ho,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{begin:r,size:s}=n,i=a.shape,[o,l]=hb(a,r,s),d=[];for(let u=0;urr(e,d)}}},xee={kernelName:Xs,outputsToSave:[!0],gradFunc:(e,t,n)=>{let[a]=t,{dim:r}=n,s=!0,i=B(e,a);return{logits:()=>ye(i,B(Te(i,[r],s),a))}}},bee={kernelName:Xo,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,wn(n))}}},mw={kernelName:Nu,gradFunc:(e,t,n)=>{let{blockShape:a,paddings:r}=n;return{x:()=>Uu(e,a,r)}}},Aw={kernelName:Ko,gradFunc:(e,t,n)=>{let{axis:a}=n;return{x:()=>ot(e,a)}}},vee={kernelName:Gs,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,B(Jt(Ae(n,"float32")),2))}}},wee={kernelName:Tu,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(e,B(Ae(n,"float32"),2))}}},kee={kernelName:Ks,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=Ie(2);return{a:()=>B(e,B(r,ye(n,a))),b:()=>B(e,B(r,ye(a,n)))}}},Iee={kernelName:Nr,gradFunc:e=>({x:()=>Ue(e)})},See={kernelName:Zs,inputsToSave:["a","b"],gradFunc:(e,t)=>{let[n,a]=t,r=ct(n.shape,a.shape);return{a:()=>{let s=e,i=zt(n.shape,r);return i.length>0&&(s=Te(s,i)),H(s,n.shape)},b:()=>{let s=e,i=zt(a.shape,r);return i.length>0&&(s=Te(s,i)),H(wt(s),a.shape)}}}},Nee={kernelName:qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,r=a.shape.slice(),{axis:s}=n;sa(s,a.shape).forEach(l=>{r[l]=1});let i=H(e,r),o=B(i,$n(a.shape,"float32"));return{x:()=>o}}},Tee={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>ge(e,st(Hu(n)))}}},Eee={kernelName:Js,outputsToSave:[!0],gradFunc:(e,t)=>{let[n]=t;return{x:()=>B(ye(Ie(1),st(n)),e)}}},Cee={kernelName:Sr,inputsToSave:["x"],gradFunc:(e,t,n)=>{let[a]=t,{reps:r}=n;return{x:()=>{let s=Ue(a);if(a.rank===1)for(let i=0;i{let a=n,{perm:r}=a,s=yA(r);return{x:()=>Ze(e,s)}}},Mee={kernelName:Jo,gradFunc:(e,t,n)=>{let a=n,{axis:r}=a;return{value:()=>zn(e,r)}}},$ee={kernelName:Eu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{let[n]=t;return{x:()=>Fee(e,n)}}};function Fee(e,t){let n=Pa(t,Ue(t)),a=ci(e,n),r=Dr(t,Ie(0,"int32")),s=a.rank-r.rank;for(let o=0;o({x:()=>Ue(e)})},Oee=[uw,OJ,zJ,_J,PJ,LJ,WJ,BJ,VJ,jJ,UJ,HJ,XJ,YJ,JJ,QJ,eQ,tQ,nQ,aQ,rQ,sQ,oQ,iQ,dQ,pQ,cQ,hQ,fQ,mQ,nee,AQ,yQ,gQ,xQ,bQ,wQ,vQ,kQ,IQ,SQ,NQ,TQ,EQ,CQ,RQ,MQ,FQ,$Q,zQ,hw,hw,_Q,WQ,jQ,UQ,HQ,GQ,qQ,XQ,KQ,ZQ,YQ,JQ,QQ,fw,fw,eee,tee,aee,ree,see,iee,oee,lee,uee,dee,pee,cee,hee,fee,mee,Aee,yee,gee,xee,bee,mw,mw,Aw,Aw,vee,kee,wee,Iee,See,Nee,Tee,Eee,Cee,Ree,Mee,$ee,Dee];for(let e of Oee)Cx(e);var yw={};Fe(yw,{maxNorm:()=>zee,minMaxNorm:()=>Lee,nonNeg:()=>Pee,unitNorm:()=>_ee});var N1;function _t(){return N1==null&&(N1=bb().epsilon()),N1}function wa(){return"channelsLast"}var ur=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,ur.prototype)}},ka=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,ka.prototype)}},W=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,W.prototype)}},Oe=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,Oe.prototype)}},gw=class extends Error{constructor(e){super(e);Object.setPrototypeOf(this,gw.prototype)}};function Ti(e,t){if(Array.isArray(e)){let n=[];for(let a=0;an.toUpperCase())}var da={};function T1(e){if(e==null)return null;let t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function E1(e){if(!(e==null||typeof e!="object"))if(Array.isArray(e))e.forEach(t=>E1(t));else{let t=Object.keys(e);for(let n of t){let a=e[n];a!=null&&typeof a=="object"&&(!Array.isArray(a)&&a.type==="ndarray"&&typeof a.value=="number"?e[n]=a.value:E1(a))}}}function wd(e,t={},n={},a="object",r=!1){if(typeof e=="string"){let s=e,i;if(s in n)i=n[s];else if(s in da)i=da[s];else if(i=t[s],i==null)throw new W(`Unknown ${a}: ${e}. This may be due to one of the following reasons: +1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}else{let s=e;if(s.className==null||s.config==null)throw new W(`${a}: Improper config format: ${JSON.stringify(s)}. +'className' and 'config' must set.`);let i=s.className,o,l;if(i in n?[o,l]=n[i]:i in da?[o,l]=da.className:i in t&&([o,l]=t[i]),o==null)throw new W(`Unknown ${a}: ${i}. This may be due to one of the following reasons: +1. The ${a} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${a} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(l!=null){let d={};for(let h of Object.keys(da))d[h]=da[h];for(let h of Object.keys(n))d[h]=n[h];let u=s.config;u.customObjects=d;let p=Object.assign({},da);for(let h of Object.keys(n))da[h]=n[h];E1(s.config);let c=l(o,s.config,n,r);return da=Object.assign({},p),c}else{let d=Object.assign({},da);for(let p of Object.keys(n))da[p]=n[p];let u=new o(s.config);return da=Object.assign({},d),u}}}function Wee(e,t){return et?1:0}function Ch(e,t){return-1*Wee(e,t)}function Br(e){if(e==null)return e;let t=[];for(let n of e)t.indexOf(n)===-1&&t.push(n);return t}function Bee(e){if(e==null)throw new W(`Invalid value in obj: ${JSON.stringify(e)}`);for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Ci(e,t,n){if(n!=null&&e.indexOf(n)<0)throw new W(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function C1(e,t,n=0,a=Infinity){return ja(n>=0),ja(a>=n),Array.isArray(e)&&e.length>=n&&e.length<=a&&e.every(r=>typeof r===t)}function Ht(e,t){Array.isArray(e)?(w.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((n,a)=>Ht(n,`element ${a+1} of ${t}`))):w.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${bw(e)}.`)}function bw(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>bw(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function Vee(e,t){let n=w.now(),a;return(...r)=>{let s=w.now();return s-nJt(Te(B(e,e),t,!0)))}var kd=class extends ae.Serializable{getConfig(){return{}}},M1=class extends kd{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=R1(e,this.axis),n=kn(t,0,this.maxValue);return B(e,ge(n,se(_t(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}};M1.className="MaxNorm";ae.registerClass(M1);var F1=class extends kd{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>ge(e,se(_t(),R1(e,this.axis))))}getConfig(){return{axis:this.axis}}};F1.className="UnitNorm";ae.registerClass(F1);var $1=class extends kd{apply(e){return La(e)}};$1.className="NonNeg";ae.registerClass($1);var D1=class extends kd{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return L(()=>{let t=R1(e,this.axis),n=se(B(this.rate,kn(t,this.minValue,this.maxValue)),B(1-this.rate,t));return B(e,ge(n,se(_t(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}};D1.className="MinMaxNorm";ae.registerClass(D1);var ww={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Pt(e){return T1(e)}function kw(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"constraint")}function Lt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in ww?ww[e]:e,config:{}};return kw(t)}else return e instanceof kd?e:kw(e)}function zee(e){return new M1(e)}function _ee(e){return new F1(e)}function Pee(){return new $1}function Lee(e){return new D1(e)}var Iw={};Fe(Iw,{constant:()=>Hee,glorotNormal:()=>Jee,glorotUniform:()=>Yee,heNormal:()=>Qee,heUniform:()=>ete,identity:()=>Kee,leCunNormal:()=>tte,leCunUniform:()=>nte,ones:()=>Uee,orthogonal:()=>ate,randomNormal:()=>qee,randomUniform:()=>Gee,truncatedNormal:()=>Xee,varianceScaling:()=>Zee,zeros:()=>jee});var rte=["channelsFirst","channelsLast"],ste=["nearest","bilinear"],ite=["valid","same","causal"],ote=["max","avg"],lte=["sum","mul","concat","ave"],_l=new Map;function Et(e){Ci(rte,"DataFormat",e)}function ute(e){Ci(ste,"InterpolationFormat",e)}function Qn(e){Ci(ite,"PaddingMode",e)}function Sw(e){Ci(ote,"PoolMode",e)}var Id=[],Nw="/";function Ri(e,t){Id.push(e);try{let n=t();return Id.pop(),n}catch(n){throw Id.pop(),n}}function dte(){return Id.length===0?"":Id.join(Nw)+Nw}function Ew(e){if(!Tw(e))throw new Error("Not a valid tensor name: '"+e+"'");return dte()+e}function Cw(e){if(!Tw(e))throw new Error("Not a valid tensor name: '"+e+"'");_l.has(e)||_l.set(e,0);let t=_l.get(e);if(_l.set(e,_l.get(e)+1),t>0){let n=`${e}_${t}`;return _l.set(n,1),n}else return e}var pte=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Tw(e){return!!e.match(pte)}function cte(e){return e===parseInt(e.toString(),10)}function Vr(e,t,n){t==null&&(t=0),n==null&&(n=e.length);let a=1;for(let r=t;r{if(e.shape.length!==2)throw new W(`repeat() expects a rank-2 tensor, but received a rank-${e.shape.length} tensor.`);let n=Nd(e,1);return O1(n,[1,t,1])})}function fte(e){let t=[Vr(e.shape)];return e.reshape(t)}function mte(e){if(e.rank<=1)throw new W(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);let t=[e.shape[0],Vr(e.shape,1)];return e.reshape(t)}function Mi(e,t,n){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:return EA(e,[t,0],[n,e.shape[1]]);case 3:return _c(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Qu(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Me(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Me(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new W(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function z1(e,t,n){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:return EA(e,[0,t],[e.shape[0],n]);case 3:return _c(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Qu(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function Rh(e,t,n,a){return L(()=>{switch(e.rank){case 1:return zc(e,t,n);case 2:switch(a){case 1:return Mi(e,t,n);case 2:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}case 3:switch(a){case 1:return Mi(e,t,n);case 2:return _c(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}case 4:switch(a){case 1:return Mi(e,t,n);case 2:return Qu(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Qu(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return z1(e,t,n);default:throw new W(`The axis is not within the rank of the tensor ${a}`)}default:throw new W(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function _1(e,t=-1){let n;return t<0&&(n=e[0].rank,n!==0?t=n:t=0),t===e[0].rank&&(t=-1),ot(e,t)}function Mw(e,t){switch(e.rank){case 1:return Eb([e,t]);case 2:return cl([e,t],0);case 3:return Cb([e,t],0);case 4:return Rb([e,t],0);default:throw new W(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function O1(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new W(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return $r(e,t)}function Mh(e,t=0,n=1,a,r){return Xb(e,t,n,a,r)}function Ua(e,t,n,a){if(e.rank<2||t.rank<2)throw new Oe(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){let r=e.shape.slice(-1)[0],s=t.shape.slice(-2)[0];if(r!==s)throw new Oe(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(e.rank===2&&t.rank===2){let r=!1,s=!1;return zr.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:a?P1(e.rank,a,wa()):null,activation:n})}else{let r=e.shape.slice(),s=r.pop();e=e.reshape([-1,s]);let i=t.shape.slice(),o=i.pop(),l=i.pop(),d=[...i,o],u=Array.from({length:t.rank},(m,f)=>f===0?t.rank-2:f<=t.rank-2?f-1:f);t=t.transpose(u).reshape([l,-1]);let p=[...r,...d],c=!1,h=!1;return zr.matMul({a:e,b:t,transposeA:c,transposeB:h,bias:a?P1(e.rank,a,wa()):null,activation:n}).reshape(p)}}function Fw(e,t,n){return L(()=>(Array.isArray(t)?t=nn(t,"int32"):t=t.toInt(),ci(e,t,n)))}function Td(e){return B(e,e)}function P1(e,t,n){let a=t.shape;if(t.rank!==1&&t.rank!==e)throw new W(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(e===5){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1,1]):t.reshape([1,a[3],a[0],a[1],a[2]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===4){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1,1]):t.reshape([1,a[2],a[0],a[1]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,1,a[0]]):t.reshape([1].concat(a))}else if(e===3){if(n==="channelsFirst")return a.length===1?t.reshape([1,a[0],1]):t.reshape([1,a[1],a[0]]);if(n==="channelsLast")return a.length===1?t.reshape([1,1,a[0]]):t.reshape([1].concat(a))}else if(e<3)return t;throw new W(`Unsupported input rank by biasAdd: ${t.rank}`)}function Sa(e,t,n){return L(()=>(n==null&&(n=wa()),Et(n),e.add(P1(e.rank,t,n))))}function Ate(e,t=1){if(t!==1)throw new Oe(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return fl(e)}function yte(e){return L(()=>ge(e,Ot(e).add(1)))}function $w(e,t,n,a){return L(()=>t3(e,t,n,a))}function gte(e){return L(()=>{let t=se(.5,B(.2,e));return kn(t,0,1)})}function Ed(e,t,n=!1){return n?e():t()}var xte=["fanIn","fanOut","fanAvg"],bte=["normal","uniform","truncatedNormal"];function vte(e){Ci(xte,"FanMode",e)}function wte(e){Ci(bte,"Distribution",e)}var pa=class extends ae.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}},L1=class extends pa{apply(e,t){return Ct(e,t)}};L1.className="Zeros";ae.registerClass(L1);var Fh=class extends pa{apply(e,t){return $n(e,t)}};Fh.className="Ones";ae.registerClass(Fh);var W1=class extends pa{constructor(e){super();if(typeof e!="object")throw new W(`Expected argument of type ConstantConfig but got ${e}`);if(e.value===void 0)throw new W(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return L(()=>B(Ie(this.value),$n(e,t)))}getConfig(){return{value:this.value}}};W1.className="Constant";ae.registerClass(W1);var B1=class extends pa{constructor(e){super();this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return gl(e,this.minval,this.maxval,t)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}};B1.className="RandomUniform";ae.registerClass(B1);var V1=class extends pa{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`randomNormal does not support dType ${t}.`);return Mh(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};V1.className="RandomNormal";ae.registerClass(V1);var j1=class extends pa{constructor(e){super();this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`truncatedNormal does not support dType ${t}.`);return Wc(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}};j1.className="TruncatedNormal";ae.registerClass(j1);var U1=class extends pa{constructor(e){super();this.gain=e.gain!=null?e.gain:1}apply(e,t){return L(()=>{if(e.length!==2||e[0]!==e[1])throw new W("Identity matrix initializer can only be used for 2D square matrices.");return B(this.gain,hA(e[0]))})}getConfig(){return{gain:this.gain}}};U1.className="Identity";ae.registerClass(U1);function kte(e,t="channelsLast"){let n,a;if(Et(t),e.length===2)n=e[0],a=e[1];else if([3,4,5].indexOf(e.length)!==-1){if(t==="channelsFirst"){let r=Vr(e,2);n=e[1]*r,a=e[0]*r}else if(t==="channelsLast"){let r=Vr(e,0,e.length-2);n=e[e.length-2]*r,a=e[e.length-1]*r}}else{let r=Vr(e);n=Math.sqrt(r),a=Math.sqrt(r)}return[n,a]}var Tn=class extends pa{constructor(e){super();if(e.scale<0)throw new W(`scale must be a positive float. Got: ${e.scale}`);this.scale=e.scale==null?1:e.scale,this.mode=e.mode==null?"fanIn":e.mode,vte(this.mode),this.distribution=e.distribution==null?"normal":e.distribution,wte(this.distribution),this.seed=e.seed}apply(e,t){let n=kte(e),a=n[0],r=n[1],s=this.scale;if(this.mode==="fanIn"?s/=Math.max(1,a):this.mode==="fanOut"?s/=Math.max(1,r):s/=Math.max(1,(a+r)/2),this.distribution==="normal"){let i=Math.sqrt(s);if(t=t||"float32",t!=="float32"&&t!=="int32")throw new Oe(`${this.getClassName()} does not support dType ${t}.`);return Wc(e,0,i,t,this.seed)}else{let i=Math.sqrt(3*s);return gl(e,-i,i,t)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}};Tn.className="VarianceScaling";ae.registerClass(Tn);var $h=class extends Tn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};$h.className="GlorotUniform";ae.registerClass($h);var Dh=class extends Tn{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Dh.className="GlorotNormal";ae.registerClass(Dh);var Oh=class extends Tn{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Oh.className="HeNormal";ae.registerClass(Oh);var zh=class extends Tn{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};zh.className="HeUniform";ae.registerClass(zh);var _h=class extends Tn{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};_h.className="LeCunNormal";ae.registerClass(_h);var Ph=class extends Tn{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:e==null?null:e.seed})}getClassName(){return Tn.className}};Ph.className="LeCunNormal";ae.registerClass(Ph);var H1=class extends pa{constructor(e){super();if(this.DEFAULT_GAIN=1,this.gain=e.gain==null?this.DEFAULT_GAIN:e.gain,this.seed=e.seed,this.seed!=null)throw new Oe("Random seed is not implemented for Orthogonal Initializer yet.")}apply(e,t){return L(()=>{if(e.length<2)throw new Oe("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${e[0]*e[1]}) elements: Slowness may result.`);let n=e[0]>e[1]?[e[1],e[0]]:e,a=Mh(n,0,1,"float32"),r=f3.gramSchmidt(a);return e[0]>e[1]&&(r=r.transpose()),B(this.gain,r)})}getConfig(){return{gain:this.gain,seed:this.seed}}};H1.className="Orthogonal";ae.registerClass(H1);var Dw={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Ow(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"initializer")}function It(e){return T1(e)}function At(e){if(typeof e=="string"){let t=e in Dw?Dw[e]:e;if(t==="GlorotNormal")return new Dh;if(t==="GlorotUniform")return new $h;if(t==="HeNormal")return new Oh;if(t==="HeUniform")return new zh;if(t==="LeCunNormal")return new _h;if(t==="LeCunUniform")return new Ph;{let n={};return n.className=t,n.config={},Ow(n)}}else return e instanceof pa?e:Ow(e)}function jee(){return new L1}function Uee(){return new Fh}function Hee(e){return new W1(e)}function Gee(e){return new B1(e)}function qee(e){return new V1(e)}function Xee(e){return new j1(e)}function Kee(e){return new U1(e)}function Zee(e){return new Tn(e)}function Yee(e){return new $h(e)}function Jee(e){return new Dh(e)}function Qee(e){return new Oh(e)}function ete(e){return new zh(e)}function tte(e){return new _h(e)}function nte(e){return new Ph(e)}function ate(e){return new H1(e)}var zw={};Fe(zw,{Layer:()=>Ge,RNN:()=>Ha,RNNCell:()=>Cd,activation:()=>Wte,add:()=>Kte,alphaDropout:()=>Fne,average:()=>Zte,averagePooling1d:()=>G1,averagePooling2d:()=>q1,averagePooling3d:()=>X1,avgPool1d:()=>sne,avgPool2d:()=>one,avgPool3d:()=>une,avgPooling1d:()=>ine,avgPooling2d:()=>lne,avgPooling3d:()=>dne,batchNormalization:()=>nne,bidirectional:()=>Ine,concatenate:()=>Yte,conv1d:()=>Mte,conv2d:()=>Fte,conv2dTranspose:()=>$te,conv3d:()=>Dte,conv3dTranspose:()=>Ote,convLstm2d:()=>bne,convLstm2dCell:()=>vne,cropping2D:()=>_te,dense:()=>Bte,depthwiseConv2d:()=>Lte,dot:()=>tne,dropout:()=>Vte,elu:()=>Ste,embedding:()=>Xte,flatten:()=>Ute,gaussianDropout:()=>Mne,gaussianNoise:()=>Rne,globalAveragePooling1d:()=>pne,globalAveragePooling2d:()=>cne,globalMaxPool1d:()=>Nne,globalMaxPool2d:()=>Tne,globalMaxPooling1d:()=>Pw,globalMaxPooling2d:()=>Lw,gru:()=>fne,gruCell:()=>mne,input:()=>_w,inputLayer:()=>Ite,layerNormalization:()=>ane,leakyReLU:()=>Tte,lstm:()=>Ane,lstmCell:()=>yne,masking:()=>$ne,maxPool1d:()=>Ene,maxPool2d:()=>Cne,maxPooling1d:()=>Ww,maxPooling2d:()=>Bw,maxPooling3d:()=>hne,maximum:()=>Jte,minimum:()=>Qte,multiply:()=>ene,permute:()=>qte,prelu:()=>Ete,reLU:()=>Nte,repeatVector:()=>Hte,reshape:()=>Gte,rnn:()=>wne,separableConv2d:()=>zte,simpleRNN:()=>gne,simpleRNNCell:()=>xne,softmax:()=>Cte,spatialDropout1d:()=>jte,stackedRNNCells:()=>kne,thresholdedReLU:()=>Rte,timeDistributed:()=>Sne,upSampling2d:()=>Pte,zeroPadding2d:()=>rne});var Dne=0;function Vw(){return Dne++}var Lh={};function Wh(e=""){return e in Lh||(Lh[e]=0),Lh[e]+=1,e+Lh[e].toString()}function K1(e){return Array.isArray(e)&&Array.isArray(e[0])}function Bh(e){return e.length===0?[]:Array.isArray(e[0])?e:[e]}function _e(e){let t;if(Array.isArray(e)){if(e.length!==1)throw new W(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function at(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(e.length===1)return e=e,e[0];throw new W(`Expected exactly 1 Shape; got ${e.length}`)}else return e}function Vh(e){let t=0;for(let n of e)n.shape.length===0?t+=1:t+=n.shape.reduce((a,r)=>a*r);return t}var jw="Variable",Uw=class{constructor(e,t="float32",n=jw,a=!0,r=null){this.dtype=t==null?"float32":t,this.shape=e.shape,this.id=Vw(),n=n==null?jw:n,this.originalName=Ew(n),this.name=Cw(this.originalName),this.trainable_=a,this.constraint=r,this.val=Zb(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),One(this.val,e),this.val.id!==e.id&&(this.val.assign(e),this.constraint!=null&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}};function One(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}function Z1(e){return e.map(t=>t.read())}function Y1(e){e.forEach(t=>{t[0].write(t[1])})}var Mt=class{constructor(e){this.dtype=e.dtype,this.shape=e.shape,e.shape!=null?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}},Na=class{constructor(e,t,n,a,r,s,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=a,this.callArgs=r,this.outputTensorIndex=i,this.id=Vw(),s!=null&&(this.originalName=Ew(s),this.name=Cw(this.originalName)),this.rank=t.length}},zne=0,jh=class{constructor(e,t){this.callArgs=t,this.id=zne++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(let n of e.inboundLayers)n!=null&&n.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){let e=[];for(let t of this.inboundLayers)t!=null?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}},_ne=0,Ge=class extends ae.Serializable{constructor(e={}){super();this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=_ne++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){let n=this.getClassName();t=dr(n)+"_"+Wh(n)}if(this.name=t,this.trainable_=e.trainable==null?!0:e.trainable,e.inputShape!=null||e.batchInputShape!=null){let n;if(e.batchInputShape!=null)n=e.batchInputShape;else if(e.inputShape!=null){let r=null;e.batchSize!=null&&(r=e.batchSize),n=[r].concat(e.inputShape)}this.batchInputShape=n;let a=e.dtype;a==null&&(a=e.inputDType),a==null&&(a="float32"),this.dtype=a}e.weights!=null?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(this.inboundNodes.length===0)throw new ka(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new W(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return Nn(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return Nn(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new ur(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(this.inboundNodes.length===0)throw new ur(`Layer ${this.name} is not connected, no input to return.`);return Nn(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(this.inboundNodes.length===0)throw new ur(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new ur(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return Nn(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map(e=>e())}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach(t=>t.trainable=e),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter(e=>e.trainable):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter(e=>!e.trainable).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){if(e=ft(e),this.inputSpec==null||this.inputSpec.length===0)return;let t=ft(this.inputSpec);if(e.length!==t.length)throw new W(`Layer ${this.name} expects ${t.length} inputs, but it received ${e.length} input tensors. Input received: ${e}`);for(let n=0;nr.maxNDim)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(r.minNDim!=null&&s=0?i[l]:i[i.length+l];if(d!=null&&[d,null].indexOf(u)===-1)throw new W(`Input ${n} is incompatible with layer ${this.name}: expected axis ${l} of input shape to have value ${d} but got shape ${i}.`)}}if(r.shape!=null)for(let i=0;i{if(!this.built){this.assertInputCompatibility(e);let s=[];for(let i of ft(e))s.push(i.shape);this.build(Nn(s)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),this._refCount===null&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t),i=ft(s),o=[];for(let l of i)n.indexOf(l)!==-1&&(l=l.clone()),o.push(l);if(s=Nn(o),this.activityRegularizer!=null)throw new Oe("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}else{let s=Pne(e),i=this.computeOutputShape(s),o,l=Lne(e);if(this.warnOnIncompatibleInputShape(Array.isArray(e)?s[0]:s),i!=null&&i.length>0&&Array.isArray(i[0])?o=i.map((d,u)=>new Na(l,d,this,ft(e),t,this.name,u)):o=new Na(l,i,this,ft(e),t,this.name),this.addInboundNode(e,o,null,null,s,i,t),this._refCount++,this.activityRegularizer!=null)throw new Oe("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return o}})}warnOnIncompatibleInputShape(e){if(this.batchInputShape!=null)if(e.length!==this.batchInputShape.length)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,a)=>{n!=null&&e[a]!=null&&e[a]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(this.inboundNodes==null||this.inboundNodes.length===0)throw new ur(`The layer ${this.name} has never been called and thus has no defined output shape.`);let e=[];for(let t of this.inboundNodes){let n=JSON.stringify(t.outputShapes);e.indexOf(n)===-1&&e.push(n)}if(e.length===1){let t=this.inboundNodes[0].outputShapes;return Array.isArray(t)&&Array.isArray(t[0])&&t.length===1?t[0]:t}else throw new ur(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new ka(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Vh(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Z1(e?this.trainableWeights:this.weights)}setWeights(e){L(()=>{let t=this.weights;if(t.length!==e.length)throw new W(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(t.length===0)return;let n=[],a=Z1(t);for(let r=0;rr.apply(l.read())),s==null&&(s=!0),s?this._trainableWeights.push(l):this._nonTrainableWeights.push(l),l}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){e==null||Array.isArray(e)&&e.length===0||(e=ft(e),this._losses!==void 0&&this._losses!==null&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(t!=null)if(Array.isArray(t))t.forEach(n=>{if(n!=null)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)});else throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);return null}return t}addInboundNode(e,t,n,a,r,s,i=null){let o=ft(e);t=ft(t),n=ft(n),a=ft(a),r=Bh(r),s=Bh(s);let l=[],d=[],u=[];for(let p of o)l.push(p.sourceLayer),d.push(p.nodeIndex),u.push(p.tensorIndex);new jh({outboundLayer:this,inboundLayers:l,nodeIndices:d,tensorIndices:u,inputTensors:o,outputTensors:t,inputMasks:n,outputMasks:a,inputShapes:r,outputShapes:s},i);for(let p=0;pe.dispose()),this.weights.length}assertNotDisposed(){if(this._refCount===0)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(this._refCount===null)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return--this._refCount==0&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}};function Pne(e){e=ft(e);let t=[];for(let n of e)t.push(n.shape);return Nn(t)}function Lne(e){return"float32"}function Hw(e,t,n){if((t==null||n!=null&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),t.inboundNodes.length===0)return[e];{let a=t.inboundNodes[n];if(a.inboundLayers.length===0)return a.inputTensors;{let r=[];for(let s=0;s0){let r=await Promise.all(t);for(let s=0;sse(this.totals[a],B(r,n)));this.totals[a]=i,s!=null&&s.dispose()}}}async onEpochEnd(e,t){if(t!=null)for(let n of this.params.metrics)this.totals[n]!=null&&(typeof this.totals[n]=="number"?t[n]=this.totals[n]/this.seen:L(()=>{let a=B(ge(1,this.seen),this.totals[n]);t[n]=a,this.totals[n].dispose(),jt(t[n])}))}},Zw=class extends Wl{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){t==null&&(t={}),this.epoch.push(e);for(let n in t)this.history[n]==null&&(this.history[n]=[]),this.history[n].push(t[n])}async syncData(){let e=[],t=[],n=[];for(let r in this.history){let s=this.history[r];for(let i=0;inew Yw(n,t))}var ca=class{constructor(){}static registerCallbackConstructor(e,t){w.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),ca.checkForDuplicate(t),ca.constructors[e]==null&&(ca.constructors[e]=[]),ca.constructors[e].push(t)}static checkForDuplicate(e){for(let t in ca.constructors)ca.constructors[+t].forEach(n=>{if(n===e)throw new W("Duplicate callback constructor.")})}static clear(){ca.constructors={}}static createCallbacks(e){let t=[];for(let n in ca.constructors){let a=+n;e>=a&&t.push(...ca.constructors[a])}return t.map(n=>new n)}};ca.constructors={};function Qw(e,t,n,a,r,s,i,o,l){let d=new Zw,u=[new Bne,...ca.createCallbacks(t)];e!=null&&u.push(...e),u.push(d);let p=new Kw(u);return p.setParams({epochs:n,initialEpoch:a,samples:r,steps:s,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:p,history:d}}function Ta(e,t={},n=!1){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"layer",n)}function Uh(e,t){return L(()=>{e.dtype!=="float32"&&(e=e.asType("float32"));let n=Te(Td(e),t,!0),a=Gu(n.shape,_t()),r=Jt(Pa(n,a));return ge(e,r)})}function Fi(e,t){return L(()=>kt(Td(ye(t,e)),-1))}function Hh(e,t){return L(()=>kt(Ot(ye(t,e)),-1))}function Bl(e,t){return L(()=>{let n=ye(e,t),a=kn(Ot(e),_t(),Number.MAX_VALUE),r=Ot(ge(n,a));return B(100,kt(r,-1))})}function Vne(e,t){return L(()=>{let n=kn(t,_t(),Number.MAX_VALUE),a=Fn(se(1,n)),r=kn(e,_t(),Number.MAX_VALUE),s=Fn(se(1,r));return kt(Td(ye(a,s)),-1)})}function jne(e,t){return L(()=>{let n=Pa(0,ye(1,B(e,t)));return kt(Td(n),-1)})}function Une(e,t){return L(()=>{let n=Pa(0,ye(1,B(e,t)));return kt(n,-1)})}function Hne(e,t){return L(()=>{let n=Te(B(e,t),-1),a=Xn(B(ye(1,e),t),-1);return Pa(0,se(1,ye(a,n)))})}function Gne(e,t){return L(()=>{let n=Math.log(2),a=ye(t,e),r=ye(se(a,fi(B(-2,a))),n);return kt(r,-1)})}function Rd(e,t,n=!1){return L(()=>{if(n)t=ed(t);else{let a=Te(t,t.shape.length-1,!0);t=ge(t,a)}return t=kn(t,_t(),1-_t()),wt(Te(B(e.toFloat(),Fn(t)),t.shape.length-1))})}function Gh(e,t,n=!1){return L(()=>{let a=ml(fte(e)).toInt();t=kn(t,_t(),1-_t());let r=t.shape,s=ol(a,r[r.length-1]).reshape(r);return Rd(s,t,n)})}function qne(e,t){if(!w.arraysEqual(e.shape,t.shape))throw new W(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return L(()=>{let n=t.relu(),a=t.abs().neg();return n.sub(t.mul(e)).add(a.exp().log1p())})}function qh(e,t){return L(()=>{let n;return n=kn(t,_t(),1-_t()),n=Fn(ge(n,ye(1,n))),kt(qne(e,n),-1)})}function Xne(e,t){return L(()=>{let n=kn(e,_t(),1),a=kn(t,_t(),1);return Te(B(e,Fn(ge(n,a))),-1)})}function Kne(e,t){return L(()=>{let n=Fn(se(_t(),t));return kt(ye(t,B(e,n)),-1)})}function J1(e,t){return L(()=>{let n=Uh(e,-1),a=Uh(t,-1),r=B(n,a);return wt(Te(r,-1))})}var Xh={meanSquaredError:Fi,meanAbsoluteError:Hh,meanAbsolutePercentageError:Bl,meanSquaredLogarithmicError:Vne,squaredHinge:jne,hinge:Une,categoricalHinge:Hne,logcosh:Gne,categoricalCrossentropy:Rd,sparseCategoricalCrossentropy:Gh,binaryCrossentropy:qh,kullbackLeiblerDivergence:Xne,poisson:Kne,cosineProximity:J1};function Q1(e){if(typeof e=="string"){if(e in Xh)return Xh[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new W(t)}else return e}function ey(e,t){return L(()=>{let n=B(.5,Dn(t)),a=Sd(oa(t,n),e.dtype);return kt(Fr(e,a),-1)})}function ty(e,t){return L(()=>Sd(Fr(Bu(e,-1),Bu(t,-1)),"float32"))}function e4(e,t){return L(()=>la(e.equal(1),t.equal(1)).sum().cast("float32"))}function Zne(e,t){return L(()=>la(e.equal(1),t.equal(0)).sum().cast("float32"))}function Yne(e,t){return L(()=>la(e.equal(0),t.equal(1)).sum().cast("float32"))}function t4(e,t){return L(()=>{let n=e4(e,t),a=Yne(e,t),r=n.add(a);return In(oa(r,0),n.div(r),0).cast("float32")})}function Jne(e,t){return L(()=>{let n=e4(e,t),a=Zne(e,t),r=n.add(a);return In(oa(r,0),n.div(r),0).cast("float32")})}function n4(e,t){return qh(e,t)}function a4(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),t=t.argMax(-1),t.dtype!==e.dtype&&(t=t.asType(e.dtype)),Fr(e,t).asType("float32")}var Qne=Fi,eae=Fi,tae=Hh,nae=Hh,aae=Bl,rae=Bl,ny=Rd,sae=J1,r4=Gh,Kh={binaryAccuracy:ey,categoricalAccuracy:ty,precision:t4,categoricalCrossentropy:ny,sparseCategoricalCrossentropy:r4,mse:Qne,MSE:eae,mae:tae,MAE:nae,mape:aae,MAPE:rae,cosine:sae};function iae(e){if(typeof e=="string"&&e in Kh)return Kh[e];if(typeof e!="string"&&e!=null)return e;throw new W(`Unknown metric ${e}`)}function Zh(e){if(ja(e!==null,`Unknown LossOrMetricFn ${e}`),typeof e=="string")return e;{let t;for(let n of Object.keys(Xh))if(Xh[n]===e){t=n;break}if(t!==void 0)return t;for(let n of Object.keys(Kh))if(Kh[n]===e){t=n;break}return t!==void 0?t:e.name}}function oae(e){let t={Adagrad:()=>gi.adagrad(.01),Adadelta:()=>gi.adadelta(1,.95,_t()),Adam:()=>gi.adam(.001,.9,.999,_t()),Adamax:()=>gi.adamax(.002,.9,.999,_t(),0),RMSProp:()=>gi.rmsprop(.001,.9,0,_t()),SGD:()=>gi.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new W(`Unknown Optimizer ${e}`)}var s4=1*1024*1024;function i4(e,t,n=!1){if(e==null||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype||!ay(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){let a=JSON.stringify(e);a.length>s4&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${a.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${s4}.`)}}function ay(e){if(e===null)return!0;if(typeof e=="object")if(Object.getPrototypeOf(e)===Object.prototype){let t=Object.keys(e);for(let n of t)if(typeof n!="string"||!ay(e[n]))return!1;return!0}else if(Array.isArray(e)){for(let t of e)if(!ay(t))return!1;return!0}else return!1;else{let t=typeof e;return t==="string"||t==="number"||t==="boolean"}}function cae(e,t,n,a=console.log){let r=uae(e),s=["Layer (type)","Output shape","Param #"];r?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(u=>Math.floor(t*u)));let i;if(!r){s.push("Receives inputs"),i=[];for(let u in e.nodesByDepth)i.push(...e.nodesByDepth[u])}a("_".repeat(t)),Yh(s,n,a),a("=".repeat(t));let o=e.layers;for(let u=0;u1||r.length===1&&r[0].inboundLayers.length>1){t=!1;break}a.push(...r)}if(t)for(let r of e.layers){let s=!1;for(let i of r.inboundNodes)if(a.indexOf(i)!==-1)if(s){t=!1;break}else s=!0;if(!t)break}return t}function Yh(e,t,n=console.log){let a="";for(let r=0;r0&&(a=a.slice(0,a.length-1)+" "),a+=e[r],a=a.slice(0,t[r]),a+=" ".repeat(t[r]-a.length);n(a)}function dae(e,t,n){let a;try{a=JSON.stringify(e.outputShape)}catch(o){a="multiple"}let r=e.name,s=e.getClassName(),i=[`${r} (${s})`,a,e.countParams().toString()];Yh(i,t,n)}function pae(e,t,n,a){let r;try{r=JSON.stringify(e.outputShape)}catch(u){r="multiple"}let s=[];for(let u of e.inboundNodes)if(!(n!=null&&n.length>0&&n.indexOf(u)===-1))for(let p=0;pm.name),l=[],d=t.names();for(let m of o)d.indexOf(m)!==-1?l.push(t.getValue(m)):l.push(null);a!=null&&(a.maxNumTensors=-Infinity,a.minNumTensors=Infinity);let u=o.join(",")+"|"+t.names().join(","),p,c;if(iy[u]==null){let m=fae(i,t);p=m.sorted,c=m.recipientCounts,iy[u]=p,l4[u]=c}p=iy[u],c={},r||Object.assign(c,l4[u]);let h=new $i(t);for(let m=0;ma.maxNumTensors&&(a.maxNumTensors=R),R0,()=>"Expected at least one fetch, got none");let n=[],a={};if(e.length===1){let r=u4(e[0],t);n=r.sorted,a=r.recipientMap}else{let r=new Set;for(let s of e){let{sorted:i,recipientMap:o}=u4(s,t);for(let l of i)r.has(l.name)||(n.push(l),r.add(l.name));for(let l in o)a[l]==null&&(a[l]=new Set),o[l].forEach(d=>a[l].add(d))}}return{sorted:n,recipientCounts:Aae(a)}}function Aae(e){let t={};for(let n in e)t[n]=e[n].size;return t}function u4(e,t){let n=new Set,a=[],r={};for(let o of t.names())n.add(o);let s=[],i=[];for(s.push(e);s.length>0;){let o=s[s.length-1];if(n.has(o.name)){s.pop();continue}let l=i[i.length-1]===s.length-1;if(o.inputs.length===0||l)s.pop(),a.push(o),n.add(o.name),l&&i.pop();else{i.push(s.length-1);for(let d of o.inputs)r[d.name]==null&&(r[d.name]=new Set),r[d.name].add(o.name),!n.has(d.name)&&s.push(d)}}return{sorted:a,recipientMap:r}}function mae(e){let t;if(e.sourceLayer.inboundNodes.length===1)t=e.sourceLayer.output;else{let n=null;for(let a=0;ay.name)}`);Br(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(y=>y.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(let y of this.outputs){let g=y.sourceLayer,x=y.nodeIndex,k=y.tensorIndex;this.outputLayers.push(g),this.outputLayersNodeIndices.push(x),this.outputLayersTensorIndices.push(k)}for(let y of this.inputs){let g=y.sourceLayer,x=y.nodeIndex,k=y.tensorIndex;ja(x===0,"input layer has >1 nodes"),ja(k===0,"input layer has >1 tensors"),this.inputLayers.push(g),this.inputLayersNodeIndices.push(x),this.inputLayersTensorIndices.push(k)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let y=0;yy.shape),this.internalOutputShapes=this.outputs.map(y=>y.shape);let t={},n={},a={},r={},s={},i=[],o=(y,g,x,k,b,v)=>{(k==null||b==null||v==null)&&(k=y.sourceLayer,b=y.nodeIndex,v=y.tensorIndex);let I=k.inboundNodes[b];if(x.indexOf(I)!==-1)throw new ka(`The tensor ${y.name} at layer "${k.name}" is part of a cycle.`);if(g.indexOf(I)!==-1)return;this.containerNodes.add(Ga.nodeKey(k,b)),k.id in s||(s[k.id]=Object.keys(s).length),x.indexOf(I)===-1&&x.push(I);let T=I.inboundLayers.length;for(let R=0;R=0;)x.splice(x.indexOf(I),1);i.push(I)},l=[],d=[];for(let y of this.outputs)o(y,l,d);let u=i.slice().reverse();for(let y of u){n[y.id]=y,y.id in t||(t[y.id]=0);let g=t[y.id],x=a[y.outboundLayer.id]==null?0:a[y.outboundLayer.id];g=Math.max(g,x),a[y.outboundLayer.id]=g,r[y.outboundLayer.id]=y.outboundLayer,t[y.id]=g;for(let k=0;kparseInt(y,10)).sort(Ch);this.layers=[];for(let y of h){let g=c[y];g.sort((x,k)=>{let b=s[x.id],v=s[k.id];return bv?1:0});for(let x of g)x instanceof Ga&&this.internalContainerRefs.push(x),this.layers.push(x)}this.layersByDepth=c,h=Object.keys(p).map(y=>parseInt(y,10)).sort(Ch);let m=this.inputs.slice(),f=[];for(let y of h)for(let g of p[y]){let x=g.outboundLayer;if(x!=null){for(let k of g.inputTensors)if(m.indexOf(k)===-1)throw new ka(`Graph disconnected: cannot obtain value for tensor ${k} at layer "${x.name}". The following previous layers were accessed without issue: ${f}`);for(let k of g.outputTensors)m.push(k);f.push(x.name)}}this.nodesByDepth=p;let A=this.layers.map(y=>y.name);for(let y of A){let g=A.filter(x=>x===y).length;if(g!==1)throw new ka(`The name "${y}" is used ${g} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(A))}this.outboundNodes=[],this.inboundNodes=[],new jh({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(y=>null),outputMasks:this.outputs.map(y=>null),inputShapes:this.inputs.map(y=>y.shape),outputShapes:this.outputs.map(y=>y.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();let e={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount==0){for(let t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(let t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach(t=>{t._trainableWeights.forEach(n=>n.trainable=e)}),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new W("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(let t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.layers)t.push(...n.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){let n={},a=0;for(let s of this.layers)for(let i of s.weights){if(n[i.originalName]!=null)throw new W(`Duplicate weight name: ${i.originalName}`);n[i.originalName]=i,a++}let r=[];for(let s in e){let i=s;if(n[s]==null){let o=s.split("/");i=o.slice(0,-2).concat([o[o.length-1]]).join("/")}if(n[i]!=null)r.push([n[i],e[s]]);else if(t)throw new W(`Provided weight data has no target variable: ${s}`);delete n[i]}if(t){let s=[];for(let i in n)s.push(i);if(s.length>0)throw new W(`${s.length} of ${a} weights are not set: ${s}`)}Y1(r)}updatedConfig(){let e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${sy}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){let n=ry(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return L(()=>{e=ft(e);let n=new $i;for(let a=0;a{e=ft(e);let n;return t==null?n=Ti(null,e.length):n=ft(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){let t=Bh(e);if(t.length!==this.inputLayers.length)throw new W(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);let n={};for(let i=0;iparseInt(i,10)).sort(Ch);if(a.length>1)for(let i of a){let o=this.nodesByDepth[i];for(let l of o){let d=l.outboundLayer;if(this.inputLayers.map(m=>m.id).indexOf(d.id)!==-1)continue;let u=[];for(let m=0;mparseInt(o,10)).sort(Ch);for(let o of a){let l=this.nodesByDepth[o];for(let d of l){let u=d.outboundLayer,p=d.inputTensors,c=d.outputTensors,h=new Array;for(let m of p)m.id in n&&h.push(n[m.id]);if(h.length===p.length){let m={},f,A,y,g;if(d.callArgs!=null&&(m=d.callArgs),h.length===1){let[x,k]=h[0];m.mask==null&&(m.mask=k),y=ft(u.call(x,m)),g=ft(u.computeMask(x,k)),f=[x],A=[k]}else f=h.map(x=>x[0]),A=h.map(x=>x[1]),m.mask==null&&(m.mask=A),y=ft(u.call(f,m)),g=ft(u.computeMask(f,A));if(u.activityRegularizer)throw new Oe("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let x=0;x{let e=[];for(let t of this.layers)for(let n=0;n0){let m=[];for(let f=0;f0&&f.apply(Nn(y),g)}function l(f){let A=f.name,y=Ta(f,t.customObjects!=null?t.customObjects:{});y.setFastWeightInitDuringBuild(a),r[A]=y,f.inboundNodes.forEach(g=>{if(!(g instanceof Array))throw new W(`Corrupted configuration, expected array for nodeData: ${g}`);i(y,g)})}let d=t.name,u=t.layers;for(let f of u)l(f);for(;!Bee(s);)for(let f of u){let A=r[f.name];if(A.name in s){let y=s[A.name];delete s[A.name];for(let g of y)o(A,g)}}let p=[],c=[],h=t.inputLayers;for(let f of h){let A=f[0],y=f[1],g=f[2];ja(A in r);let x=r[A].inboundNodes[y].outputTensors;p.push(x[g])}let m=t.outputLayers;for(let f of m){let A=f[0],y=f[1],g=f[2];ja(A in r);let x=r[A].inboundNodes[y].outputTensors;c.push(x[g])}return new e({inputs:p,outputs:c,name:d})}get stateful(){if(this._stateful)throw new W("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(let e of this.layers)if(e.stateful)return!0;return!1}resetStates(){L(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}};function yae(e,t,n){let a=t.length;if(e==null||Array.isArray(e)&&e.length===0)return t.map(r=>null);if(a===1)return Array.isArray(e)&&e.length===1?e:typeof e=="object"&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==a)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${a} outputs. Make sure a set of weights is provided for each model output.`);return e}else if(typeof e=="object"&&Object.keys(e).length>0&&typeof e[Object.keys(e)[0]]=="object"){let r=[];return t.forEach(s=>{s in e?r.push(e[s]):r.push(null)}),r}else throw new Error(`The model has multiple (${a}) outputs, so ${n} must be either an array with ${a} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function d4(e,t){return yae(e,t,"classWeight")}async function p4(e,t,n,a){if(t!=null||a!=null)throw new Error("Support sampleWeight is not implemented yet");if(n!=null){let r=L(()=>{if(e.shape.length===1)return e.clone();if(e.shape.length===2)if(e.shape[1]>1){let o=1;return e.argMax(o)}else{if(e.shape[1]===1)return e.reshape([e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}else throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)}),s=Array.from(await r.data());Ee(r);let i=[];return s.forEach(o=>{if(n[o]==null)throw new Error(`classWeight must contain all classes in the training data. The class ${o} exists in the data but not in classWeight`);i.push(n[o])}),nn(i,"float32")}else return null}function gae(e,t){return B(e,t)}var xae=32;function h4(e,t){let n,a,r=t;n=r.xs,a=r.ys,w.assert(n!=null&&a!=null,()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`);let s=c4("input",e.inputNames,n),i=c4("output",e.outputNames,a),o=s[0].shape[0];w.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),w.assert(i.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let l=0;l`Batch size mismatch: input ${e.inputNames[l]} has ${s[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);for(let l=0;l`Batch size mismatch: output ${e.outputNames[l]} has ${i[l].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`);return{xs:s,ys:i}}function c4(e,t,n){if(n instanceof Le)return[n];if(Array.isArray(n))return w.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{let a=[];for(let r of t){if(n[r]==null)throw new W(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);a.push(n[r])}return a}}function bae(e){if(e.length===3)throw new Oe("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}async function wae(e,t,n){let a=n.batchesPerEpoch!=null;if(w.assert(e.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),w.assert(n!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),w.assert(n.epochs!=null&&n.epochs>0&&Number.isInteger(n.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`),w.assert(!a||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),w.assert(n.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{let r=n.validationData!=null,s,i;if(r)if(f4(n.validationData))w.assert(n.validationBatches==null||n.validationBatches>0&&Number.isInteger(n.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`);else{let A=bae(n.validationData);s=A.xs,i=A.ys}let o=e.makeTrainFunction(),l=e.getDedupedMetricsNames(),d;r?d=l.slice().concat(l.map(A=>"val_"+A)):d=l.slice();let u=Jw(n.callbacks,n.yieldEvery),p=n.verbose==null?1:n.verbose,{callbackList:c,history:h}=Qw(u,p,n.epochs,null,null,vae(t,n),null,r,d);c.setModel(e),e.history=h,await c.onTrainBegin(),e.stopTraining_=!1;let m=n.initialEpoch==null?0:n.initialEpoch,f=await t.iterator();for(;m=n.batchesPerEpoch:x.done){if(r){let k;f4(n.validationData)?k=ft(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):k=ft(e.evaluate(s,i,{batchSize:n.validationBatchSize==null?xae:n.validationBatchSize,verbose:0}));for(let b=0;b0)throw new Oe("Verbose mode is not implemented yet.");w.assert(!a||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);let i=kae(t)?t:await t.iterator(),o=0,l=0;for(;a?l{if(d.value){let{xs:u,ys:p}=h4(e,d.value),c=u.concat(p),h=L(()=>r(c));if(Ee(c),l===0)for(let f=0;fse(s[f],B(m,A))),l>0&&Ee(y)}Ee(h),o+=m,++l}return s}),d.done){a&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let d=0;d0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function $d(e,t,n){return e==null?[null]:Array.isArray(e)?e.map(a=>Mi(a,t,n-t)):Mi(e,t,n-t)}function ly(e,t){return L(()=>e==null?null:Array.isArray(e)?e.map(n=>ly(n,t)):Fw(e,t.dtype==="int32"?t:t.toInt()))}function uy(e,t){let n=[],a=0,r=null;for(;a=e&&(r=e),n.push([a,r]),a=r;return n}async function Sae(e,t,n,a,r,s,i,o,l,d,u,p,c,h,m){r==null&&(r=32),s==null&&(s=1),u==null&&(u=!0),c==null&&(c=0);let f=!1;if(l!=null&&d!=null&&(f=!0),m!=null&&(f=!0,h==null))throw new W("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");let A=e.checkNumSamples(n,r,h,"steps_per_epoch"),y;A!=null&&(y=Ia(0,A)),i==null&&(i=1);let{callbackList:g,history:x}=Qw(o,i,s,c,A,h,r,f,p);g.setModel(e),e.history=x,await g.onTrainBegin(),e.stopTraining_=!1;for(let k=c;k{let $=I[T][0],z=I[T][1],_=Mi(v,$,z-$);R.batch=T,R.size=z-$;let V=ly(n,_),j=t(V);for(let U=0;U0){if(m=!0,a.validationData.length===2)i=a.validationData[0],o=a.validationData[1];else throw a.validationData.length===3?new Oe("validationData including sample weights is not supported yet."):new W(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${a.validationData} is invalid.`);let v=!0,I=await e.standardizeUserData(i,o,null,null,v,p);l=I[0],d=I[1],f=l.concat(d)}else if(a.validationSplit!=null&&a.validationSplit>0&&a.validationSplit<1){m=!0;let v=Math.floor(r[0].shape[0]*(1-a.validationSplit)),I=r[0].shape[0];l=$d(r,v,I),r=$d(r,0,v),d=$d(s,v,I),s=$d(s,0,v),f=l.concat(d)}else a.validationSteps!=null&&(m=!0);let A=r.concat(s).concat(u);e.checkTrainableWeightsConsistency();let y=e.makeTrainFunction(),g=e.getDedupedMetricsNames(),x,k;m?(e.makeTestFunction(),x=e.testFunction,k=g.slice().concat(g.map(v=>"val_"+v))):(x=null,f=[],k=g.slice());let b=Jw(a.callbacks,a.yieldEvery);return await Sae(e,y,A,g,p,a.epochs,a.verbose,b,x,f,a.shuffle,k,a.initialEpoch,null,null)}finally{e.isTraining=!1,Di(r,t),Di(s,n),Di(l,i),Di(d,o),u!=null&&Ee(u)}}function m4(e){let t=[];e instanceof Le&&(e=[e]);for(let n=0;nn.push(r.id));else if(t!=null)for(let r in t){let s=t[r];n.push(s.id)}let a=[];if(e instanceof Le)n.indexOf(e.id)===-1&&a.push(e);else if(Array.isArray(e))e.forEach(r=>{n.indexOf(r.id)===-1&&a.push(r)});else if(e!=null)for(let r in e){let s=e[r];n.indexOf(s.id)===-1&&a.push(s)}a.forEach(r=>{r.isDisposed||r.dispose()})}function Tae(e){return e instanceof Le}function dy(e){return Array.isArray(e)}function A4(e){return!Tae(e)&&!dy(e)}function y4(e,t,n,a=!0,r=""){if(t==null||t.length===0){if(e!=null){let i=!1;if(dy(e)&&e.length>0)i=!0;else if(A4(e)){for(let o in e)if(e.hasOwnProperty(o)){i=!0;break}}else i=!0;if(i)throw new W(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(e==null)return t.map(i=>null);let s;if(A4(e)){e=e,s=[];for(let i of t){if(e[i]==null)throw new W(`No data provided for "${i}". Need data for each key in: ${t}`);s.push(e[i])}}else if(dy(e)){if(e=e,e.length!==t.length)throw new W(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);s=e}else{if(e=e,t.length>1)throw new W(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=m4(s),n!=null)for(let i=0;i=0&&d!==u)throw new W(`Error when checking ${r}: expected ${t[i]} to have shape [${n[i]}], but got array with shape [${o.shape}].`)}}return s}function Eae(e,t,n){let a=Br(e.map(s=>s.shape[0]));a.sort();let r=Br(t.map(s=>s.shape[0]));if(r.sort(),a.length>1)throw new W(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(s=>s.shape))}`);if(r.length>1)throw new W(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(s=>s.shape))}`);if(a.length>0&&r.length>0&&!w.arraysEqual(a,r))throw new W(`Input Tensors should have the same number of samples as target Tensors. Found ${a[0]} input sample(s) and ${r[0]} target sample(s).`)}function Cae(e,t,n){let a=[Fi,qh,Rd];for(let r=0;r1)throw new W(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(n!=null)for(let i=0;i[]);let n;if(typeof e=="string"||typeof e=="function")n=[e];else if(Array.isArray(e)||typeof e=="object")n=e;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);if(Array.isArray(n))return t.map(a=>n);{let a=[];for(let r of t){let s=n.hasOwnProperty(r)?n[r]:[];Array.isArray(s)||(s=[s]),a.push(s)}return a}}var Mae="layers-model",pr=class extends Ga{constructor(e){super(e);this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new W("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");cae(this,e,t,n)}compile(e){if(e.loss==null&&(e.loss=[]),this.loss=e.loss,typeof e.optimizer=="string")this.optimizer_=oae(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof or))throw new W("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(!Array.isArray(e.loss)&&typeof e.loss!="string"&&typeof e.loss!="function"){e.loss=e.loss;for(let s in e.loss)if(this.outputNames.indexOf(s)===-1)throw new W(`Unknown entry in loss dictionary: "${s}". Only expected the following keys: ${this.outputNames}`);for(let s of this.outputNames)e.loss[s]==null&&console.warn(`Output "${s}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${s} during training`),t.push(Q1(e.loss[s]))}else if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new W(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);t=e.loss.map(s=>Q1(s))}else{let s=Q1(e.loss);this.outputs.forEach(i=>{t.push(s)})}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let s=0;s{for(let s=0;s1&&(this.metricsTensors.push([i,s]),this.metricsNames.push(this.outputNames[s]+"_loss"))}});let a=Rae(e.metrics,this.outputNames),r=(s,i,o)=>{this.outputNames.length>1&&(i=this.outputNames[s]+"_"+i),this.metricsNames.push(i),this.metricsTensors.push([o,s])};Ri("metric",()=>{for(let s=0;s{let l="",d,u,p;for(let c of o){if(typeof c=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(c)!==-1){let m=this.internalOutputShapes[s];m[m.length-1]===1||this.lossFunctions[s]===qh?["accuracy","acc"].indexOf(c)!==-1?u=ey:["crossentropy","ce"].indexOf(c)!==-1&&(u=n4):this.lossFunctions[s]===Gh?["accuracy","acc"].indexOf(c)!==-1?u=a4:["crossentropy","ce"].indexOf(c)!==-1&&(u=r4):["accuracy","acc"].indexOf(c)!==-1?u=ty:["crossentropy","ce"].indexOf(c)!==-1&&(u=ny);let f;["accuracy","acc"].indexOf(c)!==-1?f="acc":["crossentropy","ce"].indexOf(c)!==-1&&(f="ce"),p=u,d=l+f}else p=iae(c),d=l+Zh(c);let h;Ri(d,()=>{h=p}),r(s,d,h)}})(i)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){let a=n.batchSize==null?32:n.batchSize;oy(a);let r=!0,s=this.standardizeUserDataXY(e,t,r,a);try{let i=s[0].concat(s[1]);this.makeTestFunction();let o=this.testFunction,l=this.testLoop(o,i,a,n.verbose,n.steps);return Nn(l)}finally{Di(s[0],e),Di(s[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),Iae(this,e,t)}checkNumSamples(e,t,n,a="steps"){let r;if(n!=null){if(r=null,t!=null)throw new W(`If ${a} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else if(e!=null)Array.isArray(e)?r=e[0].shape[0]:r=e.shape[0];else throw new W(`Either the input data should have a defined shape, or ${a} shoud be specified.`);return r}execute(e,t){if(Array.isArray(t)&&t.length===0)throw new W("`outputs` is an empty Array, which is not allowed.");let n=Array.isArray(t),a=n?t:[t],r=this.retrieveSymbolicTensors(a),s=new $i;if(e instanceof Le&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new W(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let o=0;oi.name);for(let i=0;i0){let a=[];throw t.forEach((r,s)=>{r==null&&a.push(e[s])}),new W(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(a)}`)}return t}predictLoop(e,t=32,n=!1){return L(()=>{let a=this.checkNumSamples(e);if(n)throw new Oe("Verbose predictLoop() is not implemented yet.");let r=uy(a,t),s=this.outputs.map(i=>[]);for(let i=0;i{let o=r[i][0],l=r[i][1],d=$d(e,o,l),u=[];if(Array.isArray(d))for(let c=0;cs[l].push(o));return Nn(s.map(i=>ot(i,0)))})}predict(e,t={}){let n=m4(e);g4(n,this.inputNames,this.feedInputShapes,!1);try{let a=t.batchSize==null?32:t.batchSize;return oy(a),this.predictLoop(n,a)}finally{Di(n,e)}}predictOnBatch(e){g4(e,this.inputNames,this.feedInputShapes,!0);let t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,a){if(this.optimizer_==null)throw new ka("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");let r=[];for(let s=0;s0&&e[0].shape[0]%a!=0)throw new W(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${a}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,a,r=!0,s){let[i,o]=this.standardizeUserDataXY(e,t,r,s);if(n!=null)throw new Error("sample weight is not supported yet.");let l=null;if(a!=null){let d=d4(a,this.outputNames);l=[];for(let u=0;u{let s=this.checkNumSamples(t,n,r,"steps"),i=[];if(a>0)throw new Oe("Verbose mode is not implemented yet.");if(r!=null)throw new Oe("steps mode in testLoop() is not implemented yet");{let o=uy(s,n),l=nn(Ia(0,s));for(let d=0;d1&&(r+=`_${xw(e.slice(0,n),a)}`),t.push(r)}return t}makeTrainFunction(){return e=>{let t=[],n=e.slice(0,this.inputs.length),a=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),s=[],i=()=>{let d=[];for(let h=0;h1&&h{c=se(c,h)}),c},o=this.collectedTrainableWeights.map(d=>d.read()),l=!0;return[this.optimizer_.minimize(i,l,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>L(()=>{let t=[],n,a=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let l=0;ldr(t))}else{let t=Object.keys(this.loss);e={};let n=this.loss;for(let a of t)if(typeof n[a]=="string")e[a]=dr(n[a]);else throw new Error("Serialization of non-string loss is not supported.")}return e}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[dr(Zh(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>dr(Zh(e)));{let e={};for(let t in this.metrics)e[t]=dr(Zh(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(e.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(e.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(e.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");let t=Md(e.optimizer_config),n=Ta(t),a;if(typeof e.loss=="string")a=Ei(e.loss);else if(Array.isArray(e.loss))a=e.loss.map(s=>Ei(s));else if(e.loss!=null){a={};for(let s in e.loss)a[s]=Ei(e.loss[s])}let r;if(Array.isArray(e.metrics))r=e.metrics.map(s=>Ei(s));else if(e.metrics!=null){r={};for(let s in e.metrics)r[s]=Ei(e.metrics[s])}this.compile({loss:a,metrics:r,optimizer:n})}async save(e,t){if(typeof e=="string"){let i=vn.getSaveHandlers(e);if(i.length===0)throw new W(`Cannot find any save handlers for URL '${e}'`);if(i.length>1)throw new W(`Found more than one (${i.length}) save handlers for URL '${e}'`);e=i[0]}if(e.save==null)throw new W("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");let n=await vn.encodeWeights(this.getNamedWeights(t)),a=!1,r=null,s={modelTopology:this.toJSON(r,a),format:Mae,generatedBy:`TensorFlow.js tfjs-layers v${sy}`,convertedBy:null};if((t==null?!1:t.includeOptimizer)&&this.optimizer!=null){s.trainingConfig=this.getTrainingConfig();let i="optimizer",{data:o,specs:l}=await vn.encodeWeights(await this.optimizer.getWeights(),i);n.specs.push(...l),n.data=vn.concatenateArrayBuffers([n.data,o])}if(this.userDefinedMetadata!=null){let i=!0;i4(this.userDefinedMetadata,this.name,i),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){i4(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}};pr.className="Model";ae.registerClass(pr);var x4=class extends pr{};x4.className="Functional";ae.registerClass(x4);async function Fae(e,t){"modelTopology"in e||(e={modelTopology:e}),e=e;let n=e.modelTopology;n.model_config!=null&&(n=n.model_config);let a=Md(n),r=Ta(a,t);if(e.weightsManifest!=null){let s=await vn.loadWeights(e.weightsManifest,e.pathPrefix,r.weights.map(o=>o.originalName)),i={};for(let o of r.weights)i[o.originalName]=s[o.originalName];r.loadWeights(i),Ee(s)}return r}async function Dae(e,t){if(t==null&&(t={}),typeof e=="string"){let n=vn.getLoadHandlers(e,t);if(n.length===0)n.push(vn.browserHTTPRequest(e,t));else if(n.length>1)throw new W(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return $ae(e,void 0,t)}async function $ae(e,t,n){if(n==null&&(n={}),e.load==null)throw new W("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let a=await e.load(),r=a.modelTopology;r.model_config!=null&&(r=r.model_config);let s=n.strict==null?!0:n.strict,i=a.weightData!=null&&a.weightSpecs!=null&&s,o=Ta(Md(r),t,i),l=a.trainingConfig;if(l!=null&&o.loadTrainingConfig(l),a.userDefinedMetadata!=null&&o.setUserDefinedMetadata(a.userDefinedMetadata),a.weightData!=null){if(a.weightSpecs==null)throw new W("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");let{modelWeights:d,optimizerWeights:u}=Oae(a.weightData,a.weightSpecs);o.loadWeights(d,s),o.optimizer!=null&&u.length>0&&await o.optimizer.setWeights(u),Ee(d),Ee(u.map(p=>p.tensor))}return o}function Oae(e,t){let n=vn.decodeWeights(e,t),a={},r=[];return t.forEach(s=>{s.group==="optimizer"?r.push({name:s.name,tensor:n[s.name]}):a[s.name]=n[s.name]}),{modelWeights:a,optimizerWeights:r}}var Vl=class extends pr{constructor(e){super({inputs:[],outputs:[]});if(e=e||{},this.trainable=!0,this.built=!1,this.name=e.name!=null?e.name:Wh("sequential_"),e.layers!=null)for(let t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some(t=>t<0))throw new W(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){let t=e instanceof Vl||e instanceof pr,n;if(t){if(n=e,n.outputs.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(n.inputs.length!==1)throw new W("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(this.outputs.length===0){if(e.inboundNodes.length===0){if(e.batchInputShape==null)throw new W("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");let a=Gw({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(e.inboundNodes.length!==1)throw new W(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(e.inboundNodes[0].outputTensors.length!==1)throw new W("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Hw(this.outputs[0])}this.inboundNodes=[],new jh({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Ti(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(a=>a.shape),outputShapes:this.outputs[0].shape})}else{let a=e.apply(this.outputs[0]);if(Array.isArray(a))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[a],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(this.layers.length===0)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),this.layers.length===0)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{let e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return this.model==null&&this.build(),this.model.call(e,t)}build(e){if(at(e),this.inputs.length===0||this.outputs.length===0)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new pr({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){this.model==null&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new ka("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new ka("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return this.model==null&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return this.model==null&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return this.model==null?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new ka("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new ka("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},a=!1){let r,s={};if(t instanceof Array){if(t[0].className==null||t[0].className==="Merge")throw new W("Legacy serialization format not supported yet.");r=t}else w.assert(t.layers!=null,()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."),r=t.layers,delete t.layers,s=t;let i=new e(s);if(!(i instanceof Vl))throw new Oe(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(let o of r){let l=Ta(o,void 0,a);a&&l.setFastWeightInitDuringBuild(!0),i.add(l)}return i}set stopTraining(e){if(this.model==null)throw new W("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(this.model==null)throw new W("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){let e=[];for(let t of this.layers){let n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}};Vl.className="Sequential";ae.registerClass(Vl);function zae(e){return new pr(e)}function _ae(e){return new Vl(e)}function Pae(e,t){return t==null&&(t={}),Dae(e,t)}function _w(e){return Gw(e)}function Lae(e,t){ca.registerCallbackConstructor(e,t)}var En=class extends ae.Serializable{getConfig(){return{}}},b4=class extends En{apply(e,t=1){return Ate(e,t)}};b4.className="elu";ae.registerClass(b4);var v4=class extends En{apply(e){return $c(e)}};v4.className="selu";ae.registerClass(v4);var w4=class extends En{apply(e){return La(e)}};w4.className="relu";ae.registerClass(w4);var k4=class extends En{apply(e){return L(()=>yl(6,La(e)))}};k4.className="relu6";ae.registerClass(k4);var I4=class extends En{apply(e){return e}};I4.className="linear";ae.registerClass(I4);var S4=class extends En{apply(e){return wn(e)}};S4.className="sigmoid";ae.registerClass(S4);var N4=class extends En{apply(e){return gte(e)}};N4.className="hardSigmoid";ae.registerClass(N4);var T4=class extends En{apply(e){return fi(e)}};T4.className="softplus";ae.registerClass(T4);var E4=class extends En{apply(e){return yte(e)}};E4.className="softsign";ae.registerClass(E4);var C4=class extends En{apply(e){return di(e)}};C4.className="tanh";ae.registerClass(C4);var py=class extends En{apply(e,t=-1){return ed(e,t)}};py.className="softmax";ae.registerClass(py);var R4=class extends En{apply(e,t=-1){return Nc(e,t)}};R4.className="logSoftmax";ae.registerClass(R4);var M4=class extends En{apply(e,t=1){return L(()=>wn(e.mul(t)).mul(e))}};M4.className="swish";ae.registerClass(M4);var F4=class extends En{apply(e){return L(()=>B(e,di(fi(e))))}};F4.className="mish";ae.registerClass(F4);function Hr(e){return e.getClassName()}function cy(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"activation")}function Gr(e){if(e==null){let t={};return t.className="linear",t.config={},cy(t)}if(typeof e=="string"){let t={};return t.className=e,t.config={},cy(t)}else return e instanceof En?e:cy(e)}function hy(e){if(e!=null&&typeof e!="object")throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}var $4=class extends ae.Serializable{},Dd=class extends $4{constructor(e){super();hy(e),this.l1=e==null||e.l1==null?.01:e.l1,this.l2=e==null||e.l2==null?.01:e.l2,this.hasL1=this.l1!==0,this.hasL2=this.l2!==0}apply(e){return L(()=>{let t=Ct([1]);return this.hasL1&&(t=se(t,Te(B(this.l1,Ot(e))))),this.hasL2&&(t=se(t,Te(B(this.l2,Td(e))))),t.asScalar()})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}};Dd.className="L1L2";ae.registerClass(Dd);function Wae(e){return hy(e),new Dd({l1:e!=null?e.l1:null,l2:0})}function Bae(e){return hy(e),new Dd({l2:e!=null?e.l2:null,l1:0})}var D4={l1l2:"L1L2"};function ut(e){return T1(e)}function O4(e,t={}){return wd(e,ae.SerializationMap.getMap().classNameMap,t,"regularizer")}function yt(e){if(e==null)return null;if(typeof e=="string"){let t={className:e in D4?D4[e]:e,config:{}};return O4(t)}else return e instanceof $4?e:O4(e)}var fy=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null&&(this.maxValue=e.maxValue)}call(e,t){e=_e(e);let n=La(e);return this.maxValue!=null&&(n=kn(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){let e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}};fy.className="ReLU";ae.registerClass(fy);var my=class extends Ge{constructor(e){super(e==null?{}:e);this.DEFAULT_ALPHA=.3,e==null&&(e={}),this.alpha=e.alpha==null?this.DEFAULT_ALPHA:e.alpha}call(e,t){let n=_e(e);return qu(n,this.alpha)}computeOutputShape(e){return e}getConfig(){let e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}};my.className="LeakyReLU";ae.registerClass(my);var Ay=class extends Ge{constructor(e){super(e==null?{}:e);if(this.DEFAULT_ALPHA_INITIALIZER="zeros",e==null&&(e={}),this.supportsMasking=!0,this.alphaInitializer=At(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=yt(e.alphaRegularizer),this.alphaConstraint=Lt(e.alphaConstraint),e.sharedAxes==null)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else if(typeof e.sharedAxes=="number")this.sharedAxes=[e.sharedAxes];else throw new W(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`)}build(e){e=at(e);let t=e.slice(1);if(this.sharedAxes!=null)for(let a of this.sharedAxes)t[a-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);let n={};if(this.sharedAxes!=null)for(let a=1;a(Et(t),t==="channelsFirst"?Ze(e,[0,2,3,1]):e))}function z4(e,t){return L(()=>(Et(t),t==="channelsFirst"?Ze(e,[0,2,3,4,1]):e))}function Vae(e,t,n,a=1,r="valid",s,i=1){return L(()=>{if(s==null&&(s=wa()),Et(s),e.shape.length!==3)throw new W(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(t.shape.length!==3)throw new W(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(n!=null&&n.shape.length!==1)throw new W(`The bias for a conv1dWithBias operation should be 1, but is ${t.shape.length} instead`);if(s==="channelsFirst"&&(e=Ze(e,[0,2,1])),r==="causal")throw new Oe("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=gc(e,t,a,r==="same"?"same":"valid","NWC",i);return n!=null&&(o=Sa(o,n)),o})}function _4(e,t,n,a=[1,1],r="valid",s,i,o=null){return L(()=>{if(s==null&&(s=wa()),Et(s),e.rank!==3&&e.rank!==4)throw new W(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(t.rank!==3&&t.rank!==4)throw new W(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=by(e,s);if(r==="causal")throw new Oe("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=zr.conv2d({x:l,filter:t,strides:a,pad:r==="same"?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),s==="channelsFirst"&&(l=Ze(l,[0,3,1,2])),l})}function jae(e,t,n,a=[1,1,1],r="valid",s,i){return L(()=>{if(s==null&&(s=wa()),Et(s),e.rank!==4&&e.rank!==5)throw new W(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(t.rank!==4&&t.rank!==5)throw new W(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=z4(e,s);if(r==="causal")throw new Oe("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=oA(o,t,a,r==="same"?"same":"valid","NDHWC",i),n!=null&&(o=Sa(o,n)),s==="channelsFirst"&&(o=Ze(o,[0,4,1,2,3])),o})}var vy=class extends Ge{constructor(e,t){super(t);if(this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",vy.verifyArgs(t),this.rank=e,Ht(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new Oe(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=jl(t.kernelSize,e,"kernelSize"),this.strides=jl(t.strides==null?1:t.strides,e,"strides"),this.padding=t.padding==null?"valid":t.padding,Qn(this.padding),this.dataFormat=t.dataFormat==null?"channelsLast":t.dataFormat,Et(this.dataFormat),this.activation=Gr(t.activation),this.useBias=t.useBias==null?!0:t.useBias,this.biasInitializer=At(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=Lt(t.biasConstraint),this.biasRegularizer=yt(t.biasRegularizer),this.activityRegularizer=yt(t.activityRegularizer),this.dilationRate=jl(t.dilationRate==null?1:t.dilationRate,e,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new W(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new W(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new W(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(e){if(ja("kernelSize"in e,"required key 'kernelSize' not in config"),typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,3))throw new W(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){let e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Hr(this.activation),useBias:this.useBias,biasInitializer:It(this.biasInitializer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}},Od=class extends vy{constructor(e,t){super(e,t);this.kernel=null,Od.verifyArgs(t),this.filters=t.filters,Ht(this.filters,"filters"),this.kernelInitializer=At(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=Lt(t.kernelConstraint),this.kernelRegularizer=yt(t.kernelRegularizer)}build(e){e=at(e);let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[t]}`);let n=e[t],a=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return L(()=>{e=_e(e);let n,a=this.bias==null?null:this.bias.read(),r=vw(this.activation.getClassName());if(r!=null&&this.rank===2)n=_4(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate,r);else{if(this.rank===1)n=Vae(e,this.kernel.read(),a,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)n=_4(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)n=jae(e,this.kernel.read(),a,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new Oe("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(n=this.activation.apply(n))}return n})}computeOutputShape(e){e=at(e);let t=[],n=this.dataFormat==="channelsLast"?e.slice(1,e.length-1):e.slice(2);for(let r=0;r 0 but got ${JSON.stringify(e.filters)}`)}},zd=class extends Od{constructor(e){super(2,e);zd.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,2))throw new W(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}};zd.className="Conv2D";ae.registerClass(zd);var _d=class extends Od{constructor(e){super(3,e);_d.verifyArgs(e)}getConfig(){let e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!(Array.isArray(e.kernelSize)&&(e.kernelSize.length===1||e.kernelSize.length===3)))throw new W(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}};_d.className="Conv3D";ae.registerClass(_d);var wy=class extends zd{constructor(e){super(e);if(this.inputSpec=[new Mt({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=at(e),e.length!==4)throw new W("Input should have rank 4; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Mt({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=_e(e);if(n.shape.length!==4)throw new W(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i;this.dataFormat==="channelsFirst"?(s=2,i=3):(s=1,i=2);let o=a[s],l=a[i],d=this.kernelSize[0],u=this.kernelSize[1],p=this.strides[0],c=this.strides[1],h=qa(o,p,d,this.padding),m=qa(l,c,u,this.padding),f=[r,h,m,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,1]));let A=xc(n,this.kernel.read(),f,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(A=Ze(A,[0,3,1,2])),this.bias!=null&&(A=Sa(A,this.bias.read(),this.dataFormat)),this.activation!=null&&(A=this.activation.apply(A)),A})}computeOutputShape(e){e=at(e);let t=e.slice(),n,a,r;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3):(n=3,a=1,r=2);let s=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[a]=qa(t[a],o,s,this.padding),t[r]=qa(t[r],l,i,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};wy.className="Conv2DTranspose";ae.registerClass(wy);var ky=class extends _d{constructor(e){super(e);if(this.inputSpec=[new Mt({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new W(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(e=at(e),e.length!==5)throw new W("Input should have rank 5; Received input shape: "+JSON.stringify(e));let t=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[t]==null)throw new W("The channel dimension of the inputs should be defined. Found `None`.");let n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Mt({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return L(()=>{let n=_e(e);if(n.shape.length!==5)throw new W(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${n.shape.length}`);let a=n.shape,r=a[0],s,i,o;this.dataFormat==="channelsFirst"?(o=2,s=3,i=4):(o=1,s=2,i=3);let l=a[o],d=a[s],u=a[i],p=this.kernelSize[0],c=this.kernelSize[1],h=this.kernelSize[2],m=this.strides[0],f=this.strides[1],A=this.strides[2],y=qa(l,m,p,this.padding),g=qa(d,f,c,this.padding),x=qa(u,A,h,this.padding),k=[r,y,g,x,this.filters];this.dataFormat!=="channelsLast"&&(n=Ze(n,[0,2,3,4,1]));let b=Fb(n,this.kernel.read(),k,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(b=Ze(b,[0,4,1,2,3])),this.bias!==null&&(b=Sa(b,this.bias.read(),this.dataFormat)),this.activation!==null&&(b=this.activation.apply(b)),b})}computeOutputShape(e){e=at(e);let t=e.slice(),n,a,r,s;this.dataFormat==="channelsFirst"?(n=1,a=2,r=3,s=4):(n=4,a=1,r=2,s=3);let i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],d=this.strides[0],u=this.strides[1],p=this.strides[2];return t[n]=this.filters,t[a]=qa(t[a],d,i,this.padding),t[r]=qa(t[r],u,o,this.padding),t[s]=qa(t[s],p,l,this.padding),t}getConfig(){let e=super.getConfig();return delete e.dilationRate,e}};ky.className="Conv3DTranspose";ae.registerClass(ky);var P4=class extends Od{constructor(e,t){super(e,t);if(this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,t.filters==null)throw new W("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(t.kernelInitializer!=null||t.kernelRegularizer!=null||t.kernelConstraint!=null)throw new W("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(t.padding!=null&&t.padding!=="same"&&t.padding!=="valid")throw new W(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=t.depthMultiplier==null?1:t.depthMultiplier,this.depthwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=yt(t.depthwiseRegularizer),this.depthwiseConstraint=Lt(t.depthwiseConstraint),this.pointwiseInitializer=At(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=yt(t.pointwiseRegularizer),this.pointwiseConstraint=Lt(t.pointwiseConstraint)}build(e){if(e=at(e),e.length{e=_e(e);let n;if(this.rank===1)throw new Oe("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(e=Ze(e,[0,2,3,1])),n=NA(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(n=Sa(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),this.dataFormat==="channelsFirst"&&(n=Ze(n,[0,3,1,2])),n})}getConfig(){let e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=It(this.depthwiseInitializer),e.pointwiseInitializer=It(this.pointwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.pointwiseRegularizer=ut(this.pointwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseConstraint),e.pointwiseConstraint=Pt(this.pointwiseConstraint),e}};P4.className="SeparableConv";var Iy=class extends P4{constructor(e){super(2,e)}};Iy.className="SeparableConv2D";ae.registerClass(Iy);var Jh=class extends Od{constructor(e){super(1,e);Jh.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){let e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if(typeof e.kernelSize!="number"&&!C1(e.kernelSize,"number",1,1))throw new W(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}};Jh.className="Conv1D";ae.registerClass(Jh);var Sy=class extends Ge{constructor(e){super(e);typeof e.cropping=="number"?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:typeof e.cropping[0]=="number"?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=e.dataFormat===void 0?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return this.dataFormat==="channelsFirst"?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return L(()=>{if(e=_e(e),this.dataFormat==="channelsLast"){let n=Rh(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Rh(n,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{let n=Rh(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Rh(n,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){let e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Sy.className="Cropping2D";ae.registerClass(Sy);var Ny=class extends Ge{constructor(e){super(e);this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=e.size==null?this.DEFAULT_SIZE:e.size,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),this.interpolation=e.interpolation==null?"nearest":e.interpolation,ute(this.interpolation)}computeOutputShape(e){if(this.dataFormat==="channelsFirst"){let t=e[2]==null?null:this.size[0]*e[2],n=e[3]==null?null:this.size[1]*e[3];return[e[0],e[1],t,n]}else{let t=e[1]==null?null:this.size[0]*e[1],n=e[2]==null?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return L(()=>{let n=_e(e),a=n.shape;if(this.dataFormat==="channelsFirst"){n=Ze(n,[0,2,3,1]);let r=this.size[0]*a[2],s=this.size[1]*a[3],i=this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s]);return Ze(i,[0,3,1,2])}else{let r=this.size[0]*a[1],s=this.size[1]*a[2];return this.interpolation==="nearest"?n.resizeNearestNeighbor([r,s]):n.resizeBilinear([r,s])}})}getConfig(){let e={size:this.size,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Ny.className="UpSampling2D";ae.registerClass(Ny);function Uae(e,t,n=[1,1],a="valid",r,s){return L(()=>{r==null&&(r=wa()),Et(r);let i=by(e,r);if(e.rank!==4)throw new W(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(t.rank!==4)throw new W(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=hl(i,t,n,a==="same"?"same":"valid","NHWC",s),r==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}var Ty=class extends vy{constructor(e){super(2,e);this.depthwiseKernel=null,this.depthMultiplier=e.depthMultiplier==null?1:e.depthMultiplier,this.depthwiseInitializer=At(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=Lt(e.depthwiseConstraint),this.depthwiseRegularizer=yt(e.depthwiseRegularizer)}build(e){if(e=at(e),e.length<4)throw new W(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);let t=this.dataFormat==="channelsFirst"?1:3;if(e[t]==null||e[t]<0)throw new W(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);let n=e[t],a=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",a,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{e=_e(e);let n=Uae(e,this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(n=Sa(n,this.bias.read(),this.dataFormat)),this.activation!=null&&(n=this.activation.apply(n)),n})}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=Ea(t,this.kernelSize[0],this.padding,this.strides[0]),s=Ea(n,this.kernelSize[1],this.padding,this.strides[1]);return this.dataFormat==="channelsFirst"?[e[0],a,r,s]:[e[0],r,s,a]}getConfig(){let e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=It(this.depthwiseInitializer),e.depthwiseRegularizer=ut(this.depthwiseRegularizer),e.depthwiseConstraint=Pt(this.depthwiseRegularizer),e}};Ty.className="DepthwiseConv2D";ae.registerClass(Ty);function L4(e,t,n,a){if(Array.isArray(e)){if(t!=null||n!=null)throw new W("When inputs is an array, neither initialState or constants should be provided");a!=null&&(n=e.slice(e.length-a,e.length),e=e.slice(0,e.length-a)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(s){return s==null||Array.isArray(s)?s:[s]}return t=r(t),n=r(n),{inputs:e,initialState:t,constants:n}}function W4(e,t,n,a=!1,r,s,i=!1,o=!1){return L(()=>{let l=t.shape.length;if(l<3)throw new W(`Input should be at least 3D, but is ${l}D.`);let d=[1,0].concat(Ia(2,l));if(t=Ze(t,d),s!=null)throw new Oe("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r!=null&&(r=r.asType("bool").asType("float32"),r.rank===l-1&&(r=on(r,-1)),r=Ze(r,d)),a&&(t=On(t,0),r!=null&&(r=On(r,0)));let u=[],p,c=n,h=t.shape[0],m=ua(t),f;r!=null&&(f=ua(r));for(let y=0;ye(g,c));if(r==null)p=x[0],c=x[1];else{let k=L(()=>{let b=f[y],v=Dn(b).sub(b),I=x[0].mul(b).add(c[0].mul(v)),T=c.map((R,$)=>x[1][$].mul(b).add(R.mul(v)));return{output:I,newStates:T}});p=k.output,c=k.newStates}o&&u.push(p)}let A;return o&&(A=zn(u,1)),[p,A,c]})}var Ha=class extends Ge{constructor(e){super(e);let t;if(e.cell==null)throw new W("cell property is missing for the constructor of RNN.");if(Array.isArray(e.cell)?t=new Qh({cells:e.cell}):t=e.cell,t.stateSize==null)throw new W("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=e.returnSequences==null?!1:e.returnSequences,this.returnState=e.returnState==null?!1:e.returnState,this.goBackwards=e.goBackwards==null?!1:e.goBackwards,this._stateful=e.stateful==null?!1:e.stateful,this.unroll=e.unroll==null?!1:e.unroll,this.supportsMasking=!0,this.inputSpec=[new Mt({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return Ia(0,e).map(t=>null)}else return this.states_}setStates(e){this.states_=e}computeOutputShape(e){K1(e)&&(e=e[0]),e=e;let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);let n=t[0],a;if(this.returnSequences?a=[e[0],e[1],n]:a=[e[0],n],this.returnState){let r=[];for(let s of t)r.push([e[0],s]);return[a].concat(r)}else return a}computeMask(e,t){return L(()=>{Array.isArray(t)&&(t=t[0]);let n=this.returnSequences?t:null;if(this.returnState){let a=this.states.map(r=>null);return[n].concat(a)}else return n})}get states(){if(this.states_==null){let e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ni.shape[i.shape.length-1]),s))throw new W(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=s.map(i=>new Mt({shape:[null,i]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ur("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape[0];if(n==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>Ct([n,a])):this.states_=[Ct([n,this.cell.stateSize])];else if(e==null)Ee(this.states_),this.keptStates!=null&&(Ee(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(a=>Ct([n,a])):this.states_[0]=Ct([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t===!0?this.keptStates.push(this.states_.slice()):Ee(this.states_);for(let a=0;ajt(a.clone()))})}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=L4(e,n,a,this.numConstants);e=r.inputs,n=r.initialState,a=r.constants;let s=[],i=[];if(n!=null){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(let o of n)this.stateSpec.push(new Mt({shape:o.shape}));i=i.concat(this.stateSpec)}if(a!=null&&(t.constants=a,s=s.concat(a),this.numConstants=a.length),s[0]instanceof Na){let o=[e].concat(s),l=this.inputSpec.concat(i),d=this.inputSpec;this.inputSpec=l;let u=super.apply(o,t);return this.inputSpec=d,u}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;e=_e(e),r==null&&(this.stateful?r=this.states_:r=this.getInitialState(e));let s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new W(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");let i={training:a},o=W4((c,h)=>{let m=this.cell.call([c].concat(h),i);return[m[0],m.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],d=o[1],u=o[2];this.stateful&&this.resetStates(u,a);let p=this.returnSequences?d:l;return this.returnState?[p].concat(u):p})}getInitialState(e){return L(()=>{let t=Ct(e.shape);return t=Te(t,[1,2]),t=Nd(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(n=>n>1?O1(t,[1,n]):t):this.cell.stateSize>1?[O1(t,[1,this.cell.stateSize])]:[t]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){let e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(t.numConstants=this.numConstants);let n=this.cell.getConfig();return this.getClassName()===Ha.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign({},n,e,t)}static fromConfig(e,t,n={}){let a=t.cell,r=Ta(a,n);return new e(Object.assign(t,{cell:r}))}};Ha.className="RNN";ae.registerClass(Ha);var Cd=class extends Ge{},e0=class extends Cd{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation==null?this.DEFAULT_ACTIVATION:e.activation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=at(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];let a=t.training==null?!1:t.training;0Dn(e),rate:this.dropout,training:a})),0Dn(n),rate:this.recurrentDropout,training:a}));let r,s=this.dropoutMask,i=this.recurrentDropoutMask;s!=null?r=Ua(B(e,s),this.kernel.read()):r=Ua(e,this.kernel.read()),this.bias!=null&&(r=Sa(r,this.bias.read())),i!=null&&(n=B(n,i));let o=se(r,Ua(n,this.recurrentKernel.read()));return this.activation!=null&&(o=this.activation.apply(o)),[o,o]})}getConfig(){let e=super.getConfig(),t={units:this.units,activation:Hr(this.activation),useBias:this.useBias,kernelInitializer:It(this.kernelInitializer),recurrentInitializer:It(this.recurrentInitializer),biasInitializer:It(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),recurrentRegularizer:ut(this.recurrentRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),recurrentConstraint:Pt(this.recurrentConstraint),biasConstraint:Pt(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}};e0.className="SimpleRNNCell";ae.registerClass(e0);var Ey=class extends Ha{constructor(e){e.cell=new e0(e),super(e)}call(e,t){return L(()=>{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return new e(t)}};Ey.className="SimpleRNN";ae.registerClass(Ey);var t0=class extends Cd{constructor(e){super(e);if(this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new W("GRUCell does not support reset_after parameter set to true.");this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Gr(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=at(e);let t=e[e.length-1];this.kernel=this.addWeight("kernel",[t,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return L(()=>{if(e=e,e.length!==2)throw new W(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training==null?!1:t.training,a=e[1];e=e[0],0Dn(e),rate:this.dropout,training:n,count:3})),0Dn(a),rate:this.recurrentDropout,training:n,count:3}));let r=this.dropoutMask,s=this.recurrentDropoutMask,i,o,l;0{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Cy.className="GRU";ae.registerClass(Cy);var Pd=class extends Cd{constructor(e){super(e);this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation===void 0?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Gr(e.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=e.useBias==null?!0:e.useBias,this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=At(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=yt(e.kernelRegularizer),this.recurrentRegularizer=yt(e.recurrentRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.kernelConstraint=Lt(e.kernelConstraint),this.recurrentConstraint=Lt(e.recurrentConstraint),this.biasConstraint=Lt(e.biasConstraint),this.dropout=Pl([1,jr([0,e.dropout==null?0:e.dropout])]),this.recurrentDropout=Pl([1,jr([0,e.recurrentDropout==null?0:e.recurrentDropout])]),this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;e=at(e);let n=e[e.length-1];this.kernel=this.addWeight("kernel",[n,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let a;if(this.useBias){if(this.unitForgetBias){let r=this.biasInitializer,s=this.units;a=new(t=class extends pa{apply(i,o){let l=r.apply([s]),d=new Fh().apply([s]),u=r.apply([s*2]);return Mw(Mw(l,d),u)}},t.className="CustomInit",t)}else a=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,a,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training;if(e=e,e.length!==3)throw new W(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let a=e[1],r=e[2];e=e[0],0Dn(e),rate:this.dropout,training:n,count:4})),0Dn(a),rate:this.recurrentDropout,training:n,count:4}));let s=this.dropoutMask,i=this.recurrentDropoutMask,o,l,d,u;0{this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}static fromConfig(e,t){return t.implmentation===0&&(t.implementation=1),new e(t)}};Ry.className="LSTM";ae.registerClass(Ry);var Qh=class extends Cd{constructor(e){super(e);this.cells=e.cells}get stateSize(){let e=[];for(let t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return L(()=>{e=e;let n=e.slice(1),a=[];for(let i of this.cells.slice().reverse())Array.isArray(i.stateSize)?a.push(n.splice(0,i.stateSize.length)):a.push(n.splice(0,1));a.reverse();let r=[],s;for(let i=0;i{Ri(`RNNCell_${a}`,()=>{n.build(e),Array.isArray(n.stateSize)?t=n.stateSize[0]:t=n.stateSize,e=[e[0],t]})}),this.built=!0}getConfig(){let e=super.getConfig(),t=a=>({className:a.getClassName(),config:a.getConfig()}),n={cells:this.cells.map(t)};return Object.assign({},e,n)}static fromConfig(e,t,n={}){let a=[];for(let r of t.cells)a.push(Ta(r,n));return new e({cells:a})}get trainableWeights(){if(!this.trainable)return[];let e=[];for(let t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){let e=[];for(let t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){let t=[];for(let n of this.cells)t.push(...n.trainableWeights);return t.concat(e)}return e}getWeights(){let e=[];for(let t of this.cells)e.push(...t.weights);return Z1(e)}setWeights(e){let t=[];for(let n of this.cells){let a=n.weights.length,r=e.splice(a);for(let s=0;s$w(t(),n),i=()=>Ed(s,t,a);return!r||r<=1?jt(i().clone()):Array(r).fill(void 0).map(i).map(o=>jt(o.clone()))}var Hae=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r{if(this.cell.dropoutMask!=null&&(Ee(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(Ee(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new W("ConvRNN2D cell does not support constants");let n=t==null?null:t.mask,a=t==null?null:t.training,r=t==null?null:t.initialState;return super.call(e,{mask:n,training:a,initialState:r})})}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return L(()=>{let{stateSize:t}=this.cell,n=e.shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)],s=Ct(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){L(()=>{if(!this.stateful)throw new ur("Cannot call resetStates() on an RNN Layer that is not stateful.");let n=this.inputSpec[0].shape,a=this.computeSingleOutputShape(n),r=[a[0],...a.slice(2)];if(n[0]==null)throw new W("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Ct(r)):this.states_=[Ct(r)];else if(e==null)Ee(this.states_),this.keptStates!=null&&(Ee(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>Ct(r)):this.states_[0]=Ct(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new W(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):Ee(this.states_);for(let s=0;sjt(s.clone()))})}computeSingleOutputShape(e){let{dataFormat:t,filters:n,kernelSize:a,padding:r,strides:s,dilationRate:i}=this.cell,o=t==="channelsFirst",l=e[o?3:2],d=e[o?4:3],u=Ea(l,a[0],r,s[0],i[0]),p=Ea(d,a[1],r,s[1],i[1]);return[...e.slice(0,2),...o?[n,u,p]:[u,p,n]]}};B4.className="ConvRNN2D";var n0=class extends Pd{constructor(e){let{filters:t,kernelSize:n,strides:a,padding:r,dataFormat:s,dilationRate:i}=e;super(Object.assign({},e,{units:t}));this.filters=t,Ht(this.filters,"filters"),this.kernelSize=jl(n,2,"kernelSize"),this.kernelSize.forEach(o=>Ht(o,"kernelSize")),this.strides=jl(a||1,2,"strides"),this.strides.forEach(o=>Ht(o,"strides")),this.padding=r||"valid",Qn(this.padding),this.dataFormat=s||"channelsLast",Et(this.dataFormat),this.dilationRate=jl(i||1,2,"dilationRate"),this.dilationRate.forEach(o=>Ht(o,"dilationRate"))}build(e){var t;e=at(e);let n=this.dataFormat==="channelsFirst"?1:e.length-1;if(e[n]==null)throw new W(`The channel dimension of the input should be defined. Found ${e[n]}`);let a=e[n],r=4,s=this.kernelSize.concat([a,this.filters*r]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);let i=this.kernelSize.concat([this.filters,this.filters*r]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let o;if(this.unitForgetBias){let l=this.biasInitializer,d=this.filters;o=new(t=class extends pa{apply(u,p){let c=l.apply([d]),h=$n([d]),m=l.apply([d*2]);return _1([c,h,m])}},t.className="CustomInit",t)}else o=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*r],null,o,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return L(()=>{if(e.length!==3)throw new W(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let n=t.training||!1,a=e[0],r=e[1],s=e[2],i=4;0Dn(a),rate:this.dropout,training:n,count:i}));let o=this.dropoutMask,l=(Y,re,te)=>!re||!re[te]?Y:B(re[te],Y),d=l(a,o,0),u=l(a,o,1),p=l(a,o,2),c=l(a,o,3);0Dn(r),rate:this.recurrentDropout,training:n,count:i}));let h=this.recurrentDropoutMask,m=l(r,h,0),f=l(r,h,1),A=l(r,h,2),y=l(r,h,3),g=3,[x,k,b,v]=ln(this.kernel.read(),i,g),[I,T,R,$]=this.useBias?ln(this.bias.read(),i):[null,null,null,null];d=this.inputConv(d,x,I,this.padding),u=this.inputConv(u,k,T,this.padding),p=this.inputConv(p,b,R,this.padding),c=this.inputConv(c,v,$,this.padding);let[z,_,V,j]=ln(this.recurrentKernel.read(),i,g);m=this.recurrentConv(m,z),f=this.recurrentConv(f,_),A=this.recurrentConv(A,V),y=this.recurrentConv(y,j);let U=this.recurrentActivation.apply(se(d,m)),X=this.recurrentActivation.apply(se(u,f)),G=se(B(X,s),B(U,this.activation.apply(se(p,A)))),ee=B(this.recurrentActivation.apply(se(c,y)),this.activation.apply(G));return[ee,ee,G]})}getConfig(){let e=super.getConfig(),{units:t}=e,n=Hae(e,["units"]),a={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},n,a)}inputConv(e,t,n,a){let r=ar(e,t,this.strides,a||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return n?Sa(r,n,this.dataFormat):r}recurrentConv(e,t){return ar(e,t,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}};n0.className="ConvLSTM2DCell";ae.registerClass(n0);var My=class extends B4{constructor(e){let t=new n0(e);super(Object.assign({},e,{cell:t}))}static fromConfig(e,t){return new e(t)}};My.className="ConvLSTM2D";ae.registerClass(My);var a0=class extends Ge{constructor(e){super(e);this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(this.noiseShape==null)return this.noiseShape;let t=e.shape,n=[];for(let a=0;a{this.invokeCallHook(e,t);let n=_e(e);if(0$w(n,this.rate,r,this.seed),()=>n,a)}return e})}getConfig(){let e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}};a0.className="Dropout";ae.registerClass(a0);var Fy=class extends a0{constructor(e){super(e);this.inputSpec=[{ndim:3}]}getNoiseShape(e){let t=e.shape;return[t[0],1,t[2]]}};Fy.className="SpatialDropout1D";ae.registerClass(Fy);var $y=class extends Ge{constructor(e){super(e);if(this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.batchInputShape==null&&e.inputShape==null&&e.inputDim!=null){let t=null;e.batchSize!=null&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,Ht(this.units,"units"),this.activation=Gr(e.activation),e.useBias!=null&&(this.useBias=e.useBias),this.kernelInitializer=At(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=At(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=Lt(e.kernelConstraint),this.biasConstraint=Lt(e.biasConstraint),this.kernelRegularizer=yt(e.kernelRegularizer),this.biasRegularizer=yt(e.biasRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){e=at(e);let t=e[e.length-1];this.kernel==null&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){e=at(e);let t=e.slice();return t[t.length-1]=this.units,t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e),a=vw(this.activation.getClassName()),r;return a!=null?r=Ua(n,this.kernel.read(),a,this.bias?this.bias.read():null):(r=Ua(n,this.kernel.read()),this.bias!=null&&(r=Sa(r,this.bias.read())),this.activation!=null&&(r=this.activation.apply(r))),r})}getConfig(){let e={units:this.units,activation:Hr(this.activation),useBias:this.useBias,kernelInitializer:It(this.kernelInitializer),biasInitializer:It(this.biasInitializer),kernelRegularizer:ut(this.kernelRegularizer),biasRegularizer:ut(this.biasRegularizer),activityRegularizer:ut(this.activityRegularizer),kernelConstraint:Pt(this.kernelConstraint),biasConstraint:Pt(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}};$y.className="Dense";ae.registerClass($y);var Dy=class extends Ge{constructor(e){e=e||{},super(e),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=at(e);for(let t of e.slice(1))if(t==null)throw new W(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Vr(e,1)]}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);if(this.dataFormat==="channelsFirst"&&n.rank>1){let a=[0];for(let r=2;r{this.invokeCallHook(e,t);let n=_e(e);return this.activation.apply(n)})}getConfig(){let e={activation:Hr(this.activation)},t=super.getConfig();return Object.assign(e,t),e}};Oy.className="Activation";ae.registerClass(Oy);var zy=class extends Ge{constructor(e){super(e);this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return L(()=>(e=_e(e),hte(e,this.n)))}getConfig(){let e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}};zy.className="RepeatVector";ae.registerClass(zy);var _y=class extends Ge{constructor(e){super(e);this.targetShape=e.targetShape;for(let t=0;t{this.invokeCallHook(e,t);let n=_e(e),a=n.shape,r=a.slice(0,1).concat(this.fixUnknownDimension(a.slice(1),this.targetShape));return n.reshape(r)})}getConfig(){let e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}};_y.className="Reshape";ae.registerClass(_y);var Py=class extends Ge{constructor(e){super(e);if(e.dims==null)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);let t=Ia(1,e.dims.length+1);if(!w.arraysEqual(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Mt({ndim:this.dims.length+1})]}computeOutputShape(e){e=at(e);let t=e.slice();return this.dims.forEach((n,a)=>{t[a+1]=e[n]}),t}call(e,t){return Ze(_e(e),this.dimsIncludingBatch)}getConfig(){let e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}};Py.className="Permute";ae.registerClass(Py);var Ly=class extends Ge{constructor(e){super(e==null?{}:e);this.supportsMasking=!0,e!=null?this.maskValue=e.maskValue==null?0:e.maskValue:this.maskValue=0}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){let n=_e(e),a=-1;return Wu(Ai(n,this.maskValue),a)}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e),a=-1,r=!0,s=Wu(Ai(n,this.maskValue),a,r);return n.mul(s.asType(n.dtype))})}};Ly.className="Masking";ae.registerClass(Ly);var Wy=class extends Ge{constructor(e){super(e);if(this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",e.batchInputShape==null&&e.inputShape==null){let t=null;e.batchSize!=null&&(t=e.batchSize),e.inputLength==null?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ft(e.inputLength))}this.inputDim=e.inputDim,Ht(this.inputDim,"inputDim"),this.outputDim=e.outputDim,Ht(this.outputDim,"outputDim"),this.embeddingsInitializer=At(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=yt(e.embeddingsRegularizer),this.activityRegularizer=yt(e.activityRegularizer),this.embeddingsConstraint=Lt(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return L(()=>this.maskZero?(e=_e(e),Ai(e,Ue(e))):null)}computeOutputShape(e){if(e=at(e),this.inputLength==null)return[...e,this.outputDim];let t=ft(this.inputLength);if(t.length!==e.length-1)throw new W(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let a=0;a{this.invokeCallHook(e,t);let n=_e(e);return n.dtype!=="int32"&&(n=Sd(n,"int32")),Fw(this.embeddings.read(),n.as1D()).reshape(at(this.computeOutputShape(n.shape)))})}getConfig(){let e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:It(this.embeddingsInitializer),embeddingsRegularizer:ut(this.embeddingsRegularizer),activityRegularizer:ut(this.activityRegularizer),embeddingsConstraint:Pt(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}};Wy.className="Embedding";ae.registerClass(Wy);var Oi=class extends Ge{constructor(e){super(e||{});this.supportsMasking=!0}mergeFunction(e){throw new Oe}computeElementwiseOpOutputShape(e,t){if(e==null||t==null)return null;if(e.length1)throw new W(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=e[0]==null?null:e[0].slice(1);for(let r=1;rr.length);e.indexOf(null)===-1&&Br(a).length===1?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return L(()=>{if(e=e,this.reshapeRequired){let n=[],a=e.map(r=>r.rank);if(a.indexOf(null)===-1){let r=jr(a);for(let s of e){let i=s.rank;for(let o=0;o1){let d=Ia(1,l).concat([0]);n.push(Ze(o,d)),r=!0}else n.push(o)}let s=this.mergeFunction(n),i=s.rank;if(r){if(i==null){let o=s.shape,l=o.length,d=o[l-1],u=[d].concat(o.slice(0,o.length-1));s=Ze(s.reshape([-1,d]),[1,0]).reshape(u)}else if(i>1){let o=[i-1].concat(Ia(0,i-1));s=Ze(s,o)}}return s}}else return this.mergeFunction(e)})}computeOutputShape(e){e=e;let t;e[0]==null?t=null:t=e[0].slice(1);for(let a=1;a{if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an Array");if(!Array.isArray(e))throw new W("`inputs` should be an Array");if(t.length!==e.length)throw new W(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every(a=>a==null))return null;t=t.map(a=>a==null?a:on(a,0));let n=t[0];for(let a=1;a{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new W("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return L(()=>_1(e,this.axis))}computeOutputShape(e){if(!(Array.isArray(e)&&Array.isArray(e[0])))throw new W("A `Concatenate` layer should be called on a list of inputs.");let t=e,n=t[0].slice(),a=this.axis<0?n.length+this.axis:this.axis;for(let r of t.slice(1)){if(n[a]==null||r[a]==null){n[a]=null;break}n[a]+=r[a]}return n}computeMask(e,t){if(t==null)return null;if(!Array.isArray(t))throw new W("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new W("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new W(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return L(()=>{let n=!0;if(t.forEach(s=>{if(s!=null){n=!1;return}}),n)return null;let a=[];for(let s=0;s3||t.shape.length>3)throw new Oe("batchDot is not implemented for tensors of 4D or higher rank yet");if(w.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),w.assert(e.shape.length>=2,()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`),typeof n=="number"&&(n=[n,n]),e.dtype==="complex64"||t.dtype==="complex64")throw new Oe("batchDot is not implemented for complex64-type Tensors yet.");let a=e.shape.length,r=t.shape.length;n==null&&(n=[a-1,r-2]);let s=n;return L(()=>{let i;if(a>r){i=a-r;let l=[];for(let d=0;da){i=r-a;let l=[];for(let d=0;d0){let l;a>r?l=a+r-3:l=a-1;let d=[];for(let u=l;u"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0],n=e[1];if(t.length>3||n.length>3)throw new Oe("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);if(t[a[0]]!==n[a[1]])throw new W(`Dimension incompatibility: ${t[a[0]]} !== ${n[a[1]]}`)}mergeFunction(e){if(e.length!==2)throw new W(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t=e[0],n=e[1],a;return Array.isArray(this.axes)?a=this.axes.map((r,s)=>Ld(r,e[s].shape.length)):a=[Ld(this.axes,t.shape.length),Ld(this.axes,n.shape.length)],this.normalize&&(t=Uh(t,a[0]),n=Uh(n,a[1])),Gae(t,n,a)}interpretAxes(e,t){let n;return Array.isArray(this.axes)?n=this.axes:n=[Ld(this.axes,e.length),Ld(this.axes,t.length)],n}computeOutputShape(e){w.assert(Array.isArray(e)&&e.length===2&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"A `Dot` layer should be called on a list of exactly 2 inputs.");let t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new Oe("Dot layer does not support tensors of 4D or higher rank yet.");let a=this.interpretAxes(t,n);t.splice(a[0],1),n.splice(a[1],1),n.splice(0,1);let r=t.concat(n);return r.length===1&&r.push(1),r}computeMask(e,t){return null}getConfig(){let e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}};qy.className="Dot";ae.registerClass(qy);var Xy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);return Ed(()=>Mh(n.shape,0,this.stddev).add(n),()=>n,t.training||!1)})}};Xy.className="GaussianNoise";ae.registerClass(Xy);var Ky=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{this.invokeCallHook(e,t);let n=_e(e);return this.rate>0&&this.rate<1?Ed(()=>{let a=Math.sqrt(this.rate/(1-this.rate));return n.mul(Mh(n.shape,1,a))},()=>n,t.training||!1):n})}};Ky.className="GaussianDropout";ae.registerClass(Ky);var Zy=class extends Ge{constructor(e){super(e);this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||_e(e).shape}computeOutputShape(e){return e}getConfig(){let e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return L(()=>{if(this.rate<1&&this.rate>0){let n=this._getNoiseShape(e);return Ed(()=>{let a=_e(e),r=1.6732632423543772,s=1.0507009873554805,i=-r*s,o=Dr(gl(n),this.rate);o=Sd(o,"float32");let l=((1-this.rate)*(1+this.rate*i**2))**-.5,d=-l*i*this.rate;return a.mul(o).add(o.add(-1).mul(i)).mul(l).add(d)},()=>_e(e),t.training||!1)}return e})}};Zy.className="AlphaDropout";ae.registerClass(Zy);function Wd(e,t,n,a,r,s=.001){let i;if(e.rank===2)i=Ib(e,t,n,a,r,s);else if(e.rank===3)i=Sb(e,t,n,a,r,s);else if(e.rank===4)i=Nb(e,t,n,a,r,s);else throw new Oe(`batchNormalization is not implemented for array of rank ${e.rank} yet`);return i}function qae(e,t,n,a,r=.001){return L(()=>{let s=Ec(e,a),i=s.mean,o=s.variance;return[Wd(e,i,o,n,t,r),i,o]})}function Xae(e,t,n,a,r=.001){return L(()=>{let s=Ec(e,a),i=s.mean,o=s.variance,l=[];for(let h of Ia(0,e.rank))a.indexOf(h)!==-1?l.push(1):l.push(e.shape[h]);let d=i.reshape(l),u=o.reshape(l),p=t==null?null:t.reshape(l),c=n==null?null:n.reshape(l);return[Wd(e,d,u,c,p,r),i,o]})}function Kae(e,t,n,a,r=.001){return w.arraysEqual(a.slice().sort(),Ia(0,e.rank-1))?qae(e,t,n,a,r):Xae(e,t,n,a,r)}var Yy=class extends Ge{constructor(e){e==null&&(e={}),super(e),this.supportsMasking=!0,this.axis=e.axis==null?-1:e.axis,this.momentum=e.momentum==null?.99:e.momentum,this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.movingMeanInitializer=At(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=At(e.movingVarianceInitializer||"ones"),this.betaConstraint=Lt(e.betaConstraint),this.gammaConstraint=Lt(e.gammaConstraint),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer)}build(e){e=at(e);let t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(n==null)throw new W(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Mt({ndim:e.length,axes:{[t]:n}})];let a=[n];this.scale&&(this.gamma=this.addWeight("gamma",a,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",a,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",a,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",a,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return L(()=>{let n=t.training==null?!1:t.training,a=_e(e),r=a.shape,s=r.length,i=Ia(0,s),o=this.axis>=0?this.axis:this.axis+s;i.splice(o,1);let l=Ti(1,s);l[o]=r[o];let d=i.slice();d.sort();let u=!w.arraysEqual(d,Ia(0,s).slice(0,s-1)),p=()=>{if(u){let A=this.movingMean.read().reshape(l),y=this.movingVariance.read().reshape(l),g=this.center?this.beta.read().reshape(l):null,x=this.scale?this.gamma.read().reshape(l):null;return Wd(a,A,y,g,x,this.epsilon)}else return Wd(a,this.movingMean.read(),this.movingVariance.read(),this.beta==null?null:this.beta.read(),this.gamma==null?null:this.gamma.read(),this.epsilon)};if(!n)return p();let[c,h,m]=Kae(a,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(A,y,g)=>{L(()=>{let x=1-g,k=A.read(),b=k.sub(y).mul(x);A.write(k.sub(b))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,m,this.momentum)})(),c})}getConfig(){let e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:It(this.betaInitializer),gammaInitializer:It(this.gammaInitializer),movingMeanInitializer:It(this.movingMeanInitializer),movingVarianceInitializer:It(this.movingVarianceInitializer),betaRegularizer:ut(this.betaRegularizer),gammaRegularizer:ut(this.gammaRegularizer),betaConstraint:Pt(this.betaConstraint),gammaConstraint:Pt(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}};Yy.className="BatchNormalization";ae.registerClass(Yy);var Jy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.axis=e.axis==null?-1:e.axis,typeof this.axis=="number"){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else if(Array.isArray(this.axis)){for(let t of this.axis)if(!Number.isInteger(t))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}else throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);this.epsilon=e.epsilon==null?.001:e.epsilon,this.center=e.center==null?!0:e.center,this.scale=e.scale==null?!0:e.scale,this.betaInitializer=At(e.betaInitializer||"zeros"),this.gammaInitializer=At(e.gammaInitializer||"ones"),this.betaRegularizer=yt(e.betaRegularizer),this.gammaRegularizer=yt(e.gammaRegularizer),this.supportsMasking=!0}build(e){e=at(e);let t=e.length;typeof this.axis=="number"&&(this.axis=[this.axis]);for(let r=0;r=t)throw new Error(`Invalid axis: ${r}`);if(this.axis.length!==Br(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);let n=this.axis.map(r=>e[r]),a=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,a):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,a):this.beta=null,this.built=!0}call(e,t){let n=_e(e),a=n.shape,r=a.length;return L(()=>{let s=!0,{mean:i,variance:o}=Ec(n,this.axis,s),l=Ti(1,r);for(let m of this.axis)l[m]=a[m];let d=m=>m!=null&&m.shape.length!==r&&this.axis!==[r-1]?m.reshape(l):m,u=d(this.gamma.read()),p=d(this.beta.read()),c=[],h=[];for(let m=0;m{if(e.rank!==4)throw new W(`temporalPadding expects input tensor to be 4-D, but received a ${e.rank}-D tensor.`);if(t==null&&(t=[[1,1],[1,1]]),t.length!==2||t[0].length!==2||t[1].length!==2)throw new W("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(n==null&&(n=wa()),n!=="channelsLast"&&n!=="channelsFirst")throw new W(`Unknown data format: ${n}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let a;return n==="channelsFirst"?a=[[0,0],[0,0],t[0],t[1]]:a=[[0,0],t[0],t[1],[0,0]],rr(e,a)})}var Qy=class extends Ge{constructor(e){if(e==null&&(e={}),super(e),this.dataFormat=e.dataFormat==null?wa():e.dataFormat,e.padding==null)this.padding=[[1,1],[1,1]];else if(typeof e.padding=="number")this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,e.padding.length!==2)throw new W(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if(typeof e.padding[0]=="number")t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,e.padding[0].length!==2)throw new W(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],e.padding[1].length!==2)throw new W(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){e=at(e);let t,n;return this.dataFormat==="channelsFirst"?(e[2]!=null&&e[2]>=0?t=e[2]+this.padding[0][0]+this.padding[0][1]:t=null,e[3]!=null&&e[3]>=0?n=e[3]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],e[1],t,n]):(e[1]!=null&&e[1]>=0?t=e[1]+this.padding[0][0]+this.padding[0][1]:t=null,e[2]!=null&&e[2]>=0?n=e[2]+this.padding[1][0]+this.padding[1][1]:n=null,[e[0],t,n,e[3]])}call(e,t){return L(()=>Zae(_e(e),this.padding,this.dataFormat))}getConfig(){let e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}};Qy.className="ZeroPadding2D";ae.registerClass(Qy);function r0(e,t,n,a,r,s){return L(()=>{Et(r),Sw(s),Qn(a),n==null&&(n=[1,1]),a==null&&(a="valid"),r==null&&(r=wa()),s==null&&(s="max"),e=by(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=Ku(e,t,n,o):i=ju(e,t,n,o),r==="channelsFirst"&&(i=Ze(i,[0,3,1,2])),i})}function V4(e,t,n,a,r,s){return L(()=>{Et(r),Sw(s),Qn(a),n==null&&(n=[1,1,1]),a==null&&(a="valid"),r==null&&(r=wa()),s==null&&(s="max"),e=z4(e,r);let i,o=a==="same"?"same":"valid";return s==="max"?i=xA(e,t,n,o):i=rA(e,t,n,o),r==="channelsFirst"&&(i=Ze(i,[0,4,1,2,3])),i})}var j4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=2),super(e),typeof e.poolSize=="number")this.poolSize=[e.poolSize];else if(Array.isArray(e.poolSize)&&e.poolSize.length===1&&typeof e.poolSize[0]=="number")this.poolSize=e.poolSize;else throw new W(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);if(Ht(this.poolSize,"poolSize"),e.strides==null)this.strides=this.poolSize;else if(typeof e.strides=="number")this.strides=[e.strides];else if(Array.isArray(e.strides)&&e.strides.length===1&&typeof e.strides[0]=="number")this.strides=e.strides;else throw new W(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,Qn(this.padding),this.inputSpec=[new Mt({ndim:3})]}computeOutputShape(e){e=at(e);let t=Ea(e[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return L(()=>{this.invokeCallHook(e,t),e=Nd(_e(e),2);let n=this.poolingFunction(_e(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Or(n,[2])})}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}},e2=class extends j4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"max")}};e2.className="MaxPooling1D";ae.registerClass(e2);var t2=class extends j4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"avg")}};t2.className="AveragePooling1D";ae.registerClass(t2);var U4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==2)throw new W(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];Ht(this.poolSize,"poolSize"),Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),Qn(this.padding),this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2];return t=Ea(t,this.poolSize[0],this.padding,this.strides[0]),n=Ea(n,this.poolSize[1],this.padding,this.strides[1]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(_e(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},n2=class extends U4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"max")}};n2.className="MaxPooling2D";ae.registerClass(n2);var a2=class extends U4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),r0(e,t,n,a,r,"avg")}};a2.className="AveragePooling2D";ae.registerClass(a2);var H4=class extends Ge{constructor(e){if(e.poolSize==null&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],e.strides==null)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(e.strides.length!==3)throw new W(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];Ht(this.poolSize,"poolSize"),Ht(this.strides,"strides"),this.padding=e.padding==null?"valid":e.padding,this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),Qn(this.padding),this.inputSpec=[new Mt({ndim:5})]}computeOutputShape(e){e=at(e);let t=this.dataFormat==="channelsFirst"?e[2]:e[1],n=this.dataFormat==="channelsFirst"?e[3]:e[2],a=this.dataFormat==="channelsFirst"?e[4]:e[3];return t=Ea(t,this.poolSize[0],this.padding,this.strides[0]),n=Ea(n,this.poolSize[1],this.padding,this.strides[1]),a=Ea(a,this.poolSize[2],this.padding,this.strides[2]),this.dataFormat==="channelsFirst"?[e[0],e[1],t,n,a]:[e[0],t,n,a,e[4]]}call(e,t){return L(()=>(this.invokeCallHook(e,t),this.poolingFunction(_e(e),this.poolSize,this.strides,this.padding,this.dataFormat)))}getConfig(){let e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},r2=class extends H4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),V4(e,t,n,a,r,"max")}};r2.className="MaxPooling3D";ae.registerClass(r2);var s2=class extends H4{constructor(e){super(e)}poolingFunction(e,t,n,a,r){return Et(r),Qn(a),V4(e,t,n,a,r,"avg")}};s2.className="AveragePooling3D";ae.registerClass(s2);var G4=class extends Ge{constructor(e){super(e);this.inputSpec=[new Mt({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Oe}},i2=class extends G4{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=_e(e);return kt(n,1)})}};i2.className="GlobalAveragePooling1D";ae.registerClass(i2);var o2=class extends G4{constructor(e){super(e||{})}call(e,t){return L(()=>{let n=_e(e);return Xn(n,1)})}};o2.className="GlobalMaxPooling1D";ae.registerClass(o2);var q4=class extends Ge{constructor(e){super(e);this.dataFormat=e.dataFormat==null?"channelsLast":e.dataFormat,Et(this.dataFormat),this.inputSpec=[new Mt({ndim:4})]}computeOutputShape(e){return e=e,this.dataFormat==="channelsLast"?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Oe}getConfig(){let e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}},l2=class extends q4{call(e,t){return L(()=>{let n=_e(e);return this.dataFormat==="channelsLast"?kt(n,[1,2]):kt(n,[2,3])})}};l2.className="GlobalAveragePooling2D";ae.registerClass(l2);var u2=class extends q4{call(e,t){return L(()=>{let n=_e(e);return this.dataFormat==="channelsLast"?Xn(n,[1,2]):Xn(n,[2,3])})}};u2.className="GlobalMaxPooling2D";ae.registerClass(u2);var X4=class extends Ge{constructor(e){super(e);this.layer=e.layer}build(e){this.built=!0}get trainable(){return this.layer!=null?this.layer.trainable:!1}set trainable(e){this.layer!=null&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){let e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.layer!=null&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){let a=t.layer,r=Ta(a,n);delete t.layer;let s={layer:r};return Object.assign(s,t),new e(s)}},d2=class extends X4{constructor(e){super(e);this.supportsMasking=!0}build(e){if(e=at(e),e.length<3)throw new W(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];let t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){e=at(e);let t=[e[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),a=e[1];return[n[0],a].concat(n.slice(1))}call(e,t){return L(()=>(e=_e(e),W4((n,a)=>[_e(this.layer.call(n,t)),[]],e,[],!1,null,null,!1,!0)[1]))}};d2.className="TimeDistributed";ae.registerClass(d2);function Yae(e){Ci(lte,"BidirectionalMergeMode",e)}var Jae="concat",p2=class extends X4{constructor(e){super(e);let t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Ta(n),t.goBackwards=t.goBackwards!==!0;let a={};if(a.className=e.layer.getClassName(),a.config=t,this.backwardLayer=Ta(a),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=e.mergeMode===void 0?Jae:e.mergeMode,Yae(this.mergeMode),e.weights)throw new Oe("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,this.forwardLayer!=null&&(this.forwardLayer.trainable=e),this.backwardLayer!=null&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){let t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t=this.forwardLayer.computeOutputShape(e);Array.isArray(t)&&Array.isArray(t[0])||(t=[t]),t=t;let n,a,r;return this.returnState&&(r=t.slice(1)),n=t[0],n=n,this.mergeMode==="concat"?(n[n.length-1]*=2,a=[n]):this.mergeMode==null?a=[n,n.slice()]:a=[n],this.returnState?this.mergeMode==null?a.concat(r).concat(r.slice()):[n].concat(r).concat(r.slice()):Nn(a)}apply(e,t){let n=t==null?null:t.initialState,a=t==null?null:t.constants;t==null&&(t={});let r=L4(e,n,a,this.numConstants);if(e=r.inputs,n=r.initialState,a=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(n==null||n.length===0)&&a==null)return super.apply(e,t);let s=[],i=[];if(n!=null){let l=n.length;if(l%2>0)throw new W("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);let d=n.map(u=>new Mt({shape:u.shape}));this.forwardLayer.stateSpec=d.slice(0,l/2),this.backwardLayer.stateSpec=d.slice(l/2),i.push(...d)}if(a!=null)throw new Oe("Support for constants in Bidirectional layers is not implemented yet.");let o=s[0]instanceof Na;for(let l of s)if(l instanceof Na!==o)throw new W("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){let l=[e].concat(s),d=this.inputSpec.concat(i),u=this.inputSpec;this.inputSpec=d;let p=super.apply(l,t);return this.inputSpec=u,p}else return super.apply(e,t)}call(e,t){return L(()=>{let n=t.initialState,a,r;if(n==null)a=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{let o=n.slice(0,n.length/2),l=n.slice(n.length/2);a=this.forwardLayer.call(e,Object.assign(t,{initialState:o})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:l}))}let s;this.returnState&&(Array.isArray(a)&&(s=a.slice(1).concat(r.slice(1))),a=a[0],r=r[0]),this.returnSequences&&(r=On(r,1));let i;return this.mergeMode==="concat"?i=_1([a,r]):this.mergeMode==="sum"?i=se(a,r):this.mergeMode==="ave"?i=B(.5,se(a,r)):this.mergeMode==="mul"?i=B(a,r):this.mergeMode==null&&(i=[a,r]),this.returnState?this.mergeMode==null?i.concat(s):[i].concat(s):i})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ri(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),Ri(this.backwardLayer.name,()=>{this.backwardLayer.build(e)}),this.built=!0}computeMask(e,t){Array.isArray(t)&&(t=t[0]);let n;if(this.returnSequences?this.mergeMode==null?n=[t,t]:n=t:this.mergeMode==null?n=[null,null]:n=null,this.returnState){let a=this.forwardLayer.states.map(r=>null);return Array.isArray(n)?n.concat(a).concat(a):[n].concat(a).concat(a)}else return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),this.forwardLayer!=null&&this.forwardLayer.setFastWeightInitDuringBuild(e),this.backwardLayer!=null&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){let e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){let n=Ta(t.layer);if(delete t.layer,t.numConstants!=null)throw new Oe("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");let a=t;return a.layer=n,new e(a)}};p2.className="Bidirectional";ae.registerClass(p2);function Ite(e){return new Ll(e)}function Ste(e){return new yy(e)}function Nte(e){return new fy(e)}function Tte(e){return new my(e)}function Ete(e){return new Ay(e)}function Cte(e){return new xy(e)}function Rte(e){return new gy(e)}function Mte(e){return new Jh(e)}function Fte(e){return new zd(e)}function $te(e){return new wy(e)}function Dte(e){return new _d(e)}function Ote(e){return new ky(e)}function zte(e){return new Iy(e)}function _te(e){return new Sy(e)}function Pte(e){return new Ny(e)}function Lte(e){return new Ty(e)}function Wte(e){return new Oy(e)}function Bte(e){return new $y(e)}function Vte(e){return new a0(e)}function jte(e){return new Fy(e)}function Ute(e){return new Dy(e)}function Hte(e){return new zy(e)}function Gte(e){return new _y(e)}function qte(e){return new Py(e)}function Xte(e){return new Wy(e)}function Kte(e){return new By(e)}function Zte(e){return new jy(e)}function Yte(e){return new Gy(e)}function Jte(e){return new Uy(e)}function Qte(e){return new Hy(e)}function ene(e){return new Vy(e)}function tne(e){return new qy(e)}function nne(e){return new Yy(e)}function ane(e){return new Jy(e)}function rne(e){return new Qy(e)}function G1(e){return new t2(e)}function sne(e){return G1(e)}function ine(e){return G1(e)}function q1(e){return new a2(e)}function one(e){return q1(e)}function lne(e){return q1(e)}function X1(e){return new s2(e)}function une(e){return X1(e)}function dne(e){return X1(e)}function pne(e){return new i2(e)}function cne(e){return new l2(e)}function Pw(e){return new o2(e)}function Lw(e){return new u2(e)}function Ww(e){return new e2(e)}function Bw(e){return new n2(e)}function hne(e){return new r2(e)}function fne(e){return new Cy(e)}function mne(e){return new t0(e)}function Ane(e){return new Ry(e)}function yne(e){return new Pd(e)}function gne(e){return new Ey(e)}function xne(e){return new e0(e)}function bne(e){return new My(e)}function vne(e){return new n0(e)}function wne(e){return new Ha(e)}function kne(e){return new Qh(e)}function Ine(e){return new p2(e)}function Sne(e){return new d2(e)}var Nne=Pw,Tne=Lw,Ene=Ww,Cne=Bw;function Rne(e){return new Xy(e)}function Mne(e){return new Ky(e)}function Fne(e){return new Zy(e)}function $ne(e){return new Ly(e)}var K4={};Fe(K4,{MAPE:()=>ure,MSE:()=>cre,binaryAccuracy:()=>Qae,binaryCrossentropy:()=>ere,categoricalAccuracy:()=>nre,categoricalCrossentropy:()=>are,cosineProximity:()=>ire,mape:()=>dre,meanAbsoluteError:()=>ore,meanAbsolutePercentageError:()=>lre,meanSquaredError:()=>pre,mse:()=>hre,precision:()=>rre,recall:()=>sre,sparseCategoricalAccuracy:()=>tre});function Qae(e,t){return ey(e,t)}function ere(e,t){return n4(e,t)}function tre(e,t){return a4(e,t)}function nre(e,t){return ty(e,t)}function are(e,t){return ny(e,t)}function rre(e,t){return t4(e,t)}function sre(e,t){return Jne(e,t)}function ire(e,t){return J1(e,t)}function ore(e,t){return Hh(e,t)}function lre(e,t){return Bl(e,t)}function ure(e,t){return Bl(e,t)}function dre(e,t){return Bl(e,t)}function pre(e,t){return Fi(e,t)}function cre(e,t){return Fi(e,t)}function hre(e,t){return Fi(e,t)}var Z4={};Fe(Z4,{modelFromJSON:()=>Fae});var Y4={};Fe(Y4,{l1:()=>mre,l1l2:()=>fre,l2:()=>Are});function fre(e){return new Dd(e)}function mre(e){return Wae(e)}function Are(e){return Bae(e)}var J4=class extends Wl{constructor(){super(...arguments);this.model=null}setModel(e){if(!(e instanceof pr))throw new Error("model must be a LayersModel, not some other Container");this.model=e}};function s0(e,t){return et}var e8=class extends J4{constructor(e){super();if(e==null&&(e={}),e.restoreBestWeights)throw new Oe("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,["auto","min","max"].indexOf(this.mode)===-1&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),this.mode==="min"?this.monitorFunc=s0:this.mode==="max"?this.monitorFunc=Q4:this.monitor.indexOf("acc")!==-1?this.monitorFunc=Q4:this.monitorFunc=s0,this.monitorFunc===s0&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,this.baseline!=null?this.best=this.baseline:this.best=this.monitorFunc===s0?Infinity:-Infinity}async onEpochEnd(e,t){await Ur(t);let n=this.getMonitorValue(t);n!=null&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){e==null&&(e={});let t=e[this.monitor];return t==null&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}};function yre(e){return new e8(e)}var gre={earlyStopping:yre},Ca;(function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"})(Ca||(Ca={}));var t8;(function(e){let t;(function(n){n[n.LEGACY=0]="LEGACY",n[n.V1=1]="V1",n[n.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(t8||(t8={}));var c2={};function xre(e,t){let n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};c2[e]=n}function n8(e){return c2[e]}function bre(e){delete c2[e]}function S(e,t,n,a,r){let s=t.inputParams[e];if(s&&s.inputIndexStart!==void 0){let o=s.inputIndexStart,l=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?o+1:s.inputIndexEnd;if(s.type==="tensor")return mn(t.inputNames[s.inputIndexStart],n,a,r);if(s.type==="tensors")return t.inputNames.slice(o,l).map(p=>mn(p,n,a,r));let d=mn(t.inputNames.slice(o)[0],n,a,r),u=d.dataSync();return s.type==="number"?u[0]:w.toNestedArray(d.shape,u)}let i=t.attrParams[e];return i&&i.value}function mn(e,t,n,a){let[r,s]=Ln(e);if(a!=null){let o=a.getHashTableHandleByName(r);if(o!=null)return o}let i=n.currentContextIds.find(o=>!!t[i0(r,o)]);return i!==void 0?t[i0(r,i)][s]:void 0}function vre(e,t,n){return t[i0(e,n.currentContextId)]}function cr(e,t){let[n,a]=Ln(e);return[i0(n,t&&t.currentContextId),a]}function i0(e,t){return t?`${e}-${t}`:e}function Ln(e){let t=e.split(":");return t.length===1?[e,0]:[t[0],Number(t[t.length-1])]}function o0(e,t,n){let a=S("pad",e,t,n);if(a==="explicit"){a=S("explicitPaddings",e,t,n);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=a[s*2],r[s][1]=a[s*2+1];return r}return a}function hr(e){return e.kept?e:Oa(e)}var a8={};Fe(a8,{json:()=>wre});var wre=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],r8={};Fe(r8,{json:()=>kre});var kre=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],s8={};Fe(s8,{json:()=>Ire});var Ire=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],i8={};Fe(i8,{json:()=>Sre});var Sre=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],o8={};Fe(o8,{json:()=>Nre});var Nre=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],l8={};Fe(l8,{json:()=>Tre});var Tre=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],u8={};Fe(u8,{json:()=>Ere});var Ere=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],d8={};Fe(d8,{json:()=>Cre});var Cre=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],p8={};Fe(p8,{json:()=>Rre});var Rre=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],c8={};Fe(c8,{json:()=>Mre});var Mre=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],h8={};Fe(h8,{json:()=>Fre});var Fre=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],f8={};Fe(f8,{json:()=>$re});var $re=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],m8={};Fe(m8,{json:()=>Dre});var Dre=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],A8={};Fe(A8,{json:()=>Ore});var Ore=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],y8={};Fe(y8,{json:()=>zre});var zre=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],g8={};Fe(g8,{json:()=>_re});var _re=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],x8={};Fe(x8,{json:()=>Pre});var Pre=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}],v8=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[a8,r8,s8,i8,o8,l8,u8,h8,c8,d8,f8,m8,A8,y8,g8,x8,p8],t=[].concat(...e.map(n=>n.json));this.opMappers=t.reduce((n,a)=>(n[a.tfOpName]=a,n),{})}transformGraph(e,t={}){let n=e.node,a=[],r=[],s=[],i=n.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?a.push(m[f.name]):f.op==="Const"?r.push(m[f.name]):(f.input==null||f.input.length===0)&&s.push(m[f.name]),m),{}),o=[],l=[],d={},u={};t!=null&&(d=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));let p=Object.keys(i);p.forEach(m=>{let f=i[m];f.inputNames.forEach(A=>{let[y]=cr(A);f.inputs.push(i[y]),i[y].children.push(f)})}),Object.keys(u).length===0?p.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(u).forEach(m=>{let[f]=cr(m),A=i[f];A!=null&&(A.signatureKey=u[m],l.push(A))}),Object.keys(d).length>0?Object.keys(d).forEach(m=>{let[f]=cr(m),A=i[f];A&&(A.signatureKey=d[m],o.push(A))}):o=a;let c={};e.library!=null&&e.library.function!=null&&(c=e.library.function.reduce((m,f)=>(m[f.signature.name]=this.mapFunction(f),m),{}));let h={nodes:i,inputs:o,outputs:l,weights:r,placeholders:a,signature:t,functions:c};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){let t=n8(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.substr(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return t.inputs!=null&&(n.inputParams=t.inputs.reduce((a,r)=>(a[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},a),{})),t.attrs!=null&&(n.attrParams=t.attrs.reduce((a,r)=>{let s=r.type,i;switch(r.type){case"string":i=h2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=h2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=v2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=v2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=m2(e.attr,r.tfName,r.defaultValue||0),i===void 0&&!!r.tfDeprecatedName&&(i=m2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=b2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=b2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=f2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=f2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=k2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=k2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=x2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=x2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=w2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=w2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=y2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=y2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=g2(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=g2(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=b8(e.attr,r.tfName,r.defaultValue),i===void 0&&!!r.tfDeprecatedName&&(i=b8(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${r.type} for op: ${e.op}`)}return a[r.name]={value:i,type:s},a},{})),n}mapFunction(e){let t=e.nodeDef,n=[],a=[],r={};t!=null&&(r=t.reduce((d,u)=>(d[u.name]=this.mapNode(u),u.op==="Const"&&a.push(d[u.name]),d),{}));let s=[],i=[];e.signature.inputArg.forEach(d=>{let[u]=cr(d.name),p={name:u,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:A2(d.type),type:"dtype"}},children:[]};p.signatureKey=d.name,s.push(p),r[u]=p}),Object.keys(r).forEach(d=>{let u=r[d];u.inputNames.forEach(p=>{let[c]=cr(p);u.inputs.push(r[c]),r[c].children.push(u)})});let o=e.ret;e.signature.outputArg.forEach(d=>{let[u,p]=cr(o[d.name]),c=r[u];c!=null&&(c.defaultOutput=p,i.push(c))});let l=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:a,placeholders:n,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n),t),{}),outputs:e.signature.outputArg.reduce((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t),{})}}mapArgToTensorInfo(e,t){let n=e.name;return t!=null&&(n=t[n]),{name:n,dtype:e.type}}};function Lre(e){let t=J().global;if(typeof t.atob!="undefined")return t.atob(e);if(typeof Buffer!="undefined")return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function w8(e,t){let n=Array.isArray(e)?String.fromCharCode.apply(null,e):Lre(e);return t?n:n.toLowerCase()}function h2(e,t,n,a=!1){let r=e[t];return r!=null?w8(r.s,a):n}function f2(e,t,n){let a=e[t];return a?a.b:n}function m2(e,t,n){let a=e[t]||{},r=a.i!=null?a.i:a.f!=null?a.f:n;return typeof r=="number"?r:parseInt(r,10)}function A2(e){switch(typeof e=="string"&&(e=Ca[e]),e){case Ca.DT_FLOAT:return"float32";case Ca.DT_INT32:case Ca.DT_INT64:case Ca.DT_INT8:case Ca.DT_UINT8:return"int32";case Ca.DT_BOOL:return"bool";case Ca.DT_DOUBLE:return"float32";case Ca.DT_STRING:return"string";default:return null}}function b8(e,t,n){let a=e[t];return a&&a.func?a.func.name:n}function y2(e,t,n){let a=e[t];return a&&a.type?A2(a.type):n}function g2(e,t,n){let a=e[t];return a&&a.list&&a.list.type?a.list.type.map(r=>A2(r)):n}function k8(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function x2(e,t,n){let a=e[t];return a&&a.shape?k8(a.shape):n}function b2(e,t,n){let a=e[t];return a?((a.list.f&&a.list.f.length?a.list.f:a.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):n}function v2(e,t,n,a=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>w8(s,a)):n}function w2(e,t,n){let a=e[t];return a&&a.list&&a.list.shape?a.list.shape.map(r=>k8(r)):n}function k2(e,t,n){let a=e[t];return a&&a.list&&a.list.b?a.list.b:n}var Wre=class{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(a=>this.getInput(a)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((a,r)=>(a[r]=this.getAttr(r),a),{}))}getInput(e){return mn(e,this.tensorMap,this.context)}getAttr(e,t){let n=this.node.rawAttrs[e];if(n.tensor!=null)return mn(e,this.tensorMap,this.context);if(n.i!=null||n.f!=null)return m2(this.node.rawAttrs,e,t);if(n.s!=null)return h2(this.node.rawAttrs,e,t);if(n.b!=null)return f2(this.node.rawAttrs,e,t);if(n.shape!=null)return x2(this.node.rawAttrs,e,t);if(n.type!=null)return y2(this.node.rawAttrs,e,t);if(n.list!=null){if(n.list.i!=null||n.list.f!=null)return b2(this.node.rawAttrs,e,t);if(n.list.s!=null)return v2(this.node.rawAttrs,e,t);if(n.list.shape!=null)return w2(this.node.rawAttrs,e,t);if(n.list.b!=null)return k2(this.node.rawAttrs,e,t);if(n.list.type!=null)return g2(this.node.rawAttrs,e,t)}return t}},Bre=(e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[se(S("a",e,t,n),S("b",e,t,n))];case"AddN":return[mc(S("tensors",e,t,n))];case"FloorMod":case"Mod":return[vA(S("a",e,t,n),S("b",e,t,n))];case"Mul":return[B(S("a",e,t,n),S("b",e,t,n))];case"RealDiv":case"Div":return[ge(S("a",e,t,n),S("b",e,t,n))];case"DivNoNan":return[dA(S("a",e,t,n),S("b",e,t,n))];case"FloorDiv":return[fc(S("a",e,t,n),S("b",e,t,n))];case"Sub":return[ye(S("a",e,t,n),S("b",e,t,n))];case"Minimum":return[yl(S("a",e,t,n),S("b",e,t,n))];case"Maximum":return[Pa(S("a",e,t,n),S("b",e,t,n))];case"Pow":return[sr(S("a",e,t,n),S("b",e,t,n))];case"SquaredDifference":return[Lc(S("a",e,t,n),S("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Vre=(e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Ot(S("x",e,t,n))];case"Acos":return[Xm(S("x",e,t,n))];case"Acosh":return[Km(S("x",e,t,n))];case"Asin":return[Ym(S("x",e,t,n))];case"Asinh":return[Jm(S("x",e,t,n))];case"Atan":return[Qm(S("x",e,t,n))];case"Atan2":return[eA(S("x",e,t,n),S("y",e,t,n))];case"Atanh":return[tA(S("x",e,t,n))];case"Ceil":return[sA(S("x",e,t,n))];case"Complex":return[Tr(S("real",e,t,n),S("imag",e,t,n))];case"Cos":return[Hu(S("x",e,t,n))];case"Cosh":return[bc(S("x",e,t,n))];case"Elu":return[fl(S("x",e,t,n))];case"Erf":return[pA(S("x",e,t,n))];case"Exp":return[qn(S("x",e,t,n))];case"Expm1":return[cA(S("x",e,t,n))];case"Floor":return[ml(S("x",e,t,n))];case"Log":return[Fn(S("x",e,t,n))];case"Log1p":return[Ic(S("x",e,t,n))];case"Imag":return[wc(S("x",e,t,n))];case"Neg":return[wt(S("x",e,t,n))];case"Reciprocal":return[IA(S("x",e,t,n))];case"Real":return[Ju(S("x",e,t,n))];case"Relu":return[La(S("x",e,t,n))];case"Round":return[SA(S("x",e,t,n))];case"Selu":return[$c(S("x",e,t,n))];case"Sigmoid":return[wn(S("x",e,t,n))];case"Sin":return[Dc(S("x",e,t,n))];case"Sign":return[TA(S("x",e,t,n))];case"Sinh":return[Oc(S("x",e,t,n))];case"Softplus":return[fi(S("x",e,t,n))];case"Sqrt":return[Jt(S("x",e,t,n))];case"Square":return[st(S("x",e,t,n))];case"Tanh":return[di(S("x",e,t,n))];case"Tan":return[RA(S("x",e,t,n))];case"ClipByValue":return[kn(S("x",e,t,n),S("clipValueMin",e,t,n),S("clipValueMax",e,t,n))];case"Relu6":return[Mc(S("x",e,t,n))];case"Rsqrt":return[Fc(mn(e.inputNames[0],t,n))];case"Prod":return[Cc(S("x",e,t,n),S("axes",e,t,n))];case"LeakyRelu":return[qu(S("x",e,t,n),S("alpha",e,t,n))];case"Prelu":return[Yu(S("x",e,t,n),S("alpha",e,t,n))];case"IsNan":return[fA(mn(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function ha(e,t,n=""){if(!(typeof e=="number"||typeof t=="number")){w.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let a=0;an+` Shapes ${e} and ${t} must match`)}}}function I8(e){return!(typeof e=="number"||e.some(t=>t<0))}function Bd(e,t,n){let a=I2(e,n),r=!I8(a);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${a}`);if(r&&t.forEach(s=>{a=I2(s.shape,a)}),!I8(a))throw new Error(`Non-fully-defined elementShape: ${a}`);return a}function I2(e,t){if(typeof e=="number")return t;if(typeof t=="number")return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);let n=[];for(let a=0;a=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[a]=r>=0?r:s}return n}var jre=class{constructor(e,t,n,a,r,s,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=a,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Ie(0),jt(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.tensor.id))&&t.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);let t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map(t=>this.read(t))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);let n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, + because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),ha(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,jt(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach((n,a)=>this.write(n,t[a]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let a=0;a=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,ua(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0,a=e.map(o=>(n+=o,n));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);let a=n===0?0:t.size/n,s=[];L(()=>{t=H(t,[1,n,a]);for(let o=0;o{if(n!==a.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${a.dtype}`);pr(t,a.shape,"TensorList shape mismatch: "),Vt(a)}),this.idTensor=ke(0),this.maxNumElements=r,Vt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new Vc([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.id))&&t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);pr(e,this.elementShape,"TensorList shape mismatch: ");let r=Bc(this.elementShape,this.tensors,e);return L(()=>{let a=this.tensors.map(s=>H(s,r));return On(a,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=Bc(this.elementShape,this.tensors,e),r=this.tensors.pop();return pr(r.shape,e,"TensorList shape mismatch: "),H(r,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(pr(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Vt(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);pr(this.tensors[e].shape,t,"TensorList shape mismatch: ");let r=Bc(this.elementShape,this.tensors,t);return H(this.tensors[e],r)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);pr(this.elementShape,t.shape,"TensorList shape mismatch: "),Vt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);pr(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let r=Bc(this.elementShape,this.tensors,n);return e.length===0?xr([],[0].concat(r)):L(()=>{let a=e.map(s=>H(this.tensors[s],r));return On(a,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);pr(this.elementShape,t,"TensorList shape mismatch: ");let n=Bc(this.elementShape,this.tensors,t);return this.size()===0?xr([],[0].concat(n)):L(()=>{let r=this.tensors.map(a=>H(a,n));return ot(r,0)})}};function Lae(e,t,n){let r=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let a=e.shape.slice(1);pr(a,t,"TensorList shape mismatch: ");let s=ur(e);return new Vc(s,t,r)}function Wae(e,t,n){return new Vc([],e,t,n)}function Bae(e,t,n,r){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let a=Math.max(...t);if(r!=null&&r!==-1&&a>=r)throw new Error(`Max index must be < array size (${a} vs. ${r})`);let s=new Vc([],n,e.dtype,r),i=ur(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function Vae(e,t,n){let r=0,a=t.map(u=>(r+=u,r));if(r!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);let r=n===0?0:t.size/n,s=[];L(()=>{t=H(t,[1,n,r]);for(let o=0;o{if(n!==r.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${r.dtype}`);ha(t,r.shape,"TensorList shape mismatch: "),jt(r)}),this.idTensor=Ie(0),this.maxNumElements=a,jt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new Vd([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(t=>{(e==null||!e.has(t.id))&&t.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(n!==-1&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);ha(e,this.elementShape,"TensorList shape mismatch: ");let a=Bd(this.elementShape,this.tensors,e);return L(()=>{let r=this.tensors.map(s=>H(s,a));return zn(r,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=Bd(this.elementShape,this.tensors,e),a=this.tensors.pop();return ha(a.shape,e,"TensorList shape mismatch: "),H(a,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(ha(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");jt(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);ha(this.tensors[e].shape,t,"TensorList shape mismatch: ");let a=Bd(this.elementShape,this.tensors,t);return H(this.tensors[e],a)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);ha(this.elementShape,t.shape,"TensorList shape mismatch: "),jt(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);ha(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());let a=Bd(this.elementShape,this.tensors,n);return e.length===0?xa([],[0].concat(a)):L(()=>{let r=e.map(s=>H(this.tensors[s],a));return zn(r,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);ha(this.elementShape,t,"TensorList shape mismatch: ");let n=Bd(this.elementShape,this.tensors,t);return this.size()===0?xa([],[0].concat(n)):L(()=>{let a=this.tensors.map(r=>H(r,n));return ot(a,0)})}};function Ure(e,t,n){let a=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);let r=e.shape.slice(1);ha(r,t,"TensorList shape mismatch: ");let s=ua(e);return new Vd(s,t,a)}function Hre(e,t,n){return new Vd([],e,t,n)}function Gre(e,t,n,a){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);let r=Math.max(...t);if(a!=null&&a!==-1&&r>=a)throw new Error(`Max index must be < array size (${r} vs. ${a})`);let s=new Vd([],n,e.dtype,a),i=ua(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function qre(e,t,n){let a=0,r=t.map(u=>(a+=u,a));if(a!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${r}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=k2(s,n),o=r===0?0:e.size/r,l=L(()=>{let u=[];e=H(e,[1,r,o]);for(let h=0;h{switch(e.op){case"If":case"StatelessIf":{let r=I("thenBranch",e,t,n),a=I("elseBranch",e,t,n),s=I("cond",e,t,n),i=I("args",e,t,n);return(await s.data())[0]?n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let r=I("body",e,t,n),a=I("cond",e,t,n),s=I("args",e,t,n),i=await n.functionMap[a].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(u=>u.id),l=await i[0].data();i.forEach(u=>{!u.kept&&o.indexOf(u.id)===-1&&u.dispose()});let c=s;for(;l[0];){let u=c;c=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);let h=c.map(p=>p.id);u.forEach(p=>{!p.kept&&o.indexOf(p.id)===-1&&h.indexOf(p.id)===-1&&p.dispose()});let d=await n.functionMap[a].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);l=await d[0].data(),d.forEach(p=>{!p.kept&&o.indexOf(p.id)===-1&&h.indexOf(p.id)===-1&&p.dispose()})}return c}case"LoopCond":{let r=I("pred",e,t,n);return[ma(r)]}case"Switch":{let r=I("pred",e,t,n),a=I("data",e,t,n);return a.kept||(a=ma(a)),(await r.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{let r=e.inputNames.find(a=>mn(a,t,n)!==void 0);if(r){let a=mn(r,t,n);return[ma(a)]}return}case"Enter":{let r=I("frameName",e,t,n),a=I("tensor",e,t,n);return n.enterFrame(r),[ma(a)]}case"Exit":{let r=I("tensor",e,t,n);return n.exitFrame(),[ma(r)]}case"NextIteration":{let r=I("tensor",e,t,n);return n.nextIteration(),[ma(r)]}case"TensorArrayV3":{let r=I("size",e,t,n),a=I("dtype",e,t,n),s=I("elementShape",e,t,n),i=I("dynamicSize",e,t,n),o=I("clearAfterRead",e,t,n),l=I("identicalElementShapes",e,t,n),c=I("name",e,t,n),u=new Pae(c,a,r,s,l,i,o);return n.addTensorArray(u),[u.idTensor,ke(1)]}case"TensorArrayWriteV3":{let r=I("tensorArrayId",e,t,n),a=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(r.id);return i.write(a,s),[i.idTensor]}case"TensorArrayReadV3":{let r=I("tensorArrayId",e,t,n),a=I("index",e,t,n);return[n.getTensorArray(r.id).read(a)]}case"TensorArrayGatherV3":{let r=I("tensorArrayId",e,t,n),a=I("indices",e,t,n),s=I("dtype",e,t,n);return[n.getTensorArray(r.id).gather(a,s)]}case"TensorArrayScatterV3":{let r=I("tensorArrayId",e,t,n),a=I("indices",e,t,n),s=I("tensor",e,t,n),i=n.getTensorArray(r.id);return i.scatter(a,s),[i.idTensor]}case"TensorArrayConcatV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id),s=I("dtype",e,t,n);return[a.concat(s)]}case"TensorArraySplitV3":{let r=I("tensorArrayId",e,t,n),a=I("tensor",e,t,n),s=I("lengths",e,t,n),i=n.getTensorArray(r.id);return i.split(s,a),[i.idTensor]}case"TensorArraySizeV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return[ke(a.size(),"int32")]}case"TensorArrayCloseV3":{let r=I("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{let r=I("tensorListId",e,t,n),a=I("index",e,t,n),s=I("tensor",e,t,n),i=n.getTensorList(r.id);return i.setItem(a,s),[i.idTensor]}case"TensorListGetItem":{let r=I("tensorListId",e,t,n),a=I("index",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(a,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let r=I("indices",e,t,n),a=I("tensor",e,t,n),s=I("elementShape",e,t,n),i=I("numElements",e,t,n),o=Bae(a,r,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let r=I("elementShape",e,t,n),a=I("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=I(s,e,t,n),o=Wae(r,a,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let r=I("tensorListId",e,t,n),a=I("indices",e,t,n),s=I("elementShape",e,t,n),i=I("elementDType",e,t,n);return[n.getTensorList(r.id).gather(a,i,s)]}case"TensorListStack":{let r=I("tensorListId",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=I("numElements",e,t,n);return[n.getTensorList(r.id).stack(a,s,i)]}case"TensorListFromTensor":{let r=I("tensor",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n),i=Lae(r,a,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let r=I("tensorListId",e,t,n),a=n.getTensorList(r.id),s=I("dtype",e,t,n),i=I("elementShape",e,t,n);return[a.concat(s,i)]}case"TensorListPushBack":{let r=I("tensorListId",e,t,n),a=I("tensor",e,t,n),s=n.getTensorList(r.id);return s.pushBack(a),[s.idTensor]}case"TensorListPopBack":{let r=I("tensorListId",e,t,n),a=I("elementShape",e,t,n),s=I("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(a,s)]}case"TensorListSplit":{let r=I("tensor",e,t,n),a=I("elementShape",e,t,n),s=I("lengths",e,t,n),i=Vae(r,s,a);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function k4(e,t,n){let[r,a]=I("fusedOps",e,t,n),s=r==="biasadd",i=a==="prelu",o=r==="fusedbatchnorm",l=I("numArgs",e,t,n);if(s){if(i&&l!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&l!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(o)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let c=I("strides",e,t,n),u=o0(e,t,n),h=I("dataFormat",e,t,n).toUpperCase(),d=I("dilations",e,t,n),[p,m]=I("args",e,t,n),f=I("leakyreluAlpha",e,t,n);return{stride:c,pad:u,dataFormat:h,dilations:d,biasArg:p,preluArg:m,activationFunc:a,leakyreluAlpha:f}}var Uae=(e,t,n)=>{switch(e.op){case"Conv1D":{let r=I("stride",e,t,n),a=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilation",e,t,n);return[gd(I("x",e,t,n),I("filter",e,t,n),r,a,s,i)]}case"Conv2D":{let r=I("strides",e,t,n),a=o0(e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[sa(I("x",e,t,n),I("filter",e,t,n),[r[1],r[2]],a,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:r,pad:a,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:c,leakyreluAlpha:u}=k4(e,t,n);return[Pa.conv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{let{stride:r,pad:a,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:c,leakyreluAlpha:u}=k4(e,t,n);return[Pa.depthwiseConv2d({x:I("x",e,t,n),filter:I("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:c,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let r=I("outputShape",e,t,n),a=I("strides",e,t,n),s=o0(e,t,n);return[xd(I("x",e,t,n),I("filter",e,t,n),r,[a[1],a[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let r=I("strides",e,t,n),a=o0(e,t,n),s=I("dilations",e,t,n),i=I("dataFormat",e,t,n).toUpperCase();return[pl(I("input",e,t,n),I("filter",e,t,n),[r[1],r[2]],a,i,[s[1],s[2]])]}case"Conv3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("dataFormat",e,t,n).toUpperCase(),i=I("dilations",e,t,n);return[om(I("x",e,t,n),I("filter",e,t,n),[r[1],r[2],r[3]],a,s,[i[1],i[2],i[3]])]}case"AvgPool":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[ju(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPool":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[Ku(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPoolWithArgmax":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n),i=I("includeBatchInIndex",e,t,n),{result:o,indexes:l}=Uw(I("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a,i);return[o,l]}case"AvgPool3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[am(I("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"MaxPool3D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("kernelSize",e,t,n);return[xm(I("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"Dilation2D":{let r=I("strides",e,t,n),a=I("pad",e,t,n),s=I("dilations",e,t,n),i=r[1],o=r[2],l=s[1],c=s[2];return[um(I("x",e,t,n),I("filter",e,t,n),[i,o],a,[l,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Hae=(e,t,n)=>{switch(e.op){case"Fill":{let r=I("shape",e,t,n),a=I("dtype",e,t,n),s=I("value",e,t,n);return[Gu(r,s,a)]}case"LinSpace":{let r=I("start",e,t,n),a=I("stop",e,t,n),s=I("num",e,t,n);return[zw(r,a,s)]}case"Multinomial":{let r=I("logits",e,t,n),a=I("numSamples",e,t,n),s=I("seed",e,t,n);return[Hw(r,a,s)]}case"OneHot":{let r=I("indices",e,t,n),a=I("depth",e,t,n),s=I("onValue",e,t,n),i=I("offValue",e,t,n);return[ol(r,a,s,i)]}case"Ones":return[Fn(I("shape",e,t,n),I("dtype",e,t,n))];case"OnesLike":return[$n(I("x",e,t,n))];case"RandomUniform":return[gl(I("shape",e,t,n),I("minval",e,t,n),I("maxval",e,t,n),I("dtype",e,t,n))];case"Range":{let r=I("start",e,t,n),a=I("stop",e,t,n),s=I("step",e,t,n);return[Cd(r,a,s,I("dtype",e,t,n))]}case"TruncatedNormal":{let r=I("shape",e,t,n),a=I("mean",e,t,n),s=I("stdDev",e,t,n),i=I("seed",e,t,n);return[Wd(r,a,s,I("dtype",e,t,n),i)]}case"Zeros":return[Et(I("shape",e,t,n),I("dtype",e,t,n))];case"ZerosLike":return[Ue(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function I2(e,t,n){let r=I("boxes",e,t,n),a=I("scores",e,t,n),s=I("maxOutputSize",e,t,n),i=I("iouThreshold",e,t,n),o=I("scoreThreshold",e,t,n),l=I("softNmsSigma",e,t,n);return{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var Gae=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}=I2(e,t,n),c=await Ye.nonMaxSuppressionWithScoreAsync(r,a,s,i,o,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=I2(e,t,n),l=I("padToMaxOutputSize",e,t,n),c=await Ye.nonMaxSuppressionPaddedAsync(r,a,s,i,o,l);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:r,scores:a,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=I2(e,t,n);return[await Ye.nonMaxSuppressionAsync(r,a,s,i,o)]}case"Where":{let r=Ae(I("condition",e,t,n),"bool"),a=[await Fm(r)];return r.dispose(),a}case"ListDiff":return Xw(I("x",e,t,n),I("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},qae=(e,t,n)=>{switch(e.op){case"TopKV2":{let r=I("x",e,t,n),a=I("k",e,t,n),s=I("sorted",e,t,n),i=Rm(r,a,s);return[i.values,i.indices]}case"Unique":{let r=I("x",e,t,n),a=Bd(r);return[a.values,a.indices]}case"UniqueV2":{let r=I("x",e,t,n),a=I("axis",e,t,n),s=Bd(r,a);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Xae=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let r=I("default",e,t,n);return[mn(e.name,t,n)||r];case"Placeholder":return[mn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let c=I("x",e,t,n);return[ma(c)]}case"IdentityN":return I("x",e,t,n).map(c=>ma(c));case"Snapshot":let a=I("x",e,t,n);return[ma(a)];case"Shape":return[nn(I("x",e,t,n).shape,"int32")];case"ShapeN":return I("x",e,t,n).map(c=>nn(c.shape));case"Size":return[ke(I("x",e,t,n).size,"int32")];case"Rank":return[ke(I("x",e,t,n).rank,"int32")];case"NoOp":return[ke(1)];case"Print":let s=I("x",e,t,n),i=I("data",e,t,n),o=I("message",e,t,n),l=I("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let c=0;ce.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(r=>r.dispose()),this.tensorMap.clear(),L(()=>{let r=ur(t),a=n.length,s=r.length;_.assert(a===s,()=>`The number of elements doesn't match, keys has ${a} elements, the values has ${s} elements.`);for(let i=0;i{let r=[];for(let a=0;a{switch(e.op){case"HashTable":case"HashTableV2":{let a=I("keyDType",e,t,n),s=I("valueDType",e,t,n),i=new Kae(a,s);return r.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let a=I("tableHandle",e,t,n,r),s=I("keys",e,t,n),i=I("values",e,t,n);return[await r.getHashTableById(a.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let a=I("tableHandle",e,t,n,r),s=I("keys",e,t,n),i=I("defaultValue",e,t,n);return[await r.getHashTableById(a.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let a=I("tableHandle",e,t,n,r);return[r.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Yae=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let r=I("images",e,t,n),a=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[Ye.resizeBilinear(r,[a[0],a[1]],s,i)]}case"ResizeNearestNeighbor":{let r=I("images",e,t,n),a=I("size",e,t,n),s=I("alignCorners",e,t,n),i=I("halfPixelCenters",e,t,n);return[Ye.resizeNearestNeighbor(r,[a[0],a[1]],s,i)]}case"CropAndResize":{let r=I("image",e,t,n),a=I("boxes",e,t,n),s=I("boxInd",e,t,n),i=I("cropSize",e,t,n),o=I("method",e,t,n),l=I("extrapolationValue",e,t,n);return[Ye.cropAndResize(r,a,s,i,o,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Jae=(e,t,n)=>{switch(e.op){case"Equal":return[$a(I("a",e,t,n),I("b",e,t,n))];case"NotEqual":return[Ai(I("a",e,t,n),I("b",e,t,n))];case"Greater":return[or(I("a",e,t,n),I("b",e,t,n))];case"GreaterEqual":return[Oa(I("a",e,t,n),I("b",e,t,n))];case"Less":return[vd(I("a",e,t,n),I("b",e,t,n))];case"LessEqual":return[pi(I("a",e,t,n),I("b",e,t,n))];case"LogicalAnd":return[lr(I("a",e,t,n),I("b",e,t,n))];case"LogicalNot":return[Xu(I("a",e,t,n))];case"LogicalOr":return[Nd(I("a",e,t,n),I("b",e,t,n))];case"Select":case"SelectV2":return[kn(I("condition",e,t,n),I("a",e,t,n),I("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Qae=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[Be(I("a",e,t,n),I("b",e,t,n),I("transposeA",e,t,n),I("transposeB",e,t,n))];case"Einsum":return[$w(I("equation",e,t,n),...I("tensors",e,t,n))];case"Transpose":return[Ze(I("x",e,t,n),I("perm",e,t,n))];case"_FusedMatMul":let[r,a]=I("fusedOps",e,t,n),s=r==="biasadd",i=a==="prelu",o=I("numArgs",e,t,n),l=I("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[c,u]=I("args",e,t,n);return[Pa.matMul({a:I("a",e,t,n),b:I("b",e,t,n),transposeA:I("transposeA",e,t,n),transposeB:I("transposeB",e,t,n),bias:c,activation:a,preluActivationWeights:u,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},ese=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[hi(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"FusedBatchNormV3":return[hi(I("x",e,t,n),I("mean",e,t,n),I("variance",e,t,n),I("offset",e,t,n),I("scale",e,t,n),I("epsilon",e,t,n))];case"LRN":return[mm(I("x",e,t,n),I("radius",e,t,n),I("bias",e,t,n),I("alpha",e,t,n),I("beta",e,t,n))];case"Softmax":return[ec(I("x",e,t,n))];case"LogSoftmax":return[Sd(I("x",e,t,n))];case"SparseToDense":return[$m(I("sparseIndices",e,t,n),I("outputShape",e,t,n),I("sparseValues",e,t,n),I("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},tse=(e,t,n)=>{switch(e.op){case"Max":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Xn(I("x",e,t,n),i,o)]}case"Mean":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[vt(I("x",e,t,n),i,o)]}case"Min":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Al(I("x",e,t,n),i,o)]}case"Sum":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ne(I("x",e,t,n),i,o)]}case"All":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ad(I("x",e,t,n),i,o)]}case"Any":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Wu(I("x",e,t,n),i,o)]}case"ArgMax":{let i=I("axis",e,t,n);return[Bu(I("x",e,t,n),i)]}case"ArgMin":{let i=I("axis",e,t,n);return[Zf(I("x",e,t,n),i)]}case"Prod":{let i=I("axis",e,t,n),o=I("keepDims",e,t,n);return[Ed(I("x",e,t,n),i,o)]}case"Cumsum":{let i=I("axis",e,t,n),o=I("exclusive",e,t,n),l=I("reverse",e,t,n);return[bd(I("x",e,t,n),i,o,l)]}case"Bincount":let r=I("x",e,t,n),a=I("weights",e,t,n),s=I("size",e,t,n);return[Sw(r,a,s)];case"DenseBincount":{let i=I("x",e,t,n),o=I("weights",e,t,n),l=I("size",e,t,n),c=I("binaryOutput",e,t,n);return[Mw(i,o,l,c)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},nse=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let r=I("n",e,t,n),a=I("axis",e,t,n),s=I("tensors",e,t,n);return s=s.slice(0,r),[ot(s,a)]}case"Gather":{let r=I("x",e,t,n),a=I("indices",e,t,n);return[di(r,Ae(a,"int32"),0)]}case"GatherV2":{let r=I("axis",e,t,n),a=I("batchDims",e,t,n),s=I("x",e,t,n),i=I("indices",e,t,n);return[di(s,Ae(i,"int32"),r,a)]}case"Reverse":{let r=I("dims",e,t,n),a=[];for(let i=0;i{let r=I("axis",e,t,n),a=I("tensors",e,t,n),s=a[0].shape,i=za(a[0]).shape,o=a.map(l=>{let c=_.arraysEqual(l.shape,s);if(!c&&!_.arraysEqual(za(l).shape,i))throw new Error("the input tensors shape does not match");return c?l:H(l,s)});return[On(o,r)]});case"Unpack":{let r=I("axis",e,t,n),a=I("tensor",e,t,n);return ur(a,r)}case"Tile":{let r=I("reps",e,t,n);return[Da(I("x",e,t,n),r)]}case"Split":case"SplitV":{let r=I("axis",e,t,n),a=I("numOrSizeSplits",e,t,n),s=I("x",e,t,n);return ln(s,a,r)}case"ScatterNd":{let r=I("indices",e,t,n),a=I("values",e,t,n),s=I("shape",e,t,n);return[Jw(r,a,s)]}case"GatherNd":{let r=I("x",e,t,n),a=I("indices",e,t,n);return[Qw(r,a)]}case"SparseToDense":{let r=I("sparseIndices",e,t,n),a=I("outputShape",e,t,n),s=I("sparseValues",e,t,n),i=I("defaultValue",e,t,n);return[$m(r,s,a,s.dtype===i.dtype?i:Ae(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},rse=(e,t,n)=>{switch(e.op){case"SparseReshape":{let{outputIndices:r,outputShape:a}=fb.sparseReshape(I("inputIndices",e,t,n),I("inputShape",e,t,n),I("newShape",e,t,n));return[r,a]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ase=(e,t,n)=>{switch(e.op){case"FFT":return[tc(I("x",e,t,n))];case"IFFT":return[xl(I("x",e,t,n))];case"RFFT":return[nc(I("x",e,t,n))];case"IRFFT":return[Pd(I("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},sse=(e,t,n)=>{switch(e.op){case"Cast":return[Ae(I("x",e,t,n),I("dtype",e,t,n))];case"ExpandDims":{let r=I("axis",e,t,n);return[on(I("x",e,t,n),r)]}case"Squeeze":{let r=I("axis",e,t,n);return[za(I("x",e,t,n),r)]}case"Reshape":return[H(I("x",e,t,n),I("shape",e,t,n))];case"MirrorPad":return[wm(I("x",e,t,n),I("padding",e,t,n),I("mode",e,t,n))];case"PadV2":case"Pad":return[ia(I("x",e,t,n),I("padding",e,t,n),I("constantValue",e,t,n))];case"SpaceToBatchND":{let r=I("blockShape",e,t,n),a=I("paddings",e,t,n);return[Zu(I("x",e,t,n),r,a)]}case"BatchToSpaceND":{let r=I("blockShape",e,t,n),a=I("crops",e,t,n);return[Uu(I("x",e,t,n),r,a)]}case"DepthToSpace":{let r=I("blockSize",e,t,n),a=I("dataFormat",e,t,n).toUpperCase();return[lm(I("x",e,t,n),r,a)]}case"BroadcastTo":return[hl(I("x",e,t,n),I("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function I4(e,t,n,r){let a=((s,i,o)=>{switch(s.category){case"arithmetic":return L(()=>Oae(s,i,o));case"basic_math":return L(()=>zae(s,i,o));case"control":return jae(s,i,o);case"convolution":return L(()=>Uae(s,i,o));case"creation":return L(()=>Hae(s,i,o));case"dynamic":return Gae(s,i,o);case"evaluation":return L(()=>qae(s,i,o));case"image":return L(()=>Yae(s,i,o));case"graph":return L(()=>Xae(s,i,o));case"logical":return L(()=>Jae(s,i,o));case"matrices":return L(()=>Qae(s,i,o));case"normalization":return L(()=>ese(s,i,o));case"reduction":return L(()=>tse(s,i,o));case"slice_join":return L(()=>nse(s,i,o));case"sparse":return L(()=>rse(s,i,o));case"spectral":return L(()=>ase(s,i,o));case"transformation":return L(()=>sse(s,i,o));case"hash_table":return Zae(s,i,o,r);case"custom":let l=t4(s.op);if(l&&l.customExecutor)return l.customExecutor(new Dae(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return _.isPromise(a)?a.then(s=>[].concat(s)):[].concat(a)}var S4=class{constructor(e={},t={},n={},r={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let e=[];for(let t=0;tt.id===0&&t.iterationId===0?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;let e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function T4(e,t,n,r){let a=new Set,s=[],i=null,o=null,l=new Set,c=Object.keys(e).map(d=>Ln(d)[0]),u=[];r!=null&&(u=r.map(d=>Ln(d.name)[0]));let h=[...t];for(;h.length>0;){let d=h.pop();if((N4(d)||ise(d)||ose(d))&&i==null&&(i=d,o=i.children.map(p=>p.name).filter(p=>a.has(p))),a.add(d.name),n[d.name]==null&&c.indexOf(d.name)===-1&&u.indexOf(d.name)===-1){if(d.inputs.length===0){s.push(d.name);continue}d.inputs.forEach(p=>{l.has(p.name)||(l.add(p.name),h.push(p))})}}return{inputs:e,outputs:t,usedNodes:a,missingInputs:s,dynamicNode:i,syncInputs:o}}function lse(e,t,n){let{usedNodes:r,inputs:a}=n,s=[],i=Object.keys(a).map(u=>Ln(u)[0]).map(u=>e.nodes[u]),o=e.initNodes;i.forEach(u=>{r.has(u.name)&&s.push(u)}),e.weights.forEach(u=>{r.has(u.name)&&s.push(u)}),o!=null&&o.forEach(u=>{r.has(u.name)&&s.push(u)});let l=new Set,c=[];for(;s.length>0;){let u=s.pop();l.add(u.name),t[u.name]||c.push(u),u.children.forEach(h=>{!l.has(h.name)&&r.has(h.name)&&h.inputs.every(d=>l.has(d.name))&&s.push(h)})}return c}var use=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],cse=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],hse=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function N4(e){return use.indexOf(e.op)>=0}function ise(e){return cse.indexOf(e.op)>=0}function ose(e){return hse.indexOf(e.op)>=0}var S2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(n=>{this._functionExecutorMap[n]=new S2(e.functions[n],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){let t=Object.keys(e).map(n=>e[n].map(r=>r.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(a=>a.name).sort(),r=t.map(a=>a.name).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(e,t){let n=T4(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:a,syncInputs:s}=n;if(a!=null)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(r.length>0){let i=t.map(l=>l.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${r}]`)}return lse(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let r=n.map(u=>this.graph.nodes[Ln(u)[0]]),a=t.map(u=>Ln(u)[0]),s=a.map(u=>this.graph.nodes[u]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(r,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let l={},c={};return L(()=>{let u=new S4(this.weightMap,l,c,this.functionExecutorMap),h=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,A]=Ln(m),y=[];y[A]=e[m],h[f]=y});let d=this.getFrozenTensorIds(h),p={};for(let m=0;mmn(m,h,u))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(r=>r.id)));return new Set(t)}checkTensorForDisposal(e,t,n,r,a,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let l=Aae(o.name,n,r);l!=null&&l.forEach(c=>{if(c&&!c.kept&&!a.has(c.id)){let u=i[c.id];u===1?(c.dispose(),delete i[c.id]):u!=null&&i[c.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,r={},a={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new S4(this.weightMap,r,a,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(h=>mn(h,i,s)),l=o.map(h=>h.id),c=Object.keys(e).map(h=>e[h].id),u=new Set([...l,...c,...this.weightIds]);return Object.keys(i).forEach(h=>{i[h].forEach(d=>{d&&!d.kept&&!d.isDisposed&&!u.has(d.id)&&d.dispose()})}),this.parent==null&&s.dispose(u),o}async executeFunctionAsync(e,t,n){let r=e.reduce((a,s,i)=>(a[this.inputs[i].name]=s,a),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){let a=Object.keys(e),s=a.map(g=>this.graph.nodes[Ln(g)[0]]),i=n.map(g=>Ln(g)[0]),o=i.map(g=>this.graph.nodes[g]);o.length===0&&(o=this._outputs);let{usedNodes:l,missingInputs:c,dynamicNode:u,syncInputs:h}=T4(e,o,this.weightMap,this._initNodes),d=[...s,...this.graph.weights,...this._initNodes||[]].map(g=>({node:g,contexts:t.currentContext})),p=Object.assign({},this.weightMap);Object.keys(e).forEach(g=>{let[x,v]=Ln(g),w=[];w[v]=e[g],p[x]=w});let m={},f=this.getFrozenTensorIds(p),A={};for(;d.length>0;){let g=this.processStack(s,d,t,p,A,f,i,m,l);await Promise.all(g)}u==null&&!r&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(g=>!N4(g)&&!mn(g.name,p,t)).map(g=>g.name);if(y.length>0){let g="";throw u!=null&&(g=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${a}]. Consider providing the following inputs: [${c}]. ${g}`)}return p}processStack(e,t,n,r,a,s,i,o,l){let c=[];for(;t.length>0;){let u=t.pop();n.currentContext=u.contexts;let h="";if(u.node.op==="Enter"&&I("isConstant",u.node,r,n)&&([h]=fa(u.node.name,n)),r[u.node.name]==null){let d=I4(u.node,r,n,this._resourceManager);h||([h]=fa(u.node.name,n));let p=n.currentContext;_.isPromise(d)?c.push(d.then(m=>(r[h]=m,n.currentContext=p,this.checkTensorForDisposal(h,u.node,r,n,s,i,o),this.processChildNodes(u.node,t,n,r,a,l),m))):(r[h]=d,this.checkTensorForDisposal(h,u.node,r,n,s,i,o),this.processChildNodes(u.node,t,n,r,a,l))}else this.processChildNodes(u.node,t,n,r,a,l)}return c}processChildNodes(e,t,n,r,a,s){e.children.forEach(i=>{let[o]=fa(i.name,n);a[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(l=>!!mn(l,r,n))&&(a[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(l=>!!mn(l,r,n))&&(a[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[r]=Ln(t),a=this.graph.nodes[r];if(a.attrParams.shape&&a.attrParams.shape.value){let s=a.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,l)=>s[l]===-1||s[l]===o);_.assert(i,()=>`The shape of dict['${a.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}a.attrParams.dtype&&a.attrParams.dtype.value&&_.assert(n.dtype===a.attrParams.dtype.value,()=>`The dtype of dict['${a.name}'] provided in model.execute(dict) must be ${a.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let r=this._signature.inputs[n];t[r.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[r]=Ln(n);return this.graph.nodes[r]==null});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(t=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Ln(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},dse=class{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},pse="?tfjs-format=file",fse="model.json",E4=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new dse}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=bn.browserHTTPRequest(e,this.loadOptions);else{let t=bn.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(bn.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let r=bn.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new S2(w4.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let a=w4.Instance.transformGraph(e.modelInitializer);this.initializer=new S2(a),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=bn.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Le)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,r)=>(t[n]=e[r],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function Ht(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${fse}${pse}`);let n=new E4(e,t);return await n.load(),n}var mse="3.5.0",C4={};Me(C4,{CSVDataset:()=>M4,Dataset:()=>Ul,FileDataSource:()=>F4,TextLineDataset:()=>R4,URLDataSource:()=>$4,array:()=>Ase,csv:()=>gse,func:()=>xse,generator:()=>wse,microphone:()=>_se,version_data:()=>vse,webcam:()=>bse,zip:()=>yse});var kse=Yi(zg()),Ise=Yi(zg());function Sse(e,t){return l0(e,t)}function l0(e,t,n=new Map,r=new Set){if(e==null)return null;if(r.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let a=t(e);if(a.recurse&&a.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(a.recurse)if(Hl(e)){let s=Array.isArray(e)?[]:{};r.add(e);for(let i in e){let o=e[i],l=l0(o,t,n,r);s[i]=l}return r.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,a.value),a.value}function Nse(e,t=O4){return D4(e,t)}function D4(e,t,n=new Set){let r=e[0];if(n.has(r))throw new Error("Circular references are not supported.");let a=t(e);if(a.recurse&&a.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(a.recurse)if(Hl(r)){let s=Array.isArray(r)?[]:{};n.add(r);for(let i in r){let o=e.map(c=>c[i]),l=D4(o,t,n);s[i]=l}return n.delete(r),s}else throw new Error(`Can't recurse into non-iterable type: ${r}`);else return a.value}function O4(e){return e===null?null:Hl(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function z4(e,t){let n=new Map;l0(e,t,n);for(let r of Array.from(n.keys())){let a=n.get(r);if(_.isPromise(a)){let s=await a;n.set(r,s)}}return l0(e,t,n)}function Hl(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Le))}function Ese(e){return e==null||Tse(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Le||_.isTypedArray(e)}function Tse(e){return e===null||typeof e!="object"&&typeof e!="function"}function Rse(e){return Sse(e,Cse)}function Cse(e){return e instanceof Le?{value:e.clone(),recurse:!1}:Hl(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var P4=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},N2=class extends P4{constructor(){super(N2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let r=0;rt===!0)}rowMajorBatch(e,t=!0){return new Wse(this,e,t)}columnMajorBatch(e,t=!0,n=O4){return this.rowMajorBatch(e,t).map(r=>Nse(r,n))}concatenate(e,t){return new W4(L4([this,e]),t)}take(e){return e<0||e==null?this:new Lse(this,e)}skip(e){return e<0||e==null?this:new Pse(this,e)}prefetch(e){return new V4(this,e)}shuffle(e,t){return new Hse(this,e,t)}serial(){return new zse(this)}},Mse=class extends Gt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:Rse(e),done:!1}}},Fse=class extends Gt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},zse=class extends Gt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},Pse=class extends Gt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Wse=class extends Gt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Bse=class extends Gt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Te(e.value)}}},Vse=class extends Gt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=yr.getTensorsInContainer(e.value),n=this.transform(e.value),r=yr.getTensorsInContainer(n);for(let a of t)yr.isTensorInList(a,r)||a.dispose();return{value:n,done:!1}}},jse=class extends Gt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},B4=class extends Gt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=yr.getTensorsInContainer(e.value),n=await this.transform(e.value),r=yr.getTensorsInContainer(n);for(let a of t)yr.isTensorInList(a,r)||a.dispose();return{value:n,done:!1}}},E2=class extends Gt{constructor(){super();this.outputQueue=new N2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},Use=class extends E2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=yr.getTensorsInContainer(e.value),n=this.transform(e.value),r=yr.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let a of t)yr.isTensorInList(a,r)||a.dispose();return!0}},W4=class extends Gt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},Za;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(Za||(Za={}));var Dse=class extends Gt{constructor(e,t=Za.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function r(s){return s instanceof Gt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let a=await z4(this.iterators,r);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case Za.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case Za.SHORTEST:return{value:null,done:!0};case Za.LONGEST:default:}return this.count++,{value:a,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},V4=class extends Gt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new P4(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},Hse=class extends V4{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Ise.alea(n||_.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},Ul=class{constructor(){this.size=null}batch(e,t=!0){let n=this;_.assert(e>0,()=>`batchSize needs to be positive, but it is - ${e}`);let r;return this.size===Infinity||this.size==null?r=this.size:t?r=Math.ceil(this.size/e):r=Math.floor(this.size/e),Wn(async()=>(await n.iterator()).columnMajorBatch(e,t,Gse),r)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Wn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Wn(async()=>(await t.iterator()).filter(r=>L(()=>e(r))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Wn(async()=>(await t.iterator()).map(n=>L(()=>e(n))),this.size)}mapAsync(e){let t=this;return Wn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Wn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Wn(async()=>{let r=T2(async()=>({value:await t.iterator(),done:!1}));return $se(r.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let r=this,a=kse.alea(t||_.now().toString());return Wn(async()=>{let s=a.int32();return n&&(s+=a.int32()),(await r.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Wn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};Ul.MAX_BUFFER_SIZE=1e4;function Wn(e,t=null){return new class extends Ul{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function Ase(e){return Wn(async()=>L4(e),e.length)}function yse(e){if(!Hl(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await z4(e,r=>{if(r instanceof Ul)return{value:r.iterator(),recurse:!1};if(Hl(r))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return Ose(n,Za.SHORTEST)},t)}function Gse(e){if(e===null)return null;let t=e[0];return Ese(t)?{value:qse(e),recurse:!1}:{value:null,recurse:!0}}function qse(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Le?On(e):xr(e)}var R4=class extends Ul{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` -`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},u0='"',jc=Symbol("out"),j4=Symbol("field"),c0=Symbol("quote"),C2=Symbol("quoteafterquote"),U4=Symbol("quoteinquote"),M4=class extends Ul{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new R4(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(_.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&_.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((r,a)=>(r[a]=r[a]+1||1,r),{}),n=Object.keys(t).filter(r=>t[r]>1);if(_.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let r of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(r)===-1)throw new Error('The key "'+r+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},r={};for(let a=0;a14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(J().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new H4(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let r=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(r,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let r=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(r,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(r=>{let a=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&r({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(a),r({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((r,a)=>n.set(r,a*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(_.sizeFromShape(t));return n.set(e,n.length-e.length),xr(n,t)}},G4=class extends Gt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=nn([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,r=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,a=(1-n)/2,s=(1-r)/2,i=a+n,o=r+s;this.cropBox=Kn([s,a,o,i],[1,4])}else this.cropBox=Kn([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(J().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new G4(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&_.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oi.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return L(()=>{let t=on(Ae(e,"float32"),0),n;n=Ye.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let r=n.shape;return H(n,r.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},q4=class{},X4=class extends Gt{split(e){return new Xse(this,e)}},Xse=class extends X4{constructor(e,t){super();this.upstream=e,this.impl=new Kse(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},Kse=class extends E2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},Yse=class extends Gt{decodeUTF8(){return new Zse(this)}},Zse=class extends X4{constructor(e){super();this.upstream=e,this.impl=new Jse(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},Jse=class extends E2{constructor(e){super();if(this.upstream=e,J().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=r9();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return J().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},K4=class extends Yse{constructor(e,t={}){super();this.file=e,this.options=t,_.assert(e instanceof Uint8Array||(J().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let r=new FileReader;r.onload=s=>{let i=r.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},r.onabort=s=>t(new Error("Aborted")),r.onerror=s=>t(new Error(s.type));let a=this.file.slice(this.offset,n);r.readAsArrayBuffer(a)}this.offset=n}),done:!1}}};async function eie(e,t={}){let n,r;typeof e=="string"?n=e:(n=e.url,r=Qse(e));let a=await _.fetch(n,r);if(a.ok){let s=new Uint8Array(await a.arrayBuffer());return new K4(s,t)}else throw new Error(a.statusText)}var Qse=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Z4(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var F4=class extends q4{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Z4(this.input)&&J().get("IS_NODE")){let e=require("fs");this.input=e.readFileSync(this.input.substr(7))}return new K4(this.input,this.options)}},$4=class extends q4{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Z4(this.url)?new F4(this.url,this.fileOptions).iterator():eie(this.url,this.fileOptions)}};function gse(e,t={}){return new M4(new $4(e),t)}function xse(e){let t=T2(e);return Wn(async()=>t)}function wse(e){return Wn(async()=>{let t=await e();return T2(()=>t.next())})}async function bse(e,t){return G4.create(e,t)}async function _se(e){return H4.create(e)}var vse="3.5.0",tie={tfjs:(of==null?void 0:of.version)||void 0,"tfjs-core":(lf==null?void 0:lf.version)||void 0,"tfjs-data":(uf==null?void 0:uf.version)||void 0,"tfjs-layers":(cf==null?void 0:cf.version)||void 0,"tfjs-converter":(hf==null?void 0:hf.version)||void 0,"tfjs-backend-cpu":qb||void 0,"tfjs-backend-webgl":A3||void 0,"tfjs-backend-wasm":ov||void 0};var Bn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Y4(){if(!qf(Bn.name)){pe("backend registration:",Bn.name);try{Bn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Bn.width,Bn.height):document.createElement("canvas")}catch(e){pe("error: cannot create canvas:",e);return}try{Bn.gl=Bn.canvas.getContext("webgl2",Bn.webGLattr)}catch(e){pe("error: cannot get WebGL2 context:",e);return}try{up(2,Bn.gl)}catch(e){pe("error: cannot set WebGL2 context:",e);return}try{let e=new pp(Bn.gl);ul(Bn.name,()=>new Fl(e),Bn.priority)}catch(e){pe("error: cannot register WebGL backend:",e);return}try{nl("webgl").forEach(t=>{let n={...t,backendName:Bn.name};ri(n)})}catch(e){pe("error: cannot update WebGL backend registration:",e);return}try{Ar.set("WEBGL_VERSION",2)}catch(e){pe("error: cannot set WebGL backend flags:",e);return}pe("backend registered:",Bn.name)}}var R2={};mr(R2,{load:()=>$2,predict:()=>d0});var nie=["angry","disgust","fear","happy","sad","surprise","neutral"],Cr,M2=[],h0=Number.MAX_SAFE_INTEGER,F2=[.2989,.587,.114];async function $2(e){return Cr?e.debug&&pe("cached model:",Cr.modelUrl):(Cr=await Ht(Yt(e.modelBasePath,e.face.emotion.modelPath)),!Cr||!Cr.modelUrl?pe("load model failed:",e.face.emotion.modelPath):e.debug&&pe("load model:",Cr.modelUrl)),Cr}async function d0(e,t){return Cr?h00?(h0++,M2):(t.videoOptimized?h0=0:h0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=Ye.resizeBilinear(e,[Cr.inputs[0].shape[2],Cr.inputs[0].shape[1]],!1),[a,s,i]=ln(r,3,3);r.dispose();let o=B(a,F2[0]),l=B(s,F2[1]),c=B(i,F2[2]);a.dispose(),s.dispose(),i.dispose();let u=md([o,l,c]);o.dispose(),l.dispose(),c.dispose();let h=L(()=>u.sub(.5).mul(2));u.dispose();let d=[];if(t.face.emotion.enabled){let p=await Cr.predict(h),m=p.dataSync();Te(p);for(let f=0;ft.face.emotion.minConfidence&&d.push({score:Math.min(.99,Math.trunc(100*m[f])/100),emotion:nie[f]});d.sort((f,A)=>A.score-f.score)}h.dispose(),M2=d,n(d)})):null}var D2={};mr(D2,{enhance:()=>P2,load:()=>O2,match:()=>J4,predict:()=>m0,similarity:()=>z2});var er,p0={age:0},f0=Number.MAX_SAFE_INTEGER;async function O2(e){return er?e.debug&&pe("cached model:",er.modelUrl):(er=await Ht(Yt(e.modelBasePath,e.face.description.modelPath)),!er||!er.modelUrl?pe("load model failed:",e.face.description.modelPath):e.debug&&pe("load model:",er.modelUrl)),er}function z2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let r=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-r)/100}function J4(e,t,n=0){let r={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return r;for(let a of t)if(a.embedding&&a.name){let s=z2(e,a.embedding);s>n&&s>r.similarity&&(r={...a,similarity:s})}return r}function P2(e){return L(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Le))return null;let r=[[.05,.15,.85,.85]];return(n.shape.length===3?Ye.cropAndResize(on(n,0),r,[0],[er.inputs[0].shape[2],er.inputs[0].shape[1]]):Ye.cropAndResize(n,r,[0],[er.inputs[0].shape[2],er.inputs[0].shape[1]])).mul(255)})}async function m0(e,t){return er?f00?(f0++,p0):(t.videoOptimized?f0=0:f0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=P2(e),a,s={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};t.face.description.enabled&&(a=await er.predict(r)),Te(r),a&&(L(()=>{let i=a.find(h=>h.shape[1]===1).dataSync(),o=Math.trunc(200*Math.abs(i[0]-.5))/100;o>t.face.description.minConfidence&&(s.gender=i[0]<=.5?"female":"male",s.genderConfidence=Math.min(.99,o));let l=a.find(h=>h.shape[1]===100).argMax(1).dataSync()[0],c=a.find(h=>h.shape[1]===100).dataSync();s.age=Math.round(c[l-1]>c[l+1]?10*l-100*c[l-1]:10*l+100*c[l+1])/10;let u=a.find(h=>h.shape[1]===1024);s.descriptor=[...u.dataSync()]}),a.forEach(i=>Te(i))),p0=s,n(s)})):null}var rie=(e,t)=>{let n=A=>A*180/Math.PI,r=A=>{let y=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);return A[0]/=y,A[1]/=y,A[2]/=y,A},a=(A,y)=>{let g=A[0]-y[0],x=A[1]-y[1],v=A[2]-y[2];return[g,x,v]},s=(A,y)=>{let g=A[1]*y[2]-A[2]*y[1],x=A[2]*y[0]-A[0]*y[2],v=A[0]*y[1]-A[1]*y[0];return[g,x,v]},i=A=>{let[y,g,x,v,w,b,k,N,C]=A,F,O,z;return v<1?v>-1?(z=Math.asin(v),O=Math.atan2(-k,y),F=Math.atan2(-b,w)):(z=-Math.PI/2,O=-Math.atan2(N,C),F=0):(z=Math.PI/2,O=Math.atan2(N,C),F=0),{pitch:2*-F,yaw:2*-O,roll:2*-z}},o=A=>{let y=(x,v,w,b)=>Math.atan2(b-v,w-x);return{pitch:y(A[10][1],A[10][2],A[152][1],A[152][2]),yaw:y(A[33][0],A[33][2],A[263][0],A[263][2]),roll:y(A[33][0],A[33][1],A[263][0],A[263][1])}},l=e.meshRaw;if(!l||l.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let c=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,u=[l[10],l[152],l[234],l[454]].map(A=>[A[0]*t[0]/c,A[1]*t[1]/c,A[2]]),h=r(a(u[1],u[0])),d=r(a(u[3],u[2])),p=r(s(d,h));d=s(h,p);let m=[d[0],d[1],d[2],h[0],h[1],h[2],p[0],p[1],p[2]];return{angle:i(m),matrix:m}},L2=async(e,t)=>{var u,h,d,p,m,f,A;let n,r,a,s,i,o,l=[];e.state="run:face",n=it();let c=await((u=e.models.face)==null?void 0:u.estimateFaces(t,e.config));if(e.perf.face=Math.trunc(it()-n),!c)return[];for(let y of c){if(e.analyze("Get Face"),!y.image||y.image.isDisposedInternal){pe("Face object is disposed:",y.image);continue}let g=rie(y,[t.shape[2],t.shape[1]]);e.analyze("Start Emotion:"),e.config.async?s=e.config.face.emotion.enabled?d0(y.image,e.config):{}:(e.state="run:emotion",n=it(),s=e.config.face.emotion.enabled?await d0(y.image,e.config):{},e.perf.emotion=Math.trunc(it()-n)),e.analyze("End Emotion:"),e.analyze("Start Description:"),e.config.async?o=e.config.face.description.enabled?m0(y,e.config):[]:(e.state="run:description",n=it(),o=e.config.face.description.enabled?await m0(y.image,e.config):[],e.perf.embedding=Math.trunc(it()-n)),e.analyze("End Description:"),e.config.async&&([r,a,s,i,o]=await Promise.all([r,a,s,i,o])),e.analyze("Finish Face:"),!e.config.face.iris.enabled&&((h=y==null?void 0:y.annotations)==null?void 0:h.leftEyeIris)&&((d=y==null?void 0:y.annotations)==null?void 0:d.rightEyeIris)&&(delete y.annotations.leftEyeIris,delete y.annotations.rightEyeIris);let x=((p=y.annotations)==null?void 0:p.leftEyeIris)&&((m=y.annotations)==null?void 0:m.rightEyeIris)?11.7*Math.max(Math.abs(y.annotations.leftEyeIris[3][0]-y.annotations.leftEyeIris[1][0]),Math.abs(y.annotations.rightEyeIris[4][1]-y.annotations.rightEyeIris[2][1])):0;l.push({...y,age:o.age,gender:o.gender,genderConfidence:o.genderConfidence,embedding:o.descriptor,emotion:s,iris:x!==0?Math.trunc(x)/100:0,rotation:g,tensor:e.config.face.detector.return?(f=y.image)==null?void 0:f.squeeze():null}),(A=y.image)==null||A.dispose(),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.perf.face&&delete e.perf.face,e.perf.age&&delete e.perf.age,e.perf.gender&&delete e.perf.gender,e.perf.emotion&&delete e.perf.emotion),l};var H2={};mr(H2,{MediaPipeFaceMesh:()=>G2,load:()=>q2,triangulation:()=>l8,uvmap:()=>u8});var Q4=6;function aie(e){let t={strides:[e/16,e/8],anchors:[2,6]},n=[];for(let r=0;r({startEndTensor:e,startPoint:Re(e,[0,0],[-1,2]),endPoint:Re(e,[0,2],[-1,2])});function iie(e,t,n){let r=Re(e,[0,1],[-1,2]),a=se(r,t),s=Re(e,[0,3],[-1,2]),i=ge(s,n),o=ge(a,n),l=ge(i,2),c=ye(o,l),u=se(o,l),h=B(c,n),d=B(u,n);return dl([h,d],1)}var e8=class{constructor(t,n){this.model=t,this.anchorsData=aie(t.inputs[0].shape[1]),this.anchors=Kn(this.anchorsData),this.inputSize=t.inputs[0].shape[2],this.config=n}async getBoundingBoxes(t){if(!t||t.isDisposedInternal||t.shape.length!==4||t.shape[1]<1||t.shape[2]<1)return null;let[n,r,a]=L(()=>{let d=t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),p=this.model.predict(d),m;if(Array.isArray(p)){let g=p.sort((b,k)=>b.size-k.size),x=ot([g[0],g[2]],2),v=ot([g[1],g[3]],2);m=ot([v,x],1).squeeze(0)}else m=p.squeeze();let f=iie(m,this.anchors,[this.inputSize,this.inputSize]),A=Re(m,[0,0],[-1,1]),y=_n(A).squeeze();return[m,f,y]}),s=await Ye.nonMaxSuppressionAsync(r,a,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let l=i.map(h=>Re(r,[h,0],[1,-1])).map(h=>{let d=h.arraySync();return h.dispose(),d}),c=a.dataSync(),u=[];for(let h=0;hthis.config.face.detector.minConfidence){let m=sie(l[h]),f=this.anchorsData[d],A=L(()=>Re(n,[d,Q4-1],[1,-1]).squeeze().reshape([Q4,-1]));u.push({box:m,landmarks:A,anchor:f,confidence:p})}}return n.dispose(),r.dispose(),a.dispose(),{boxes:u,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function t8(e){let t=await Ht(Yt(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new e8(t,e);return!t||!t.modelUrl?pe("load model failed:",e.face.detector.modelPath):e.debug&&pe("load model:",t.modelUrl),n}function n8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:r}}function Uc(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gl(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ql(e,t,n){let r=t.shape[1],a=t.shape[2],s=[[e.startPoint[1]/r,e.startPoint[0]/a,e.endPoint[1]/r,e.endPoint[0]/a]];return Ye.cropAndResize(t,s,[0],n)}function A0(e,t=1.5){let n=Gl(e),r=Uc(e),a=[t*r[0]/2,t*r[1]/2],s=[n[0]-a[0],n[1]-a[1]],i=[n[0]+a[0],n[1]+a[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function y0(e){let t=Gl(e),n=Uc(e),a=Math.max(...n)/2,s=[t[0]-a,t[1]-a],i=[t[0]+a,t[1]+a];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}var g0=[[1,0,0],[0,1,0],[0,0,1]];function oie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function W2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return oie(n)}function r8(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function Ya(e,t){let n=0;for(let r=0;rHc[e]),Qie=cie.map(e=>Hc[e]),eoe=hie.map(e=>Hc[e]);var V2=Xr.leftEyeLower0,j2=Xr.rightEyeLower0,Xl={leftBounds:[V2[0],V2[V2.length-1]],rightBounds:[j2[0],j2[j2.length-1]]},w0={count:468,mouth:13,symmetryLine:[13,Xr.midwayBetweenEyes[0]]},o8={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},Kl={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function b0(e,t,n,r){for(let a=0;a[s[0]/this.meshSize*(h[0]-this.meshSize/2),s[1]/this.meshSize*(h[1]-this.meshSize/2),h[2]]),o=r!==0?x0(r,[0,0]):g0,l=r!==0?i.map(h=>[...i8(h,o),h[2]]):i,c=r!==0?s8(a):g0,u=[...Gl({startPoint:n.startPoint,endPoint:n.endPoint}),1];return l.map(h=>[h[0]+Ya(u,c[0]),h[1]+Ya(u,c[1]),h[2]])}getLeftToRightEyeDepthDifference(t){let n=t[Xl.leftBounds[0]][2],r=t[Xl.rightBounds[0]][2];return n-r}getEyeBox(t,n,r,a,s=!1){let i=y0(A0(this.calculateLandmarksBoundingBox([t[r],t[a]]),this.irisEnlarge)),o=Uc(i),l=Ye.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&Ar.flags.IS_BROWSER&&(l=Ye.flipLeftRight(l)),{box:i,boxSize:o,crop:l}}getEyeCoords(t,n,r,a=!1){let s=[];for(let i=0;i{let c=i;return l===2?c=a:l===4&&(c=s),[o[0],o[1],c]})}async predict(t,n){let r=!1,a;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.videoOptimized)&&(a=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.videoOptimized&&this.skipped++,!n.videoOptimized||a&&a.boxes&&(!n.face.mesh.enabled||a.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of a.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks,confidence:i.confidence});this.storedBoxes.length>0&&(r=!0)}if(n.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),r){if(!a||!a.boxes||a.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=L(()=>this.storedBoxes.map((i,o)=>{let l=i.confidence,c,u=0,h;if(n.face.detector.rotation&&n.face.mesh.enabled&&Ar.flags.IS_BROWSER){let[w,b]=i.landmarks.length>=w0.count?w0.symmetryLine:o8.symmetryLine;u=W2(i.landmarks[w],i.landmarks[b]);let k=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),N=[k[0]/t.shape[2],k[1]/t.shape[1]],C=Ye.rotateWithOffset(t,u,0,N);h=x0(-u,k),n.face.mesh.enabled?c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.meshSize,this.meshSize]).div(255):c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.boxSize,this.boxSize]).div(255)}else{h=g0;let w=t.clone();n.face.mesh.enabled?c=ql({startPoint:i.startPoint,endPoint:i.endPoint},w,[this.meshSize,this.meshSize]).div(255):c=ql({startPoint:i.startPoint,endPoint:i.endPoint},w,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{coords:null,box:i,faceConfidence:null,boxConfidence:l,confidence:i.confidence,image:c};let[,d,p]=this.meshDetector.predict(c),m=d.dataSync()[0];if(m=w0.count?w0.symmetryLine:o8.symmetryLine;u=W2(i.landmarks[w],i.landmarks[b]);let k=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),N=[k[0]/t.shape[2],k[1]/t.shape[1]],C=Ye.rotateWithOffset(t.toFloat(),u,0,N);h=x0(-u,k),c=ql({startPoint:i.startPoint,endPoint:i.endPoint},C,[this.meshSize,this.meshSize]).div(255)}let x={coords:g,box:i,faceConfidence:m,boxConfidence:l,image:c,rawCoords:A},v=y0(i);return this.storedBoxes[o]={...v,landmarks:y,confidence:i.confidence,faceConfidence:m},x}));return s=s.filter(i=>i!==null),n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.faceConfidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),r=t.map(i=>i[1]),a=[Math.min(...n),Math.min(...r)],s=[Math.max(...n),Math.max(...r)];return{startPoint:a,endPoint:s,landmarks:t}}};var G2=class{constructor(t,n,r,a){this.facePipeline=new U2(t,n,r),this.config=a}async estimateFaces(t,n){let r=await this.facePipeline.predict(t,n),a=[];for(let s of r||[]){if(s.isDisposedInternal)continue;let i=s.coords?s.coords.arraySync():[],o=i.map(h=>[h[0]/t.shape[2],h[1]/t.shape[1],h[2]/this.facePipeline.meshSize]),l={};if(i&&i.length>0)for(let h of Object.keys(Xr))l[h]=Xr[h].map(d=>i[d]);let c=s.box?[Math.max(0,s.box.startPoint[0]),Math.max(0,s.box.startPoint[1]),Math.min(t.shape[2],s.box.endPoint[0])-Math.max(0,s.box.startPoint[0]),Math.min(t.shape[1],s.box.endPoint[1])-Math.max(0,s.box.startPoint[1])]:0,u=s.box?[s.box.startPoint[0]/t.shape[2],s.box.startPoint[1]/t.shape[1],(s.box.endPoint[0]-s.box.startPoint[0])/t.shape[2],(s.box.endPoint[1]-s.box.startPoint[1])/t.shape[1]]:[];a.push({confidence:Math.round(100*s.faceConfidence||100*s.boxConfidence||0)/100,boxConfidence:Math.round(100*s.boxConfidence)/100,faceConfidence:Math.round(100*s.faceConfidence)/100,box:c,boxRaw:u,mesh:i,meshRaw:o,annotations:l,image:s.image?s.image.clone():null}),s.coords&&s.coords.dispose(),s.image&&s.image.dispose()}return a}},qt=[null,null,null];async function q2(e){return!qt[0]&&e.face.enabled||!qt[1]&&e.face.mesh.enabled||!qt[2]&&e.face.iris.enabled?(qt=await Promise.all([!qt[0]&&e.face.enabled?t8(e):null,!qt[1]&&e.face.mesh.enabled?Ht(Yt(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!qt[2]&&e.face.iris.enabled?Ht(Yt(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!qt[1]||!qt[1].modelUrl?pe("load model failed:",e.face.mesh.modelPath):e.debug&&pe("load model:",qt[1].modelUrl)),e.face.iris.enabled&&(!qt[2]||!qt[1].modelUrl?pe("load model failed:",e.face.iris.modelPath):e.debug&&pe("load model:",qt[2].modelUrl))):e.debug&&(pe("cached model:",qt[0].model.modelUrl),pe("cached model:",qt[1].modelUrl),pe("cached model:",qt[2].modelUrl)),new G2(qt[0],qt[1],qt[2],e)}var l8=Oi,u8=Hc;var Q2={};mr(Q2,{load:()=>tg,predict:()=>eg});var Gc=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],c8=Gc.length,qc=Gc.reduce((e,t,n)=>(e[t]=n,e),{}),die=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],pie=die.map(([e,t])=>[qc[e],qc[t]]),h8=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function d8(e){let t=e.reduce(({maxX:n,maxY:r,minX:a,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(r,o),minX:Math.min(a,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function p8(e,[t,n],[r,a]){let s=(o,l,c)=>({score:o.score,box:[Math.trunc(o.box[0]*c),Math.trunc(o.box[1]*l),Math.trunc(o.box[2]*c),Math.trunc(o.box[3]*l)],keypoints:o.keypoints.map(({score:u,part:h,position:d})=>({score:u,part:h,position:{x:Math.trunc(d.x*c),y:Math.trunc(d.y*l)}}))});return e.map(o=>s(o,t/r,n/a))}var X2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function f8(e,t,n,r){let a=n-e,s=r-t;return a*a+s*s}function J2(e,t){return{x:e.x+t.x,y:e.y+t.y}}var _0=1,m8=16,fie=20**2;function A8(e,t,n,r,a,s,i,o=2){let l=g=>({y:i.get(g.y,g.x,e),x:i.get(g.y,g.x,i.shape[2]/2+e)}),c=(g,x,v)=>({y:Y2(Math.round(g.y/s),0,x-1),x:Y2(Math.round(g.x/s),0,v-1)}),[u,h]=r.shape,d=c(t.position,u,h),p=l(d),f=J2(t.position,p);for(let g=0;g[qc[f],qc[A]]),o=i.map(([,f])=>f),l=i.map(([f])=>f),c=t.shape[2],u=o.length,h=new Array(c),{part:d,score:p}=e,m=Z2(d,r,n);h[d.id]={score:p,part:Gc[d.id],position:m};for(let f=u-1;f>=0;--f){let A=o[f],y=l[f];h[A]&&!h[y]&&(h[y]=A8(f,h[A],y,t,n,r,s))}for(let f=0;ft){o=!1;break}if(!o)break}return o}function yie(e,t){let[n,r,a]=t.shape,s=new X2(n*r*a,({score:i})=>i);for(let i=0;i{let s=a[r].position;return f8(n,t,s.y,s.x)<=fie})}function gie(e,t){return t.reduce((r,{position:a,score:s},i)=>(y8(e,a,i)||(r+=s),r),0)/t.length}function g8(e,t,n,r,a,s){let i=[],o=yie(s,t);for(;i.lengthm.score>s),d=gie(i,h),p=d8(h);d>s&&i.push({keypoints:h,box:p,score:Math.round(100*d)/100})}return i}var fr,xie=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function eg(e,t){let n=L(()=>{let o=e.resizeBilinear([fr.inputs[0].shape[2],fr.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),c=fr.execute(o,xie).map(u=>u.squeeze([0]));return c[1]=c[1].sigmoid(),c}),r=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let a=await g8(r[0],r[1],r[2],r[3],t.body.maxDetected,t.body.minConfidence);return p8(a,[e.shape[1],e.shape[2]],[fr.inputs[0].shape[2],fr.inputs[0].shape[1]])}async function tg(e){return fr?e.debug&&pe("cached model:",fr.modelUrl):(fr=await Ht(Yt(e.modelBasePath,e.body.modelPath)),!fr||!fr.modelUrl?pe("load model failed:",e.body.modelPath):e.debug&&pe("load model:",fr.modelUrl)),fr}var ig={};mr(ig,{HandPose:()=>lg,load:()=>ug});function v0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Xc(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function x8(e,t,n){let r=t.shape[1],a=t.shape[2],s=[[e.startPoint[1]/r,e.startPoint[0]/a,e.endPoint[1]/r,e.endPoint[0]/a]];return Ye.cropAndResize(t,s,[0],n)}function w8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],a=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:r,palmLandmarks:a,confidence:e.confidence}}function k0(e,t=1.5){let n=Xc(e),r=v0(e),a=[t*r[0]/2,t*r[1]/2],s=[n[0]-a[0],n[1]-a[1]],i=[n[0]+a[0],n[1]+a[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function I0(e){let t=Xc(e),n=v0(e),a=Math.max(...n)/2,s=[t[0]-a,t[1]-a],i=[t[0]+a,t[1]+a];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var ng=class{constructor(t,n,r){this.model=t,this.anchors=r.map(a=>[a.x_center,a.y_center]),this.anchorsTensor=Kn(this.anchors),this.inputSize=n,this.inputSizeTensor=nn([n,n]),this.doubleInputSizeTensor=nn([n*2,n*2])}normalizeBoxes(t){return L(()=>{let n=Re(t,[0,0],[-1,2]),r=Re(t,[0,2],[-1,2]),a=se(ge(n,this.inputSizeTensor),this.anchorsTensor),s=ge(r,this.doubleInputSizeTensor),i=B(ye(a,s),this.inputSizeTensor),o=B(se(a,s),this.inputSizeTensor);return dl([i,o],1)})}normalizeLandmarks(t,n){return L(()=>{let r=se(ge(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(r,this.inputSizeTensor)})}async getBoxes(t,n){let r=this.model.predict(t),a=r.squeeze();r.dispose();let s=L(()=>_n(Re(a,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Re(a,[0,1],[-1,4]),l=this.normalizeBoxes(o);o.dispose();let c=await Ye.nonMaxSuppressionAsync(l,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),u=c.arraySync();s.dispose(),c.dispose();let h=[];for(let d of u)if(i[d]>=n.hand.minConfidence){let p=Re(l,[d,0],[1,-1]),m=Re(a,[d,5],[1,14]),f=L(()=>this.normalizeLandmarks(m,d).reshape([-1,2]));m.dispose(),h.push({box:p,palmLandmarks:f,confidence:i[d]})}return a.dispose(),l.dispose(),h}async estimateHandBounds(t,n){let r=t.shape[1],a=t.shape[2],s=L(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let l of i){let c=l.box.dataSync(),u=c.slice(0,2),h=c.slice(2,4),d=l.palmLandmarks.arraySync();l.box.dispose(),l.palmLandmarks.dispose(),o.push(w8({startPoint:u,endPoint:h,palmLandmarks:d,confidence:l.confidence},[a/this.inputSize,r/this.inputSize]))}return o}};function wie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function b8(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return wie(n)}var _8=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Ja(e,t){let n=0;for(let r=0;rag([...s,1],n)),a=this.calculateLandmarksBoundingBox(r);return k0(I0(a),_ie)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),r=k0(I0(n),I8);r.palmLandmarks=[];for(let a=0;a[i[0]*(p[0]-this.inputSize/2),i[1]*(p[1]-this.inputSize/2),i[2]*p[2]]),l=rg(r,[0,0]),c=o.map(p=>[...ag(p,l),p[2]]),u=k8(a),h=[...Xc(n),1],d=[Ja(h,u[0]),Ja(h,u[1])];return c.map(p=>[p[0]+d[0],p[1]+d[1],p[2]])}async estimateHands(t,n){let r=!1,a;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.videoOptimized)&&(a=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.videoOptimized&&this.skipped++,a&&a.length>0&&(a.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...a],this.storedBoxes.length>0&&(r=!0));let s=[];n.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let i=0;i=n.hand.minConfidence){let x=H(y,[-1,3]),v=x.arraySync();y.dispose(),x.dispose();let w=this.transformRawCoords(v,p,l,d),b=this.getBoxForHandLandmarks(w);this.storedBoxes[i]=b;let k={landmarks:w,confidence:g,box:{topLeft:b.startPoint,bottomRight:b.endPoint}};s.push(k)}else this.storedBoxes[i]=null;y.dispose()}else{let l=k0(I0(o),I8),c={confidence:o.confidence,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};s.push(c)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),r=t.map(i=>i[1]),a=[Math.min(...n),Math.min(...r)],s=[Math.max(...n),Math.max(...r)];return{startPoint:a,endPoint:s}}};var N8=[{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.046875,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.078125,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.109375,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.140625,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.171875,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.203125,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.234375,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.265625,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.296875,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.328125,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.359375,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.390625,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.421875,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.453125,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.484375,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.515625,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.546875,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.578125,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.609375,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.640625,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.671875,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.703125,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.734375,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.765625,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.796875,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.828125,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.859375,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.890625,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.921875,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.953125,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.984375,y_center:.015625},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.046875,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.078125,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.109375,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.140625,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.171875,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.203125,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.234375,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.265625,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.296875,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.328125,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.359375,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.390625,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.421875,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.453125,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.484375,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.515625,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.546875,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.578125,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.609375,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.640625,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.671875,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.703125,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.734375,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.765625,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.796875,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.828125,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.859375,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.890625,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.921875,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.953125,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.984375,y_center:.046875},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.046875,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.078125,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.109375,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.140625,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.171875,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.203125,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.234375,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.265625,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.296875,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.328125,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.359375,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.390625,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.421875,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.453125,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.484375,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.515625,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.546875,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.578125,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.609375,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.640625,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.671875,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.703125,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.734375,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.765625,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.796875,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.828125,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.859375,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.890625,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.921875,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.953125,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.984375,y_center:.078125},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.046875,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.078125,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.109375,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.140625,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.171875,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.203125,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.234375,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.265625,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.296875,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.328125,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.359375,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.390625,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.421875,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.453125,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.484375,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.515625,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.546875,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.578125,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.609375,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.640625,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.671875,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.703125,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.734375,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.765625,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.796875,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.828125,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.859375,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.890625,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.921875,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.953125,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.984375,y_center:.109375},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.046875,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.078125,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.109375,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.140625,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.171875,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.203125,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.234375,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.265625,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.296875,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.328125,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.359375,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.390625,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.421875,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.453125,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.484375,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.515625,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.546875,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.578125,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.609375,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.640625,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.671875,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.703125,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.734375,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.765625,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.796875,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.828125,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.859375,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.890625,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.921875,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.953125,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.984375,y_center:.140625},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.046875,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.078125,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.109375,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.140625,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.171875,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.203125,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.234375,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.265625,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.296875,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.328125,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.359375,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.390625,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.421875,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.453125,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.484375,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.515625,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.546875,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.578125,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.609375,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.640625,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.671875,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.703125,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.734375,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.765625,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.796875,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.828125,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.859375,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.890625,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.921875,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.953125,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.984375,y_center:.171875},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.046875,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.078125,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.109375,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.140625,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.171875,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.203125,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.234375,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.265625,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.296875,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.328125,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.359375,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.390625,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.421875,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.453125,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.484375,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.515625,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.546875,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.578125,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.609375,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.640625,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.671875,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.703125,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.734375,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.765625,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.796875,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.828125,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.859375,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.890625,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.921875,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.953125,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.984375,y_center:.203125},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.046875,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.078125,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.109375,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.140625,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.171875,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.203125,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.234375,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.265625,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.296875,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.328125,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.359375,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.390625,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.421875,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.453125,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.484375,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.515625,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.546875,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.578125,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.609375,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.640625,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.671875,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.703125,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.734375,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.765625,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.796875,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.828125,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.859375,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.890625,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.921875,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.953125,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.984375,y_center:.234375},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.046875,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.078125,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.109375,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.140625,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.171875,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.203125,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.234375,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.265625,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.296875,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.328125,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.359375,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.390625,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.421875,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.453125,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.484375,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.515625,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.546875,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.578125,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.609375,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.640625,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.671875,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.703125,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.734375,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.765625,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.796875,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.828125,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.859375,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.890625,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.921875,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.953125,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.984375,y_center:.265625},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.046875,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.078125,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.109375,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.140625,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.171875,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.203125,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.234375,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.265625,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.296875,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.328125,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.359375,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.390625,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.421875,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.453125,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.484375,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.515625,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.546875,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.578125,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.609375,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.640625,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.671875,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.703125,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.734375,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.765625,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.796875,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.828125,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.859375,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.890625,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.921875,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.953125,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.984375,y_center:.296875},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.046875,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.078125,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.109375,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.140625,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.171875,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.203125,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.234375,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.265625,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.296875,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.328125,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.359375,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.390625,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.421875,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.453125,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.484375,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.515625,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.546875,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.578125,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.609375,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.640625,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.671875,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.703125,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.734375,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.765625,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.796875,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.828125,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.859375,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.890625,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.921875,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.953125,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.984375,y_center:.328125},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.046875,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.078125,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.109375,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.140625,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.171875,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.203125,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.234375,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.265625,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.296875,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.328125,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.359375,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.390625,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.421875,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.453125,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.484375,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.515625,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.546875,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.578125,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.609375,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.640625,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.671875,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.703125,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.734375,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.765625,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.796875,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.828125,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.859375,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.890625,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.921875,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.953125,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.984375,y_center:.359375},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.046875,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.078125,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.109375,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.140625,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.171875,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.203125,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.234375,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.265625,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.296875,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.328125,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.359375,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.390625,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.421875,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.453125,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.484375,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.515625,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.546875,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.578125,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.609375,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.640625,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.671875,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.703125,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.734375,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.765625,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.796875,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.828125,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.859375,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.890625,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.921875,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.953125,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.984375,y_center:.390625},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.046875,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.078125,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.109375,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.140625,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.171875,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.203125,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.234375,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.265625,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.296875,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.328125,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.359375,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.390625,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.421875,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.453125,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.484375,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.515625,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.546875,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.578125,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.609375,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.640625,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.671875,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.703125,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.734375,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.765625,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.796875,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.828125,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.859375,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.890625,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.921875,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.953125,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.984375,y_center:.421875},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.046875,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.078125,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.109375,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.140625,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.171875,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.203125,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.234375,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.265625,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.296875,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.328125,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.359375,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.390625,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.421875,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.453125,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.484375,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.515625,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.546875,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.578125,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.609375,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.640625,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.671875,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.703125,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.734375,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.765625,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.796875,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.828125,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.859375,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.890625,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.921875,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.953125,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.984375,y_center:.453125},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.046875,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.078125,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.109375,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.140625,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.171875,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.203125,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.234375,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.265625,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.296875,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.328125,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.359375,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.390625,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.421875,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.453125,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.484375,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.515625,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.546875,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.578125,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.609375,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.640625,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.671875,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.703125,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.734375,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.765625,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.796875,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.828125,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.859375,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.890625,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.921875,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.953125,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.984375,y_center:.484375},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.046875,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.078125,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.109375,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.140625,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.171875,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.203125,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.234375,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.265625,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.296875,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.328125,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.359375,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.390625,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.421875,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.453125,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.484375,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.515625,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.546875,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.578125,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.609375,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.640625,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.671875,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.703125,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.734375,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.765625,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.796875,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.828125,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.859375,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.890625,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.921875,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.953125,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.984375,y_center:.515625},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.046875,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.078125,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.109375,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.140625,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.171875,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.203125,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.234375,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.265625,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.296875,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.328125,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.359375,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.390625,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.421875,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.453125,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.484375,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.515625,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.546875,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.578125,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.609375,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.640625,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.671875,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.703125,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.734375,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.765625,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.796875,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.828125,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.859375,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.890625,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.921875,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.953125,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.984375,y_center:.546875},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.046875,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.078125,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.109375,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.140625,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.171875,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.203125,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.234375,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.265625,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.296875,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.328125,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.359375,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.390625,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.421875,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.453125,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.484375,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.515625,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.546875,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.578125,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.609375,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.640625,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.671875,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.703125,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.734375,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.765625,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.796875,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.828125,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.859375,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.890625,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.921875,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.953125,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.984375,y_center:.578125},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.046875,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.078125,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.109375,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.140625,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.171875,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.203125,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.234375,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.265625,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.296875,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.328125,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.359375,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.390625,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.421875,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.453125,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.484375,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.515625,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.546875,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.578125,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.609375,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.640625,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.671875,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.703125,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.734375,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.765625,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.796875,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.828125,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.859375,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.890625,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.921875,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.953125,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.984375,y_center:.609375},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.046875,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.078125,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.109375,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.140625,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.171875,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.203125,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.234375,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.265625,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.296875,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.328125,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.359375,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.390625,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.421875,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.453125,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.484375,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.515625,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.546875,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.578125,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.609375,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.640625,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.671875,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.703125,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.734375,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.765625,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.796875,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.828125,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.859375,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.890625,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.921875,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.953125,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.984375,y_center:.640625},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.046875,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.078125,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.109375,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.140625,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.171875,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.203125,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.234375,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.265625,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.296875,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.328125,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.359375,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.390625,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.421875,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.453125,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.484375,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.515625,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.546875,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.578125,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.609375,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.640625,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.671875,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.703125,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.734375,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.765625,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.796875,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.828125,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.859375,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.890625,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.921875,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.953125,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.984375,y_center:.671875},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.046875,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.078125,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.109375,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.140625,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.171875,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.203125,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.234375,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.265625,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.296875,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.328125,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.359375,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.390625,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.421875,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.453125,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.484375,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.515625,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.546875,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.578125,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.609375,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.640625,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.671875,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.703125,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.734375,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.765625,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.796875,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.828125,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.859375,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.890625,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.921875,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.953125,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.984375,y_center:.703125},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.046875,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.078125,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.109375,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.140625,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.171875,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.203125,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.234375,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.265625,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.296875,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.328125,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.359375,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.390625,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.421875,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.453125,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.484375,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.515625,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.546875,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.578125,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.609375,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.640625,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.671875,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.703125,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.734375,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.765625,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.796875,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.828125,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.859375,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.890625,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.921875,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.953125,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.984375,y_center:.734375},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.046875,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.078125,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.109375,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.140625,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.171875,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.203125,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.234375,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.265625,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.296875,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.328125,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.359375,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.390625,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.421875,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.453125,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.484375,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.515625,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.546875,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.578125,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.609375,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.640625,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.671875,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.703125,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.734375,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.765625,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.796875,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.828125,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.859375,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.890625,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.921875,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.953125,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.984375,y_center:.765625},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.046875,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.078125,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.109375,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.140625,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.171875,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.203125,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.234375,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.265625,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.296875,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.328125,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.359375,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.390625,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.421875,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.453125,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.484375,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.515625,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.546875,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.578125,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.609375,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.640625,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.671875,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.703125,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.734375,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.765625,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.796875,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.828125,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.859375,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.890625,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.921875,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.953125,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.984375,y_center:.796875},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.046875,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.078125,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.109375,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.140625,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.171875,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.203125,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.234375,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.265625,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.296875,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.328125,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.359375,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.390625,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.421875,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.453125,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.484375,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.515625,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.546875,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.578125,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.609375,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.640625,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.671875,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.703125,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.734375,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.765625,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.796875,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.828125,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.859375,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.890625,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.921875,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.953125,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.984375,y_center:.828125},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.046875,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.078125,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.109375,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.140625,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.171875,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.203125,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.234375,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.265625,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.296875,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.328125,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.359375,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.390625,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.421875,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.453125,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.484375,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.515625,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.546875,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.578125,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.609375,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.640625,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.671875,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.703125,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.734375,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.765625,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.796875,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.828125,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.859375,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.890625,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.921875,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.953125,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.984375,y_center:.859375},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.046875,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.078125,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.109375,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.140625,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.171875,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.203125,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.234375,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.265625,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.296875,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.328125,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.359375,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.390625,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.421875,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.453125,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.484375,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.515625,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.546875,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.578125,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.609375,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.640625,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.671875,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.703125,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.734375,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.765625,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.796875,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.828125,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.859375,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.890625,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.921875,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.953125,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.984375,y_center:.890625},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.046875,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.078125,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.109375,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.140625,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.171875,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.203125,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.234375,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.265625,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.296875,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.328125,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.359375,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.390625,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.421875,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.453125,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.484375,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.515625,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.546875,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.578125,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.609375,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.640625,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.671875,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.703125,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.734375,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.765625,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.796875,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.828125,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.859375,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.890625,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.921875,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.953125,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.984375,y_center:.921875},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.046875,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.078125,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.109375,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.140625,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.171875,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.203125,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.234375,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.265625,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.296875,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.328125,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.359375,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.390625,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.421875,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.453125,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.484375,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.515625,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.546875,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.578125,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.609375,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.640625,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.671875,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.703125,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.734375,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.765625,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.796875,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.828125,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.859375,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.890625,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.921875,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.953125,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.984375,y_center:.953125},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.015625,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.046875,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.078125,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.109375,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.140625,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.171875,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.203125,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.234375,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.265625,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.296875,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.328125,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.359375,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.390625,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.421875,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.453125,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.484375,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.515625,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.546875,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.578125,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.609375,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.640625,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.671875,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.703125,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.734375,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.765625,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.796875,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.828125,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.859375,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.890625,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.921875,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.953125,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.984375,y_center:.984375},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.09375,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.15625,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.21875,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.28125,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.34375,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.40625,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.46875,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.53125,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.59375,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.65625,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.71875,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.78125,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.84375,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.90625,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.96875,y_center:.03125},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.09375,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.15625,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.21875,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.28125,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.34375,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.40625,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.46875,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.53125,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.59375,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.65625,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.71875,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.78125,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.84375,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.90625,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.96875,y_center:.09375},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.09375,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.15625,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.21875,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.28125,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.34375,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.40625,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.46875,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.53125,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.59375,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.65625,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.71875,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.78125,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.84375,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.90625,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.96875,y_center:.15625},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.09375,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.15625,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.21875,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.28125,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.34375,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.40625,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.46875,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.53125,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.59375,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.65625,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.71875,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.78125,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.84375,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.90625,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.96875,y_center:.21875},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.09375,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.15625,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.21875,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.28125,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.34375,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.40625,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.46875,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.53125,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.59375,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.65625,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.71875,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.78125,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.84375,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.90625,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.96875,y_center:.28125},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.09375,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.15625,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.21875,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.28125,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.34375,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.40625,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.46875,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.53125,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.59375,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.65625,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.71875,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.78125,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.84375,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.90625,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.96875,y_center:.34375},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.09375,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.15625,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.21875,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.28125,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.34375,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.40625,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.46875,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.53125,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.59375,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.65625,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.71875,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.78125,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.84375,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.90625,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.96875,y_center:.40625},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.09375,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.15625,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.21875,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.28125,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.34375,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.40625,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.46875,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.53125,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.59375,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.65625,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.71875,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.78125,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.84375,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.90625,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.96875,y_center:.46875},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.09375,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.15625,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.21875,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.28125,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.34375,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.40625,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.46875,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.53125,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.59375,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.65625,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.71875,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.78125,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.84375,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.90625,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.96875,y_center:.53125},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.09375,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.15625,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.21875,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.28125,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.34375,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.40625,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.46875,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.53125,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.59375,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.65625,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.71875,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.78125,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.84375,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.90625,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.96875,y_center:.59375},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.09375,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.15625,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.21875,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.28125,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.34375,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.40625,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.46875,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.53125,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.59375,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.65625,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.71875,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.78125,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.84375,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.90625,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.96875,y_center:.65625},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.09375,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.15625,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.21875,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.28125,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.34375,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.40625,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.46875,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.53125,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.59375,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.65625,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.71875,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.78125,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.84375,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.90625,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.96875,y_center:.71875},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.09375,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.15625,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.21875,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.28125,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.34375,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.40625,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.46875,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.53125,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.59375,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.65625,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.71875,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.78125,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.84375,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.90625,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.96875,y_center:.78125},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.09375,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.15625,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.21875,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.28125,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.34375,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.40625,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.46875,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.53125,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.59375,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.65625,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.71875,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.78125,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.84375,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.90625,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.96875,y_center:.84375},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.09375,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.15625,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.21875,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.28125,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.34375,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.40625,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.46875,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.53125,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.59375,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.65625,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.71875,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.78125,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.84375,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.90625,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.96875,y_center:.90625},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.03125,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.09375,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.15625,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.21875,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.28125,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.34375,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.40625,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.46875,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.53125,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.59375,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.65625,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.71875,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.78125,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.84375,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.90625,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.96875,y_center:.96875},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.1875,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.3125,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.4375,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.5625,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.6875,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.8125,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.9375,y_center:.0625},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.1875,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.3125,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.4375,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.5625,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.6875,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.8125,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.9375,y_center:.1875},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.1875,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.3125,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.4375,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.5625,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.6875,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.8125,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.9375,y_center:.3125},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.1875,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.3125,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.4375,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.5625,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.6875,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.8125,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.9375,y_center:.4375},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.1875,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.3125,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.4375,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.5625,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.6875,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.8125,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.9375,y_center:.5625},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.1875,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.3125,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.4375,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.5625,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.6875,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.8125,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.9375,y_center:.6875},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.1875,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.3125,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.4375,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.5625,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.6875,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.8125,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.9375,y_center:.8125},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.0625,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.1875,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.3125,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.4375,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.5625,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.6875,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.8125,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375},{w:1,h:1,x_center:.9375,y_center:.9375}];var og={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},lg=class{constructor(t){this.handPipeline=t}static getAnnotations(){return og}async estimateHands(t,n){let r=await this.handPipeline.estimateHands(t,n);if(!r)return[];let a=[];for(let s of r){let i={};if(s.landmarks)for(let c of Object.keys(og))i[c]=og[c].map(u=>s.landmarks[u]);let o=s.box?[Math.max(0,s.box.topLeft[0]),Math.max(0,s.box.topLeft[1]),Math.min(t.shape[2],s.box.bottomRight[0])-Math.max(0,s.box.topLeft[0]),Math.min(t.shape[1],s.box.bottomRight[1])-Math.max(0,s.box.topLeft[1])]:[],l=[s.box.topLeft[0]/t.shape[2],s.box.topLeft[1]/t.shape[1],(s.box.bottomRight[0]-s.box.topLeft[0])/t.shape[2],(s.box.bottomRight[1]-s.box.topLeft[1])/t.shape[1]];a.push({confidence:Math.round(100*s.confidence)/100,box:o,boxRaw:l,landmarks:s.landmarks,annotations:i})}return a}},Kr,Zr;async function ug(e){!Kr||!Zr?([Kr,Zr]=await Promise.all([e.hand.enabled?Ht(Yt(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?Ht(Yt(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!Kr||!Kr.modelUrl?pe("load model failed:",e.hand.detector.modelPath):e.debug&&pe("load model:",Kr.modelUrl),!Zr||!Zr.modelUrl?pe("load model failed:",e.hand.skeleton.modelPath):e.debug&&pe("load model:",Zr.modelUrl))):(e.debug&&pe("cached model:",Kr.modelUrl),e.debug&&pe("cached model:",Zr.modelUrl));let t=new ng(Kr,Kr==null?void 0:Kr.inputs[0].shape[2],N8),n=new sg(t,Zr,Zr==null?void 0:Zr.inputs[0].shape[2]);return new lg(n)}var cg={};mr(cg,{load:()=>hg,predict:()=>dg});var T8=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],E8=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var En;async function hg(e){return En?e.debug&&pe("cached model:",En.modelUrl):(En=await Ht(Yt(e.modelBasePath,e.body.modelPath)),En.width=parseInt(En.signature.inputs["input_1:0"].tensorShape.dim[2].size),En.height=parseInt(En.signature.inputs["input_1:0"].tensorShape.dim[1].size),!En||!En.modelUrl?pe("load model failed:",e.body.modelPath):e.debug&&pe("load model:",En.modelUrl)),En}async function dg(e,t){if(!En||!t.body.enabled)return null;let n={width:e.shape[2],height:e.shape[1]},r=Ye.resizeBilinear(e,[En.width,En.height],!1),a=ge(r,[255]);r.dispose();let s=await En.predict(a),i=s.find(h=>h.size===195||h.size===155).dataSync();s.forEach(h=>h.dispose()),a.dispose();let o=[],l=i.length===195?T8:E8,c=5;for(let h=0;hd.score>h?d.score:h,0),keypoints:o}]}var pg={};mr(pg,{load:()=>mg,predict:()=>Ag});var S0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Cn,fg=[],N0=Number.MAX_SAFE_INTEGER,T0=2.5;async function mg(e){if(Cn)e.debug&&pe("cached model:",Cn.modelUrl);else{Cn=await Ht(Yt(e.modelBasePath,e.object.modelPath));let t=Object.values(Cn.modelSignature.inputs);if(Cn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Cn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Cn||!Cn.modelUrl?pe("load model failed:",e.object.modelPath):e.debug&&pe("load model:",Cn.modelUrl)}return Cn}async function Iie(e,t,n,r){let a=0,s=[];for(let c of[1,2,4])L(()=>{var A,y;let u=c*13,h=(A=e.find(g=>g.shape[1]===u**2&&g.shape[2]===S0.length))==null?void 0:A.squeeze(),d=(y=e.find(g=>g.shape[1]===u**2&&g.shape[2]r.object.minConfidence&&x!==61){let w=(.5+Math.trunc(g%u))/u,b=(.5+Math.trunc(g/u))/u,k=m[g].map(U=>U*(u/c/t)),[N,C]=[w-T0/c*k[0],b-T0/c*k[1]],[F,O]=[w+T0/c*k[2]-N,b+T0/c*k[3]-C],z=[N,C,F,O];z=z.map(U=>Math.max(0,Math.min(U,1)));let V=[z[0]*n[0],z[1]*n[1],z[2]*n[0],z[3]*n[1]],j={id:a++,strideSize:c,score:Math.round(100*v)/100,class:x+1,label:S0[x].label,center:[Math.trunc(n[0]*w),Math.trunc(n[1]*b)],centerRaw:[w,b],box:V.map(U=>Math.trunc(U)),boxRaw:z};s.push(j)}}});e.forEach(c=>Te(c));let i=s.map(c=>c.boxRaw),o=s.map(c=>c.score),l=[];if(i&&i.length>0){let c=await Ye.nonMaxSuppressionAsync(i,o,r.object.maxDetected,r.object.iouThreshold,r.object.minConfidence);l=c.dataSync(),Te(c)}return s=s.filter((c,u)=>l.includes(u)).sort((c,u)=>u.score-c.score),s}async function Ag(e,t){return Cn?N00?(N0++,fg):(t.videoOptimized?N0=0:N0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let r=[e.shape[2],e.shape[1]],a=Ye.resizeBilinear(e,[Cn.inputSize,Cn.inputSize],!1),s=a.div(255),i=s.transpose([0,3,1,2]);s.dispose(),a.dispose();let o;t.object.enabled&&(o=await Cn.predict(i)),i.dispose();let l=await Iie(o,Cn.inputSize,r,t);fg=l,n(l)})):null}var C8=e=>{if(!e)return[];let t=[];for(let n=0;nl.part==="leftWrist"),a=e[n].keypoints.find(l=>l.part==="rightWrist"),s=e[n].keypoints.find(l=>l.part==="nose");s&&r&&a&&r.position.yl.part==="leftShoulder"),o=e[n].keypoints.find(l=>l.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},R8=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(r)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${r<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},M8=e=>{if(!e)return[];let t=[];for(let n=0;n.033||h>.033)&&(c=!1),d>.033&&t.push({iris:n,gesture:"looking right"}),h>.033&&t.push({iris:n,gesture:"looking left"});let p=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].annotations.rightEyeIris[0][1],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].annotations.leftEyeIris[0][1];(m<.015||p<.015||m>.03||p>.03)&&(c=!1),(m<.015||p<.015)&&t.push({iris:n,gesture:"looking down"}),(m>.03||p>.03)&&t.push({iris:n,gesture:"looking up"}),c&&t.push({iris:n,gesture:"looking center"})}return t},F8=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=r.reduce((i,o)=>i.position[2]i.position[1]gg});function Sie(e,t,n){let r=function(o,l,c){let u=new RegExp("\\b"+l+" \\w+ (\\w+)","ig");o.replace(u,(h,d)=>(c[d]=0,h))},a=function(o,l){let c=e.createShader(l);if(e.shaderSource(c,o),e.compileShader(c),!e.getShaderParameter(c,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(c));return c};this.uniform={},this.attribute={};let s=a(t,e.VERTEX_SHADER),i=a(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),r(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);r(t,"uniform",this.uniform),r(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function $8(e){e||(e={});let t=0,n=null,r=!1,a=-1,s=[null,null],i=[],o=-1,l=-1,c=null,u=null,h={},d=e.canvas||document.createElement("canvas"),p={},m={INTERMEDIATE:1},f=d.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(w){let b=Array.prototype.slice.call(arguments,1),k=h[w];i.push({func:k,args:b})},this.reset=function(){i=[]};let A=function(w,b){if(!(w===o&&b===l)){if(d.width=w,o=w,d.height=b,l=b,!c){let k=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);c=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,c),f.bufferData(f.ARRAY_BUFFER,k,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,l),s=[null,null]}},y=function(w,b){let k=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,k);let N=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,N);let C=f.createTexture();return f.bindTexture(f.TEXTURE_2D,C),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,w,b,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,C,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:k,texture:C}},g=function(w){return s[w]=s[w]||y(o,l),s[w]},x=function(w=null){var C,F;let b=null,k=null,N=!1;t===0?b=n:b=(C=g(a))==null?void 0:C.texture,t++,r&&!(w&m.INTERMEDIATE)?(k=null,N=t%2==0):(a=(a+1)%2,k=(F=g(a))==null?void 0:F.fbo),f.bindTexture(f.TEXTURE_2D,b),f.bindFramebuffer(f.FRAMEBUFFER,k),f.uniform1f(u.uniform.flipY,N?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(w){if(A(w.width,w.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,w),i.length===0)return x(),d;for(let b=0;b0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0,i=a,o=s;if(i>E0&&(i=E0,o=i*s/a),o>E0&&(o=E0,i=o*a/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=a*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/a)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ee||(Ee==null?void 0:Ee.width)!==i||(Ee==null?void 0:Ee.height)!==o)&&(Ee=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ee==null?void 0:Ee.width)!==i&&(Ee.width=i),(Ee==null?void 0:Ee.height)!==o&&(Ee.height=o));let l=Ee.getContext("2d");if(e instanceof ImageData?l.putImageData(e,0,0):t.filter.flip&&typeof l.translate!="undefined"?(l.translate(a,0),l.scale(-1,1),l.drawImage(e,0,0,a,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),l.setTransform(1,0,0,1,0,0)):l.drawImage(e,0,0,a,s,0,0,Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height),t.filter.enabled){if((!Mt||!gt||Ee.width!==gt.width||(Ee==null?void 0:Ee.height)!==(gt==null?void 0:gt.height))&&(gt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ee==null?void 0:Ee.width,Ee==null?void 0:Ee.height):document.createElement("canvas"),(gt==null?void 0:gt.width)!==(Ee==null?void 0:Ee.width)&&(gt.width=Ee==null?void 0:Ee.width),(gt==null?void 0:gt.height)!==(Ee==null?void 0:Ee.height)&&(gt.height=Ee==null?void 0:Ee.height),Mt=Ar.flags.IS_BROWSER?new $8({canvas:gt}):null),!Mt)return{tensor:null,canvas:Ee};Mt.reset(),Mt.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&Mt.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&Mt.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&Mt.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&Mt.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&Mt.addFilter("hue",t.filter.hue),t.filter.negative&&Mt.addFilter("negative"),t.filter.sepia&&Mt.addFilter("sepia"),t.filter.vintage&&Mt.addFilter("brownie"),t.filter.sepia&&Mt.addFilter("sepia"),t.filter.kodachrome&&Mt.addFilter("kodachrome"),t.filter.technicolor&&Mt.addFilter("technicolor"),t.filter.polaroid&&Mt.addFilter("polaroid"),t.filter.pixelate!==0&&Mt.addFilter("pixelate",t.filter.pixelate),Mt.apply(Ee)}else gt=Ee,Mt&&(Mt=null);let c;if(gt.data){let h=[gt.height,gt.width,3];c=hd(gt.data,h,"int32")}else if(gt instanceof ImageData)c=oi.fromPixels(gt);else if(t.backend==="webgl"||t.backend==="humangl"){let h=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");h.width=i,h.height=o;let d=h.getContext("2d");d==null||d.drawImage(gt,0,0),c=oi.fromPixels(h)}else{let h=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");h.width=i,h.height=o;let d=h.getContext("2d");d==null||d.drawImage(gt,0,0);let p=d==null?void 0:d.getImageData(0,0,i,o);c=oi.fromPixels(p)}let u=c.toFloat();n=u.expandDims(0),c.dispose(),u.dispose()}let r=t.filter.return?gt:null;return{tensor:n,canvas:r}}var xg={};mr(xg,{all:()=>Tie,body:()=>z8,canvas:()=>Nie,face:()=>O8,gesture:()=>D8,hand:()=>P8,object:()=>L8,options:()=>zi});var ct={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var zi={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function C0(e,t,n,r=0,a){e.fillStyle=a.useDepth&&r?`rgba(${127.5+2*r}, ${127.5-2*r}, 255, 0.3)`:a.color,e.beginPath(),e.arc(t,n,a.pointSize,0,2*Math.PI),e.fill()}function Pi(e,t,n,r,a,s){if(e.beginPath(),s.useCurves){let i=(t+t+r)/2,o=(n+n+a)/2;e.ellipse(i,o,r/2,a/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+r-s.roundRect,n),e.quadraticCurveTo(t+r,n,t+r,n+s.roundRect),e.lineTo(t+r,n+a-s.roundRect),e.quadraticCurveTo(t+r,n+a,t+r-s.roundRect,n+a),e.lineTo(t+s.roundRect,n+a),e.quadraticCurveTo(t,n+a,t,n+a-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function wg(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let r of t)e.strokeStyle=n.useDepth&&r[2]?`rgba(${127.5+2*r[2]}, ${127.5-2*r[2]}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&r[2]?`rgba(${127.5+2*r[2]}, ${127.5-2*r[2]}, 255, 0.3)`:n.color,e.lineTo(r[0],parseInt(r[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Kc(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){wg(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let r=0;r1&&l[1].length>0){let c=o[1]>0?`#${o[1]}`:"",u=`${o[0]} ${c}: ${l[1]}`;r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(u,8,2+s*r.lineHeight)),a.fillStyle=r.labelColor,a.fillText(u,6,0+s*r.lineHeight),s+=1}}}async function O8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a)for(let s of t){a.font=r.font,a.strokeStyle=r.color,a.fillStyle=r.color,r.drawBoxes&&(r.useRawBoxes?Pi(a,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],r):Pi(a,s.box[0],s.box[1],s.box[2],s.box[3],r));let i=[];if(i.push(`face confidence: ${Math.trunc(100*s.confidence)}%`),s.genderConfidence&&i.push(`${s.gender||""} ${Math.trunc(100*s.genderConfidence)}% confident`),s.age&&i.push(`age: ${s.age||""}`),s.iris&&i.push(`iris distance: ${s.iris}`),s.emotion&&s.emotion.length>0){let o=s.emotion.map(l=>`${Math.trunc(100*l.score)}% ${l.emotion}`);i.push(o.join(" "))}s.rotation&&s.rotation.angle&&s.rotation.angle.roll&&i.push(`roll: ${Math.trunc(100*s.rotation.angle.roll)/100} yaw:${Math.trunc(100*s.rotation.angle.yaw)/100} pitch:${Math.trunc(100*s.rotation.angle.pitch)/100}`),i.length===0&&i.push("face"),a.fillStyle=r.color;for(let o=i.length-1;o>=0;o--){let l=Math.max(s.box[0],0),c=o*r.lineHeight+s.box[1];r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(i[o],l+5,c+16)),a.fillStyle=r.labelColor,a.fillText(i[o],l+4,c+15)}if(a.lineWidth=1,s.mesh&&s.mesh.length>0){if(r.drawPoints)for(let o of s.mesh)C0(a,o[0],o[1],o[2],r);if(r.drawPolygons){a.lineWidth=1;for(let o=0;os.mesh[c]);wg(a,l,r)}if(s.annotations&&s.annotations.leftEyeIris){a.strokeStyle=r.useDepth?"rgba(255, 200, 255, 0.3)":r.color,a.beginPath();let o=Math.abs(s.annotations.leftEyeIris[3][0]-s.annotations.leftEyeIris[1][0])/2,l=Math.abs(s.annotations.leftEyeIris[4][1]-s.annotations.leftEyeIris[2][1])/2;a.ellipse(s.annotations.leftEyeIris[0][0],s.annotations.leftEyeIris[0][1],o,l,0,0,2*Math.PI),a.stroke(),r.fillPolygons&&(a.fillStyle=r.useDepth?"rgba(255, 255, 200, 0.3)":r.color,a.fill())}if(s.annotations&&s.annotations.rightEyeIris){a.strokeStyle=r.useDepth?"rgba(255, 200, 255, 0.3)":r.color,a.beginPath();let o=Math.abs(s.annotations.rightEyeIris[3][0]-s.annotations.rightEyeIris[1][0])/2,l=Math.abs(s.annotations.rightEyeIris[4][1]-s.annotations.rightEyeIris[2][1])/2;a.ellipse(s.annotations.rightEyeIris[0][0],s.annotations.rightEyeIris[0][1],o,l,0,0,2*Math.PI),a.stroke(),r.fillPolygons&&(a.fillStyle=r.useDepth?"rgba(255, 255, 200, 0.3)":r.color,a.fill())}}}}}var Qa=[];async function z8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round";for(let s=0;sl.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),o.length===4&&wg(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftKnee"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftAnkle"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHeel"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftFoot"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightKnee"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightAnkle"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHeel"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightFoot"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftElbow"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftWrist"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftPalm"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightElbow"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightWrist"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightPalm"),i&&i.score>ct.body.minConfidence&&o.push([i.position.x,i.position.y]),Kc(a,o,r)}}}}async function P8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round",a.font=r.font;for(let s of t){if(r.drawBoxes){a.strokeStyle=r.color,a.fillStyle=r.color;let i;if(!r.calculateHandBox)i=r.useRawBoxes?s.boxRaw:s.box;else if(i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],s.landmarks&&s.landmarks.length>0){for(let o of s.landmarks)o[0]i[2]&&(i[2]=o[0]),o[1]>i[3]&&(i[3]=o[1]);i[2]-=i[0],i[3]-=i[1]}r.useRawBoxes?Pi(a,e.width*i[0],e.height*i[1],e.width*i[2],e.height*i[3],r):Pi(a,i[0],i[1],i[2],i[3],r),r.drawLabels&&(r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText("hand",i[0]+3,1+i[1]+r.lineHeight,i[2])),a.fillStyle=r.labelColor,a.fillText("hand",i[0]+2,0+i[1]+r.lineHeight,i[2])),a.stroke()}if(r.drawPoints&&s.landmarks&&s.landmarks.length>0)for(let i of s.landmarks)a.fillStyle=r.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:r.color,C0(a,i[0],i[1],0,r);if(r.drawPolygons){let i=o=>{if(!!o)for(let l=0;l0?l-1:0][0],o[l>0?l-1:0][1]),a.lineTo(o[l][0],o[l][1]),a.stroke()};i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function L8(e,t,n){let r=Hn(zi,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let a=e.getContext("2d");if(!!a){a.lineJoin="round",a.font=r.font;for(let s of t)if(r.drawBoxes){if(a.strokeStyle=r.color,a.fillStyle=r.color,r.useRawBoxes?Pi(a,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],r):Pi(a,s.box[0],s.box[1],s.box[2],s.box[3],r),r.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;r.shadowColor&&r.shadowColor!==""&&(a.fillStyle=r.shadowColor,a.fillText(i,s.box[0]+3,1+s.box[1]+r.lineHeight,s.box[2])),a.fillStyle=r.labelColor,a.fillText(i,s.box[0]+2,0+s.box[1]+r.lineHeight,s.box[2])}a.stroke()}}}async function Nie(e,t){if(!e||!t||!(e instanceof HTMLCanvasElement)||!(t instanceof HTMLCanvasElement))return;let n=e.getContext("2d");n==null||n.drawImage(e,0,0)}async function Tie(e,t,n){let r=Hn(zi,n);!t||!e||e instanceof HTMLCanvasElement&&(O8(e,t.face,r),z8(e,t.body,r),P8(e,t.hand,r),D8(e,t.gesture,r),L8(e,t.object,r))}var R0=` + ${a}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=I2(s,n),o=a===0?0:e.size/a,l=L(()=>{let u=[];e=H(e,[1,a,o]);for(let p=0;p{switch(e.op){case"If":case"StatelessIf":{let a=S("thenBranch",e,t,n),r=S("elseBranch",e,t,n),s=S("cond",e,t,n),i=S("args",e,t,n);return(await s.data())[0]?n.functionMap[a].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{let a=S("body",e,t,n),r=S("cond",e,t,n),s=S("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),o=s.map(u=>u.id),l=await i[0].data();i.forEach(u=>{!u.kept&&o.indexOf(u.id)===-1&&u.dispose()});let d=s;for(;l[0];){let u=d;d=await n.functionMap[a].executeFunctionAsync(d,n.tensorArrayMap,n.tensorListMap);let p=d.map(h=>h.id);u.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()});let c=await n.functionMap[r].executeFunctionAsync(d,n.tensorArrayMap,n.tensorListMap);l=await c[0].data(),c.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&p.indexOf(h.id)===-1&&h.dispose()})}return d}case"LoopCond":{let a=S("pred",e,t,n);return[hr(a)]}case"Switch":{let a=S("pred",e,t,n),r=S("data",e,t,n);return r.kept||(r=hr(r)),(await a.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let a=e.inputNames.find(r=>mn(r,t,n)!==void 0);if(a){let r=mn(a,t,n);return[hr(r)]}return}case"Enter":{let a=S("frameName",e,t,n),r=S("tensor",e,t,n);return n.enterFrame(a),[hr(r)]}case"Exit":{let a=S("tensor",e,t,n);return n.exitFrame(),[hr(a)]}case"NextIteration":{let a=S("tensor",e,t,n);return n.nextIteration(),[hr(a)]}case"TensorArrayV3":{let a=S("size",e,t,n),r=S("dtype",e,t,n),s=S("elementShape",e,t,n),i=S("dynamicSize",e,t,n),o=S("clearAfterRead",e,t,n),l=S("identicalElementShapes",e,t,n),d=S("name",e,t,n),u=new jre(d,r,a,s,l,i,o);return n.addTensorArray(u),[u.idTensor,Ie(1)]}case"TensorArrayWriteV3":{let a=S("tensorArrayId",e,t,n),r=S("index",e,t,n),s=S("tensor",e,t,n),i=n.getTensorArray(a.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let a=S("tensorArrayId",e,t,n),r=S("index",e,t,n);return[n.getTensorArray(a.id).read(r)]}case"TensorArrayGatherV3":{let a=S("tensorArrayId",e,t,n),r=S("indices",e,t,n),s=S("dtype",e,t,n);return[n.getTensorArray(a.id).gather(r,s)]}case"TensorArrayScatterV3":{let a=S("tensorArrayId",e,t,n),r=S("indices",e,t,n),s=S("tensor",e,t,n),i=n.getTensorArray(a.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id),s=S("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{let a=S("tensorArrayId",e,t,n),r=S("tensor",e,t,n),s=S("lengths",e,t,n),i=n.getTensorArray(a.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return[Ie(r.size(),"int32")]}case"TensorArrayCloseV3":{let a=S("tensorArrayId",e,t,n),r=n.getTensorArray(a.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let a=S("tensorListId",e,t,n),r=S("index",e,t,n),s=S("tensor",e,t,n),i=n.getTensorList(a.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let a=S("tensorListId",e,t,n),r=S("index",e,t,n),s=S("elementShape",e,t,n),i=S("elementDType",e,t,n);return[n.getTensorList(a.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let a=S("indices",e,t,n),r=S("tensor",e,t,n),s=S("elementShape",e,t,n),i=S("numElements",e,t,n),o=Gre(r,a,s,i);return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let a=S("elementShape",e,t,n),r=S("elementDType",e,t,n),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=S(s,e,t,n),o=Hre(a,r,i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{let a=S("tensorListId",e,t,n),r=S("indices",e,t,n),s=S("elementShape",e,t,n),i=S("elementDType",e,t,n);return[n.getTensorList(a.id).gather(r,i,s)]}case"TensorListStack":{let a=S("tensorListId",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n),i=S("numElements",e,t,n);return[n.getTensorList(a.id).stack(r,s,i)]}case"TensorListFromTensor":{let a=S("tensor",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n),i=Ure(a,r,s);return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":{let a=S("tensorListId",e,t,n),r=n.getTensorList(a.id),s=S("dtype",e,t,n),i=S("elementShape",e,t,n);return[r.concat(s,i)]}case"TensorListPushBack":{let a=S("tensorListId",e,t,n),r=S("tensor",e,t,n),s=n.getTensorList(a.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let a=S("tensorListId",e,t,n),r=S("elementShape",e,t,n),s=S("elementDType",e,t,n);return[n.getTensorList(a.id).popBack(r,s)]}case"TensorListSplit":{let a=S("tensor",e,t,n),r=S("elementShape",e,t,n),s=S("lengths",e,t,n),i=qre(a,s,r);return n.addTensorList(i),[i.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function S8(e,t,n){let[a,r]=S("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=a==="fusedbatchnorm",l=S("numArgs",e,t,n);if(s){if(i&&l!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&l!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(o)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let d=S("strides",e,t,n),u=o0(e,t,n),p=S("dataFormat",e,t,n).toUpperCase(),c=S("dilations",e,t,n),[h,m]=S("args",e,t,n),f=S("leakyreluAlpha",e,t,n);return{stride:d,pad:u,dataFormat:p,dilations:c,biasArg:h,preluArg:m,activationFunc:r,leakyreluAlpha:f}}var Kre=(e,t,n)=>{switch(e.op){case"Conv1D":{let a=S("stride",e,t,n),r=S("pad",e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilation",e,t,n);return[gc(S("x",e,t,n),S("filter",e,t,n),a,r,s,i)]}case"Conv2D":{let a=S("strides",e,t,n),r=o0(e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilations",e,t,n);return[ar(S("x",e,t,n),S("filter",e,t,n),[a[1],a[2]],r,s,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:d,leakyreluAlpha:u}=S8(e,t,n);return[zr.conv2d({x:S("x",e,t,n),filter:S("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:d,preluActivationWeights:l,leakyreluAlpha:u})]}case"FusedDepthwiseConv2dNative":{let{stride:a,pad:r,dataFormat:s,dilations:i,biasArg:o,preluArg:l,activationFunc:d,leakyreluAlpha:u}=S8(e,t,n);return[zr.depthwiseConv2d({x:S("x",e,t,n),filter:S("filter",e,t,n),strides:[a[1],a[2]],pad:r,dataFormat:s,dilations:[i[1],i[2]],bias:o,activation:d,preluActivationWeights:l,leakyreluAlpha:u})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let a=S("outputShape",e,t,n),r=S("strides",e,t,n),s=o0(e,t,n);return[xc(S("x",e,t,n),S("filter",e,t,n),a,[r[1],r[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let a=S("strides",e,t,n),r=o0(e,t,n),s=S("dilations",e,t,n),i=S("dataFormat",e,t,n).toUpperCase();return[hl(S("input",e,t,n),S("filter",e,t,n),[a[1],a[2]],r,i,[s[1],s[2]])]}case"Conv3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("dataFormat",e,t,n).toUpperCase(),i=S("dilations",e,t,n);return[oA(S("x",e,t,n),S("filter",e,t,n),[a[1],a[2],a[3]],r,s,[i[1],i[2],i[3]])]}case"AvgPool":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[ju(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPool":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[Ku(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r)]}case"MaxPoolWithArgmax":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n),i=S("includeBatchInIndex",e,t,n),{result:o,indexes:l}=Hb(S("x",e,t,n),[s[1],s[2]],[a[1],a[2]],r,i);return[o,l]}case"AvgPool3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[rA(S("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"MaxPool3D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("kernelSize",e,t,n);return[xA(S("x",e,t,n),[s[1],s[2],s[3]],[a[1],a[2],a[3]],r)]}case"Dilation2D":{let a=S("strides",e,t,n),r=S("pad",e,t,n),s=S("dilations",e,t,n),i=a[1],o=a[2],l=s[1],d=s[2];return[uA(S("x",e,t,n),S("filter",e,t,n),[i,o],r,[l,d],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Zre=(e,t,n)=>{switch(e.op){case"Fill":{let a=S("shape",e,t,n),r=S("dtype",e,t,n),s=S("value",e,t,n);return[Gu(a,s,r)]}case"LinSpace":{let a=S("start",e,t,n),r=S("stop",e,t,n),s=S("num",e,t,n);return[Pb(a,r,s)]}case"Multinomial":{let a=S("logits",e,t,n),r=S("numSamples",e,t,n),s=S("seed",e,t,n);return[Gb(a,r,s)]}case"OneHot":{let a=S("indices",e,t,n),r=S("depth",e,t,n),s=S("onValue",e,t,n),i=S("offValue",e,t,n);return[ol(a,r,s,i)]}case"Ones":return[$n(S("shape",e,t,n),S("dtype",e,t,n))];case"OnesLike":return[Dn(S("x",e,t,n))];case"RandomUniform":return[gl(S("shape",e,t,n),S("minval",e,t,n),S("maxval",e,t,n),S("dtype",e,t,n))];case"Range":{let a=S("start",e,t,n),r=S("stop",e,t,n),s=S("step",e,t,n);return[Rc(a,r,s,S("dtype",e,t,n))]}case"TruncatedNormal":{let a=S("shape",e,t,n),r=S("mean",e,t,n),s=S("stdDev",e,t,n),i=S("seed",e,t,n);return[Wc(a,r,s,S("dtype",e,t,n),i)]}case"Zeros":return[Ct(S("shape",e,t,n),S("dtype",e,t,n))];case"ZerosLike":return[Ue(S("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function S2(e,t,n){let a=S("boxes",e,t,n),r=S("scores",e,t,n),s=S("maxOutputSize",e,t,n),i=S("iouThreshold",e,t,n),o=S("scoreThreshold",e,t,n),l=S("softNmsSigma",e,t,n);return{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var Yre=async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}=S2(e,t,n),d=await Ye.nonMaxSuppressionWithScoreAsync(a,r,s,i,o,l);return[d.selectedIndices,d.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=S2(e,t,n),l=S("padToMaxOutputSize",e,t,n),d=await Ye.nonMaxSuppressionPaddedAsync(a,r,s,i,o,l);return[d.selectedIndices,d.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:a,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o}=S2(e,t,n);return[await Ye.nonMaxSuppressionAsync(a,r,s,i,o)]}case"Where":{let a=Ae(S("condition",e,t,n),"bool"),r=[await $A(a)];return a.dispose(),r}case"ListDiff":return Kb(S("x",e,t,n),S("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}},Jre=(e,t,n)=>{switch(e.op){case"TopKV2":{let a=S("x",e,t,n),r=S("k",e,t,n),s=S("sorted",e,t,n),i=MA(a,r,s);return[i.values,i.indices]}case"Unique":{let a=S("x",e,t,n),r=Bc(a);return[r.values,r.indices]}case"UniqueV2":{let a=S("x",e,t,n),r=S("axis",e,t,n),s=Bc(a,r);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},Qre=(e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let a=S("default",e,t,n);return[mn(e.name,t,n)||a];case"Placeholder":return[mn(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let d=S("x",e,t,n);return[hr(d)]}case"IdentityN":return S("x",e,t,n).map(d=>hr(d));case"Snapshot":let r=S("x",e,t,n);return[hr(r)];case"Shape":return[nn(S("x",e,t,n).shape,"int32")];case"ShapeN":return S("x",e,t,n).map(d=>nn(d.shape));case"Size":return[Ie(S("x",e,t,n).size,"int32")];case"Rank":return[Ie(S("x",e,t,n).rank,"int32")];case"NoOp":return[Ie(1)];case"Print":let s=S("x",e,t,n),i=S("data",e,t,n),o=S("message",e,t,n),l=S("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let d=0;de.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Ie(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let n=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),L(()=>{let a=ua(t),r=n.length,s=a.length;w.assert(r===s,()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${s} elements.`);for(let i=0;i{let a=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=S("keyDType",e,t,n),s=S("valueDType",e,t,n),i=new ese(r,s);return a.addHashTable(e.name,i),[i.handle]}case"LookupTableImport":case"LookupTableImportV2":{let r=S("tableHandle",e,t,n,a),s=S("keys",e,t,n),i=S("values",e,t,n);return[await a.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=S("tableHandle",e,t,n,a),s=S("keys",e,t,n),i=S("defaultValue",e,t,n);return[await a.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=S("tableHandle",e,t,n,a);return[a.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},nse=(e,t,n)=>{switch(e.op){case"ResizeBilinear":{let a=S("images",e,t,n),r=S("size",e,t,n),s=S("alignCorners",e,t,n),i=S("halfPixelCenters",e,t,n);return[Ye.resizeBilinear(a,[r[0],r[1]],s,i)]}case"ResizeNearestNeighbor":{let a=S("images",e,t,n),r=S("size",e,t,n),s=S("alignCorners",e,t,n),i=S("halfPixelCenters",e,t,n);return[Ye.resizeNearestNeighbor(a,[r[0],r[1]],s,i)]}case"CropAndResize":{let a=S("image",e,t,n),r=S("boxes",e,t,n),s=S("boxInd",e,t,n),i=S("cropSize",e,t,n),o=S("method",e,t,n),l=S("extrapolationValue",e,t,n);return[Ye.cropAndResize(a,r,s,i,o,l)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ase=(e,t,n)=>{switch(e.op){case"Equal":return[Fr(S("a",e,t,n),S("b",e,t,n))];case"NotEqual":return[Ai(S("a",e,t,n),S("b",e,t,n))];case"Greater":return[oa(S("a",e,t,n),S("b",e,t,n))];case"GreaterEqual":return[Dr(S("a",e,t,n),S("b",e,t,n))];case"Less":return[kc(S("a",e,t,n),S("b",e,t,n))];case"LessEqual":return[hi(S("a",e,t,n),S("b",e,t,n))];case"LogicalAnd":return[la(S("a",e,t,n),S("b",e,t,n))];case"LogicalNot":return[Xu(S("a",e,t,n))];case"LogicalOr":return[Tc(S("a",e,t,n),S("b",e,t,n))];case"Select":case"SelectV2":return[In(S("condition",e,t,n),S("a",e,t,n),S("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},rse=(e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[Be(S("a",e,t,n),S("b",e,t,n),S("transposeA",e,t,n),S("transposeB",e,t,n))];case"Einsum":return[Ob(S("equation",e,t,n),...S("tensors",e,t,n))];case"Transpose":return[Ze(S("x",e,t,n),S("perm",e,t,n))];case"_FusedMatMul":let[a,r]=S("fusedOps",e,t,n),s=a==="biasadd",i=r==="prelu",o=S("numArgs",e,t,n),l=S("leakyreluAlpha",e,t,n);if(s){if(i&&o!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&o!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[d,u]=S("args",e,t,n);return[zr.matMul({a:S("a",e,t,n),b:S("b",e,t,n),transposeA:S("transposeA",e,t,n),transposeB:S("transposeB",e,t,n),bias:d,activation:r,preluActivationWeights:u,leakyreluAlpha:l})];default:throw TypeError(`Node type ${e.op} is not implemented`)}},sse=(e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[pi(S("x",e,t,n),S("mean",e,t,n),S("variance",e,t,n),S("offset",e,t,n),S("scale",e,t,n),S("epsilon",e,t,n))];case"FusedBatchNormV3":return[pi(S("x",e,t,n),S("mean",e,t,n),S("variance",e,t,n),S("offset",e,t,n),S("scale",e,t,n),S("epsilon",e,t,n))];case"LRN":return[mA(S("x",e,t,n),S("radius",e,t,n),S("bias",e,t,n),S("alpha",e,t,n),S("beta",e,t,n))];case"Softmax":return[ed(S("x",e,t,n))];case"LogSoftmax":return[Nc(S("x",e,t,n))];case"SparseToDense":return[DA(S("sparseIndices",e,t,n),S("outputShape",e,t,n),S("sparseValues",e,t,n),S("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},ise=(e,t,n)=>{switch(e.op){case"Max":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Xn(S("x",e,t,n),i,o)]}case"Mean":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[kt(S("x",e,t,n),i,o)]}case"Min":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Al(S("x",e,t,n),i,o)]}case"Sum":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Te(S("x",e,t,n),i,o)]}case"All":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Ac(S("x",e,t,n),i,o)]}case"Any":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Wu(S("x",e,t,n),i,o)]}case"ArgMax":{let i=S("axis",e,t,n);return[Bu(S("x",e,t,n),i)]}case"ArgMin":{let i=S("axis",e,t,n);return[Zm(S("x",e,t,n),i)]}case"Prod":{let i=S("axis",e,t,n),o=S("keepDims",e,t,n);return[Cc(S("x",e,t,n),i,o)]}case"Cumsum":{let i=S("axis",e,t,n),o=S("exclusive",e,t,n),l=S("reverse",e,t,n);return[vc(S("x",e,t,n),i,o,l)]}case"Bincount":let a=S("x",e,t,n),r=S("weights",e,t,n),s=S("size",e,t,n);return[Tb(a,r,s)];case"DenseBincount":{let i=S("x",e,t,n),o=S("weights",e,t,n),l=S("size",e,t,n),d=S("binaryOutput",e,t,n);return[$b(i,o,l,d)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},ose=(e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{let a=S("n",e,t,n),r=S("axis",e,t,n),s=S("tensors",e,t,n);return s=s.slice(0,a),[ot(s,r)]}case"Gather":{let a=S("x",e,t,n),r=S("indices",e,t,n);return[ci(a,Ae(r,"int32"),0)]}case"GatherV2":{let a=S("axis",e,t,n),r=S("batchDims",e,t,n),s=S("x",e,t,n),i=S("indices",e,t,n);return[ci(s,Ae(i,"int32"),a,r)]}case"Reverse":{let a=S("dims",e,t,n),r=[];for(let i=0;i{let a=S("axis",e,t,n),r=S("tensors",e,t,n),s=r[0].shape,i=Or(r[0]).shape,o=r.map(l=>{let d=w.arraysEqual(l.shape,s);if(!d&&!w.arraysEqual(Or(l).shape,i))throw new Error("the input tensors shape does not match");return d?l:H(l,s)});return[zn(o,a)]});case"Unpack":{let a=S("axis",e,t,n),r=S("tensor",e,t,n);return ua(r,a)}case"Tile":{let a=S("reps",e,t,n);return[$r(S("x",e,t,n),a)]}case"Split":case"SplitV":{let a=S("axis",e,t,n),r=S("numOrSizeSplits",e,t,n),s=S("x",e,t,n);return ln(s,r,a)}case"ScatterNd":{let a=S("indices",e,t,n),r=S("values",e,t,n),s=S("shape",e,t,n);return[Qb(a,r,s)]}case"GatherNd":{let a=S("x",e,t,n),r=S("indices",e,t,n);return[e3(a,r)]}case"SparseToDense":{let a=S("sparseIndices",e,t,n),r=S("outputShape",e,t,n),s=S("sparseValues",e,t,n),i=S("defaultValue",e,t,n);return[DA(a,s,r,s.dtype===i.dtype?i:Ae(i,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},lse=(e,t,n)=>{switch(e.op){case"SparseReshape":{let{outputIndices:a,outputShape:r}=m3.sparseReshape(S("inputIndices",e,t,n),S("inputShape",e,t,n),S("newShape",e,t,n));return[a,r]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},use=(e,t,n)=>{switch(e.op){case"FFT":return[td(S("x",e,t,n))];case"IFFT":return[xl(S("x",e,t,n))];case"RFFT":return[nd(S("x",e,t,n))];case"IRFFT":return[Pc(S("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},dse=(e,t,n)=>{switch(e.op){case"Cast":return[Ae(S("x",e,t,n),S("dtype",e,t,n))];case"ExpandDims":{let a=S("axis",e,t,n);return[on(S("x",e,t,n),a)]}case"Squeeze":{let a=S("axis",e,t,n);return[Or(S("x",e,t,n),a)]}case"Reshape":return[H(S("x",e,t,n),S("shape",e,t,n))];case"MirrorPad":return[bA(S("x",e,t,n),S("padding",e,t,n),S("mode",e,t,n))];case"PadV2":case"Pad":return[rr(S("x",e,t,n),S("padding",e,t,n),S("constantValue",e,t,n))];case"SpaceToBatchND":{let a=S("blockShape",e,t,n),r=S("paddings",e,t,n);return[Zu(S("x",e,t,n),a,r)]}case"BatchToSpaceND":{let a=S("blockShape",e,t,n),r=S("crops",e,t,n);return[Uu(S("x",e,t,n),a,r)]}case"DepthToSpace":{let a=S("blockSize",e,t,n),r=S("dataFormat",e,t,n).toUpperCase();return[lA(S("x",e,t,n),a,r)]}case"BroadcastTo":return[pl(S("x",e,t,n),S("shape",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function N8(e,t,n,a){let r=((s,i,o)=>{switch(s.category){case"arithmetic":return L(()=>Bre(s,i,o));case"basic_math":return L(()=>Vre(s,i,o));case"control":return Xre(s,i,o);case"convolution":return L(()=>Kre(s,i,o));case"creation":return L(()=>Zre(s,i,o));case"dynamic":return Yre(s,i,o);case"evaluation":return L(()=>Jre(s,i,o));case"image":return L(()=>nse(s,i,o));case"graph":return L(()=>Qre(s,i,o));case"logical":return L(()=>ase(s,i,o));case"matrices":return L(()=>rse(s,i,o));case"normalization":return L(()=>sse(s,i,o));case"reduction":return L(()=>ise(s,i,o));case"slice_join":return L(()=>ose(s,i,o));case"sparse":return L(()=>lse(s,i,o));case"spectral":return L(()=>use(s,i,o));case"transformation":return L(()=>dse(s,i,o));case"hash_table":return tse(s,i,o,a);case"custom":let l=n8(s.op);if(l&&l.customExecutor)return l.customExecutor(new Wre(s,i,o));throw TypeError(`Custom op ${s.op} is not registered.`);default:throw TypeError(`Unknown op '${s.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return w.isPromise(r)?r.then(s=>[].concat(s)):[].concat(r)}var T8=class{constructor(e={},t={},n={},a={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let e=[];for(let t=0;tt.id===0&&t.iterationId===0?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;let e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(let t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(let t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}};function C8(e,t,n,a){let r=new Set,s=[],i=null,o=null,l=new Set,d=Object.keys(e).map(c=>Ln(c)[0]),u=[];a!=null&&(u=a.map(c=>Ln(c.name)[0]));let p=[...t];for(;p.length>0;){let c=p.pop();if((E8(c)||pse(c)||cse(c))&&i==null&&(i=c,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(c.name),n[c.name]==null&&d.indexOf(c.name)===-1&&u.indexOf(c.name)===-1){if(c.inputs.length===0){s.push(c.name);continue}c.inputs.forEach(h=>{l.has(h.name)||(l.add(h.name),p.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function hse(e,t,n){let{usedNodes:a,inputs:r}=n,s=[],i=Object.keys(r).map(u=>Ln(u)[0]).map(u=>e.nodes[u]),o=e.initNodes;i.forEach(u=>{a.has(u.name)&&s.push(u)}),e.weights.forEach(u=>{a.has(u.name)&&s.push(u)}),o!=null&&o.forEach(u=>{a.has(u.name)&&s.push(u)});let l=new Set,d=[];for(;s.length>0;){let u=s.pop();l.add(u.name),t[u.name]||d.push(u),u.children.forEach(p=>{!l.has(p.name)&&a.has(p.name)&&p.inputs.every(c=>l.has(c.name))&&s.push(p)})}return d}var fse=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],mse=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Ase=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function E8(e){return fse.indexOf(e.op)>=0}function pse(e){return mse.indexOf(e.op)>=0}function cse(e){return Ase.indexOf(e.op)>=0}var N2=class{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(n=>{this._functionExecutorMap[n]=new N2(e.functions[n],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){let t=Object.keys(e).map(n=>e[n].map(a=>a.id));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{let t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t})}get functions(){return Object.keys(this._functions).reduce((e,t)=>(e[t]=this._functions[t].signature,e),{})}getCompilationKey(e,t){let n=e.map(r=>r.name).sort(),a=t.map(r=>r.name).sort();return n.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,t){let n=C8(e,t,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:r,syncInputs:s}=n;if(r!=null)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(a.length>0){let i=t.map(l=>l.name),o=Object.keys(e);throw new Error(`Cannot compute the outputs [${i}] from the provided inputs [${o}]. Missing the following inputs: [${a}]`)}return hse(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);let n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let a=n.map(u=>this.graph.nodes[Ln(u)[0]]),r=t.map(u=>Ln(u)[0]),s=r.map(u=>this.graph.nodes[u]);s.length===0&&(s=this._outputs);let i=this.getCompilationKey(a,s),o=this.compiledMap.get(i);o==null&&(o=this.compile(e,s),this.compiledMap.set(i,o));let l={},d={};return L(()=>{let u=new T8(this.weightMap,l,d,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(m=>{let[f,A]=Ln(m),y=[];y[A]=e[m],p[f]=y});let c=this.getFrozenTensorIds(p),h={};for(let m=0;mmn(m,p,u))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(n=>e[n]).map(n=>n.map(a=>a.id)));return new Set(t)}checkTensorForDisposal(e,t,n,a,r,s,i){t.category==="control"||s.indexOf(e)!==-1||(n[e].forEach(o=>{o!=null&&(i[o.id]=(i[o.id]||0)+t.children.length)}),t.inputs.forEach(o=>{if(o.category!=="control"){let l=vre(o.name,n,a);l!=null&&l.forEach(d=>{if(d&&!d.kept&&!r.has(d.id)){let u=i[d.id];u===1?(d.dispose(),delete i[d.id]):u!=null&&i[d.id]--}})}}))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,a={},r={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));let s=new T8(this.weightMap,a,r,this.functionExecutorMap),i=await this.executeWithControlFlow(e,s,t,n),o=t.map(p=>mn(p,i,s)),l=o.map(p=>p.id),d=Object.keys(e).map(p=>e[p].id),u=new Set([...l,...d,...this.weightIds]);return Object.keys(i).forEach(p=>{i[p].forEach(c=>{c&&!c.kept&&!c.isDisposed&&!u.has(c.id)&&c.dispose()})}),this.parent==null&&s.dispose(u),o}async executeFunctionAsync(e,t,n){let a=e.reduce((r,s,i)=>(r[this.inputs[i].name]=s,r),{});return this._executeAsync(a,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,a){let r=Object.keys(e),s=r.map(g=>this.graph.nodes[Ln(g)[0]]),i=n.map(g=>Ln(g)[0]),o=i.map(g=>this.graph.nodes[g]);o.length===0&&(o=this._outputs);let{usedNodes:l,missingInputs:d,dynamicNode:u,syncInputs:p}=C8(e,o,this.weightMap,this._initNodes),c=[...s,...this.graph.weights,...this._initNodes||[]].map(g=>({node:g,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(g=>{let[x,k]=Ln(g),b=[];b[k]=e[g],h[x]=b});let m={},f=this.getFrozenTensorIds(h),A={};for(;c.length>0;){let g=this.processStack(s,c,t,h,A,f,i,m,l);await Promise.all(g)}u==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let y=o.filter(g=>!E8(g)&&!mn(g.name,h,t)).map(g=>g.name);if(y.length>0){let g="";throw u!=null&&(g=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${d}]. ${g}`)}return h}processStack(e,t,n,a,r,s,i,o,l){let d=[];for(;t.length>0;){let u=t.pop();n.currentContext=u.contexts;let p="";if(u.node.op==="Enter"&&S("isConstant",u.node,a,n)&&([p]=cr(u.node.name,n)),a[u.node.name]==null){let c=N8(u.node,a,n,this._resourceManager);p||([p]=cr(u.node.name,n));let h=n.currentContext;w.isPromise(c)?d.push(c.then(m=>(a[p]=m,n.currentContext=h,this.checkTensorForDisposal(p,u.node,a,n,s,i,o),this.processChildNodes(u.node,t,n,a,r,l),m))):(a[p]=c,this.checkTensorForDisposal(p,u.node,a,n,s,i,o),this.processChildNodes(u.node,t,n,a,r,l))}else this.processChildNodes(u.node,t,n,a,r,l)}return d}processChildNodes(e,t,n,a,r,s){e.children.forEach(i=>{let[o]=cr(i.name,n);r[o]||!s.has(i.name)||(i.op==="Merge"?i.inputNames.some(l=>!!mn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})):i.inputNames.every(l=>!!mn(l,a,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(t=>t.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(t=>{let n=e[t],[a]=Ln(t),r=this.graph.nodes[a];if(r.attrParams.shape&&r.attrParams.shape.value){let s=r.attrParams.shape.value,i=s.length===n.shape.length&&n.shape.every((o,l)=>s[l]===-1||s[l]===o);w.assert(i,()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${s}], but was [${n.shape}]`)}r.attrParams.dtype&&r.attrParams.dtype.value&&w.assert(n.dtype===r.attrParams.dtype.value,()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(e){let t={};for(let n in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[n]!=null){let a=this._signature.inputs[n];t[a.name]=e[n]}else t[n]=e[n];return t}checkInputs(e){let t=Object.keys(e).filter(n=>{let[a]=Ln(n);return this.graph.nodes[a]==null});if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map(t=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[t]!=null?this._signature.outputs[t].name:t,{})}checkOutputs(e){e.forEach(t=>{let[n]=Ln(t);if(!this.graph.nodes[n])throw new Error(`The output '${t}' is not found in the graph`)})}},yse=class{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(let e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(let e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}},gse="?tfjs-format=file",xse="model.json",R8=class{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",t==null&&(this.loadOptions={}),this.resourceManager=new yse}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=vn.browserHTTPRequest(e,this.loadOptions);else{let t=vn.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(vn.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");let e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,n;this.artifacts.userDefinedMetadata!=null&&this.artifacts.userDefinedMetadata.signature!=null?n=this.artifacts.userDefinedMetadata.signature:n=this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let a=vn.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new N2(v8.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=v8.Instance.transformGraph(e.modelInitializer);this.initializer=new N2(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if(typeof e=="string"){let n=vn.getSaveHandlers(e);if(n.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(n.length>1)throw new Error(`Found more than one (${n.length}) save handlers for URL '${e}'`);e=n[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof Le)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((t,n,a)=>(t[n]=e[a],t),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,n)=>(t[n]=[e[n]],t),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}};async function Gt(e,t={}){if(e==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");t==null&&(t={}),t.fromTFHub&&e.load==null&&(e.endsWith("/")||(e=e+"/"),e=`${e}${xse}${gse}`);let n=new R8(e,t);return await n.load(),n}var bse="3.5.0",M8={};Fe(M8,{CSVDataset:()=>$8,Dataset:()=>Ul,FileDataSource:()=>D8,TextLineDataset:()=>F8,URLDataSource:()=>O8,array:()=>vse,csv:()=>kse,func:()=>Ise,generator:()=>Sse,microphone:()=>Tse,version_data:()=>Ese,webcam:()=>Nse,zip:()=>wse});var Cse=Yi(Pg()),Rse=Yi(Pg());function Mse(e,t){return l0(e,t)}function l0(e,t,n=new Map,a=new Set){if(e==null)return null;if(a.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse)if(Hl(e)){let s=Array.isArray(e)?[]:{};a.add(e);for(let i in e){let o=e[i],l=l0(o,t,n,a);s[i]=l}return a.delete(e),s}else throw new Error(`Can't recurse into non-iterable type: ${e}`);else return n.set(e,r.value),r.value}function Fse(e,t=_8){return z8(e,t)}function z8(e,t,n=new Set){let a=e[0];if(n.has(a))throw new Error("Circular references are not supported.");let r=t(e);if(r.recurse&&r.value!==null)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse)if(Hl(a)){let s=Array.isArray(a)?[]:{};n.add(a);for(let i in a){let o=e.map(d=>d[i]),l=z8(o,t,n);s[i]=l}return n.delete(a),s}else throw new Error(`Can't recurse into non-iterable type: ${a}`);else return r.value}function _8(e){return e===null?null:Hl(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function P8(e,t){let n=new Map;l0(e,t,n);for(let a of Array.from(n.keys())){let r=n.get(a);if(w.isPromise(r)){let s=await r;n.set(a,s)}}return l0(e,t,n)}function Hl(e){return e!=null&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||typeof e=="object"&&!(e instanceof Le))}function Dse(e){return e==null||$se(e)||Array.isArray(e)||typeof e=="object"&&e instanceof Le||w.isTypedArray(e)}function $se(e){return e===null||typeof e!="object"&&typeof e!="function"}function zse(e){return Mse(e,Ose)}function Ose(e){return e instanceof Le?{value:e.clone(),recurse:!1}:Hl(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var L8=class{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,e==null)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return this.length()===0}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(let t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);let e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");let t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}},T2=class extends L8{constructor(){super(T2.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){let e=this.capacity*2,t=new Array(e),n=this.length();for(let a=0;at===!0)}rowMajorBatch(e,t=!0){return new Hse(this,e,t)}columnMajorBatch(e,t=!0,n=_8){return this.rowMajorBatch(e,t).map(a=>Fse(a,n))}concatenate(e,t){return new B8(W8([this,e]),t)}take(e){return e<0||e==null?this:new Use(this,e)}skip(e){return e<0||e==null?this:new jse(this,e)}prefetch(e){return new j8(this,e)}shuffle(e,t){return new Zse(this,e,t)}serial(){return new Vse(this)}},_se=class extends qt{constructor(e){super();this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};let e=this.items[this.trav];return this.trav++,{value:zse(e),done:!1}}},Pse=class extends qt{constructor(e){super();this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}},Vse=class extends qt{constructor(e){super();this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){return this.upstream.next()}},jse=class extends qt{constructor(e,t){super();this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}},Hse=class extends qt{constructor(e,t,n=!0){super();this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){let e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}},Gse=class extends qt{constructor(e,t){super();this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;){let e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;Ee(e.value)}}},qse=class extends qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=ya.getTensorsInContainer(e.value),n=this.transform(e.value),a=ya.getTensorsInContainer(n);for(let r of t)ya.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},Xse=class extends qt{constructor(e,t){super();this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}},V8=class extends qt{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){let e=await this.upstream.next();if(e.done)return{value:null,done:!0};let t=ya.getTensorsInContainer(e.value),n=await this.transform(e.value),a=ya.getTensorsInContainer(n);for(let r of t)ya.isTensorInList(r,a)||r.dispose();return{value:n,done:!1}}},C2=class extends qt{constructor(){super();this.outputQueue=new T2,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}async serialNext(){for(;this.outputQueue.length()===0;)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}},Kse=class extends C2{constructor(e,t){super();this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){let e=await this.upstream.next();if(e.done)return!1;let t=ya.getTensorsInContainer(e.value),n=this.transform(e.value),a=ya.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(let r of t)ya.isTensorInList(r,a)||r.dispose();return!0}},B8=class extends qt{constructor(e,t){super();this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,this.iterator==null){let n=await this.moreIterators.next();if(n.done)return{value:null,done:!0};this.iterator=n.value,this.baseErrorHandler!=null&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}let t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}},Xr;(function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"})(Xr||(Xr={}));var Wse=class extends qt{constructor(e,t=Xr.FAIL){super();this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;function a(s){return s instanceof qt?{value:s.next().then(i=>(t++,i.done&&n++,i.value)),recurse:!1}:{value:null,recurse:!0}}let r=await P8(this.iterators,a);if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case Xr.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case Xr.SHORTEST:return{value:null,done:!0};case Xr.LONGEST:default:}return this.count++,{value:r,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}},j8=class extends qt{constructor(e,t){super();this.upstream=e,this.bufferSize=t,this.buffer=new L8(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){let e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}},Zse=class extends j8{constructor(e,t,n){super(e,t);this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Rse.alea(n||w.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then(()=>this.serialNext()),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){let e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(t.done)this.upstreamExhausted=!0;else return this.refill(),t}return{value:null,done:!0}}},Ul=class{constructor(){this.size=null}batch(e,t=!0){let n=this;w.assert(e>0,()=>`batchSize needs to be positive, but it is + ${e}`);let a;return this.size===Infinity||this.size==null?a=this.size:t?a=Math.ceil(this.size/e):a=Math.floor(this.size/e),Wn(async()=>(await n.iterator()).columnMajorBatch(e,t,Yse),a)}concatenate(e){let t=this,n;return this.size===Infinity||e.size===Infinity?n=Infinity:this.size!=null&&e.size!=null?n=this.size+e.size:n=null,Wn(async()=>(await t.iterator()).concatenate(await e.iterator()),n)}filter(e){let t=this,n;return this.size===Infinity?n=Infinity:n=null,Wn(async()=>(await t.iterator()).filter(a=>L(()=>e(a))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){let t=this;return Wn(async()=>(await t.iterator()).map(n=>L(()=>e(n))),this.size)}mapAsync(e){let t=this;return Wn(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");let t=this;return Wn(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){let t=this,n;return this.size!=null&&e>0?n=this.size*e:e===0?n=0:this.size!=null&&(e===void 0||e<0)?n=Infinity:n=null,Wn(async()=>{let a=E2(async()=>({value:await t.iterator(),done:!1}));return Lse(a.take(e))},n)}skip(e){let t=this,n;return this.size!=null&&e>=0&&this.size>=e?n=this.size-e:this.size!=null&&(this.size(await t.iterator()).skip(e),n)}shuffle(e,t,n=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);let a=this,r=Cse.alea(t||w.now().toString());return Wn(async()=>{let s=r.int32();return n&&(s+=r.int32()),(await a.iterator()).shuffle(e,s.toString())},this.size)}take(e){let t=this,n;return this.size!=null&&this.size>e?n=e:this.size!=null&&this.size<=e?n=this.size:n=null,Wn(async()=>(await t.iterator()).take(e),n)}async toArray(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===Infinity)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}};Ul.MAX_BUFFER_SIZE=1e4;function Wn(e,t=null){return new class extends Ul{constructor(){super(...arguments);this.size=t}async iterator(){return e()}}}function vse(e){return Wn(async()=>W8(e),e.length)}function wse(e){if(!Hl(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n{let n=await P8(e,a=>{if(a instanceof Ul)return{value:a.iterator(),recurse:!1};if(Hl(a))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")});return Bse(n,Xr.SHORTEST)},t)}function Yse(e){if(e===null)return null;let t=e[0];return Dse(t)?{value:Jse(e),recurse:!1}:{value:null,recurse:!0}}function Jse(e){if(e.length===0)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Le?zn(e):xa(e)}var F8=class extends Ul{constructor(e){super();this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split(` +`).map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}},u0='"',jd=Symbol("out"),U8=Symbol("field"),d0=Symbol("quote"),R2=Symbol("quoteafterquote"),H8=Symbol("quoteinquote"),$8=class extends Ul{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new F8(e),t||(t={}),this.hasHeader=t.hasHeader!==!1,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(w.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){let e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&w.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);let t=this.fullColumnNames.reduce((a,r)=>(a[r]=a[r]+1||1,a),{}),n=Object.keys(t).filter(a=>t[a]>1);if(w.assert(n.length===0,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs){for(let a of Object.keys(this.columnConfigs))if(this.fullColumnNames.indexOf(a)===-1)throw new Error('The key "'+a+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){let e=await(await this.base.iterator()).next();if(e.done)throw new Error("No data was found for CSV parsing.");let t=e.value;return this.parseRow(t,!1)}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){let t=this.parseRow(e),n={},a={};for(let r=0;r14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=e.includeSpectrogram!==!1,this.includeWaveform=e.includeWaveform===!0,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(J().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");let t=new G8(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:this.audioTrackConstraints==null?!0:this.audioTrackConstraints,video:!1})}catch(n){throw new Error(`Error thrown while initializing video stream: ${n.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");let e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,!this.sampleRateHz)this.sampleRateHz=this.audioContext.sampleRate;else if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`);let t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=this.fftSize*2,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t,n=await this.getAudioData();if(this.includeSpectrogram){let a=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(a,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){let a=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(a,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){let e=[],t=[],n=0;return new Promise(a=>{let r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-Infinity&&a({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),a({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),this.stream!=null&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){let t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((a,r)=>n.set(a,r*t)),n}getTensorFromAudioDataArray(e,t){let n=new Float32Array(w.sizeFromShape(t));return n.set(e,n.length-e.length),xa(n,t)}},q8=class extends qt{constructor(e,t){super();if(this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=nn([0],"int32"),this.webcamConfig.centerCrop){let n=this.webcamConfig.resizeWidth*1/this.webcamVideoElement.width,a=this.webcamConfig.resizeHeight*1/this.webcamVideoElement.height,r=(1-n)/2,s=(1-a)/2,i=r+n,o=a+s;this.cropBox=Kn([s,r,o,i],[1,4])}else this.cropBox=Kn([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(J().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}let n=new q8(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&w.assert(this.webcamConfig.facingMode==="user"||this.webcamConfig.facingMode==="environment",()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=oi.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(this.resize)try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{e.dispose()}else return{value:e,done:!1}}needToResize(){return!!(this.webcamConfig.resizeWidth&&this.webcamConfig.resizeHeight&&(this.webcamVideoElement.width!==this.webcamConfig.resizeWidth||this.webcamVideoElement.height!==this.webcamConfig.resizeHeight))}cropAndResizeFrame(e){return L(()=>{let t=on(Ae(e,"float32"),0),n;n=Ye.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");let a=n.shape;return H(n,a.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}},X8=class{},K8=class extends qt{split(e){return new Qse(this,e)}},Qse=class extends K8{constructor(e,t){super();this.upstream=e,this.impl=new eie(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},eie=class extends C2{constructor(e,t){super();this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){let e=await this.upstream.next();if(e.done)return this.carryover===""?!1:(this.outputQueue.push(this.carryover),this.carryover="",!0);let t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(let n of t.slice(0,-1))this.outputQueue.push(n);return this.carryover=t[t.length-1],!0}},nie=class extends qt{decodeUTF8(){return new tie(this)}},tie=class extends K8{constructor(e){super();this.upstream=e,this.impl=new aie(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}},aie=class extends C2{constructor(e){super();if(this.upstream=e,J().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{let{StringDecoder:t}=lI();this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){let e=await this.upstream.next(),t;if(e.done)return!1;t=e.value;let n;return J().get("IS_BROWSER")?n=this.decoder.decode(t,{stream:!0}):n=this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0}},Z8=class extends nie{constructor(e,t={}){super();this.file=e,this.options=t,w.assert(e instanceof Uint8Array||(J().get("IS_BROWSER")?e instanceof File||e instanceof Blob:!1),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1024*1024}summary(){return`FileChunks ${this.file}`}async next(){return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?{value:null,done:!0}:{value:await new Promise((e,t)=>{let n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{let a=new FileReader;a.onload=s=>{let i=a.result;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),!(i instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(i)},a.onabort=s=>t(new Error("Aborted")),a.onerror=s=>t(new Error(s.type));let r=this.file.slice(this.offset,n);a.readAsArrayBuffer(r)}this.offset=n}),done:!1}}};async function sie(e,t={}){let n,a;typeof e=="string"?n=e:(n=e.url,a=rie(e));let r=await w.fetch(n,a);if(r.ok){let s=new Uint8Array(await r.arrayBuffer());return new Z8(s,t)}else throw new Error(r.statusText)}var rie=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});function Y8(e){return typeof e=="string"&&e.substr(0,7)==="file://"}var D8=class extends X8{constructor(e,t={}){super();this.input=e,this.options=t}async iterator(){if(Y8(this.input)&&J().get("IS_NODE")){let e=require("fs");this.input=e.readFileSync(this.input.substr(7))}return new Z8(this.input,this.options)}},O8=class extends X8{constructor(e,t={}){super();this.url=e,this.fileOptions=t}async iterator(){return Y8(this.url)?new D8(this.url,this.fileOptions).iterator():sie(this.url,this.fileOptions)}};function kse(e,t={}){return new $8(new O8(e),t)}function Ise(e){let t=E2(e);return Wn(async()=>t)}function Sse(e){return Wn(async()=>{let t=await e();return E2(()=>t.next())})}async function Nse(e,t){return q8.create(e,t)}async function Tse(e){return G8.create(e)}var Ese="3.5.0",iie={tfjs:(om==null?void 0:om.version)||void 0,"tfjs-core":(lm==null?void 0:lm.version)||void 0,"tfjs-data":(um==null?void 0:um.version)||void 0,"tfjs-layers":(dm==null?void 0:dm.version)||void 0,"tfjs-converter":(pm==null?void 0:pm.version)||void 0,"tfjs-backend-cpu":X3||void 0,"tfjs-backend-webgl":yv||void 0,"tfjs-backend-wasm":lw||void 0};var Bn={name:"humangl",priority:99,canvas:null,gl:null,width:1024,height:1024,webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function J8(){if(!qm(Bn.name)){he("backend registration:",Bn.name);try{Bn.canvas=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Bn.width,Bn.height):document.createElement("canvas")}catch(e){he("error: cannot create canvas:",e);return}try{Bn.gl=Bn.canvas.getContext("webgl2",Bn.webGLattr)}catch(e){he("error: cannot get WebGL2 context:",e);return}try{uh(2,Bn.gl)}catch(e){he("error: cannot set WebGL2 context:",e);return}try{let e=new hh(Bn.gl);ul(Bn.name,()=>new $l(e),Bn.priority)}catch(e){he("error: cannot register WebGL backend:",e);return}try{nl("webgl").forEach(t=>{let n={...t,backendName:Bn.name};ai(n)})}catch(e){he("error: cannot update WebGL backend registration:",e);return}try{Aa.set("WEBGL_VERSION",2)}catch(e){he("error: cannot set WebGL backend flags:",e);return}he("backend registered:",Bn.name)}}var _2={};ma(_2,{load:()=>W2,predict:()=>L2,triangulation:()=>dk,uvmap:()=>pk});function Q8(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]];return{startPoint:n,endPoint:a}}function Ud(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Gl(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function ql(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return Ye.cropAndResize(t,s,[0],n)}function p0(e,t=1.5){let n=Gl(e),a=Ud(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function c0(e){let t=Gl(e),n=Ud(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,landmarks:e.landmarks}}function M2(e){let t=e.map(s=>s[0]),n=e.map(s=>s[1]),a=[Math.min(...t),Math.min(...n)],r=[Math.max(...t),Math.max(...n)];return{startPoint:a,endPoint:r,landmarks:e}}var ek=e=>({startEndTensor:e,startPoint:Me(e,[0,0],[-1,2]),endPoint:Me(e,[0,2],[-1,2])});var h0=[[1,0,0],[0,1,0],[0,0,1]];function oie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function F2(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return oie(n)}function tk(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function Kr(e,t){let n=0;for(let a=0;a{let c=t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(.5),h=this.model.predict(c),m;if(Array.isArray(h)){let g=h.sort((v,I)=>v.size-I.size),x=ot([g[0],g[2]],2),k=ot([g[1],g[3]],2);m=ot([k,x],1).squeeze(0)}else m=h.squeeze();let f=uie(m,this.anchors,[this.inputSize,this.inputSize]),A=Me(m,[0,0],[-1,1]),y=wn(A).squeeze();return[m,f,y]}),s=await Ye.nonMaxSuppressionAsync(a,r,this.config.face.detector.maxDetected,this.config.face.detector.iouThreshold,this.config.face.detector.minConfidence),i=s.arraySync();s.dispose();let l=i.map(p=>Me(a,[p,0],[1,-1])).map(p=>{let c=p.arraySync();return p.dispose(),c}),d=r.dataSync(),u=[];for(let p=0;pthis.config.face.detector.minConfidence){let m=ek(l[p]),f=this.anchorsData[c],A=L(()=>Me(n,[c,ik-1],[1,-1]).squeeze().reshape([ik,-1]));u.push({box:m,landmarks:A,anchor:f,confidence:h})}}return n.dispose(),a.dispose(),r.dispose(),{boxes:u,scaleFactor:[t.shape[2]/this.inputSize,t.shape[1]/this.inputSize]}}};async function lk(e){let t=await Gt(Yt(e.modelBasePath,e.face.detector.modelPath),{fromTFHub:e.face.detector.modelPath.includes("tfhub.dev")}),n=new ok(t,e);return!t||!t.modelUrl?he("load model failed:",e.face.detector.modelPath):e.debug&&he("load model:",t.modelUrl),n}var Xa={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],rightEyeIris:[473,474,475,476,477],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],leftEyeIris:[468,469,470,471,472],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]},$2=[{key:"EyeUpper0",indices:[9,10,11,12,13,14,15]},{key:"EyeUpper1",indices:[25,26,27,28,29,30,31]},{key:"EyeUpper2",indices:[41,42,43,44,45,46,47]},{key:"EyeLower0",indices:[0,1,2,3,4,5,6,7,8]},{key:"EyeLower1",indices:[16,17,18,19,20,21,22,23,24]},{key:"EyeLower2",indices:[32,33,34,35,36,37,38,39,40]},{key:"EyeLower3",indices:[54,55,56,57,58,59,60,61,62]}],Hd=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]],zi=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];var die=[127,234,132,58,172,150,149,148,152,377,378,379,397,288,361,454,356,70,63,105,66,107,336,296,334,293,300,168,6,195,4,98,97,2,326,327,33,160,158,133,153,144,362,385,387,263,373,380,57,40,37,0,267,270,287,321,314,17,84,91,78,81,13,311,308,402,14,178],pie=[33,133,362,263,1,62,308,159,145,386,374,6,102,331,2,13,14,70,105,107,336,334,300,54,10,284,50,280,234,454,58,288,152],cie=[33,133,362,263,1,78,308],Kie=die.map(e=>Hd[e]),Zie=pie.map(e=>Hd[e]),Yie=cie.map(e=>Hd[e]);var D2=Xa.leftEyeLower0,O2=Xa.rightEyeLower0,Xl={leftBounds:[D2[0],D2[D2.length-1]],rightBounds:[O2[0],O2[O2.length-1]]},m0={count:468,mouth:13,symmetryLine:[13,Xa.midwayBetweenEyes[0]]},uk={leftEye:0,rightEye:1,nose:2,mouth:3,leftEar:4,rightEar:5,symmetryLine:[3,2]},Kl={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};function A0(e,t,n,a){for(let r=0;r<$2.length;r++){let{key:s,indices:i}=$2[r],o=Xa[`${n}${s}`];if(!a||a.includes(s))for(let l=0;l[s[0]/this.meshSize*(p[0]-this.meshSize/2),s[1]/this.meshSize*(p[1]-this.meshSize/2),p[2]]),o=a!==0?f0(a,[0,0]):h0,l=a!==0?i.map(p=>[...rk(p,o),p[2]]):i,d=a!==0?ak(r):h0,u=[...Gl({startPoint:n.startPoint,endPoint:n.endPoint}),1];return l.map(p=>[p[0]+Kr(u,d[0]),p[1]+Kr(u,d[1]),p[2]])}getLeftToRightEyeDepthDifference(t){let n=t[Xl.leftBounds[0]][2],a=t[Xl.rightBounds[0]][2];return n-a}getEyeBox(t,n,a,r,s=!1){let i=c0(p0(M2([t[a],t[r]]),this.irisEnlarge)),o=Ud(i),l=Ye.cropAndResize(n,[[i.startPoint[1]/this.meshSize,i.startPoint[0]/this.meshSize,i.endPoint[1]/this.meshSize,i.endPoint[0]/this.meshSize]],[0],[this.irisSize,this.irisSize]);return s&&Aa.flags.IS_BROWSER&&(l=Ye.flipLeftRight(l)),{box:i,boxSize:o,crop:l}}getEyeCoords(t,n,a,r=!1){let s=[];for(let i=0;i{let d=i;return l===2?d=r:l===4&&(d=s),[o[0],o[1],d]})}async predict(t,n){let a=!1,r;if((this.skipped===0||this.skipped>n.face.detector.skipFrames||!n.face.mesh.enabled||!n.videoOptimized)&&(r=await this.boundingBoxDetector.getBoundingBoxes(t),this.skipped=0),n.videoOptimized&&this.skipped++,!n.videoOptimized||r&&r.boxes&&(!n.face.mesh.enabled||r.boxes.length!==this.detectedFaces&&this.detectedFaces!==n.face.detector.maxDetected)){this.storedBoxes=[],this.detectedFaces=0;for(let i of r.boxes)this.storedBoxes.push({startPoint:i.box.startPoint.dataSync(),endPoint:i.box.endPoint.dataSync(),landmarks:i.landmarks,confidence:i.confidence});this.storedBoxes.length>0&&(a=!0)}if(n.face.detector.skipInitial&&this.detectedFaces===0&&(this.skipped=0),a){if(!r||!r.boxes||r.boxes.length===0)return this.storedBoxes=[],this.detectedFaces=0,null;for(let i=0;i{i.box.startPoint.dispose(),i.box.endPoint.dispose(),i.landmarks.dispose()});let s=L(()=>this.storedBoxes.map((i,o)=>{let l=i.confidence,d,u=0,p;if(n.face.detector.rotation&&n.face.mesh.enabled&&Aa.flags.IS_BROWSER){let[b,v]=i.landmarks.length>=m0.count?m0.symmetryLine:uk.symmetryLine;u=F2(i.landmarks[b],i.landmarks[v]);let I=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),T=[I[0]/t.shape[2],I[1]/t.shape[1]],R=Ye.rotateWithOffset(t,u,0,T);p=f0(-u,I),n.face.mesh.enabled?d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.meshSize,this.meshSize]).div(255):d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.boxSize,this.boxSize]).div(255)}else{p=h0;let b=t.clone();n.face.mesh.enabled?d=ql({startPoint:i.startPoint,endPoint:i.endPoint},b,[this.meshSize,this.meshSize]).div(255):d=ql({startPoint:i.startPoint,endPoint:i.endPoint},b,[this.boxSize,this.boxSize]).div(255)}if(!n.face.mesh.enabled)return{coords:null,box:i,faceConfidence:null,boxConfidence:l,confidence:i.confidence,image:d};let[,c,h]=this.meshDetector.predict(d),m=c.dataSync()[0];if(m=m0.count?m0.symmetryLine:uk.symmetryLine;u=F2(i.landmarks[b],i.landmarks[v]);let I=Gl({startPoint:i.startPoint,endPoint:i.endPoint}),T=[I[0]/t.shape[2],I[1]/t.shape[1]],R=Ye.rotateWithOffset(t.toFloat(),u,0,T);p=f0(-u,I),d=ql({startPoint:i.startPoint,endPoint:i.endPoint},R,[this.meshSize,this.meshSize]).div(255)}let x={coords:g,box:i,faceConfidence:m,boxConfidence:l,image:d,rawCoords:A},k=c0(i);return this.storedBoxes[o]={...k,landmarks:y,confidence:i.confidence,faceConfidence:m},x}));return s=s.filter(i=>i!==null),n.face.mesh.enabled&&(this.storedBoxes=this.storedBoxes.filter(i=>i.faceConfidence>n.face.detector.minConfidence)),this.detectedFaces=s.length,s}};var Wt=[null,null,null],P2;async function L2(e,t){let n=await P2.predict(e,t),a=[];for(let r of n||[]){if(r.isDisposedInternal)continue;let s=r.coords?r.coords.arraySync():[],i=s.map(u=>[u[0]/e.shape[2],u[1]/e.shape[1],u[2]/P2.meshSize]),o={};if(s&&s.length>0)for(let u of Object.keys(Xa))o[u]=Xa[u].map(p=>s[p]);let l=r.box?[Math.max(0,r.box.startPoint[0]),Math.max(0,r.box.startPoint[1]),Math.min(e.shape[2],r.box.endPoint[0])-Math.max(0,r.box.startPoint[0]),Math.min(e.shape[1],r.box.endPoint[1])-Math.max(0,r.box.startPoint[1])]:0,d=r.box?[r.box.startPoint[0]/e.shape[2],r.box.startPoint[1]/e.shape[1],(r.box.endPoint[0]-r.box.startPoint[0])/e.shape[2],(r.box.endPoint[1]-r.box.startPoint[1])/e.shape[1]]:[];a.push({confidence:Math.round(100*r.faceConfidence||100*r.boxConfidence||0)/100,boxConfidence:Math.round(100*r.boxConfidence)/100,faceConfidence:Math.round(100*r.faceConfidence)/100,box:l,boxRaw:d,mesh:s,meshRaw:i,annotations:o,image:r.image?r.image.clone():null}),r.coords&&r.coords.dispose(),r.image&&r.image.dispose()}return a}async function W2(e){return!Wt[0]&&e.face.enabled||!Wt[1]&&e.face.mesh.enabled||!Wt[2]&&e.face.iris.enabled?(Wt=await Promise.all([!Wt[0]&&e.face.enabled?lk(e):null,!Wt[1]&&e.face.mesh.enabled?Gt(Yt(e.modelBasePath,e.face.mesh.modelPath),{fromTFHub:e.face.mesh.modelPath.includes("tfhub.dev")}):null,!Wt[2]&&e.face.iris.enabled?Gt(Yt(e.modelBasePath,e.face.iris.modelPath),{fromTFHub:e.face.iris.modelPath.includes("tfhub.dev")}):null]),e.face.mesh.enabled&&(!Wt[1]||!Wt[1].modelUrl?he("load model failed:",e.face.mesh.modelPath):e.debug&&he("load model:",Wt[1].modelUrl)),e.face.iris.enabled&&(!Wt[2]||!Wt[1].modelUrl?he("load model failed:",e.face.iris.modelPath):e.debug&&he("load model:",Wt[2].modelUrl))):e.debug&&(he("cached model:",Wt[0].model.modelUrl),he("cached model:",Wt[1].modelUrl),he("cached model:",Wt[2].modelUrl)),P2=new z2(Wt[0],Wt[1],Wt[2]),Wt}var dk=zi,pk=Hd;var B2={};ma(B2,{load:()=>U2,predict:()=>g0});var hie=["angry","disgust","fear","happy","sad","surprise","neutral"],Ra,V2=[],y0=Number.MAX_SAFE_INTEGER,j2=[.2989,.587,.114];async function U2(e){return Ra?e.debug&&he("cached model:",Ra.modelUrl):(Ra=await Gt(Yt(e.modelBasePath,e.face.emotion.modelPath)),!Ra||!Ra.modelUrl?he("load model failed:",e.face.emotion.modelPath):e.debug&&he("load model:",Ra.modelUrl)),Ra}async function g0(e,t){return Ra?y00?(y0++,V2):(t.videoOptimized?y0=0:y0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=Ye.resizeBilinear(e,[Ra.inputs[0].shape[2],Ra.inputs[0].shape[1]],!1),[r,s,i]=ln(a,3,3);a.dispose();let o=B(r,j2[0]),l=B(s,j2[1]),d=B(i,j2[2]);r.dispose(),s.dispose(),i.dispose();let u=mc([o,l,d]);o.dispose(),l.dispose(),d.dispose();let p=L(()=>u.sub(.5).mul(2));u.dispose();let c=[];if(t.face.emotion.enabled){let h=await Ra.predict(p),m=h.dataSync();Ee(h);for(let f=0;ft.face.emotion.minConfidence&&c.push({score:Math.min(.99,Math.trunc(100*m[f])/100),emotion:hie[f]});c.sort((f,A)=>A.score-f.score)}p.dispose(),V2=c,n(c)})):null}var H2={};ma(H2,{enhance:()=>X2,load:()=>G2,match:()=>ck,predict:()=>v0,similarity:()=>q2});var ea,x0={age:0},b0=Number.MAX_SAFE_INTEGER;async function G2(e){return ea?e.debug&&he("cached model:",ea.modelUrl):(ea=await Gt(Yt(e.modelBasePath,e.face.description.modelPath)),!ea||!ea.modelUrl?he("load model failed:",e.face.description.modelPath):e.debug&&he("load model:",ea.modelUrl)),ea}function q2(e,t,n=2){if(!e||!t||(e==null?void 0:e.length)===0||(t==null?void 0:t.length)===0||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return 0;let a=5*e.map((s,i)=>Math.abs(e[i]-t[i])**n).reduce((s,i)=>s+i,0)**(1/n);return Math.max(0,100-a)/100}function ck(e,t,n=0){let a={similarity:0,name:"",source:"",embedding:[]};if(!e||!t||!Array.isArray(e)||!Array.isArray(t))return a;for(let r of t)if(r.embedding&&r.name){let s=q2(e,r.embedding);s>n&&s>a.similarity&&(a={...r,similarity:s})}return a}function X2(e){return L(()=>{let n=e.image||e.tensor||e;if(!(n instanceof Le))return null;let a=[[.05,.15,.85,.85]];return(n.shape.length===3?Ye.cropAndResize(on(n,0),a,[0],[ea.inputs[0].shape[2],ea.inputs[0].shape[1]]):Ye.cropAndResize(n,a,[0],[ea.inputs[0].shape[2],ea.inputs[0].shape[1]])).mul(255)})}async function v0(e,t){return ea?b00?(b0++,x0):(t.videoOptimized?b0=0:b0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=X2(e),r,s={age:0,gender:"unknown",genderConfidence:0,descriptor:[]};t.face.description.enabled&&(r=await ea.predict(a)),Ee(a),r&&(L(()=>{let i=r.find(p=>p.shape[1]===1).dataSync(),o=Math.trunc(200*Math.abs(i[0]-.5))/100;o>t.face.description.minConfidence&&(s.gender=i[0]<=.5?"female":"male",s.genderConfidence=Math.min(.99,o));let l=r.find(p=>p.shape[1]===100).argMax(1).dataSync()[0],d=r.find(p=>p.shape[1]===100).dataSync();s.age=Math.round(d[l-1]>d[l+1]?10*l-100*d[l-1]:10*l+100*d[l+1])/10;let u=r.find(p=>p.shape[1]===1024);s.descriptor=[...u.dataSync()]}),r.forEach(i=>Ee(i))),x0=s,n(s)})):null}var fie=(e,t)=>{let n=A=>A*180/Math.PI,a=A=>{let y=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);return A[0]/=y,A[1]/=y,A[2]/=y,A},r=(A,y)=>{let g=A[0]-y[0],x=A[1]-y[1],k=A[2]-y[2];return[g,x,k]},s=(A,y)=>{let g=A[1]*y[2]-A[2]*y[1],x=A[2]*y[0]-A[0]*y[2],k=A[0]*y[1]-A[1]*y[0];return[g,x,k]},i=A=>{let[y,g,x,k,b,v,I,T,R]=A,$,z,_;return k<1?k>-1?(_=Math.asin(k),z=Math.atan2(-I,y),$=Math.atan2(-v,b)):(_=-Math.PI/2,z=-Math.atan2(T,R),$=0):(_=Math.PI/2,z=Math.atan2(T,R),$=0),{pitch:2*-$,yaw:2*-z,roll:2*-_}},o=A=>{let y=(x,k,b,v)=>Math.atan2(v-k,b-x);return{pitch:y(A[10][1],A[10][2],A[152][1],A[152][2]),yaw:y(A[33][0],A[33][2],A[263][0],A[263][2]),roll:y(A[33][0],A[33][1],A[263][0],A[263][1])}},l=e.meshRaw;if(!l||l.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1]};let d=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,u=[l[10],l[152],l[234],l[454]].map(A=>[A[0]*t[0]/d,A[1]*t[1]/d,A[2]]),p=a(r(u[1],u[0])),c=a(r(u[3],u[2])),h=a(s(c,p));c=s(p,h);let m=[c[0],c[1],c[2],p[0],p[1],p[2],h[0],h[1],h[2]];return{angle:i(m),matrix:m}},K2=async(e,t)=>{var u,p,c,h,m,f;let n,a,r,s,i,o,l=[];e.state="run:face",n=it();let d=await L2(t,e.config);if(e.perf.face=Math.trunc(it()-n),!d)return[];for(let A of d){if(e.analyze("Get Face"),!A.image||A.image.isDisposedInternal){he("Face object is disposed:",A.image);continue}let y=fie(A,[t.shape[2],t.shape[1]]);e.analyze("Start Emotion:"),e.config.async?s=e.config.face.emotion.enabled?g0(A.image,e.config):{}:(e.state="run:emotion",n=it(),s=e.config.face.emotion.enabled?await g0(A.image,e.config):{},e.perf.emotion=Math.trunc(it()-n)),e.analyze("End Emotion:"),e.analyze("Start Description:"),e.config.async?o=e.config.face.description.enabled?v0(A,e.config):[]:(e.state="run:description",n=it(),o=e.config.face.description.enabled?await v0(A.image,e.config):[],e.perf.embedding=Math.trunc(it()-n)),e.analyze("End Description:"),e.config.async&&([a,r,s,i,o]=await Promise.all([a,r,s,i,o])),e.analyze("Finish Face:"),!e.config.face.iris.enabled&&((u=A==null?void 0:A.annotations)==null?void 0:u.leftEyeIris)&&((p=A==null?void 0:A.annotations)==null?void 0:p.rightEyeIris)&&(delete A.annotations.leftEyeIris,delete A.annotations.rightEyeIris);let g=((c=A.annotations)==null?void 0:c.leftEyeIris)&&((h=A.annotations)==null?void 0:h.rightEyeIris)?11.7*Math.max(Math.abs(A.annotations.leftEyeIris[3][0]-A.annotations.leftEyeIris[1][0]),Math.abs(A.annotations.rightEyeIris[4][1]-A.annotations.rightEyeIris[2][1])):0;l.push({...A,age:o.age,gender:o.gender,genderConfidence:o.genderConfidence,embedding:o.descriptor,emotion:s,iris:g!==0?Math.trunc(g)/100:0,rotation:y,tensor:e.config.face.detector.return?(m=A.image)==null?void 0:m.squeeze():null}),(f=A.image)==null||f.dispose(),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.perf.face&&delete e.perf.face,e.perf.age&&delete e.perf.age,e.perf.gender&&delete e.perf.gender,e.perf.emotion&&delete e.perf.emotion),l};var tg={};ma(tg,{load:()=>ag,predict:()=>ng});var Gd=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],hk=Gd.length,qd=Gd.reduce((e,t,n)=>(e[t]=n,e),{}),mie=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Aie=mie.map(([e,t])=>[qd[e],qd[t]]),fk=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]];function mk(e){let t=e.reduce(({maxX:n,maxY:a,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(n,i),maxY:Math.max(a,o),minX:Math.min(r,i),minY:Math.min(s,o)}),{maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY});return[t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY]}function Ak(e,[t,n],[a,r]){let s=(o,l,d)=>({score:o.score,box:[Math.trunc(o.box[0]*d),Math.trunc(o.box[1]*l),Math.trunc(o.box[2]*d),Math.trunc(o.box[3]*l)],keypoints:o.keypoints.map(({score:u,part:p,position:c})=>({score:u,part:p,position:{x:Math.trunc(c.x*d),y:Math.trunc(c.y*l)}}))});return e.map(o=>s(o,t/a,n/r))}var Z2=class{constructor(t,n){this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=n}enqueue(t){this.priorityQueue[++this.numberOfElements]=t,this.swim(this.numberOfElements)}dequeue(){let t=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,t}empty(){return this.numberOfElements===-1}size(){return this.numberOfElements+1}all(){return this.priorityQueue.slice(0,this.numberOfElements+1)}max(){return this.priorityQueue[0]}swim(t){for(;t>0&&this.less(Math.floor(t/2),t);)this.exchange(t,Math.floor(t/2)),t=Math.floor(t/2)}sink(t){for(;2*t<=this.numberOfElements;){let n=2*t;if(nn?n:e}function yk(e,t,n,a){let r=n-e,s=a-t;return r*r+s*s}function eg(e,t){return{x:e.x+t.x,y:e.y+t.y}}var w0=1,gk=16,yie=20**2;function xk(e,t,n,a,r,s,i,o=2){let l=g=>({y:i.get(g.y,g.x,e),x:i.get(g.y,g.x,i.shape[2]/2+e)}),d=(g,x,k)=>({y:Q2(Math.round(g.y/s),0,x-1),x:Q2(Math.round(g.x/s),0,k-1)}),[u,p]=a.shape,c=d(t.position,u,p),h=l(c),f=eg(t.position,h);for(let g=0;g[qd[f],qd[A]]),o=i.map(([,f])=>f),l=i.map(([f])=>f),d=t.shape[2],u=o.length,p=new Array(d),{part:c,score:h}=e,m=J2(c,a,n);p[c.id]={score:h,part:Gd[c.id],position:m};for(let f=u-1;f>=0;--f){let A=o[f],y=l[f];p[A]&&!p[y]&&(p[y]=xk(f,p[A],y,t,n,a,s))}for(let f=0;ft){o=!1;break}if(!o)break}return o}function bie(e,t){let[n,a,r]=t.shape,s=new Z2(n*a*r,({score:i})=>i);for(let i=0;i{let s=r[a].position;return yk(n,t,s.y,s.x)<=yie})}function vie(e,t){return t.reduce((a,{position:r,score:s},i)=>(bk(e,r,i)||(a+=s),a),0)/t.length}function vk(e,t,n,a,r,s){let i=[],o=bie(s,t);for(;i.lengthm.score>s),c=vie(i,p),h=mk(p);c>s&&i.push({keypoints:p,box:h,score:Math.round(100*c)/100})}return i}var fa,wie=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"];async function ng(e,t){let n=L(()=>{let o=e.resizeBilinear([fa.inputs[0].shape[2],fa.inputs[0].shape[1]]).toFloat().div(127.5).sub(1),d=fa.execute(o,wie).map(u=>u.squeeze([0]));return d[1]=d[1].sigmoid(),d}),a=await Promise.all(n.map(i=>i.buffer()));for(let i of n)i.dispose();let r=await vk(a[0],a[1],a[2],a[3],t.body.maxDetected,t.body.minConfidence);return Ak(r,[e.shape[1],e.shape[2]],[fa.inputs[0].shape[2],fa.inputs[0].shape[1]])}async function ag(e){return fa?e.debug&&he("cached model:",fa.modelUrl):(fa=await Gt(Yt(e.modelBasePath,e.body.modelPath)),!fa||!fa.modelUrl?he("load model failed:",e.body.modelPath):e.debug&&he("load model:",fa.modelUrl)),fa}var lg={};ma(lg,{load:()=>dg,predict:()=>ug});function k0(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function Xd(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function wk(e,t,n){let a=t.shape[1],r=t.shape[2],s=[[e.startPoint[1]/a,e.startPoint[0]/r,e.endPoint[1]/a,e.endPoint[0]/r]];return Ye.cropAndResize(t,s,[0],n)}function kk(e,t){let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],a=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],r=e.palmLandmarks.map(s=>[s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:a,palmLandmarks:r,confidence:e.confidence}}function I0(e,t=1.5){let n=Xd(e),a=k0(e),r=[t*a[0]/2,t*a[1]/2],s=[n[0]-r[0],n[1]-r[1]],i=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function S0(e){let t=Xd(e),n=k0(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}var Ik=[{x:.015625,y:.015625},{x:.015625,y:.015625},{x:.046875,y:.015625},{x:.046875,y:.015625},{x:.078125,y:.015625},{x:.078125,y:.015625},{x:.109375,y:.015625},{x:.109375,y:.015625},{x:.140625,y:.015625},{x:.140625,y:.015625},{x:.171875,y:.015625},{x:.171875,y:.015625},{x:.203125,y:.015625},{x:.203125,y:.015625},{x:.234375,y:.015625},{x:.234375,y:.015625},{x:.265625,y:.015625},{x:.265625,y:.015625},{x:.296875,y:.015625},{x:.296875,y:.015625},{x:.328125,y:.015625},{x:.328125,y:.015625},{x:.359375,y:.015625},{x:.359375,y:.015625},{x:.390625,y:.015625},{x:.390625,y:.015625},{x:.421875,y:.015625},{x:.421875,y:.015625},{x:.453125,y:.015625},{x:.453125,y:.015625},{x:.484375,y:.015625},{x:.484375,y:.015625},{x:.515625,y:.015625},{x:.515625,y:.015625},{x:.546875,y:.015625},{x:.546875,y:.015625},{x:.578125,y:.015625},{x:.578125,y:.015625},{x:.609375,y:.015625},{x:.609375,y:.015625},{x:.640625,y:.015625},{x:.640625,y:.015625},{x:.671875,y:.015625},{x:.671875,y:.015625},{x:.703125,y:.015625},{x:.703125,y:.015625},{x:.734375,y:.015625},{x:.734375,y:.015625},{x:.765625,y:.015625},{x:.765625,y:.015625},{x:.796875,y:.015625},{x:.796875,y:.015625},{x:.828125,y:.015625},{x:.828125,y:.015625},{x:.859375,y:.015625},{x:.859375,y:.015625},{x:.890625,y:.015625},{x:.890625,y:.015625},{x:.921875,y:.015625},{x:.921875,y:.015625},{x:.953125,y:.015625},{x:.953125,y:.015625},{x:.984375,y:.015625},{x:.984375,y:.015625},{x:.015625,y:.046875},{x:.015625,y:.046875},{x:.046875,y:.046875},{x:.046875,y:.046875},{x:.078125,y:.046875},{x:.078125,y:.046875},{x:.109375,y:.046875},{x:.109375,y:.046875},{x:.140625,y:.046875},{x:.140625,y:.046875},{x:.171875,y:.046875},{x:.171875,y:.046875},{x:.203125,y:.046875},{x:.203125,y:.046875},{x:.234375,y:.046875},{x:.234375,y:.046875},{x:.265625,y:.046875},{x:.265625,y:.046875},{x:.296875,y:.046875},{x:.296875,y:.046875},{x:.328125,y:.046875},{x:.328125,y:.046875},{x:.359375,y:.046875},{x:.359375,y:.046875},{x:.390625,y:.046875},{x:.390625,y:.046875},{x:.421875,y:.046875},{x:.421875,y:.046875},{x:.453125,y:.046875},{x:.453125,y:.046875},{x:.484375,y:.046875},{x:.484375,y:.046875},{x:.515625,y:.046875},{x:.515625,y:.046875},{x:.546875,y:.046875},{x:.546875,y:.046875},{x:.578125,y:.046875},{x:.578125,y:.046875},{x:.609375,y:.046875},{x:.609375,y:.046875},{x:.640625,y:.046875},{x:.640625,y:.046875},{x:.671875,y:.046875},{x:.671875,y:.046875},{x:.703125,y:.046875},{x:.703125,y:.046875},{x:.734375,y:.046875},{x:.734375,y:.046875},{x:.765625,y:.046875},{x:.765625,y:.046875},{x:.796875,y:.046875},{x:.796875,y:.046875},{x:.828125,y:.046875},{x:.828125,y:.046875},{x:.859375,y:.046875},{x:.859375,y:.046875},{x:.890625,y:.046875},{x:.890625,y:.046875},{x:.921875,y:.046875},{x:.921875,y:.046875},{x:.953125,y:.046875},{x:.953125,y:.046875},{x:.984375,y:.046875},{x:.984375,y:.046875},{x:.015625,y:.078125},{x:.015625,y:.078125},{x:.046875,y:.078125},{x:.046875,y:.078125},{x:.078125,y:.078125},{x:.078125,y:.078125},{x:.109375,y:.078125},{x:.109375,y:.078125},{x:.140625,y:.078125},{x:.140625,y:.078125},{x:.171875,y:.078125},{x:.171875,y:.078125},{x:.203125,y:.078125},{x:.203125,y:.078125},{x:.234375,y:.078125},{x:.234375,y:.078125},{x:.265625,y:.078125},{x:.265625,y:.078125},{x:.296875,y:.078125},{x:.296875,y:.078125},{x:.328125,y:.078125},{x:.328125,y:.078125},{x:.359375,y:.078125},{x:.359375,y:.078125},{x:.390625,y:.078125},{x:.390625,y:.078125},{x:.421875,y:.078125},{x:.421875,y:.078125},{x:.453125,y:.078125},{x:.453125,y:.078125},{x:.484375,y:.078125},{x:.484375,y:.078125},{x:.515625,y:.078125},{x:.515625,y:.078125},{x:.546875,y:.078125},{x:.546875,y:.078125},{x:.578125,y:.078125},{x:.578125,y:.078125},{x:.609375,y:.078125},{x:.609375,y:.078125},{x:.640625,y:.078125},{x:.640625,y:.078125},{x:.671875,y:.078125},{x:.671875,y:.078125},{x:.703125,y:.078125},{x:.703125,y:.078125},{x:.734375,y:.078125},{x:.734375,y:.078125},{x:.765625,y:.078125},{x:.765625,y:.078125},{x:.796875,y:.078125},{x:.796875,y:.078125},{x:.828125,y:.078125},{x:.828125,y:.078125},{x:.859375,y:.078125},{x:.859375,y:.078125},{x:.890625,y:.078125},{x:.890625,y:.078125},{x:.921875,y:.078125},{x:.921875,y:.078125},{x:.953125,y:.078125},{x:.953125,y:.078125},{x:.984375,y:.078125},{x:.984375,y:.078125},{x:.015625,y:.109375},{x:.015625,y:.109375},{x:.046875,y:.109375},{x:.046875,y:.109375},{x:.078125,y:.109375},{x:.078125,y:.109375},{x:.109375,y:.109375},{x:.109375,y:.109375},{x:.140625,y:.109375},{x:.140625,y:.109375},{x:.171875,y:.109375},{x:.171875,y:.109375},{x:.203125,y:.109375},{x:.203125,y:.109375},{x:.234375,y:.109375},{x:.234375,y:.109375},{x:.265625,y:.109375},{x:.265625,y:.109375},{x:.296875,y:.109375},{x:.296875,y:.109375},{x:.328125,y:.109375},{x:.328125,y:.109375},{x:.359375,y:.109375},{x:.359375,y:.109375},{x:.390625,y:.109375},{x:.390625,y:.109375},{x:.421875,y:.109375},{x:.421875,y:.109375},{x:.453125,y:.109375},{x:.453125,y:.109375},{x:.484375,y:.109375},{x:.484375,y:.109375},{x:.515625,y:.109375},{x:.515625,y:.109375},{x:.546875,y:.109375},{x:.546875,y:.109375},{x:.578125,y:.109375},{x:.578125,y:.109375},{x:.609375,y:.109375},{x:.609375,y:.109375},{x:.640625,y:.109375},{x:.640625,y:.109375},{x:.671875,y:.109375},{x:.671875,y:.109375},{x:.703125,y:.109375},{x:.703125,y:.109375},{x:.734375,y:.109375},{x:.734375,y:.109375},{x:.765625,y:.109375},{x:.765625,y:.109375},{x:.796875,y:.109375},{x:.796875,y:.109375},{x:.828125,y:.109375},{x:.828125,y:.109375},{x:.859375,y:.109375},{x:.859375,y:.109375},{x:.890625,y:.109375},{x:.890625,y:.109375},{x:.921875,y:.109375},{x:.921875,y:.109375},{x:.953125,y:.109375},{x:.953125,y:.109375},{x:.984375,y:.109375},{x:.984375,y:.109375},{x:.015625,y:.140625},{x:.015625,y:.140625},{x:.046875,y:.140625},{x:.046875,y:.140625},{x:.078125,y:.140625},{x:.078125,y:.140625},{x:.109375,y:.140625},{x:.109375,y:.140625},{x:.140625,y:.140625},{x:.140625,y:.140625},{x:.171875,y:.140625},{x:.171875,y:.140625},{x:.203125,y:.140625},{x:.203125,y:.140625},{x:.234375,y:.140625},{x:.234375,y:.140625},{x:.265625,y:.140625},{x:.265625,y:.140625},{x:.296875,y:.140625},{x:.296875,y:.140625},{x:.328125,y:.140625},{x:.328125,y:.140625},{x:.359375,y:.140625},{x:.359375,y:.140625},{x:.390625,y:.140625},{x:.390625,y:.140625},{x:.421875,y:.140625},{x:.421875,y:.140625},{x:.453125,y:.140625},{x:.453125,y:.140625},{x:.484375,y:.140625},{x:.484375,y:.140625},{x:.515625,y:.140625},{x:.515625,y:.140625},{x:.546875,y:.140625},{x:.546875,y:.140625},{x:.578125,y:.140625},{x:.578125,y:.140625},{x:.609375,y:.140625},{x:.609375,y:.140625},{x:.640625,y:.140625},{x:.640625,y:.140625},{x:.671875,y:.140625},{x:.671875,y:.140625},{x:.703125,y:.140625},{x:.703125,y:.140625},{x:.734375,y:.140625},{x:.734375,y:.140625},{x:.765625,y:.140625},{x:.765625,y:.140625},{x:.796875,y:.140625},{x:.796875,y:.140625},{x:.828125,y:.140625},{x:.828125,y:.140625},{x:.859375,y:.140625},{x:.859375,y:.140625},{x:.890625,y:.140625},{x:.890625,y:.140625},{x:.921875,y:.140625},{x:.921875,y:.140625},{x:.953125,y:.140625},{x:.953125,y:.140625},{x:.984375,y:.140625},{x:.984375,y:.140625},{x:.015625,y:.171875},{x:.015625,y:.171875},{x:.046875,y:.171875},{x:.046875,y:.171875},{x:.078125,y:.171875},{x:.078125,y:.171875},{x:.109375,y:.171875},{x:.109375,y:.171875},{x:.140625,y:.171875},{x:.140625,y:.171875},{x:.171875,y:.171875},{x:.171875,y:.171875},{x:.203125,y:.171875},{x:.203125,y:.171875},{x:.234375,y:.171875},{x:.234375,y:.171875},{x:.265625,y:.171875},{x:.265625,y:.171875},{x:.296875,y:.171875},{x:.296875,y:.171875},{x:.328125,y:.171875},{x:.328125,y:.171875},{x:.359375,y:.171875},{x:.359375,y:.171875},{x:.390625,y:.171875},{x:.390625,y:.171875},{x:.421875,y:.171875},{x:.421875,y:.171875},{x:.453125,y:.171875},{x:.453125,y:.171875},{x:.484375,y:.171875},{x:.484375,y:.171875},{x:.515625,y:.171875},{x:.515625,y:.171875},{x:.546875,y:.171875},{x:.546875,y:.171875},{x:.578125,y:.171875},{x:.578125,y:.171875},{x:.609375,y:.171875},{x:.609375,y:.171875},{x:.640625,y:.171875},{x:.640625,y:.171875},{x:.671875,y:.171875},{x:.671875,y:.171875},{x:.703125,y:.171875},{x:.703125,y:.171875},{x:.734375,y:.171875},{x:.734375,y:.171875},{x:.765625,y:.171875},{x:.765625,y:.171875},{x:.796875,y:.171875},{x:.796875,y:.171875},{x:.828125,y:.171875},{x:.828125,y:.171875},{x:.859375,y:.171875},{x:.859375,y:.171875},{x:.890625,y:.171875},{x:.890625,y:.171875},{x:.921875,y:.171875},{x:.921875,y:.171875},{x:.953125,y:.171875},{x:.953125,y:.171875},{x:.984375,y:.171875},{x:.984375,y:.171875},{x:.015625,y:.203125},{x:.015625,y:.203125},{x:.046875,y:.203125},{x:.046875,y:.203125},{x:.078125,y:.203125},{x:.078125,y:.203125},{x:.109375,y:.203125},{x:.109375,y:.203125},{x:.140625,y:.203125},{x:.140625,y:.203125},{x:.171875,y:.203125},{x:.171875,y:.203125},{x:.203125,y:.203125},{x:.203125,y:.203125},{x:.234375,y:.203125},{x:.234375,y:.203125},{x:.265625,y:.203125},{x:.265625,y:.203125},{x:.296875,y:.203125},{x:.296875,y:.203125},{x:.328125,y:.203125},{x:.328125,y:.203125},{x:.359375,y:.203125},{x:.359375,y:.203125},{x:.390625,y:.203125},{x:.390625,y:.203125},{x:.421875,y:.203125},{x:.421875,y:.203125},{x:.453125,y:.203125},{x:.453125,y:.203125},{x:.484375,y:.203125},{x:.484375,y:.203125},{x:.515625,y:.203125},{x:.515625,y:.203125},{x:.546875,y:.203125},{x:.546875,y:.203125},{x:.578125,y:.203125},{x:.578125,y:.203125},{x:.609375,y:.203125},{x:.609375,y:.203125},{x:.640625,y:.203125},{x:.640625,y:.203125},{x:.671875,y:.203125},{x:.671875,y:.203125},{x:.703125,y:.203125},{x:.703125,y:.203125},{x:.734375,y:.203125},{x:.734375,y:.203125},{x:.765625,y:.203125},{x:.765625,y:.203125},{x:.796875,y:.203125},{x:.796875,y:.203125},{x:.828125,y:.203125},{x:.828125,y:.203125},{x:.859375,y:.203125},{x:.859375,y:.203125},{x:.890625,y:.203125},{x:.890625,y:.203125},{x:.921875,y:.203125},{x:.921875,y:.203125},{x:.953125,y:.203125},{x:.953125,y:.203125},{x:.984375,y:.203125},{x:.984375,y:.203125},{x:.015625,y:.234375},{x:.015625,y:.234375},{x:.046875,y:.234375},{x:.046875,y:.234375},{x:.078125,y:.234375},{x:.078125,y:.234375},{x:.109375,y:.234375},{x:.109375,y:.234375},{x:.140625,y:.234375},{x:.140625,y:.234375},{x:.171875,y:.234375},{x:.171875,y:.234375},{x:.203125,y:.234375},{x:.203125,y:.234375},{x:.234375,y:.234375},{x:.234375,y:.234375},{x:.265625,y:.234375},{x:.265625,y:.234375},{x:.296875,y:.234375},{x:.296875,y:.234375},{x:.328125,y:.234375},{x:.328125,y:.234375},{x:.359375,y:.234375},{x:.359375,y:.234375},{x:.390625,y:.234375},{x:.390625,y:.234375},{x:.421875,y:.234375},{x:.421875,y:.234375},{x:.453125,y:.234375},{x:.453125,y:.234375},{x:.484375,y:.234375},{x:.484375,y:.234375},{x:.515625,y:.234375},{x:.515625,y:.234375},{x:.546875,y:.234375},{x:.546875,y:.234375},{x:.578125,y:.234375},{x:.578125,y:.234375},{x:.609375,y:.234375},{x:.609375,y:.234375},{x:.640625,y:.234375},{x:.640625,y:.234375},{x:.671875,y:.234375},{x:.671875,y:.234375},{x:.703125,y:.234375},{x:.703125,y:.234375},{x:.734375,y:.234375},{x:.734375,y:.234375},{x:.765625,y:.234375},{x:.765625,y:.234375},{x:.796875,y:.234375},{x:.796875,y:.234375},{x:.828125,y:.234375},{x:.828125,y:.234375},{x:.859375,y:.234375},{x:.859375,y:.234375},{x:.890625,y:.234375},{x:.890625,y:.234375},{x:.921875,y:.234375},{x:.921875,y:.234375},{x:.953125,y:.234375},{x:.953125,y:.234375},{x:.984375,y:.234375},{x:.984375,y:.234375},{x:.015625,y:.265625},{x:.015625,y:.265625},{x:.046875,y:.265625},{x:.046875,y:.265625},{x:.078125,y:.265625},{x:.078125,y:.265625},{x:.109375,y:.265625},{x:.109375,y:.265625},{x:.140625,y:.265625},{x:.140625,y:.265625},{x:.171875,y:.265625},{x:.171875,y:.265625},{x:.203125,y:.265625},{x:.203125,y:.265625},{x:.234375,y:.265625},{x:.234375,y:.265625},{x:.265625,y:.265625},{x:.265625,y:.265625},{x:.296875,y:.265625},{x:.296875,y:.265625},{x:.328125,y:.265625},{x:.328125,y:.265625},{x:.359375,y:.265625},{x:.359375,y:.265625},{x:.390625,y:.265625},{x:.390625,y:.265625},{x:.421875,y:.265625},{x:.421875,y:.265625},{x:.453125,y:.265625},{x:.453125,y:.265625},{x:.484375,y:.265625},{x:.484375,y:.265625},{x:.515625,y:.265625},{x:.515625,y:.265625},{x:.546875,y:.265625},{x:.546875,y:.265625},{x:.578125,y:.265625},{x:.578125,y:.265625},{x:.609375,y:.265625},{x:.609375,y:.265625},{x:.640625,y:.265625},{x:.640625,y:.265625},{x:.671875,y:.265625},{x:.671875,y:.265625},{x:.703125,y:.265625},{x:.703125,y:.265625},{x:.734375,y:.265625},{x:.734375,y:.265625},{x:.765625,y:.265625},{x:.765625,y:.265625},{x:.796875,y:.265625},{x:.796875,y:.265625},{x:.828125,y:.265625},{x:.828125,y:.265625},{x:.859375,y:.265625},{x:.859375,y:.265625},{x:.890625,y:.265625},{x:.890625,y:.265625},{x:.921875,y:.265625},{x:.921875,y:.265625},{x:.953125,y:.265625},{x:.953125,y:.265625},{x:.984375,y:.265625},{x:.984375,y:.265625},{x:.015625,y:.296875},{x:.015625,y:.296875},{x:.046875,y:.296875},{x:.046875,y:.296875},{x:.078125,y:.296875},{x:.078125,y:.296875},{x:.109375,y:.296875},{x:.109375,y:.296875},{x:.140625,y:.296875},{x:.140625,y:.296875},{x:.171875,y:.296875},{x:.171875,y:.296875},{x:.203125,y:.296875},{x:.203125,y:.296875},{x:.234375,y:.296875},{x:.234375,y:.296875},{x:.265625,y:.296875},{x:.265625,y:.296875},{x:.296875,y:.296875},{x:.296875,y:.296875},{x:.328125,y:.296875},{x:.328125,y:.296875},{x:.359375,y:.296875},{x:.359375,y:.296875},{x:.390625,y:.296875},{x:.390625,y:.296875},{x:.421875,y:.296875},{x:.421875,y:.296875},{x:.453125,y:.296875},{x:.453125,y:.296875},{x:.484375,y:.296875},{x:.484375,y:.296875},{x:.515625,y:.296875},{x:.515625,y:.296875},{x:.546875,y:.296875},{x:.546875,y:.296875},{x:.578125,y:.296875},{x:.578125,y:.296875},{x:.609375,y:.296875},{x:.609375,y:.296875},{x:.640625,y:.296875},{x:.640625,y:.296875},{x:.671875,y:.296875},{x:.671875,y:.296875},{x:.703125,y:.296875},{x:.703125,y:.296875},{x:.734375,y:.296875},{x:.734375,y:.296875},{x:.765625,y:.296875},{x:.765625,y:.296875},{x:.796875,y:.296875},{x:.796875,y:.296875},{x:.828125,y:.296875},{x:.828125,y:.296875},{x:.859375,y:.296875},{x:.859375,y:.296875},{x:.890625,y:.296875},{x:.890625,y:.296875},{x:.921875,y:.296875},{x:.921875,y:.296875},{x:.953125,y:.296875},{x:.953125,y:.296875},{x:.984375,y:.296875},{x:.984375,y:.296875},{x:.015625,y:.328125},{x:.015625,y:.328125},{x:.046875,y:.328125},{x:.046875,y:.328125},{x:.078125,y:.328125},{x:.078125,y:.328125},{x:.109375,y:.328125},{x:.109375,y:.328125},{x:.140625,y:.328125},{x:.140625,y:.328125},{x:.171875,y:.328125},{x:.171875,y:.328125},{x:.203125,y:.328125},{x:.203125,y:.328125},{x:.234375,y:.328125},{x:.234375,y:.328125},{x:.265625,y:.328125},{x:.265625,y:.328125},{x:.296875,y:.328125},{x:.296875,y:.328125},{x:.328125,y:.328125},{x:.328125,y:.328125},{x:.359375,y:.328125},{x:.359375,y:.328125},{x:.390625,y:.328125},{x:.390625,y:.328125},{x:.421875,y:.328125},{x:.421875,y:.328125},{x:.453125,y:.328125},{x:.453125,y:.328125},{x:.484375,y:.328125},{x:.484375,y:.328125},{x:.515625,y:.328125},{x:.515625,y:.328125},{x:.546875,y:.328125},{x:.546875,y:.328125},{x:.578125,y:.328125},{x:.578125,y:.328125},{x:.609375,y:.328125},{x:.609375,y:.328125},{x:.640625,y:.328125},{x:.640625,y:.328125},{x:.671875,y:.328125},{x:.671875,y:.328125},{x:.703125,y:.328125},{x:.703125,y:.328125},{x:.734375,y:.328125},{x:.734375,y:.328125},{x:.765625,y:.328125},{x:.765625,y:.328125},{x:.796875,y:.328125},{x:.796875,y:.328125},{x:.828125,y:.328125},{x:.828125,y:.328125},{x:.859375,y:.328125},{x:.859375,y:.328125},{x:.890625,y:.328125},{x:.890625,y:.328125},{x:.921875,y:.328125},{x:.921875,y:.328125},{x:.953125,y:.328125},{x:.953125,y:.328125},{x:.984375,y:.328125},{x:.984375,y:.328125},{x:.015625,y:.359375},{x:.015625,y:.359375},{x:.046875,y:.359375},{x:.046875,y:.359375},{x:.078125,y:.359375},{x:.078125,y:.359375},{x:.109375,y:.359375},{x:.109375,y:.359375},{x:.140625,y:.359375},{x:.140625,y:.359375},{x:.171875,y:.359375},{x:.171875,y:.359375},{x:.203125,y:.359375},{x:.203125,y:.359375},{x:.234375,y:.359375},{x:.234375,y:.359375},{x:.265625,y:.359375},{x:.265625,y:.359375},{x:.296875,y:.359375},{x:.296875,y:.359375},{x:.328125,y:.359375},{x:.328125,y:.359375},{x:.359375,y:.359375},{x:.359375,y:.359375},{x:.390625,y:.359375},{x:.390625,y:.359375},{x:.421875,y:.359375},{x:.421875,y:.359375},{x:.453125,y:.359375},{x:.453125,y:.359375},{x:.484375,y:.359375},{x:.484375,y:.359375},{x:.515625,y:.359375},{x:.515625,y:.359375},{x:.546875,y:.359375},{x:.546875,y:.359375},{x:.578125,y:.359375},{x:.578125,y:.359375},{x:.609375,y:.359375},{x:.609375,y:.359375},{x:.640625,y:.359375},{x:.640625,y:.359375},{x:.671875,y:.359375},{x:.671875,y:.359375},{x:.703125,y:.359375},{x:.703125,y:.359375},{x:.734375,y:.359375},{x:.734375,y:.359375},{x:.765625,y:.359375},{x:.765625,y:.359375},{x:.796875,y:.359375},{x:.796875,y:.359375},{x:.828125,y:.359375},{x:.828125,y:.359375},{x:.859375,y:.359375},{x:.859375,y:.359375},{x:.890625,y:.359375},{x:.890625,y:.359375},{x:.921875,y:.359375},{x:.921875,y:.359375},{x:.953125,y:.359375},{x:.953125,y:.359375},{x:.984375,y:.359375},{x:.984375,y:.359375},{x:.015625,y:.390625},{x:.015625,y:.390625},{x:.046875,y:.390625},{x:.046875,y:.390625},{x:.078125,y:.390625},{x:.078125,y:.390625},{x:.109375,y:.390625},{x:.109375,y:.390625},{x:.140625,y:.390625},{x:.140625,y:.390625},{x:.171875,y:.390625},{x:.171875,y:.390625},{x:.203125,y:.390625},{x:.203125,y:.390625},{x:.234375,y:.390625},{x:.234375,y:.390625},{x:.265625,y:.390625},{x:.265625,y:.390625},{x:.296875,y:.390625},{x:.296875,y:.390625},{x:.328125,y:.390625},{x:.328125,y:.390625},{x:.359375,y:.390625},{x:.359375,y:.390625},{x:.390625,y:.390625},{x:.390625,y:.390625},{x:.421875,y:.390625},{x:.421875,y:.390625},{x:.453125,y:.390625},{x:.453125,y:.390625},{x:.484375,y:.390625},{x:.484375,y:.390625},{x:.515625,y:.390625},{x:.515625,y:.390625},{x:.546875,y:.390625},{x:.546875,y:.390625},{x:.578125,y:.390625},{x:.578125,y:.390625},{x:.609375,y:.390625},{x:.609375,y:.390625},{x:.640625,y:.390625},{x:.640625,y:.390625},{x:.671875,y:.390625},{x:.671875,y:.390625},{x:.703125,y:.390625},{x:.703125,y:.390625},{x:.734375,y:.390625},{x:.734375,y:.390625},{x:.765625,y:.390625},{x:.765625,y:.390625},{x:.796875,y:.390625},{x:.796875,y:.390625},{x:.828125,y:.390625},{x:.828125,y:.390625},{x:.859375,y:.390625},{x:.859375,y:.390625},{x:.890625,y:.390625},{x:.890625,y:.390625},{x:.921875,y:.390625},{x:.921875,y:.390625},{x:.953125,y:.390625},{x:.953125,y:.390625},{x:.984375,y:.390625},{x:.984375,y:.390625},{x:.015625,y:.421875},{x:.015625,y:.421875},{x:.046875,y:.421875},{x:.046875,y:.421875},{x:.078125,y:.421875},{x:.078125,y:.421875},{x:.109375,y:.421875},{x:.109375,y:.421875},{x:.140625,y:.421875},{x:.140625,y:.421875},{x:.171875,y:.421875},{x:.171875,y:.421875},{x:.203125,y:.421875},{x:.203125,y:.421875},{x:.234375,y:.421875},{x:.234375,y:.421875},{x:.265625,y:.421875},{x:.265625,y:.421875},{x:.296875,y:.421875},{x:.296875,y:.421875},{x:.328125,y:.421875},{x:.328125,y:.421875},{x:.359375,y:.421875},{x:.359375,y:.421875},{x:.390625,y:.421875},{x:.390625,y:.421875},{x:.421875,y:.421875},{x:.421875,y:.421875},{x:.453125,y:.421875},{x:.453125,y:.421875},{x:.484375,y:.421875},{x:.484375,y:.421875},{x:.515625,y:.421875},{x:.515625,y:.421875},{x:.546875,y:.421875},{x:.546875,y:.421875},{x:.578125,y:.421875},{x:.578125,y:.421875},{x:.609375,y:.421875},{x:.609375,y:.421875},{x:.640625,y:.421875},{x:.640625,y:.421875},{x:.671875,y:.421875},{x:.671875,y:.421875},{x:.703125,y:.421875},{x:.703125,y:.421875},{x:.734375,y:.421875},{x:.734375,y:.421875},{x:.765625,y:.421875},{x:.765625,y:.421875},{x:.796875,y:.421875},{x:.796875,y:.421875},{x:.828125,y:.421875},{x:.828125,y:.421875},{x:.859375,y:.421875},{x:.859375,y:.421875},{x:.890625,y:.421875},{x:.890625,y:.421875},{x:.921875,y:.421875},{x:.921875,y:.421875},{x:.953125,y:.421875},{x:.953125,y:.421875},{x:.984375,y:.421875},{x:.984375,y:.421875},{x:.015625,y:.453125},{x:.015625,y:.453125},{x:.046875,y:.453125},{x:.046875,y:.453125},{x:.078125,y:.453125},{x:.078125,y:.453125},{x:.109375,y:.453125},{x:.109375,y:.453125},{x:.140625,y:.453125},{x:.140625,y:.453125},{x:.171875,y:.453125},{x:.171875,y:.453125},{x:.203125,y:.453125},{x:.203125,y:.453125},{x:.234375,y:.453125},{x:.234375,y:.453125},{x:.265625,y:.453125},{x:.265625,y:.453125},{x:.296875,y:.453125},{x:.296875,y:.453125},{x:.328125,y:.453125},{x:.328125,y:.453125},{x:.359375,y:.453125},{x:.359375,y:.453125},{x:.390625,y:.453125},{x:.390625,y:.453125},{x:.421875,y:.453125},{x:.421875,y:.453125},{x:.453125,y:.453125},{x:.453125,y:.453125},{x:.484375,y:.453125},{x:.484375,y:.453125},{x:.515625,y:.453125},{x:.515625,y:.453125},{x:.546875,y:.453125},{x:.546875,y:.453125},{x:.578125,y:.453125},{x:.578125,y:.453125},{x:.609375,y:.453125},{x:.609375,y:.453125},{x:.640625,y:.453125},{x:.640625,y:.453125},{x:.671875,y:.453125},{x:.671875,y:.453125},{x:.703125,y:.453125},{x:.703125,y:.453125},{x:.734375,y:.453125},{x:.734375,y:.453125},{x:.765625,y:.453125},{x:.765625,y:.453125},{x:.796875,y:.453125},{x:.796875,y:.453125},{x:.828125,y:.453125},{x:.828125,y:.453125},{x:.859375,y:.453125},{x:.859375,y:.453125},{x:.890625,y:.453125},{x:.890625,y:.453125},{x:.921875,y:.453125},{x:.921875,y:.453125},{x:.953125,y:.453125},{x:.953125,y:.453125},{x:.984375,y:.453125},{x:.984375,y:.453125},{x:.015625,y:.484375},{x:.015625,y:.484375},{x:.046875,y:.484375},{x:.046875,y:.484375},{x:.078125,y:.484375},{x:.078125,y:.484375},{x:.109375,y:.484375},{x:.109375,y:.484375},{x:.140625,y:.484375},{x:.140625,y:.484375},{x:.171875,y:.484375},{x:.171875,y:.484375},{x:.203125,y:.484375},{x:.203125,y:.484375},{x:.234375,y:.484375},{x:.234375,y:.484375},{x:.265625,y:.484375},{x:.265625,y:.484375},{x:.296875,y:.484375},{x:.296875,y:.484375},{x:.328125,y:.484375},{x:.328125,y:.484375},{x:.359375,y:.484375},{x:.359375,y:.484375},{x:.390625,y:.484375},{x:.390625,y:.484375},{x:.421875,y:.484375},{x:.421875,y:.484375},{x:.453125,y:.484375},{x:.453125,y:.484375},{x:.484375,y:.484375},{x:.484375,y:.484375},{x:.515625,y:.484375},{x:.515625,y:.484375},{x:.546875,y:.484375},{x:.546875,y:.484375},{x:.578125,y:.484375},{x:.578125,y:.484375},{x:.609375,y:.484375},{x:.609375,y:.484375},{x:.640625,y:.484375},{x:.640625,y:.484375},{x:.671875,y:.484375},{x:.671875,y:.484375},{x:.703125,y:.484375},{x:.703125,y:.484375},{x:.734375,y:.484375},{x:.734375,y:.484375},{x:.765625,y:.484375},{x:.765625,y:.484375},{x:.796875,y:.484375},{x:.796875,y:.484375},{x:.828125,y:.484375},{x:.828125,y:.484375},{x:.859375,y:.484375},{x:.859375,y:.484375},{x:.890625,y:.484375},{x:.890625,y:.484375},{x:.921875,y:.484375},{x:.921875,y:.484375},{x:.953125,y:.484375},{x:.953125,y:.484375},{x:.984375,y:.484375},{x:.984375,y:.484375},{x:.015625,y:.515625},{x:.015625,y:.515625},{x:.046875,y:.515625},{x:.046875,y:.515625},{x:.078125,y:.515625},{x:.078125,y:.515625},{x:.109375,y:.515625},{x:.109375,y:.515625},{x:.140625,y:.515625},{x:.140625,y:.515625},{x:.171875,y:.515625},{x:.171875,y:.515625},{x:.203125,y:.515625},{x:.203125,y:.515625},{x:.234375,y:.515625},{x:.234375,y:.515625},{x:.265625,y:.515625},{x:.265625,y:.515625},{x:.296875,y:.515625},{x:.296875,y:.515625},{x:.328125,y:.515625},{x:.328125,y:.515625},{x:.359375,y:.515625},{x:.359375,y:.515625},{x:.390625,y:.515625},{x:.390625,y:.515625},{x:.421875,y:.515625},{x:.421875,y:.515625},{x:.453125,y:.515625},{x:.453125,y:.515625},{x:.484375,y:.515625},{x:.484375,y:.515625},{x:.515625,y:.515625},{x:.515625,y:.515625},{x:.546875,y:.515625},{x:.546875,y:.515625},{x:.578125,y:.515625},{x:.578125,y:.515625},{x:.609375,y:.515625},{x:.609375,y:.515625},{x:.640625,y:.515625},{x:.640625,y:.515625},{x:.671875,y:.515625},{x:.671875,y:.515625},{x:.703125,y:.515625},{x:.703125,y:.515625},{x:.734375,y:.515625},{x:.734375,y:.515625},{x:.765625,y:.515625},{x:.765625,y:.515625},{x:.796875,y:.515625},{x:.796875,y:.515625},{x:.828125,y:.515625},{x:.828125,y:.515625},{x:.859375,y:.515625},{x:.859375,y:.515625},{x:.890625,y:.515625},{x:.890625,y:.515625},{x:.921875,y:.515625},{x:.921875,y:.515625},{x:.953125,y:.515625},{x:.953125,y:.515625},{x:.984375,y:.515625},{x:.984375,y:.515625},{x:.015625,y:.546875},{x:.015625,y:.546875},{x:.046875,y:.546875},{x:.046875,y:.546875},{x:.078125,y:.546875},{x:.078125,y:.546875},{x:.109375,y:.546875},{x:.109375,y:.546875},{x:.140625,y:.546875},{x:.140625,y:.546875},{x:.171875,y:.546875},{x:.171875,y:.546875},{x:.203125,y:.546875},{x:.203125,y:.546875},{x:.234375,y:.546875},{x:.234375,y:.546875},{x:.265625,y:.546875},{x:.265625,y:.546875},{x:.296875,y:.546875},{x:.296875,y:.546875},{x:.328125,y:.546875},{x:.328125,y:.546875},{x:.359375,y:.546875},{x:.359375,y:.546875},{x:.390625,y:.546875},{x:.390625,y:.546875},{x:.421875,y:.546875},{x:.421875,y:.546875},{x:.453125,y:.546875},{x:.453125,y:.546875},{x:.484375,y:.546875},{x:.484375,y:.546875},{x:.515625,y:.546875},{x:.515625,y:.546875},{x:.546875,y:.546875},{x:.546875,y:.546875},{x:.578125,y:.546875},{x:.578125,y:.546875},{x:.609375,y:.546875},{x:.609375,y:.546875},{x:.640625,y:.546875},{x:.640625,y:.546875},{x:.671875,y:.546875},{x:.671875,y:.546875},{x:.703125,y:.546875},{x:.703125,y:.546875},{x:.734375,y:.546875},{x:.734375,y:.546875},{x:.765625,y:.546875},{x:.765625,y:.546875},{x:.796875,y:.546875},{x:.796875,y:.546875},{x:.828125,y:.546875},{x:.828125,y:.546875},{x:.859375,y:.546875},{x:.859375,y:.546875},{x:.890625,y:.546875},{x:.890625,y:.546875},{x:.921875,y:.546875},{x:.921875,y:.546875},{x:.953125,y:.546875},{x:.953125,y:.546875},{x:.984375,y:.546875},{x:.984375,y:.546875},{x:.015625,y:.578125},{x:.015625,y:.578125},{x:.046875,y:.578125},{x:.046875,y:.578125},{x:.078125,y:.578125},{x:.078125,y:.578125},{x:.109375,y:.578125},{x:.109375,y:.578125},{x:.140625,y:.578125},{x:.140625,y:.578125},{x:.171875,y:.578125},{x:.171875,y:.578125},{x:.203125,y:.578125},{x:.203125,y:.578125},{x:.234375,y:.578125},{x:.234375,y:.578125},{x:.265625,y:.578125},{x:.265625,y:.578125},{x:.296875,y:.578125},{x:.296875,y:.578125},{x:.328125,y:.578125},{x:.328125,y:.578125},{x:.359375,y:.578125},{x:.359375,y:.578125},{x:.390625,y:.578125},{x:.390625,y:.578125},{x:.421875,y:.578125},{x:.421875,y:.578125},{x:.453125,y:.578125},{x:.453125,y:.578125},{x:.484375,y:.578125},{x:.484375,y:.578125},{x:.515625,y:.578125},{x:.515625,y:.578125},{x:.546875,y:.578125},{x:.546875,y:.578125},{x:.578125,y:.578125},{x:.578125,y:.578125},{x:.609375,y:.578125},{x:.609375,y:.578125},{x:.640625,y:.578125},{x:.640625,y:.578125},{x:.671875,y:.578125},{x:.671875,y:.578125},{x:.703125,y:.578125},{x:.703125,y:.578125},{x:.734375,y:.578125},{x:.734375,y:.578125},{x:.765625,y:.578125},{x:.765625,y:.578125},{x:.796875,y:.578125},{x:.796875,y:.578125},{x:.828125,y:.578125},{x:.828125,y:.578125},{x:.859375,y:.578125},{x:.859375,y:.578125},{x:.890625,y:.578125},{x:.890625,y:.578125},{x:.921875,y:.578125},{x:.921875,y:.578125},{x:.953125,y:.578125},{x:.953125,y:.578125},{x:.984375,y:.578125},{x:.984375,y:.578125},{x:.015625,y:.609375},{x:.015625,y:.609375},{x:.046875,y:.609375},{x:.046875,y:.609375},{x:.078125,y:.609375},{x:.078125,y:.609375},{x:.109375,y:.609375},{x:.109375,y:.609375},{x:.140625,y:.609375},{x:.140625,y:.609375},{x:.171875,y:.609375},{x:.171875,y:.609375},{x:.203125,y:.609375},{x:.203125,y:.609375},{x:.234375,y:.609375},{x:.234375,y:.609375},{x:.265625,y:.609375},{x:.265625,y:.609375},{x:.296875,y:.609375},{x:.296875,y:.609375},{x:.328125,y:.609375},{x:.328125,y:.609375},{x:.359375,y:.609375},{x:.359375,y:.609375},{x:.390625,y:.609375},{x:.390625,y:.609375},{x:.421875,y:.609375},{x:.421875,y:.609375},{x:.453125,y:.609375},{x:.453125,y:.609375},{x:.484375,y:.609375},{x:.484375,y:.609375},{x:.515625,y:.609375},{x:.515625,y:.609375},{x:.546875,y:.609375},{x:.546875,y:.609375},{x:.578125,y:.609375},{x:.578125,y:.609375},{x:.609375,y:.609375},{x:.609375,y:.609375},{x:.640625,y:.609375},{x:.640625,y:.609375},{x:.671875,y:.609375},{x:.671875,y:.609375},{x:.703125,y:.609375},{x:.703125,y:.609375},{x:.734375,y:.609375},{x:.734375,y:.609375},{x:.765625,y:.609375},{x:.765625,y:.609375},{x:.796875,y:.609375},{x:.796875,y:.609375},{x:.828125,y:.609375},{x:.828125,y:.609375},{x:.859375,y:.609375},{x:.859375,y:.609375},{x:.890625,y:.609375},{x:.890625,y:.609375},{x:.921875,y:.609375},{x:.921875,y:.609375},{x:.953125,y:.609375},{x:.953125,y:.609375},{x:.984375,y:.609375},{x:.984375,y:.609375},{x:.015625,y:.640625},{x:.015625,y:.640625},{x:.046875,y:.640625},{x:.046875,y:.640625},{x:.078125,y:.640625},{x:.078125,y:.640625},{x:.109375,y:.640625},{x:.109375,y:.640625},{x:.140625,y:.640625},{x:.140625,y:.640625},{x:.171875,y:.640625},{x:.171875,y:.640625},{x:.203125,y:.640625},{x:.203125,y:.640625},{x:.234375,y:.640625},{x:.234375,y:.640625},{x:.265625,y:.640625},{x:.265625,y:.640625},{x:.296875,y:.640625},{x:.296875,y:.640625},{x:.328125,y:.640625},{x:.328125,y:.640625},{x:.359375,y:.640625},{x:.359375,y:.640625},{x:.390625,y:.640625},{x:.390625,y:.640625},{x:.421875,y:.640625},{x:.421875,y:.640625},{x:.453125,y:.640625},{x:.453125,y:.640625},{x:.484375,y:.640625},{x:.484375,y:.640625},{x:.515625,y:.640625},{x:.515625,y:.640625},{x:.546875,y:.640625},{x:.546875,y:.640625},{x:.578125,y:.640625},{x:.578125,y:.640625},{x:.609375,y:.640625},{x:.609375,y:.640625},{x:.640625,y:.640625},{x:.640625,y:.640625},{x:.671875,y:.640625},{x:.671875,y:.640625},{x:.703125,y:.640625},{x:.703125,y:.640625},{x:.734375,y:.640625},{x:.734375,y:.640625},{x:.765625,y:.640625},{x:.765625,y:.640625},{x:.796875,y:.640625},{x:.796875,y:.640625},{x:.828125,y:.640625},{x:.828125,y:.640625},{x:.859375,y:.640625},{x:.859375,y:.640625},{x:.890625,y:.640625},{x:.890625,y:.640625},{x:.921875,y:.640625},{x:.921875,y:.640625},{x:.953125,y:.640625},{x:.953125,y:.640625},{x:.984375,y:.640625},{x:.984375,y:.640625},{x:.015625,y:.671875},{x:.015625,y:.671875},{x:.046875,y:.671875},{x:.046875,y:.671875},{x:.078125,y:.671875},{x:.078125,y:.671875},{x:.109375,y:.671875},{x:.109375,y:.671875},{x:.140625,y:.671875},{x:.140625,y:.671875},{x:.171875,y:.671875},{x:.171875,y:.671875},{x:.203125,y:.671875},{x:.203125,y:.671875},{x:.234375,y:.671875},{x:.234375,y:.671875},{x:.265625,y:.671875},{x:.265625,y:.671875},{x:.296875,y:.671875},{x:.296875,y:.671875},{x:.328125,y:.671875},{x:.328125,y:.671875},{x:.359375,y:.671875},{x:.359375,y:.671875},{x:.390625,y:.671875},{x:.390625,y:.671875},{x:.421875,y:.671875},{x:.421875,y:.671875},{x:.453125,y:.671875},{x:.453125,y:.671875},{x:.484375,y:.671875},{x:.484375,y:.671875},{x:.515625,y:.671875},{x:.515625,y:.671875},{x:.546875,y:.671875},{x:.546875,y:.671875},{x:.578125,y:.671875},{x:.578125,y:.671875},{x:.609375,y:.671875},{x:.609375,y:.671875},{x:.640625,y:.671875},{x:.640625,y:.671875},{x:.671875,y:.671875},{x:.671875,y:.671875},{x:.703125,y:.671875},{x:.703125,y:.671875},{x:.734375,y:.671875},{x:.734375,y:.671875},{x:.765625,y:.671875},{x:.765625,y:.671875},{x:.796875,y:.671875},{x:.796875,y:.671875},{x:.828125,y:.671875},{x:.828125,y:.671875},{x:.859375,y:.671875},{x:.859375,y:.671875},{x:.890625,y:.671875},{x:.890625,y:.671875},{x:.921875,y:.671875},{x:.921875,y:.671875},{x:.953125,y:.671875},{x:.953125,y:.671875},{x:.984375,y:.671875},{x:.984375,y:.671875},{x:.015625,y:.703125},{x:.015625,y:.703125},{x:.046875,y:.703125},{x:.046875,y:.703125},{x:.078125,y:.703125},{x:.078125,y:.703125},{x:.109375,y:.703125},{x:.109375,y:.703125},{x:.140625,y:.703125},{x:.140625,y:.703125},{x:.171875,y:.703125},{x:.171875,y:.703125},{x:.203125,y:.703125},{x:.203125,y:.703125},{x:.234375,y:.703125},{x:.234375,y:.703125},{x:.265625,y:.703125},{x:.265625,y:.703125},{x:.296875,y:.703125},{x:.296875,y:.703125},{x:.328125,y:.703125},{x:.328125,y:.703125},{x:.359375,y:.703125},{x:.359375,y:.703125},{x:.390625,y:.703125},{x:.390625,y:.703125},{x:.421875,y:.703125},{x:.421875,y:.703125},{x:.453125,y:.703125},{x:.453125,y:.703125},{x:.484375,y:.703125},{x:.484375,y:.703125},{x:.515625,y:.703125},{x:.515625,y:.703125},{x:.546875,y:.703125},{x:.546875,y:.703125},{x:.578125,y:.703125},{x:.578125,y:.703125},{x:.609375,y:.703125},{x:.609375,y:.703125},{x:.640625,y:.703125},{x:.640625,y:.703125},{x:.671875,y:.703125},{x:.671875,y:.703125},{x:.703125,y:.703125},{x:.703125,y:.703125},{x:.734375,y:.703125},{x:.734375,y:.703125},{x:.765625,y:.703125},{x:.765625,y:.703125},{x:.796875,y:.703125},{x:.796875,y:.703125},{x:.828125,y:.703125},{x:.828125,y:.703125},{x:.859375,y:.703125},{x:.859375,y:.703125},{x:.890625,y:.703125},{x:.890625,y:.703125},{x:.921875,y:.703125},{x:.921875,y:.703125},{x:.953125,y:.703125},{x:.953125,y:.703125},{x:.984375,y:.703125},{x:.984375,y:.703125},{x:.015625,y:.734375},{x:.015625,y:.734375},{x:.046875,y:.734375},{x:.046875,y:.734375},{x:.078125,y:.734375},{x:.078125,y:.734375},{x:.109375,y:.734375},{x:.109375,y:.734375},{x:.140625,y:.734375},{x:.140625,y:.734375},{x:.171875,y:.734375},{x:.171875,y:.734375},{x:.203125,y:.734375},{x:.203125,y:.734375},{x:.234375,y:.734375},{x:.234375,y:.734375},{x:.265625,y:.734375},{x:.265625,y:.734375},{x:.296875,y:.734375},{x:.296875,y:.734375},{x:.328125,y:.734375},{x:.328125,y:.734375},{x:.359375,y:.734375},{x:.359375,y:.734375},{x:.390625,y:.734375},{x:.390625,y:.734375},{x:.421875,y:.734375},{x:.421875,y:.734375},{x:.453125,y:.734375},{x:.453125,y:.734375},{x:.484375,y:.734375},{x:.484375,y:.734375},{x:.515625,y:.734375},{x:.515625,y:.734375},{x:.546875,y:.734375},{x:.546875,y:.734375},{x:.578125,y:.734375},{x:.578125,y:.734375},{x:.609375,y:.734375},{x:.609375,y:.734375},{x:.640625,y:.734375},{x:.640625,y:.734375},{x:.671875,y:.734375},{x:.671875,y:.734375},{x:.703125,y:.734375},{x:.703125,y:.734375},{x:.734375,y:.734375},{x:.734375,y:.734375},{x:.765625,y:.734375},{x:.765625,y:.734375},{x:.796875,y:.734375},{x:.796875,y:.734375},{x:.828125,y:.734375},{x:.828125,y:.734375},{x:.859375,y:.734375},{x:.859375,y:.734375},{x:.890625,y:.734375},{x:.890625,y:.734375},{x:.921875,y:.734375},{x:.921875,y:.734375},{x:.953125,y:.734375},{x:.953125,y:.734375},{x:.984375,y:.734375},{x:.984375,y:.734375},{x:.015625,y:.765625},{x:.015625,y:.765625},{x:.046875,y:.765625},{x:.046875,y:.765625},{x:.078125,y:.765625},{x:.078125,y:.765625},{x:.109375,y:.765625},{x:.109375,y:.765625},{x:.140625,y:.765625},{x:.140625,y:.765625},{x:.171875,y:.765625},{x:.171875,y:.765625},{x:.203125,y:.765625},{x:.203125,y:.765625},{x:.234375,y:.765625},{x:.234375,y:.765625},{x:.265625,y:.765625},{x:.265625,y:.765625},{x:.296875,y:.765625},{x:.296875,y:.765625},{x:.328125,y:.765625},{x:.328125,y:.765625},{x:.359375,y:.765625},{x:.359375,y:.765625},{x:.390625,y:.765625},{x:.390625,y:.765625},{x:.421875,y:.765625},{x:.421875,y:.765625},{x:.453125,y:.765625},{x:.453125,y:.765625},{x:.484375,y:.765625},{x:.484375,y:.765625},{x:.515625,y:.765625},{x:.515625,y:.765625},{x:.546875,y:.765625},{x:.546875,y:.765625},{x:.578125,y:.765625},{x:.578125,y:.765625},{x:.609375,y:.765625},{x:.609375,y:.765625},{x:.640625,y:.765625},{x:.640625,y:.765625},{x:.671875,y:.765625},{x:.671875,y:.765625},{x:.703125,y:.765625},{x:.703125,y:.765625},{x:.734375,y:.765625},{x:.734375,y:.765625},{x:.765625,y:.765625},{x:.765625,y:.765625},{x:.796875,y:.765625},{x:.796875,y:.765625},{x:.828125,y:.765625},{x:.828125,y:.765625},{x:.859375,y:.765625},{x:.859375,y:.765625},{x:.890625,y:.765625},{x:.890625,y:.765625},{x:.921875,y:.765625},{x:.921875,y:.765625},{x:.953125,y:.765625},{x:.953125,y:.765625},{x:.984375,y:.765625},{x:.984375,y:.765625},{x:.015625,y:.796875},{x:.015625,y:.796875},{x:.046875,y:.796875},{x:.046875,y:.796875},{x:.078125,y:.796875},{x:.078125,y:.796875},{x:.109375,y:.796875},{x:.109375,y:.796875},{x:.140625,y:.796875},{x:.140625,y:.796875},{x:.171875,y:.796875},{x:.171875,y:.796875},{x:.203125,y:.796875},{x:.203125,y:.796875},{x:.234375,y:.796875},{x:.234375,y:.796875},{x:.265625,y:.796875},{x:.265625,y:.796875},{x:.296875,y:.796875},{x:.296875,y:.796875},{x:.328125,y:.796875},{x:.328125,y:.796875},{x:.359375,y:.796875},{x:.359375,y:.796875},{x:.390625,y:.796875},{x:.390625,y:.796875},{x:.421875,y:.796875},{x:.421875,y:.796875},{x:.453125,y:.796875},{x:.453125,y:.796875},{x:.484375,y:.796875},{x:.484375,y:.796875},{x:.515625,y:.796875},{x:.515625,y:.796875},{x:.546875,y:.796875},{x:.546875,y:.796875},{x:.578125,y:.796875},{x:.578125,y:.796875},{x:.609375,y:.796875},{x:.609375,y:.796875},{x:.640625,y:.796875},{x:.640625,y:.796875},{x:.671875,y:.796875},{x:.671875,y:.796875},{x:.703125,y:.796875},{x:.703125,y:.796875},{x:.734375,y:.796875},{x:.734375,y:.796875},{x:.765625,y:.796875},{x:.765625,y:.796875},{x:.796875,y:.796875},{x:.796875,y:.796875},{x:.828125,y:.796875},{x:.828125,y:.796875},{x:.859375,y:.796875},{x:.859375,y:.796875},{x:.890625,y:.796875},{x:.890625,y:.796875},{x:.921875,y:.796875},{x:.921875,y:.796875},{x:.953125,y:.796875},{x:.953125,y:.796875},{x:.984375,y:.796875},{x:.984375,y:.796875},{x:.015625,y:.828125},{x:.015625,y:.828125},{x:.046875,y:.828125},{x:.046875,y:.828125},{x:.078125,y:.828125},{x:.078125,y:.828125},{x:.109375,y:.828125},{x:.109375,y:.828125},{x:.140625,y:.828125},{x:.140625,y:.828125},{x:.171875,y:.828125},{x:.171875,y:.828125},{x:.203125,y:.828125},{x:.203125,y:.828125},{x:.234375,y:.828125},{x:.234375,y:.828125},{x:.265625,y:.828125},{x:.265625,y:.828125},{x:.296875,y:.828125},{x:.296875,y:.828125},{x:.328125,y:.828125},{x:.328125,y:.828125},{x:.359375,y:.828125},{x:.359375,y:.828125},{x:.390625,y:.828125},{x:.390625,y:.828125},{x:.421875,y:.828125},{x:.421875,y:.828125},{x:.453125,y:.828125},{x:.453125,y:.828125},{x:.484375,y:.828125},{x:.484375,y:.828125},{x:.515625,y:.828125},{x:.515625,y:.828125},{x:.546875,y:.828125},{x:.546875,y:.828125},{x:.578125,y:.828125},{x:.578125,y:.828125},{x:.609375,y:.828125},{x:.609375,y:.828125},{x:.640625,y:.828125},{x:.640625,y:.828125},{x:.671875,y:.828125},{x:.671875,y:.828125},{x:.703125,y:.828125},{x:.703125,y:.828125},{x:.734375,y:.828125},{x:.734375,y:.828125},{x:.765625,y:.828125},{x:.765625,y:.828125},{x:.796875,y:.828125},{x:.796875,y:.828125},{x:.828125,y:.828125},{x:.828125,y:.828125},{x:.859375,y:.828125},{x:.859375,y:.828125},{x:.890625,y:.828125},{x:.890625,y:.828125},{x:.921875,y:.828125},{x:.921875,y:.828125},{x:.953125,y:.828125},{x:.953125,y:.828125},{x:.984375,y:.828125},{x:.984375,y:.828125},{x:.015625,y:.859375},{x:.015625,y:.859375},{x:.046875,y:.859375},{x:.046875,y:.859375},{x:.078125,y:.859375},{x:.078125,y:.859375},{x:.109375,y:.859375},{x:.109375,y:.859375},{x:.140625,y:.859375},{x:.140625,y:.859375},{x:.171875,y:.859375},{x:.171875,y:.859375},{x:.203125,y:.859375},{x:.203125,y:.859375},{x:.234375,y:.859375},{x:.234375,y:.859375},{x:.265625,y:.859375},{x:.265625,y:.859375},{x:.296875,y:.859375},{x:.296875,y:.859375},{x:.328125,y:.859375},{x:.328125,y:.859375},{x:.359375,y:.859375},{x:.359375,y:.859375},{x:.390625,y:.859375},{x:.390625,y:.859375},{x:.421875,y:.859375},{x:.421875,y:.859375},{x:.453125,y:.859375},{x:.453125,y:.859375},{x:.484375,y:.859375},{x:.484375,y:.859375},{x:.515625,y:.859375},{x:.515625,y:.859375},{x:.546875,y:.859375},{x:.546875,y:.859375},{x:.578125,y:.859375},{x:.578125,y:.859375},{x:.609375,y:.859375},{x:.609375,y:.859375},{x:.640625,y:.859375},{x:.640625,y:.859375},{x:.671875,y:.859375},{x:.671875,y:.859375},{x:.703125,y:.859375},{x:.703125,y:.859375},{x:.734375,y:.859375},{x:.734375,y:.859375},{x:.765625,y:.859375},{x:.765625,y:.859375},{x:.796875,y:.859375},{x:.796875,y:.859375},{x:.828125,y:.859375},{x:.828125,y:.859375},{x:.859375,y:.859375},{x:.859375,y:.859375},{x:.890625,y:.859375},{x:.890625,y:.859375},{x:.921875,y:.859375},{x:.921875,y:.859375},{x:.953125,y:.859375},{x:.953125,y:.859375},{x:.984375,y:.859375},{x:.984375,y:.859375},{x:.015625,y:.890625},{x:.015625,y:.890625},{x:.046875,y:.890625},{x:.046875,y:.890625},{x:.078125,y:.890625},{x:.078125,y:.890625},{x:.109375,y:.890625},{x:.109375,y:.890625},{x:.140625,y:.890625},{x:.140625,y:.890625},{x:.171875,y:.890625},{x:.171875,y:.890625},{x:.203125,y:.890625},{x:.203125,y:.890625},{x:.234375,y:.890625},{x:.234375,y:.890625},{x:.265625,y:.890625},{x:.265625,y:.890625},{x:.296875,y:.890625},{x:.296875,y:.890625},{x:.328125,y:.890625},{x:.328125,y:.890625},{x:.359375,y:.890625},{x:.359375,y:.890625},{x:.390625,y:.890625},{x:.390625,y:.890625},{x:.421875,y:.890625},{x:.421875,y:.890625},{x:.453125,y:.890625},{x:.453125,y:.890625},{x:.484375,y:.890625},{x:.484375,y:.890625},{x:.515625,y:.890625},{x:.515625,y:.890625},{x:.546875,y:.890625},{x:.546875,y:.890625},{x:.578125,y:.890625},{x:.578125,y:.890625},{x:.609375,y:.890625},{x:.609375,y:.890625},{x:.640625,y:.890625},{x:.640625,y:.890625},{x:.671875,y:.890625},{x:.671875,y:.890625},{x:.703125,y:.890625},{x:.703125,y:.890625},{x:.734375,y:.890625},{x:.734375,y:.890625},{x:.765625,y:.890625},{x:.765625,y:.890625},{x:.796875,y:.890625},{x:.796875,y:.890625},{x:.828125,y:.890625},{x:.828125,y:.890625},{x:.859375,y:.890625},{x:.859375,y:.890625},{x:.890625,y:.890625},{x:.890625,y:.890625},{x:.921875,y:.890625},{x:.921875,y:.890625},{x:.953125,y:.890625},{x:.953125,y:.890625},{x:.984375,y:.890625},{x:.984375,y:.890625},{x:.015625,y:.921875},{x:.015625,y:.921875},{x:.046875,y:.921875},{x:.046875,y:.921875},{x:.078125,y:.921875},{x:.078125,y:.921875},{x:.109375,y:.921875},{x:.109375,y:.921875},{x:.140625,y:.921875},{x:.140625,y:.921875},{x:.171875,y:.921875},{x:.171875,y:.921875},{x:.203125,y:.921875},{x:.203125,y:.921875},{x:.234375,y:.921875},{x:.234375,y:.921875},{x:.265625,y:.921875},{x:.265625,y:.921875},{x:.296875,y:.921875},{x:.296875,y:.921875},{x:.328125,y:.921875},{x:.328125,y:.921875},{x:.359375,y:.921875},{x:.359375,y:.921875},{x:.390625,y:.921875},{x:.390625,y:.921875},{x:.421875,y:.921875},{x:.421875,y:.921875},{x:.453125,y:.921875},{x:.453125,y:.921875},{x:.484375,y:.921875},{x:.484375,y:.921875},{x:.515625,y:.921875},{x:.515625,y:.921875},{x:.546875,y:.921875},{x:.546875,y:.921875},{x:.578125,y:.921875},{x:.578125,y:.921875},{x:.609375,y:.921875},{x:.609375,y:.921875},{x:.640625,y:.921875},{x:.640625,y:.921875},{x:.671875,y:.921875},{x:.671875,y:.921875},{x:.703125,y:.921875},{x:.703125,y:.921875},{x:.734375,y:.921875},{x:.734375,y:.921875},{x:.765625,y:.921875},{x:.765625,y:.921875},{x:.796875,y:.921875},{x:.796875,y:.921875},{x:.828125,y:.921875},{x:.828125,y:.921875},{x:.859375,y:.921875},{x:.859375,y:.921875},{x:.890625,y:.921875},{x:.890625,y:.921875},{x:.921875,y:.921875},{x:.921875,y:.921875},{x:.953125,y:.921875},{x:.953125,y:.921875},{x:.984375,y:.921875},{x:.984375,y:.921875},{x:.015625,y:.953125},{x:.015625,y:.953125},{x:.046875,y:.953125},{x:.046875,y:.953125},{x:.078125,y:.953125},{x:.078125,y:.953125},{x:.109375,y:.953125},{x:.109375,y:.953125},{x:.140625,y:.953125},{x:.140625,y:.953125},{x:.171875,y:.953125},{x:.171875,y:.953125},{x:.203125,y:.953125},{x:.203125,y:.953125},{x:.234375,y:.953125},{x:.234375,y:.953125},{x:.265625,y:.953125},{x:.265625,y:.953125},{x:.296875,y:.953125},{x:.296875,y:.953125},{x:.328125,y:.953125},{x:.328125,y:.953125},{x:.359375,y:.953125},{x:.359375,y:.953125},{x:.390625,y:.953125},{x:.390625,y:.953125},{x:.421875,y:.953125},{x:.421875,y:.953125},{x:.453125,y:.953125},{x:.453125,y:.953125},{x:.484375,y:.953125},{x:.484375,y:.953125},{x:.515625,y:.953125},{x:.515625,y:.953125},{x:.546875,y:.953125},{x:.546875,y:.953125},{x:.578125,y:.953125},{x:.578125,y:.953125},{x:.609375,y:.953125},{x:.609375,y:.953125},{x:.640625,y:.953125},{x:.640625,y:.953125},{x:.671875,y:.953125},{x:.671875,y:.953125},{x:.703125,y:.953125},{x:.703125,y:.953125},{x:.734375,y:.953125},{x:.734375,y:.953125},{x:.765625,y:.953125},{x:.765625,y:.953125},{x:.796875,y:.953125},{x:.796875,y:.953125},{x:.828125,y:.953125},{x:.828125,y:.953125},{x:.859375,y:.953125},{x:.859375,y:.953125},{x:.890625,y:.953125},{x:.890625,y:.953125},{x:.921875,y:.953125},{x:.921875,y:.953125},{x:.953125,y:.953125},{x:.953125,y:.953125},{x:.984375,y:.953125},{x:.984375,y:.953125},{x:.015625,y:.984375},{x:.015625,y:.984375},{x:.046875,y:.984375},{x:.046875,y:.984375},{x:.078125,y:.984375},{x:.078125,y:.984375},{x:.109375,y:.984375},{x:.109375,y:.984375},{x:.140625,y:.984375},{x:.140625,y:.984375},{x:.171875,y:.984375},{x:.171875,y:.984375},{x:.203125,y:.984375},{x:.203125,y:.984375},{x:.234375,y:.984375},{x:.234375,y:.984375},{x:.265625,y:.984375},{x:.265625,y:.984375},{x:.296875,y:.984375},{x:.296875,y:.984375},{x:.328125,y:.984375},{x:.328125,y:.984375},{x:.359375,y:.984375},{x:.359375,y:.984375},{x:.390625,y:.984375},{x:.390625,y:.984375},{x:.421875,y:.984375},{x:.421875,y:.984375},{x:.453125,y:.984375},{x:.453125,y:.984375},{x:.484375,y:.984375},{x:.484375,y:.984375},{x:.515625,y:.984375},{x:.515625,y:.984375},{x:.546875,y:.984375},{x:.546875,y:.984375},{x:.578125,y:.984375},{x:.578125,y:.984375},{x:.609375,y:.984375},{x:.609375,y:.984375},{x:.640625,y:.984375},{x:.640625,y:.984375},{x:.671875,y:.984375},{x:.671875,y:.984375},{x:.703125,y:.984375},{x:.703125,y:.984375},{x:.734375,y:.984375},{x:.734375,y:.984375},{x:.765625,y:.984375},{x:.765625,y:.984375},{x:.796875,y:.984375},{x:.796875,y:.984375},{x:.828125,y:.984375},{x:.828125,y:.984375},{x:.859375,y:.984375},{x:.859375,y:.984375},{x:.890625,y:.984375},{x:.890625,y:.984375},{x:.921875,y:.984375},{x:.921875,y:.984375},{x:.953125,y:.984375},{x:.953125,y:.984375},{x:.984375,y:.984375},{x:.984375,y:.984375},{x:.03125,y:.03125},{x:.03125,y:.03125},{x:.09375,y:.03125},{x:.09375,y:.03125},{x:.15625,y:.03125},{x:.15625,y:.03125},{x:.21875,y:.03125},{x:.21875,y:.03125},{x:.28125,y:.03125},{x:.28125,y:.03125},{x:.34375,y:.03125},{x:.34375,y:.03125},{x:.40625,y:.03125},{x:.40625,y:.03125},{x:.46875,y:.03125},{x:.46875,y:.03125},{x:.53125,y:.03125},{x:.53125,y:.03125},{x:.59375,y:.03125},{x:.59375,y:.03125},{x:.65625,y:.03125},{x:.65625,y:.03125},{x:.71875,y:.03125},{x:.71875,y:.03125},{x:.78125,y:.03125},{x:.78125,y:.03125},{x:.84375,y:.03125},{x:.84375,y:.03125},{x:.90625,y:.03125},{x:.90625,y:.03125},{x:.96875,y:.03125},{x:.96875,y:.03125},{x:.03125,y:.09375},{x:.03125,y:.09375},{x:.09375,y:.09375},{x:.09375,y:.09375},{x:.15625,y:.09375},{x:.15625,y:.09375},{x:.21875,y:.09375},{x:.21875,y:.09375},{x:.28125,y:.09375},{x:.28125,y:.09375},{x:.34375,y:.09375},{x:.34375,y:.09375},{x:.40625,y:.09375},{x:.40625,y:.09375},{x:.46875,y:.09375},{x:.46875,y:.09375},{x:.53125,y:.09375},{x:.53125,y:.09375},{x:.59375,y:.09375},{x:.59375,y:.09375},{x:.65625,y:.09375},{x:.65625,y:.09375},{x:.71875,y:.09375},{x:.71875,y:.09375},{x:.78125,y:.09375},{x:.78125,y:.09375},{x:.84375,y:.09375},{x:.84375,y:.09375},{x:.90625,y:.09375},{x:.90625,y:.09375},{x:.96875,y:.09375},{x:.96875,y:.09375},{x:.03125,y:.15625},{x:.03125,y:.15625},{x:.09375,y:.15625},{x:.09375,y:.15625},{x:.15625,y:.15625},{x:.15625,y:.15625},{x:.21875,y:.15625},{x:.21875,y:.15625},{x:.28125,y:.15625},{x:.28125,y:.15625},{x:.34375,y:.15625},{x:.34375,y:.15625},{x:.40625,y:.15625},{x:.40625,y:.15625},{x:.46875,y:.15625},{x:.46875,y:.15625},{x:.53125,y:.15625},{x:.53125,y:.15625},{x:.59375,y:.15625},{x:.59375,y:.15625},{x:.65625,y:.15625},{x:.65625,y:.15625},{x:.71875,y:.15625},{x:.71875,y:.15625},{x:.78125,y:.15625},{x:.78125,y:.15625},{x:.84375,y:.15625},{x:.84375,y:.15625},{x:.90625,y:.15625},{x:.90625,y:.15625},{x:.96875,y:.15625},{x:.96875,y:.15625},{x:.03125,y:.21875},{x:.03125,y:.21875},{x:.09375,y:.21875},{x:.09375,y:.21875},{x:.15625,y:.21875},{x:.15625,y:.21875},{x:.21875,y:.21875},{x:.21875,y:.21875},{x:.28125,y:.21875},{x:.28125,y:.21875},{x:.34375,y:.21875},{x:.34375,y:.21875},{x:.40625,y:.21875},{x:.40625,y:.21875},{x:.46875,y:.21875},{x:.46875,y:.21875},{x:.53125,y:.21875},{x:.53125,y:.21875},{x:.59375,y:.21875},{x:.59375,y:.21875},{x:.65625,y:.21875},{x:.65625,y:.21875},{x:.71875,y:.21875},{x:.71875,y:.21875},{x:.78125,y:.21875},{x:.78125,y:.21875},{x:.84375,y:.21875},{x:.84375,y:.21875},{x:.90625,y:.21875},{x:.90625,y:.21875},{x:.96875,y:.21875},{x:.96875,y:.21875},{x:.03125,y:.28125},{x:.03125,y:.28125},{x:.09375,y:.28125},{x:.09375,y:.28125},{x:.15625,y:.28125},{x:.15625,y:.28125},{x:.21875,y:.28125},{x:.21875,y:.28125},{x:.28125,y:.28125},{x:.28125,y:.28125},{x:.34375,y:.28125},{x:.34375,y:.28125},{x:.40625,y:.28125},{x:.40625,y:.28125},{x:.46875,y:.28125},{x:.46875,y:.28125},{x:.53125,y:.28125},{x:.53125,y:.28125},{x:.59375,y:.28125},{x:.59375,y:.28125},{x:.65625,y:.28125},{x:.65625,y:.28125},{x:.71875,y:.28125},{x:.71875,y:.28125},{x:.78125,y:.28125},{x:.78125,y:.28125},{x:.84375,y:.28125},{x:.84375,y:.28125},{x:.90625,y:.28125},{x:.90625,y:.28125},{x:.96875,y:.28125},{x:.96875,y:.28125},{x:.03125,y:.34375},{x:.03125,y:.34375},{x:.09375,y:.34375},{x:.09375,y:.34375},{x:.15625,y:.34375},{x:.15625,y:.34375},{x:.21875,y:.34375},{x:.21875,y:.34375},{x:.28125,y:.34375},{x:.28125,y:.34375},{x:.34375,y:.34375},{x:.34375,y:.34375},{x:.40625,y:.34375},{x:.40625,y:.34375},{x:.46875,y:.34375},{x:.46875,y:.34375},{x:.53125,y:.34375},{x:.53125,y:.34375},{x:.59375,y:.34375},{x:.59375,y:.34375},{x:.65625,y:.34375},{x:.65625,y:.34375},{x:.71875,y:.34375},{x:.71875,y:.34375},{x:.78125,y:.34375},{x:.78125,y:.34375},{x:.84375,y:.34375},{x:.84375,y:.34375},{x:.90625,y:.34375},{x:.90625,y:.34375},{x:.96875,y:.34375},{x:.96875,y:.34375},{x:.03125,y:.40625},{x:.03125,y:.40625},{x:.09375,y:.40625},{x:.09375,y:.40625},{x:.15625,y:.40625},{x:.15625,y:.40625},{x:.21875,y:.40625},{x:.21875,y:.40625},{x:.28125,y:.40625},{x:.28125,y:.40625},{x:.34375,y:.40625},{x:.34375,y:.40625},{x:.40625,y:.40625},{x:.40625,y:.40625},{x:.46875,y:.40625},{x:.46875,y:.40625},{x:.53125,y:.40625},{x:.53125,y:.40625},{x:.59375,y:.40625},{x:.59375,y:.40625},{x:.65625,y:.40625},{x:.65625,y:.40625},{x:.71875,y:.40625},{x:.71875,y:.40625},{x:.78125,y:.40625},{x:.78125,y:.40625},{x:.84375,y:.40625},{x:.84375,y:.40625},{x:.90625,y:.40625},{x:.90625,y:.40625},{x:.96875,y:.40625},{x:.96875,y:.40625},{x:.03125,y:.46875},{x:.03125,y:.46875},{x:.09375,y:.46875},{x:.09375,y:.46875},{x:.15625,y:.46875},{x:.15625,y:.46875},{x:.21875,y:.46875},{x:.21875,y:.46875},{x:.28125,y:.46875},{x:.28125,y:.46875},{x:.34375,y:.46875},{x:.34375,y:.46875},{x:.40625,y:.46875},{x:.40625,y:.46875},{x:.46875,y:.46875},{x:.46875,y:.46875},{x:.53125,y:.46875},{x:.53125,y:.46875},{x:.59375,y:.46875},{x:.59375,y:.46875},{x:.65625,y:.46875},{x:.65625,y:.46875},{x:.71875,y:.46875},{x:.71875,y:.46875},{x:.78125,y:.46875},{x:.78125,y:.46875},{x:.84375,y:.46875},{x:.84375,y:.46875},{x:.90625,y:.46875},{x:.90625,y:.46875},{x:.96875,y:.46875},{x:.96875,y:.46875},{x:.03125,y:.53125},{x:.03125,y:.53125},{x:.09375,y:.53125},{x:.09375,y:.53125},{x:.15625,y:.53125},{x:.15625,y:.53125},{x:.21875,y:.53125},{x:.21875,y:.53125},{x:.28125,y:.53125},{x:.28125,y:.53125},{x:.34375,y:.53125},{x:.34375,y:.53125},{x:.40625,y:.53125},{x:.40625,y:.53125},{x:.46875,y:.53125},{x:.46875,y:.53125},{x:.53125,y:.53125},{x:.53125,y:.53125},{x:.59375,y:.53125},{x:.59375,y:.53125},{x:.65625,y:.53125},{x:.65625,y:.53125},{x:.71875,y:.53125},{x:.71875,y:.53125},{x:.78125,y:.53125},{x:.78125,y:.53125},{x:.84375,y:.53125},{x:.84375,y:.53125},{x:.90625,y:.53125},{x:.90625,y:.53125},{x:.96875,y:.53125},{x:.96875,y:.53125},{x:.03125,y:.59375},{x:.03125,y:.59375},{x:.09375,y:.59375},{x:.09375,y:.59375},{x:.15625,y:.59375},{x:.15625,y:.59375},{x:.21875,y:.59375},{x:.21875,y:.59375},{x:.28125,y:.59375},{x:.28125,y:.59375},{x:.34375,y:.59375},{x:.34375,y:.59375},{x:.40625,y:.59375},{x:.40625,y:.59375},{x:.46875,y:.59375},{x:.46875,y:.59375},{x:.53125,y:.59375},{x:.53125,y:.59375},{x:.59375,y:.59375},{x:.59375,y:.59375},{x:.65625,y:.59375},{x:.65625,y:.59375},{x:.71875,y:.59375},{x:.71875,y:.59375},{x:.78125,y:.59375},{x:.78125,y:.59375},{x:.84375,y:.59375},{x:.84375,y:.59375},{x:.90625,y:.59375},{x:.90625,y:.59375},{x:.96875,y:.59375},{x:.96875,y:.59375},{x:.03125,y:.65625},{x:.03125,y:.65625},{x:.09375,y:.65625},{x:.09375,y:.65625},{x:.15625,y:.65625},{x:.15625,y:.65625},{x:.21875,y:.65625},{x:.21875,y:.65625},{x:.28125,y:.65625},{x:.28125,y:.65625},{x:.34375,y:.65625},{x:.34375,y:.65625},{x:.40625,y:.65625},{x:.40625,y:.65625},{x:.46875,y:.65625},{x:.46875,y:.65625},{x:.53125,y:.65625},{x:.53125,y:.65625},{x:.59375,y:.65625},{x:.59375,y:.65625},{x:.65625,y:.65625},{x:.65625,y:.65625},{x:.71875,y:.65625},{x:.71875,y:.65625},{x:.78125,y:.65625},{x:.78125,y:.65625},{x:.84375,y:.65625},{x:.84375,y:.65625},{x:.90625,y:.65625},{x:.90625,y:.65625},{x:.96875,y:.65625},{x:.96875,y:.65625},{x:.03125,y:.71875},{x:.03125,y:.71875},{x:.09375,y:.71875},{x:.09375,y:.71875},{x:.15625,y:.71875},{x:.15625,y:.71875},{x:.21875,y:.71875},{x:.21875,y:.71875},{x:.28125,y:.71875},{x:.28125,y:.71875},{x:.34375,y:.71875},{x:.34375,y:.71875},{x:.40625,y:.71875},{x:.40625,y:.71875},{x:.46875,y:.71875},{x:.46875,y:.71875},{x:.53125,y:.71875},{x:.53125,y:.71875},{x:.59375,y:.71875},{x:.59375,y:.71875},{x:.65625,y:.71875},{x:.65625,y:.71875},{x:.71875,y:.71875},{x:.71875,y:.71875},{x:.78125,y:.71875},{x:.78125,y:.71875},{x:.84375,y:.71875},{x:.84375,y:.71875},{x:.90625,y:.71875},{x:.90625,y:.71875},{x:.96875,y:.71875},{x:.96875,y:.71875},{x:.03125,y:.78125},{x:.03125,y:.78125},{x:.09375,y:.78125},{x:.09375,y:.78125},{x:.15625,y:.78125},{x:.15625,y:.78125},{x:.21875,y:.78125},{x:.21875,y:.78125},{x:.28125,y:.78125},{x:.28125,y:.78125},{x:.34375,y:.78125},{x:.34375,y:.78125},{x:.40625,y:.78125},{x:.40625,y:.78125},{x:.46875,y:.78125},{x:.46875,y:.78125},{x:.53125,y:.78125},{x:.53125,y:.78125},{x:.59375,y:.78125},{x:.59375,y:.78125},{x:.65625,y:.78125},{x:.65625,y:.78125},{x:.71875,y:.78125},{x:.71875,y:.78125},{x:.78125,y:.78125},{x:.78125,y:.78125},{x:.84375,y:.78125},{x:.84375,y:.78125},{x:.90625,y:.78125},{x:.90625,y:.78125},{x:.96875,y:.78125},{x:.96875,y:.78125},{x:.03125,y:.84375},{x:.03125,y:.84375},{x:.09375,y:.84375},{x:.09375,y:.84375},{x:.15625,y:.84375},{x:.15625,y:.84375},{x:.21875,y:.84375},{x:.21875,y:.84375},{x:.28125,y:.84375},{x:.28125,y:.84375},{x:.34375,y:.84375},{x:.34375,y:.84375},{x:.40625,y:.84375},{x:.40625,y:.84375},{x:.46875,y:.84375},{x:.46875,y:.84375},{x:.53125,y:.84375},{x:.53125,y:.84375},{x:.59375,y:.84375},{x:.59375,y:.84375},{x:.65625,y:.84375},{x:.65625,y:.84375},{x:.71875,y:.84375},{x:.71875,y:.84375},{x:.78125,y:.84375},{x:.78125,y:.84375},{x:.84375,y:.84375},{x:.84375,y:.84375},{x:.90625,y:.84375},{x:.90625,y:.84375},{x:.96875,y:.84375},{x:.96875,y:.84375},{x:.03125,y:.90625},{x:.03125,y:.90625},{x:.09375,y:.90625},{x:.09375,y:.90625},{x:.15625,y:.90625},{x:.15625,y:.90625},{x:.21875,y:.90625},{x:.21875,y:.90625},{x:.28125,y:.90625},{x:.28125,y:.90625},{x:.34375,y:.90625},{x:.34375,y:.90625},{x:.40625,y:.90625},{x:.40625,y:.90625},{x:.46875,y:.90625},{x:.46875,y:.90625},{x:.53125,y:.90625},{x:.53125,y:.90625},{x:.59375,y:.90625},{x:.59375,y:.90625},{x:.65625,y:.90625},{x:.65625,y:.90625},{x:.71875,y:.90625},{x:.71875,y:.90625},{x:.78125,y:.90625},{x:.78125,y:.90625},{x:.84375,y:.90625},{x:.84375,y:.90625},{x:.90625,y:.90625},{x:.90625,y:.90625},{x:.96875,y:.90625},{x:.96875,y:.90625},{x:.03125,y:.96875},{x:.03125,y:.96875},{x:.09375,y:.96875},{x:.09375,y:.96875},{x:.15625,y:.96875},{x:.15625,y:.96875},{x:.21875,y:.96875},{x:.21875,y:.96875},{x:.28125,y:.96875},{x:.28125,y:.96875},{x:.34375,y:.96875},{x:.34375,y:.96875},{x:.40625,y:.96875},{x:.40625,y:.96875},{x:.46875,y:.96875},{x:.46875,y:.96875},{x:.53125,y:.96875},{x:.53125,y:.96875},{x:.59375,y:.96875},{x:.59375,y:.96875},{x:.65625,y:.96875},{x:.65625,y:.96875},{x:.71875,y:.96875},{x:.71875,y:.96875},{x:.78125,y:.96875},{x:.78125,y:.96875},{x:.84375,y:.96875},{x:.84375,y:.96875},{x:.90625,y:.96875},{x:.90625,y:.96875},{x:.96875,y:.96875},{x:.96875,y:.96875},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.0625,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.1875,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.3125,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.4375,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.5625,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.6875,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.8125,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.9375,y:.0625},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.0625,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.1875,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.3125,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.4375,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.5625,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.6875,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.8125,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.9375,y:.1875},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.0625,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.1875,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.3125,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.4375,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.5625,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.6875,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.8125,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.9375,y:.3125},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.0625,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.1875,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.3125,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.4375,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.5625,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.6875,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.8125,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.9375,y:.4375},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.0625,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.1875,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.3125,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.4375,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.5625,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.6875,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.8125,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.9375,y:.5625},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.0625,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.1875,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.3125,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.4375,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.5625,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.6875,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.8125,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.9375,y:.6875},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.0625,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.1875,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.3125,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.4375,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.5625,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.6875,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.8125,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.9375,y:.8125},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.0625,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.1875,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.3125,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.4375,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.5625,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.6875,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.8125,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375},{x:.9375,y:.9375}];var rg=class{constructor(t){var n;this.model=t,this.anchors=Ik.map(a=>[a.x,a.y]),this.anchorsTensor=Kn(this.anchors),this.inputSize=(n=this.model)==null?void 0:n.inputs[0].shape[2],this.inputSizeTensor=nn([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=nn([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){return L(()=>{let n=Me(t,[0,0],[-1,2]),a=Me(t,[0,2],[-1,2]),r=se(ge(n,this.inputSizeTensor),this.anchorsTensor),s=ge(a,this.doubleInputSizeTensor),i=B(ye(r,s),this.inputSizeTensor),o=B(se(r,s),this.inputSizeTensor);return cl([i,o],1)})}normalizeLandmarks(t,n){return L(()=>{let a=se(ge(t.reshape([-1,7,2]),this.inputSizeTensor),this.anchors[n]);return B(a,this.inputSizeTensor)})}async getBoxes(t,n){let a=this.model.predict(t),r=a.squeeze();a.dispose();let s=L(()=>wn(Me(r,[0,0],[-1,1])).squeeze()),i=s.dataSync(),o=Me(r,[0,1],[-1,4]),l=this.normalizeBoxes(o);o.dispose();let d=await Ye.nonMaxSuppressionAsync(l,i,n.hand.maxDetected,n.hand.iouThreshold,n.hand.minConfidence),u=d.arraySync();s.dispose(),d.dispose();let p=[];for(let c of u)if(i[c]>=n.hand.minConfidence){let h=Me(l,[c,0],[1,-1]),m=Me(r,[c,5],[1,14]),f=L(()=>this.normalizeLandmarks(m,c).reshape([-1,2]));m.dispose(),p.push({box:h,palmLandmarks:f,confidence:i[c]})}return r.dispose(),l.dispose(),p}async estimateHandBounds(t,n){let a=t.shape[1],r=t.shape[2],s=L(()=>t.resizeBilinear([this.inputSize,this.inputSize]).div(127.5).sub(1)),i=await this.getBoxes(s,n);s.dispose();let o=[];if(!i||i.length===0)return o;for(let l of i){let d=l.box.dataSync(),u=d.slice(0,2),p=d.slice(2,4),c=l.palmLandmarks.arraySync();l.box.dispose(),l.palmLandmarks.dispose(),o.push(kk({startPoint:u,endPoint:p,palmLandmarks:c,confidence:l.confidence},[r/this.inputSize,a/this.inputSize]))}return o}};function kie(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Sk(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return kie(n)}var Nk=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Zr(e,t){let n=0;for(let a=0;aig([...s,1],n)),r=this.calculateLandmarksBoundingBox(a);return I0(S0(r),Sie)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),a=I0(S0(n),Ck);a.palmLandmarks=[];for(let r=0;r[i[0]*(h[0]-this.inputSize/2),i[1]*(h[1]-this.inputSize/2),i[2]*h[2]]),l=sg(a,[0,0]),d=o.map(h=>[...ig(h,l),h[2]]),u=Ek(r),p=[...Xd(n),1],c=[Zr(p,u[0]),Zr(p,u[1])];return d.map(h=>[h[0]+c[0],h[1]+c[1],h[2]])}async estimateHands(t,n){let a=!1,r;(this.skipped===0||this.skipped>n.hand.skipFrames||!n.hand.landmarks||!n.videoOptimized)&&(r=await this.handDetector.estimateHandBounds(t,n),this.skipped=0),n.videoOptimized&&this.skipped++,r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(a=!0));let s=[];n.hand.skipInitial&&this.detectedHands===0&&(this.skipped=0);for(let i=0;i=n.hand.minConfidence){let x=H(y,[-1,3]),k=x.arraySync();y.dispose(),x.dispose();let b=this.transformRawCoords(k,h,l,c),v=this.getBoxForHandLandmarks(b);this.storedBoxes[i]=v;let I={landmarks:b,confidence:g,box:{topLeft:v.startPoint,bottomRight:v.endPoint}};s.push(I)}else this.storedBoxes[i]=null;y.dispose()}else{let l=I0(S0(o),Ck),d={confidence:o.confidence,box:{topLeft:l.startPoint,bottomRight:l.endPoint}};s.push(d)}}return this.storedBoxes=this.storedBoxes.filter(i=>i!==null),this.detectedHands=s.length,s}calculateLandmarksBoundingBox(t){let n=t.map(i=>i[0]),a=t.map(i=>i[1]),r=[Math.min(...n),Math.min(...a)],s=[Math.max(...n),Math.max(...a)];return{startPoint:r,endPoint:s}}};var Mk={thumb:[1,2,3,4],indexFinger:[5,6,7,8],middleFinger:[9,10,11,12],ringFinger:[13,14,15,16],pinky:[17,18,19,20],palmBase:[0]},Yr,Jr,Fk;async function ug(e,t){let n=await Fk.estimateHands(e,t);if(!n)return[];let a=[];for(let r of n){let s={};if(r.landmarks)for(let l of Object.keys(Mk))s[l]=Mk[l].map(d=>r.landmarks[d]);let i=r.box?[Math.max(0,r.box.topLeft[0]),Math.max(0,r.box.topLeft[1]),Math.min(e.shape[2],r.box.bottomRight[0])-Math.max(0,r.box.topLeft[0]),Math.min(e.shape[1],r.box.bottomRight[1])-Math.max(0,r.box.topLeft[1])]:[],o=[r.box.topLeft[0]/e.shape[2],r.box.topLeft[1]/e.shape[1],(r.box.bottomRight[0]-r.box.topLeft[0])/e.shape[2],(r.box.bottomRight[1]-r.box.topLeft[1])/e.shape[1]];a.push({confidence:Math.round(100*r.confidence)/100,box:i,boxRaw:o,landmarks:r.landmarks,annotations:s})}return a}async function dg(e){!Yr||!Jr?([Yr,Jr]=await Promise.all([e.hand.enabled?Gt(Yt(e.modelBasePath,e.hand.detector.modelPath),{fromTFHub:e.hand.detector.modelPath.includes("tfhub.dev")}):null,e.hand.landmarks?Gt(Yt(e.modelBasePath,e.hand.skeleton.modelPath),{fromTFHub:e.hand.skeleton.modelPath.includes("tfhub.dev")}):null]),e.hand.enabled&&(!Yr||!Yr.modelUrl?he("load model failed:",e.hand.detector.modelPath):e.debug&&he("load model:",Yr.modelUrl),!Jr||!Jr.modelUrl?he("load model failed:",e.hand.skeleton.modelPath):e.debug&&he("load model:",Jr.modelUrl))):(e.debug&&he("cached model:",Yr.modelUrl),e.debug&&he("cached model:",Jr.modelUrl));let t=new rg(Yr);return Fk=new og(t,Jr),[Yr,Jr]}var pg={};ma(pg,{load:()=>cg,predict:()=>hg});var $k=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPalm","rightPalm","leftIndex","rightIndex","leftPinky","rightPinky","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","midHip","forehead","leftThumb","leftHand","rightThumb","rightHand"],Dk=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","left:15","right:16","left:17","right:18","left:19","right:20","left:21","right:22","leftChest","rightChest","neck","forehead","left:27","right:28","left:29","right:30"];var Cn;async function cg(e){return Cn?e.debug&&he("cached model:",Cn.modelUrl):(Cn=await Gt(Yt(e.modelBasePath,e.body.modelPath)),Cn.width=parseInt(Cn.signature.inputs["input_1:0"].tensorShape.dim[2].size),Cn.height=parseInt(Cn.signature.inputs["input_1:0"].tensorShape.dim[1].size),!Cn||!Cn.modelUrl?he("load model failed:",e.body.modelPath):e.debug&&he("load model:",Cn.modelUrl)),Cn}async function hg(e,t){if(!Cn||!t.body.enabled)return null;let n={width:e.shape[2],height:e.shape[1]},a=Ye.resizeBilinear(e,[Cn.width,Cn.height],!1),r=ge(a,[255]);a.dispose();let s=await Cn.predict(r),i=s.find(p=>p.size===195||p.size===155).dataSync();s.forEach(p=>p.dispose()),r.dispose();let o=[],l=i.length===195?$k:Dk,d=5;for(let p=0;pc.score>p?c.score:p,0),keypoints:o}]}var fg={};ma(fg,{load:()=>Ag,predict:()=>yg});var N0=[{class:1,label:"person"},{class:2,label:"bicycle"},{class:3,label:"car"},{class:4,label:"motorcycle"},{class:5,label:"airplane"},{class:6,label:"bus"},{class:7,label:"train"},{class:8,label:"truck"},{class:9,label:"boat"},{class:10,label:"traffic light"},{class:11,label:"fire hydrant"},{class:12,label:"stop sign"},{class:13,label:"parking meter"},{class:14,label:"bench"},{class:15,label:"bird"},{class:16,label:"cat"},{class:17,label:"dog"},{class:18,label:"horse"},{class:19,label:"sheep"},{class:20,label:"cow"},{class:21,label:"elephant"},{class:22,label:"bear"},{class:23,label:"zebra"},{class:24,label:"giraffe"},{class:25,label:"backpack"},{class:26,label:"umbrella"},{class:27,label:"handbag"},{class:28,label:"tie"},{class:29,label:"suitcase"},{class:30,label:"frisbee"},{class:31,label:"skis"},{class:32,label:"snowboard"},{class:33,label:"sports ball"},{class:34,label:"kite"},{class:35,label:"baseball bat"},{class:36,label:"baseball glove"},{class:37,label:"skateboard"},{class:38,label:"surfboard"},{class:39,label:"tennis racket"},{class:40,label:"bottle"},{class:41,label:"wine glass"},{class:42,label:"cup"},{class:43,label:"fork"},{class:44,label:"knife"},{class:45,label:"spoon"},{class:46,label:"bowl"},{class:47,label:"banana"},{class:48,label:"apple"},{class:49,label:"sandwich"},{class:50,label:"orange"},{class:51,label:"broccoli"},{class:52,label:"carrot"},{class:53,label:"hot dog"},{class:54,label:"pizza"},{class:55,label:"donut"},{class:56,label:"cake"},{class:57,label:"chair"},{class:58,label:"couch"},{class:59,label:"potted plant"},{class:60,label:"bed"},{class:61,label:"dining table"},{class:62,label:"toilet"},{class:63,label:"tv"},{class:64,label:"laptop"},{class:65,label:"mouse"},{class:66,label:"remote"},{class:67,label:"keyboard"},{class:68,label:"cell phone"},{class:69,label:"microwave"},{class:70,label:"oven"},{class:71,label:"toaster"},{class:72,label:"sink"},{class:73,label:"refrigerator"},{class:74,label:"book"},{class:75,label:"clock"},{class:76,label:"vase"},{class:77,label:"scissors"},{class:78,label:"teddy bear"},{class:79,label:"hair drier"},{class:80,label:"toothbrush"}];var Rn,mg=[],T0=Number.MAX_SAFE_INTEGER,E0=2.5;async function Ag(e){if(Rn)e.debug&&he("cached model:",Rn.modelUrl);else{Rn=await Gt(Yt(e.modelBasePath,e.object.modelPath));let t=Object.values(Rn.modelSignature.inputs);if(Rn.inputSize=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):null,!Rn.inputSize)throw new Error(`Human: Cannot determine model inputSize: ${e.object.modelPath}`);!Rn||!Rn.modelUrl?he("load model failed:",e.object.modelPath):e.debug&&he("load model:",Rn.modelUrl)}return Rn}async function Eie(e,t,n,a){let r=0,s=[];for(let d of[1,2,4])L(()=>{var A,y;let u=d*13,p=(A=e.find(g=>g.shape[1]===u**2&&g.shape[2]===N0.length))==null?void 0:A.squeeze(),c=(y=e.find(g=>g.shape[1]===u**2&&g.shape[2]a.object.minConfidence&&x!==61){let b=(.5+Math.trunc(g%u))/u,v=(.5+Math.trunc(g/u))/u,I=m[g].map(U=>U*(u/d/t)),[T,R]=[b-E0/d*I[0],v-E0/d*I[1]],[$,z]=[b+E0/d*I[2]-T,v+E0/d*I[3]-R],_=[T,R,$,z];_=_.map(U=>Math.max(0,Math.min(U,1)));let V=[_[0]*n[0],_[1]*n[1],_[2]*n[0],_[3]*n[1]],j={id:r++,strideSize:d,score:Math.round(100*k)/100,class:x+1,label:N0[x].label,center:[Math.trunc(n[0]*b),Math.trunc(n[1]*v)],centerRaw:[b,v],box:V.map(U=>Math.trunc(U)),boxRaw:_};s.push(j)}}});e.forEach(d=>Ee(d));let i=s.map(d=>d.boxRaw),o=s.map(d=>d.score),l=[];if(i&&i.length>0){let d=await Ye.nonMaxSuppressionAsync(i,o,a.object.maxDetected,a.object.iouThreshold,a.object.minConfidence);l=d.dataSync(),Ee(d)}return s=s.filter((d,u)=>l.includes(u)).sort((d,u)=>u.score-d.score),s}async function yg(e,t){return Rn?T00?(T0++,mg):(t.videoOptimized?T0=0:T0=Number.MAX_SAFE_INTEGER,new Promise(async n=>{let a=[e.shape[2],e.shape[1]],r=Ye.resizeBilinear(e,[Rn.inputSize,Rn.inputSize],!1),s=r.div(255),i=s.transpose([0,3,1,2]);s.dispose(),r.dispose();let o;t.object.enabled&&(o=await Rn.predict(i)),i.dispose();let l=await Eie(o,Rn.inputSize,a,t);mg=l,n(l)})):null}var Ok=e=>{if(!e)return[];let t=[];for(let n=0;nl.part==="leftWrist"),r=e[n].keypoints.find(l=>l.part==="rightWrist"),s=e[n].keypoints.find(l=>l.part==="nose");s&&a&&r&&a.position.yl.part==="leftShoulder"),o=e[n].keypoints.find(l=>l.part==="rightShoulder");i&&o&&t.push({body:n,gesture:`leaning ${i.position.y>o.position.y?"left":"right"}`})}return t},zk=e=>{if(!e)return[];let t=[];for(let n=0;n0){let a=e[n].mesh[33][2]-e[n].mesh[263][2];Math.abs(a)<10?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${a<0?"left":"right"}`}),Math.abs(e[n].mesh[374][1]-e[n].mesh[386][1])/Math.abs(e[n].mesh[443][1]-e[n].mesh[450][1])<.2&&t.push({face:n,gesture:"blink left eye"}),Math.abs(e[n].mesh[145][1]-e[n].mesh[159][1])/Math.abs(e[n].mesh[223][1]-e[n].mesh[230][1])<.2&&t.push({face:n,gesture:"blink right eye"});let i=Math.min(100,500*Math.abs(e[n].mesh[13][1]-e[n].mesh[14][1])/Math.abs(e[n].mesh[10][1]-e[n].mesh[152][1]));i>10&&t.push({face:n,gesture:`mouth ${Math.trunc(i)}% open`});let o=e[n].mesh[152][2];Math.abs(o)>10&&t.push({face:n,gesture:`head ${o<0?"up":"down"}`})}return t},_k=e=>{if(!e)return[];let t=[];for(let n=0;n.033||p>.033)&&(d=!1),c>.033&&t.push({iris:n,gesture:"looking right"}),p>.033&&t.push({iris:n,gesture:"looking left"});let h=Math.abs(e[n].mesh[145][1]-e[n].annotations.rightEyeIris[0][1])/e[n].annotations.rightEyeIris[0][1],m=Math.abs(e[n].mesh[374][1]-e[n].annotations.leftEyeIris[0][1])/e[n].annotations.leftEyeIris[0][1];(m<.015||h<.015||m>.03||h>.03)&&(d=!1),(m<.015||h<.015)&&t.push({iris:n,gesture:"looking down"}),(m>.03||h>.03)&&t.push({iris:n,gesture:"looking up"}),d&&t.push({iris:n,gesture:"looking center"})}return t},Pk=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=a.reduce((i,o)=>i.position[2]i.position[1]xg});function Cie(e,t,n){let a=function(o,l,d){let u=new RegExp("\\b"+l+" \\w+ (\\w+)","ig");o.replace(u,(p,c)=>(d[c]=0,p))},r=function(o,l){let d=e.createShader(l);if(e.shaderSource(d,o),e.compileShader(d),!e.getShaderParameter(d,e.COMPILE_STATUS))throw new Error("Filter: GL compile failed",e.getShaderInfoLog(d));return d};this.uniform={},this.attribute={};let s=r(t,e.VERTEX_SHADER),i=r(n,e.FRAGMENT_SHADER);if(this.id=e.createProgram(),e.attachShader(this.id,s),e.attachShader(this.id,i),e.linkProgram(this.id),!e.getProgramParameter(this.id,e.LINK_STATUS))throw new Error("Filter: GL link failed",e.getProgramInfoLog(this.id));e.useProgram(this.id),a(t,"attribute",this.attribute);for(let o in this.attribute)this.attribute[o]=e.getAttribLocation(this.id,o);a(t,"uniform",this.uniform),a(n,"uniform",this.uniform);for(let o in this.uniform)this.uniform[o]=e.getUniformLocation(this.id,o)}function Lk(e){e||(e={});let t=0,n=null,a=!1,r=-1,s=[null,null],i=[],o=-1,l=-1,d=null,u=null,p={},c=e.canvas||document.createElement("canvas"),h={},m={INTERMEDIATE:1},f=c.getContext("webgl");if(!f)throw new Error("Filter: getContext() failed");this.addFilter=function(b){let v=Array.prototype.slice.call(arguments,1),I=p[b];i.push({func:I,args:v})},this.reset=function(){i=[]};let A=function(b,v){if(!(b===o&&v===l)){if(c.width=b,o=b,c.height=v,l=v,!d){let I=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);d=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,d),f.bufferData(f.ARRAY_BUFFER,I,f.STATIC_DRAW),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}f.viewport(0,0,o,l),s=[null,null]}},y=function(b,v){let I=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,I);let T=f.createRenderbuffer();f.bindRenderbuffer(f.RENDERBUFFER,T);let R=f.createTexture();return f.bindTexture(f.TEXTURE_2D,R),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,b,v,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,R,0),f.bindTexture(f.TEXTURE_2D,null),f.bindFramebuffer(f.FRAMEBUFFER,null),{fbo:I,texture:R}},g=function(b){return s[b]=s[b]||y(o,l),s[b]},x=function(b=null){var R,$;let v=null,I=null,T=!1;t===0?v=n:v=(R=g(r))==null?void 0:R.texture,t++,a&&!(b&m.INTERMEDIATE)?(I=null,T=t%2==0):(r=(r+1)%2,I=($=g(r))==null?void 0:$.fbo),f.bindTexture(f.TEXTURE_2D,v),f.bindFramebuffer(f.FRAMEBUFFER,I),f.uniform1f(u.uniform.flipY,T?-1:1),f.drawArrays(f.TRIANGLES,0,6)};this.apply=function(b){if(A(b.width,b.height),t=0,n||(n=f.createTexture()),f.bindTexture(f.TEXTURE_2D,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b),i.length===0)return x(),c;for(let v=0;v0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0,i=r,o=s;if(i>C0&&(i=C0,o=i*s/r),o>C0&&(o=C0,i=o*r/s),t.filter.width>0?i=t.filter.width:t.filter.height>0&&(i=r*(t.filter.height/s)),t.filter.height>0?o=t.filter.height:t.filter.width>0&&(o=s*(t.filter.width/r)),!i||!o)throw new Error("Human: Input cannot determine dimension");(!Ce||(Ce==null?void 0:Ce.width)!==i||(Ce==null?void 0:Ce.height)!==o)&&(Ce=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas"),(Ce==null?void 0:Ce.width)!==i&&(Ce.width=i),(Ce==null?void 0:Ce.height)!==o&&(Ce.height=o));let l=Ce.getContext("2d");if(e instanceof ImageData?l.putImageData(e,0,0):t.filter.flip&&typeof l.translate!="undefined"?(l.translate(r,0),l.scale(-1,1),l.drawImage(e,0,0,r,s,0,0,Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height),l.setTransform(1,0,0,1,0,0)):l.drawImage(e,0,0,r,s,0,0,Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height),t.filter.enabled){if((!Ft||!gt||Ce.width!==gt.width||(Ce==null?void 0:Ce.height)!==(gt==null?void 0:gt.height))&&(gt=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(Ce==null?void 0:Ce.width,Ce==null?void 0:Ce.height):document.createElement("canvas"),(gt==null?void 0:gt.width)!==(Ce==null?void 0:Ce.width)&&(gt.width=Ce==null?void 0:Ce.width),(gt==null?void 0:gt.height)!==(Ce==null?void 0:Ce.height)&&(gt.height=Ce==null?void 0:Ce.height),Ft=Aa.flags.IS_BROWSER?new Lk({canvas:gt}):null),!Ft)return{tensor:null,canvas:Ce};Ft.reset(),Ft.addFilter("brightness",t.filter.brightness),t.filter.contrast!==0&&Ft.addFilter("contrast",t.filter.contrast),t.filter.sharpness!==0&&Ft.addFilter("sharpen",t.filter.sharpness),t.filter.blur!==0&&Ft.addFilter("blur",t.filter.blur),t.filter.saturation!==0&&Ft.addFilter("saturation",t.filter.saturation),t.filter.hue!==0&&Ft.addFilter("hue",t.filter.hue),t.filter.negative&&Ft.addFilter("negative"),t.filter.sepia&&Ft.addFilter("sepia"),t.filter.vintage&&Ft.addFilter("brownie"),t.filter.sepia&&Ft.addFilter("sepia"),t.filter.kodachrome&&Ft.addFilter("kodachrome"),t.filter.technicolor&&Ft.addFilter("technicolor"),t.filter.polaroid&&Ft.addFilter("polaroid"),t.filter.pixelate!==0&&Ft.addFilter("pixelate",t.filter.pixelate),Ft.apply(Ce)}else gt=Ce,Ft&&(Ft=null);let d;if(gt.data){let p=[gt.height,gt.width,3];d=pc(gt.data,p,"int32")}else if(gt instanceof ImageData)d=oi.fromPixels(gt);else if(t.backend==="webgl"||t.backend==="humangl"){let p=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");p.width=i,p.height=o;let c=p.getContext("2d");c==null||c.drawImage(gt,0,0),d=oi.fromPixels(p)}else{let p=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(i,o):document.createElement("canvas");p.width=i,p.height=o;let c=p.getContext("2d");c==null||c.drawImage(gt,0,0);let h=c==null?void 0:c.getImageData(0,0,i,o);d=oi.fromPixels(h)}let u=d.toFloat();n=u.expandDims(0),d.dispose(),u.dispose()}let a=t.filter.return?gt:null;return{tensor:n,canvas:a}}var bg={};ma(bg,{all:()=>Mie,body:()=>Vk,canvas:()=>Rie,face:()=>Bk,gesture:()=>Wk,hand:()=>jk,object:()=>Uk,options:()=>_i});var dt={backend:"webgl",modelBasePath:"../models/",wasmPath:"../assets/",debug:!0,async:!0,videoOptimized:!0,warmup:"face",filter:{enabled:!0,width:0,height:0,flip:!1,return:!0,brightness:0,contrast:0,sharpness:0,blur:0,saturation:0,hue:0,negative:!1,sepia:!1,vintage:!1,kodachrome:!1,technicolor:!1,polaroid:!1,pixelate:0},gesture:{enabled:!0},face:{enabled:!0,detector:{modelPath:"blazeface.json",rotation:!1,maxDetected:10,skipFrames:21,skipInitial:!1,minConfidence:.2,iouThreshold:.1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json"},iris:{enabled:!0,modelPath:"iris.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:31,minConfidence:.1},emotion:{enabled:!0,minConfidence:.1,skipFrames:32,modelPath:"emotion.json"}},body:{enabled:!0,modelPath:"posenet.json",maxDetected:1,minConfidence:.2},hand:{enabled:!0,rotation:!1,skipFrames:12,skipInitial:!1,minConfidence:.1,iouThreshold:.1,maxDetected:1,landmarks:!0,detector:{modelPath:"handdetect.json"},skeleton:{modelPath:"handskeleton.json"}},object:{enabled:!1,modelPath:"nanodet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:41}};var _i={color:"rgba(173, 216, 230, 0.3)",labelColor:"rgba(173, 216, 230, 1)",shadowColor:"black",font:'small-caps 16px "Segoe UI"',lineHeight:24,lineWidth:6,pointSize:2,roundRect:28,drawPoints:!1,drawLabels:!0,drawBoxes:!1,drawPolygons:!0,fillPolygons:!1,useDepth:!0,useCurves:!1,bufferedOutput:!1,useRawBoxes:!1,calculateHandBox:!0};function R0(e,t,n,a=0,r){e.fillStyle=r.useDepth&&a?`rgba(${127.5+2*a}, ${127.5-2*a}, 255, 0.3)`:r.color,e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function Pi(e,t,n,a,r,s){if(e.beginPath(),s.useCurves){let i=(t+t+a)/2,o=(n+n+r)/2;e.ellipse(i,o,a/2,r/2,0,0,2*Math.PI)}else e.lineWidth=s.lineWidth,e.moveTo(t+s.roundRect,n),e.lineTo(t+a-s.roundRect,n),e.quadraticCurveTo(t+a,n,t+a,n+s.roundRect),e.lineTo(t+a,n+r-s.roundRect),e.quadraticCurveTo(t+a,n+r,t+a-s.roundRect,n+r),e.lineTo(t+s.roundRect,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s.roundRect),e.lineTo(t,n+s.roundRect),e.quadraticCurveTo(t,n,t+s.roundRect,n),e.closePath();e.stroke()}function vg(e,t=[],n){if(!(t===void 0||t.length===0)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let a of t)e.strokeStyle=n.useDepth&&a[2]?`rgba(${127.5+2*a[2]}, ${127.5-2*a[2]}, 255, 0.3)`:n.color,e.fillStyle=n.useDepth&&a[2]?`rgba(${127.5+2*a[2]}, ${127.5-2*a[2]}, 255, 0.3)`:n.color,e.lineTo(a[0],parseInt(a[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Kd(e,t=[],n){if(!(t===void 0||t.length===0)){if(!n.useCurves||t.length<=2){vg(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let a=0;a1&&l[1].length>0){let d=o[1]>0?`#${o[1]}`:"",u=`${o[0]} ${d}: ${l[1]}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(u,8,2+s*a.lineHeight)),r.fillStyle=a.labelColor,r.fillText(u,6,0+s*a.lineHeight),s+=1}}}async function Bk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r)for(let s of t){r.font=a.font,r.strokeStyle=a.color,r.fillStyle=a.color,a.drawBoxes&&(a.useRawBoxes?Pi(r,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],a):Pi(r,s.box[0],s.box[1],s.box[2],s.box[3],a));let i=[];if(i.push(`face confidence: ${Math.trunc(100*s.confidence)}%`),s.genderConfidence&&i.push(`${s.gender||""} ${Math.trunc(100*s.genderConfidence)}% confident`),s.age&&i.push(`age: ${s.age||""}`),s.iris&&i.push(`iris distance: ${s.iris}`),s.emotion&&s.emotion.length>0){let o=s.emotion.map(l=>`${Math.trunc(100*l.score)}% ${l.emotion}`);i.push(o.join(" "))}s.rotation&&s.rotation.angle&&s.rotation.angle.roll&&i.push(`roll: ${Math.trunc(100*s.rotation.angle.roll)/100} yaw:${Math.trunc(100*s.rotation.angle.yaw)/100} pitch:${Math.trunc(100*s.rotation.angle.pitch)/100}`),i.length===0&&i.push("face"),r.fillStyle=a.color;for(let o=i.length-1;o>=0;o--){let l=Math.max(s.box[0],0),d=o*a.lineHeight+s.box[1];a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i[o],l+5,d+16)),r.fillStyle=a.labelColor,r.fillText(i[o],l+4,d+15)}if(r.lineWidth=1,s.mesh&&s.mesh.length>0){if(a.drawPoints)for(let o of s.mesh)R0(r,o[0],o[1],o[2],a);if(a.drawPolygons){r.lineWidth=1;for(let o=0;os.mesh[d]);vg(r,l,a)}if(s.annotations&&s.annotations.leftEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let o=Math.abs(s.annotations.leftEyeIris[3][0]-s.annotations.leftEyeIris[1][0])/2,l=Math.abs(s.annotations.leftEyeIris[4][1]-s.annotations.leftEyeIris[2][1])/2;r.ellipse(s.annotations.leftEyeIris[0][0],s.annotations.leftEyeIris[0][1],o,l,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}if(s.annotations&&s.annotations.rightEyeIris){r.strokeStyle=a.useDepth?"rgba(255, 200, 255, 0.3)":a.color,r.beginPath();let o=Math.abs(s.annotations.rightEyeIris[3][0]-s.annotations.rightEyeIris[1][0])/2,l=Math.abs(s.annotations.rightEyeIris[4][1]-s.annotations.rightEyeIris[2][1])/2;r.ellipse(s.annotations.rightEyeIris[0][0],s.annotations.rightEyeIris[0][1],o,l,0,0,2*Math.PI),r.stroke(),a.fillPolygons&&(r.fillStyle=a.useDepth?"rgba(255, 255, 200, 0.3)":a.color,r.fill())}}}}}var Qr=[];async function Vk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round";for(let s=0;sl.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),o.length===4&&vg(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftKnee"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftAnkle"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftHeel"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftFoot"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightHip"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightKnee"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightAnkle"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightHeel"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightFoot"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="leftShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftElbow"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftWrist"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="leftPalm"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a),o.length=0,i=t[s].keypoints.find(l=>l.part==="rightShoulder"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightElbow"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightWrist"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),i=t[s].keypoints.find(l=>l.part==="rightPalm"),i&&i.score>dt.body.minConfidence&&o.push([i.position.x,i.position.y]),Kd(r,o,a)}}}}async function jk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t){if(a.drawBoxes){r.strokeStyle=a.color,r.fillStyle=a.color;let i;if(!a.calculateHandBox)i=a.useRawBoxes?s.boxRaw:s.box;else if(i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],s.landmarks&&s.landmarks.length>0){for(let o of s.landmarks)o[0]i[2]&&(i[2]=o[0]),o[1]>i[3]&&(i[3]=o[1]);i[2]-=i[0],i[3]-=i[1]}a.useRawBoxes?Pi(r,e.width*i[0],e.height*i[1],e.width*i[2],e.height*i[3],a):Pi(r,i[0],i[1],i[2],i[3],a),a.drawLabels&&(a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText("hand",i[0]+3,1+i[1]+a.lineHeight,i[2])),r.fillStyle=a.labelColor,r.fillText("hand",i[0]+2,0+i[1]+a.lineHeight,i[2])),r.stroke()}if(a.drawPoints&&s.landmarks&&s.landmarks.length>0)for(let i of s.landmarks)r.fillStyle=a.useDepth?`rgba(${127.5+2*i[2]}, ${127.5-2*i[2]}, 255, 0.5)`:a.color,R0(r,i[0],i[1],0,a);if(a.drawPolygons){let i=o=>{if(!!o)for(let l=0;l0?l-1:0][0],o[l>0?l-1:0][1]),r.lineTo(o[l][0],o[l][1]),r.stroke()};i(s.annotations.indexFinger),i(s.annotations.middleFinger),i(s.annotations.ringFinger),i(s.annotations.pinky),i(s.annotations.thumb)}}}}async function Uk(e,t,n){let a=Hn(_i,n);if(!t||!e||!(e instanceof HTMLCanvasElement))return;let r=e.getContext("2d");if(!!r){r.lineJoin="round",r.font=a.font;for(let s of t)if(a.drawBoxes){if(r.strokeStyle=a.color,r.fillStyle=a.color,a.useRawBoxes?Pi(r,e.width*s.boxRaw[0],e.height*s.boxRaw[1],e.width*s.boxRaw[2],e.height*s.boxRaw[3],a):Pi(r,s.box[0],s.box[1],s.box[2],s.box[3],a),a.drawLabels){let i=`${Math.round(100*s.score)}% ${s.label}`;a.shadowColor&&a.shadowColor!==""&&(r.fillStyle=a.shadowColor,r.fillText(i,s.box[0]+3,1+s.box[1]+a.lineHeight,s.box[2])),r.fillStyle=a.labelColor,r.fillText(i,s.box[0]+2,0+s.box[1]+a.lineHeight,s.box[2])}r.stroke()}}}async function Rie(e,t){if(!e||!t||!(e instanceof HTMLCanvasElement)||!(t instanceof HTMLCanvasElement))return;let n=e.getContext("2d");n==null||n.drawImage(e,0,0)}async function Mie(e,t,n){let a=Hn(_i,n);!t||!e||e instanceof HTMLCanvasElement&&(Bk(e,t.face,a),Vk(e,t.body,a),jk(e,t.hand,a),Wk(e,t.gesture,a),Uk(e,t.object,a))}var M0=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -4344,7 +4344,7 @@ PQ4GJ+ashuK0MhWaoWcA0AaOmASMK7jRNPWYBmHyiuepO2x10qfcv6vYxCzYqoGK4HVYVTJrmb5l c6oaM5TUJ8EgGsG4kLNUHT0M64OaqMMikSRsuKbnFMRLG3zVehOaGNE445NNlnVFpDMu6uie9Vo1 8z5mOAOST2pDK91cNN+5tsrH3PrW54a06KxT7fdrlh/q1Pc+tJ6IUdZGvHPLezMcnBOWbsPap5r3 ylFtbdT1xUWNWzU0/Zbwlgfmx8zGsHWtRHmMqE59aAMyNifvHPc1f0gtPdqkY5JosJHeNci2tktY -euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,M0=` +euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,F0=` /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAsICAoIBwsKCQoNDAsNERwSEQ8PESIZGhQcKSQrKigk JyctMkA3LTA9MCcnOEw5PUNFSElIKzZPVU5GVEBHSEX/2wBDAQwNDREPESESEiFFLicuRUVFRUVF RUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUX/wAARCASwBLADASIA @@ -4912,7 +4912,7 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;var W8="1.8.0";var Zl,Zc,Yc,Li,F0,Jc,$0,D0,O0,B8=class{constructor(t={}){Zl.set(this,void 0);Zc.set(this,void 0);Yc.set(this,void 0);Li.set(this,void 0);this.analyze=(...t)=>{if(!rr(this,Zc))return;let n=this.tf.engine().state.numTensors,r=rr(this,Zl);rs(this,Zl,n);let a=n-r;a!==0&&pe(...t,a)};F0.set(this,t=>{if(!rr(this,Yc))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});Jc.set(this,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let r=it();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&pe("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&pe("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&pe("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let a=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&pe(`wasm execution: ${a?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!a&&pe("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&Y4();try{await this.tf.setBackend(this.config.backend)}catch(a){pe("error: cannot set backend:",this.config.backend,a)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(pe("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let a=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&pe(`gl version:${a.getParameter(a.VERSION)} renderer:${a.getParameter(a.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(it()-r)}});$0.set(this,async()=>{let t=(a,s="application/octet-stream")=>fetch(`data:${s};base64,${a}`).then(i=>i.blob()),n,r;switch(this.config.warmup){case"face":n=await t(R0);break;case"full":n=await t(M0);break;default:n=null}if(n){let a=await createImageBitmap(n);r=await this.detect(a,this.config),a.close()}return r});D0.set(this,async()=>new Promise(t=>{let n,r=0;switch(this.config.warmup){case"face":r=256,n="data:image/jpeg;base64,"+R0;break;case"full":case"body":r=1200,n="data:image/jpeg;base64,"+M0;break;default:n=null}let a=new Image;a.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(r,r):document.createElement("canvas");s.width=a.naturalWidth,s.height=a.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(a,0,0);let o=await this.detect(s,this.config);t(o)},n?a.src=n:t(null)}));O0.set(this,async()=>{let t=a=>Buffer.from(a,"base64"),n;if(this.config.warmup==="face"&&(n=t(R0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(M0)),!n)return null;let r;if(typeof void 0!="undefined"){let a=(void 0).decodeJpeg(n),s=a.expandDims(0);this.tf.dispose(a),r=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&pe("Warmup tfjs-node not loaded");return r});this.tf=lu,this.draw=xg,this.version=W8,this.config=Hn(ct,t),this.state="idle",rs(this,Zl,0),rs(this,Zc,!1),rs(this,Yc,!1),rs(this,Li,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=n=>gg(n,this.config),this.classes={facemesh:H2,emotion:R2,faceres:D2,body:this.config.body.modelPath.includes("posenet")?Q2:cg,hand:ig,nanodet:pg},this.faceTriangulation=l8,this.faceUVMap=u8,this.sysinfo=$g()}similarity(t,n){return z2(t,n)}enhance(t){return P2(t)}match(t,n,r=0){return J4(t,n,r)}async load(t={}){this.state="load";let n=it();t&&(this.config=Hn(this.config,t)),rr(this,Li)&&(this.config.debug&&pe(`version: ${this.version}`),this.config.debug&&pe(`tfjs version: ${this.tf.version_core}`),this.config.debug&&pe("platform:",this.sysinfo.platform),this.config.debug&&pe("agent:",this.sysinfo.agent),await rr(this,Jc).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&pe("configuration:",this.config),this.config.debug&&pe("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?q2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?$2(this.config):null),this.models.handpose||(this.config.hand.enabled?ug(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?tg(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?hg(this.config):null),this.models.nanodet||(this.config.object.enabled?mg(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?O2(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await q2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await $2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await ug(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await tg(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await hg(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await mg(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await O2(this.config))),rr(this,Li)&&(this.config.debug&&pe("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),rs(this,Li,!1));let r=Math.trunc(it()-n);r>(this.perf.load||0)&&(this.perf.load=r)}async detect(t,n={}){return new Promise(async r=>{var A,y;this.state="config";let a;this.config=Hn(this.config,n),this.state="check";let s=rr(this,F0).call(this,t);s&&(pe(s,t),r({error:s}));let i=it();await rr(this,Jc).call(this),await this.load();let o;t&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof Image!="undefined"&&t instanceof Image||typeof ImageData!="undefined"&&t instanceof ImageData||typeof ImageBitmap!="undefined"&&yg instanceof ImageBitmap)&&(pe("disabling video optimization"),o=this.config.videoOptimized,this.config.videoOptimized=!1),a=it();let l=gg(t,this.config);if(!l||!l.tensor){pe("could not convert input to tensor"),r({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(it()-a),this.analyze("Get Image:");let c,u,h,d,p;this.config.async?(h=this.config.face.enabled?L2(this,l.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",a=it(),h=this.config.face.enabled?await L2(this,l.tensor):[],p=Math.trunc(it()-a),p>0&&(this.perf.face=p)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?eg(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(c=this.config.body.enabled?dg(l.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",a=it(),this.config.body.modelPath.includes("posenet")?c=this.config.body.enabled?await eg(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(c=this.config.body.enabled?await dg(l.tensor,this.config):[]),p=Math.trunc(it()-a),p>0&&(this.perf.body=p)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?(A=this.models.handpose)==null?void 0:A.estimateHands(l.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",a=it(),u=this.config.hand.enabled?await((y=this.models.handpose)==null?void 0:y.estimateHands(l.tensor,this.config)):[],p=Math.trunc(it()-a),p>0&&(this.perf.hand=p)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(d=this.config.object.enabled?Ag(l.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",a=it(),d=this.config.object.enabled?await Ag(l.tensor,this.config):[],p=Math.trunc(it()-a),p>0&&(this.perf.object=p)),this.analyze("End Object:"),this.config.async&&([h,c,u,d]=await Promise.all([h,c,u,d])),Te(l.tensor);let m=[];this.config.gesture.enabled&&(a=it(),m=[...R8(h),...C8(c),...F8(u),...M8(h)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(it()-a)),o&&(this.config.videoOptimized=o),this.perf.total=Math.trunc(it()-i),this.state="idle";let f={face:h,body:c,hand:u,gesture:m,object:d,performance:this.perf,canvas:l.canvas};r(f)})}async warmup(t={}){let n=it();if(t&&(this.config=Hn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let r=this.config.videoOptimized;this.config.videoOptimized=!1;let a;typeof createImageBitmap=="function"?a=await rr(this,$0).call(this):typeof Image!="undefined"?a=await rr(this,D0).call(this):a=await rr(this,O0).call(this),this.config.videoOptimized=r;let s=it();return this.config.debug&&pe("Warmup",this.config.warmup,Math.round(s-n),"ms",a),a}};Zl=new WeakMap,Zc=new WeakMap,Yc=new WeakMap,Li=new WeakMap,F0=new WeakMap,Jc=new WeakMap,$0=new WeakMap,D0=new WeakMap,O0=new WeakMap;return Cie;})(); +2Q==`;var Hk="1.8.0";var Zl,Zd,Yd,Li,$0,Jd,D0,O0,z0,Gk=class{constructor(t={}){Zl.set(this,void 0);Zd.set(this,void 0);Yd.set(this,void 0);Li.set(this,void 0);this.analyze=(...t)=>{if(!aa(this,Zd))return;let n=this.tf.engine().state.numTensors,a=aa(this,Zl);as(this,Zl,n);let r=n-a;r!==0&&he(...t,r)};$0.set(this,t=>{if(!aa(this,Yd))return null;if(!t)return"input is not defined";if(this.tf.ENV.flags.IS_NODE&&!(t instanceof Le))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});Jd.set(this,async(t=!1)=>{var n;if(this.config.backend&&this.config.backend.length>0&&t||this.tf.getBackend()!==this.config.backend){let a=it();if(this.state="backend",this.config.backend&&this.config.backend.length>0){if(typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&this.config.debug&&he("running inside web worker"),this.tf.ENV.flags.IS_BROWSER&&this.config.backend==="tensorflow"&&(this.config.backend="webgl"),this.tf.ENV.flags.IS_NODE&&(this.config.backend==="webgl"||this.config.backend==="humangl")&&(this.config.backend="tensorflow"),this.config.debug&&he("setting backend:",this.config.backend),this.config.backend==="wasm"){if(this.config.debug&&he("wasm path:",this.config.wasmPath),typeof((n=this.tf)==null?void 0:n.setWasmPaths)!="undefined")this.tf.setWasmPaths(this.config.wasmPath);else throw new Error("Human: WASM backend is not loaded");let r=await this.tf.env().getAsync("WASM_HAS_SIMD_SUPPORT"),s=await this.tf.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT");this.config.debug&&he(`wasm execution: ${r?"SIMD":"no SIMD"} ${s?"multithreaded":"singlethreaded"}`),this.config.debug&&!r&&he("warning: wasm simd support is not enabled")}this.config.backend==="humangl"&&J8();try{await this.tf.setBackend(this.config.backend)}catch(r){he("error: cannot set backend:",this.config.backend,r)}}if(this.tf.enableProdMode(),this.tf.getBackend()==="webgl"||this.tf.getBackend()==="humangl"){this.tf.ENV.set("CHECK_COMPUTATION_FOR_ERRORS",!1),this.tf.ENV.set("WEBGL_PACK_DEPTHWISECONV",!0),typeof this.config.deallocate!="undefined"&&(he("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),this.tf.ENV.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0));let r=await this.tf.backend().getGPGPUContext().gl;this.config.debug&&he(`gl version:${r.getParameter(r.VERSION)} renderer:${r.getParameter(r.RENDERER)}`)}await this.tf.ready(),this.perf.backend=Math.trunc(it()-a)}});D0.set(this,async()=>{let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),n,a;switch(this.config.warmup){case"face":n=await t(M0);break;case"full":n=await t(F0);break;default:n=null}if(n){let r=await createImageBitmap(n);a=await this.detect(r,this.config),r.close()}return a});O0.set(this,async()=>new Promise(t=>{let n,a=0;switch(this.config.warmup){case"face":a=256,n="data:image/jpeg;base64,"+M0;break;case"full":case"body":a=1200,n="data:image/jpeg;base64,"+F0;break;default:n=null}let r=new Image;r.onload=async()=>{let s=typeof OffscreenCanvas!="undefined"?new OffscreenCanvas(a,a):document.createElement("canvas");s.width=r.naturalWidth,s.height=r.naturalHeight;let i=s.getContext("2d");i==null||i.drawImage(r,0,0);let o=await this.detect(s,this.config);t(o)},n?r.src=n:t(null)}));z0.set(this,async()=>{let t=r=>Buffer.from(r,"base64"),n;if(this.config.warmup==="face"&&(n=t(M0)),(this.config.warmup==="body"||this.config.warmup==="full")&&(n=t(F0)),!n)return null;let a;if(typeof void 0!="undefined"){let r=(void 0).decodeJpeg(n),s=r.expandDims(0);this.tf.dispose(r),a=await this.detect(s,this.config),this.tf.dispose(s)}else this.config.debug&&he("Warmup tfjs-node not loaded");return a});this.tf=lu,this.draw=bg,this.version=Hk,this.config=Hn(dt,t),this.state="idle",as(this,Zl,0),as(this,Zd,!1),as(this,Yd,!1),as(this,Li,!0),this.perf={},this.models={face:null,posenet:null,blazepose:null,efficientpose:null,handpose:null,iris:null,age:null,gender:null,emotion:null,embedding:null,nanodet:null,faceres:null},this.image=n=>xg(n,this.config),this.classes={facemesh:_2,emotion:B2,faceres:H2,body:this.config.body.modelPath.includes("posenet")?tg:pg,hand:lg,nanodet:fg},this.faceTriangulation=dk,this.faceUVMap=pk,this.sysinfo=Og()}similarity(t,n){return q2(t,n)}enhance(t){return X2(t)}match(t,n,a=0){return ck(t,n,a)}async load(t={}){this.state="load";let n=it();t&&(this.config=Hn(this.config,t)),aa(this,Li)&&(this.config.debug&&he(`version: ${this.version}`),this.config.debug&&he(`tfjs version: ${this.tf.version_core}`),this.config.debug&&he("platform:",this.sysinfo.platform),this.config.debug&&he("agent:",this.sysinfo.agent),await aa(this,Jd).call(this,!0),this.tf.ENV.flags.IS_BROWSER&&(this.config.debug&&he("configuration:",this.config),this.config.debug&&he("tf flags:",this.tf.ENV.flags))),this.config.async?[this.models.face,this.models.emotion,this.models.handpose,this.models.posenet,this.models.blazepose,this.models.nanodet,this.models.faceres]=await Promise.all([this.models.face||(this.config.face.enabled?W2(this.config):null),this.models.emotion||(this.config.face.enabled&&this.config.face.emotion.enabled?U2(this.config):null),this.models.handpose||(this.config.hand.enabled?dg(this.config):null),this.models.posenet||(this.config.body.enabled&&this.config.body.modelPath.includes("posenet")?ag(this.config):null),this.models.blazepose||(this.config.body.enabled&&this.config.body.modelPath.includes("blazepose")?cg(this.config):null),this.models.nanodet||(this.config.object.enabled?Ag(this.config):null),this.models.faceres||(this.config.face.enabled&&this.config.face.description.enabled?G2(this.config):null)]):(this.config.face.enabled&&!this.models.face&&(this.models.face=await W2(this.config)),this.config.face.enabled&&this.config.face.emotion.enabled&&!this.models.emotion&&(this.models.emotion=await U2(this.config)),this.config.hand.enabled&&!this.models.handpose&&(this.models.handpose=await dg(this.config)),this.config.body.enabled&&!this.models.posenet&&this.config.body.modelPath.includes("posenet")&&(this.models.posenet=await ag(this.config)),this.config.body.enabled&&!this.models.blazepose&&this.config.body.modelPath.includes("blazepose")&&(this.models.blazepose=await cg(this.config)),this.config.object.enabled&&!this.models.nanodet&&(this.models.nanodet=await Ag(this.config)),this.config.face.enabled&&this.config.face.description.enabled&&!this.models.faceres&&(this.models.faceres=await G2(this.config))),aa(this,Li)&&(this.config.debug&&he("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),as(this,Li,!1));let a=Math.trunc(it()-n);a>(this.perf.load||0)&&(this.perf.load=a)}async detect(t,n={}){return new Promise(async a=>{this.state="config";let r;this.config=Hn(this.config,n),this.state="check";let s=aa(this,$0).call(this,t);s&&(he(s,t),a({error:s}));let i=it();await aa(this,Jd).call(this),await this.load();let o;t&&this.config.videoOptimized&&typeof window!="undefined"&&typeof WorkerGlobalScope!="undefined"&&(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof Image!="undefined"&&t instanceof Image||typeof ImageData!="undefined"&&t instanceof ImageData||typeof ImageBitmap!="undefined"&&gg instanceof ImageBitmap)&&(he("disabling video optimization"),o=this.config.videoOptimized,this.config.videoOptimized=!1),r=it();let l=xg(t,this.config);if(!l||!l.tensor){he("could not convert input to tensor"),a({error:"could not convert input to tensor"});return}this.perf.image=Math.trunc(it()-r),this.analyze("Get Image:");let d,u,p,c,h;this.config.async?(p=this.config.face.enabled?K2(this,l.tensor):[],this.perf.face&&delete this.perf.face):(this.state="run:face",r=it(),p=this.config.face.enabled?await K2(this,l.tensor):[],h=Math.trunc(it()-r),h>0&&(this.perf.face=h)),this.analyze("Start Body:"),this.config.async?(this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?ng(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(d=this.config.body.enabled?hg(l.tensor,this.config):[]),this.perf.body&&delete this.perf.body):(this.state="run:body",r=it(),this.config.body.modelPath.includes("posenet")?d=this.config.body.enabled?await ng(l.tensor,this.config):[]:this.config.body.modelPath.includes("blazepose")&&(d=this.config.body.enabled?await hg(l.tensor,this.config):[]),h=Math.trunc(it()-r),h>0&&(this.perf.body=h)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.config.async?(u=this.config.hand.enabled?ug(l.tensor,this.config):[],this.perf.hand&&delete this.perf.hand):(this.state="run:hand",r=it(),u=this.config.hand.enabled?await ug(l.tensor,this.config):[],h=Math.trunc(it()-r),h>0&&(this.perf.hand=h)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.config.async?(c=this.config.object.enabled?yg(l.tensor,this.config):[],this.perf.object&&delete this.perf.object):(this.state="run:object",r=it(),c=this.config.object.enabled?await yg(l.tensor,this.config):[],h=Math.trunc(it()-r),h>0&&(this.perf.object=h)),this.analyze("End Object:"),this.config.async&&([p,d,u,c]=await Promise.all([p,d,u,c])),Ee(l.tensor);let m=[];this.config.gesture.enabled&&(r=it(),m=[...zk(p),...Ok(d),...Pk(u),..._k(p)],this.config.async?this.perf.gesture&&delete this.perf.gesture:this.perf.gesture=Math.trunc(it()-r)),o&&(this.config.videoOptimized=o),this.perf.total=Math.trunc(it()-i),this.state="idle";let f={face:p,body:d,hand:u,gesture:m,object:c,performance:this.perf,canvas:l.canvas};a(f)})}async warmup(t={}){let n=it();if(t&&(this.config=Hn(this.config,t)),!this.config.warmup||this.config.warmup==="none")return{error:"null"};let a=this.config.videoOptimized;this.config.videoOptimized=!1;let r;typeof createImageBitmap=="function"?r=await aa(this,D0).call(this):typeof Image!="undefined"?r=await aa(this,O0).call(this):r=await aa(this,z0).call(this),this.config.videoOptimized=a;let s=it();return this.config.debug&&he("Warmup",this.config.warmup,Math.round(s-n),"ms",r),r}};Zl=new WeakMap,Zd=new WeakMap,Yd=new WeakMap,Li=new WeakMap,$0=new WeakMap,Jd=new WeakMap,D0=new WeakMap,O0=new WeakMap,z0=new WeakMap;return $ie;})(); /** * @license * Copyright 2017 Google LLC. All Rights Reserved. diff --git a/dist/human.js.map b/dist/human.js.map index 0bde97a9..4533941d 100644 --- a/dist/human.js.map +++ b/dist/human.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/human.ts", "../src/helpers.ts", "../src/sysinfo.ts", "../node_modules/.pnpm/node-fetch@2.6.1/node_modules/node-fetch/browser.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js", "(disabled):crypto", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js", "(disabled):path", "(disabled):worker_threads", "(disabled):perf_hooks", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js", "../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/util_base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/environment.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/global_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/kernel_names.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/kernel_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/profiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_format.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/engine.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/device_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/flags.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/tensor_util_env.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/operation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/router_registry.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/indexed_db.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/local_storage.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/model_management.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/print.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/base_side_effects.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/io.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/browser_files.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/progress.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/weights_loader.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/http.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/io/passthrough.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/confusion_matrix.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/test_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/globals.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/add_n.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/basic_lstm_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/batchnorm4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dense_bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/broadcast_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/eye.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linspace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/axis_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_with_argmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/zeros.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ones.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/moments.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/multi_rnn_cell.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/outer_product.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pad4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rand_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_gamma.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/random_uniform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reverse_4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/setdiff1d_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/slice4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/spectral/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/tensor6d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/truncated_normal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/variable.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/where_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/where_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/boolean_mask.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/moving_average.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/scatter_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse_to_dense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/gather_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/dropout.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/in_top_k.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv2d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/fused/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hamming_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/hann_window.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/frame.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/crop_and_resize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/flip_left_right.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/rotate_with_offset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/nonmax_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/non_max_suppression_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_with_score_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/non_max_suppression_padded_async.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/band_part.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/gram_schmidt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/linalg/qr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/loss_ops_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/compute_weighted_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/absolute_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/cosine_distance.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/hinge_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/huber_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/log_loss.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/mean_squared_error.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/sigmoid_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/losses/softmax_cross_entropy.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/train.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/browser_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/backend_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/concat_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/reduce_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/rotate_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/array_ops_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/selu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/erf_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/complex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/split_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/segment_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/backends/kernel_impls.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/cpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/backend_cpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/zeros_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/binary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/unary_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fused_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/pool_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Clip.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Dilation2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/utils/fft_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Scatter_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-cpu/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/canvas_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flags_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/glsl_version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/packing_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reshape_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/texture_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unpack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/backend_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/kernel_funcs_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mulmat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_complex_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mean_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reduce_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reduce.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/arg_min_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pool_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/avg_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/complex_abs_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/im2col_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/crop_and_resize_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/cumsum_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/depth_to_space_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_packed_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/diag_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/dilation_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fft_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fill_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flip_left_right_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_nd_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_grad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/max_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/multinomial_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/onehot_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/rotate_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/scatter_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/select_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/strided_slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tile_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transform_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/segment_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-webgl/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/unary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/binary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/kernel_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedBatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/flags_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/backend_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-backend-wasm/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Abs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Acosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Add_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AddN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ArgMin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Asinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Atanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/avg_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/AvgPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchMatMul_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BatchToSpaceND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/BroadcastTo_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cast_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Ceil_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ClipByValue_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ComplexAbs_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Concat_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv2DBackpropInput_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/conv3d_backprop_filter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Conv3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cos_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cosh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Cumsum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/DepthwiseConv2dNative_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Dilation2D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Elu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Erf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Exp_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ExpandDims_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Expm1_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Floor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/FloorDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/FusedBatchNorm_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/GatherV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/GreaterEqual_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Identity_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsFinite_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsInf_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/IsNan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LeakyRelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log1p_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Log_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LogSoftmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/local_response_normalization_backprop.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/LRN_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/min_max_grad_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Max_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Maximum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_3d_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool3D_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/ops/max_pool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MaxPool_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mean_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Min_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Minimum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/MirrorPad_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Mod_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Multiply_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Neg_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/OneHot_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/OnesLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/PadV2_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Pow_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Prelu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/RealDiv_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reciprocal_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu6_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Relu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reshape_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeBilinear_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ResizeNearestNeighbor_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Reverse_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Round_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Rsqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Select_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Selu_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sigmoid_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sign_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sin_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sinh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Slice_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softmax_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Softplus_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SpaceToBatchND_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SplitV_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sqrt_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Square_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/SquaredDifference_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Step_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sub_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Sum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tan_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tanh_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Tile_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Transpose_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/Unpack_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/UnsortedSegmentSum_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/gradients/ZerosLike_grad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-core/src/register_all_gradients.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/errors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/variables.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/logs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/losses.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-layers/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/data/compiled_api.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/register.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/arithmetic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/basic_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/control.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/convolution.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/creation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/dynamic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/evaluation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/graph.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/image.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/logical.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/matrices.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/reduction.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/slice_join.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/spectral.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/transformation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_mapper.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/node_value_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/arithmetic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/basic_math_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_array.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_list.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/control_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/convolution_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/creation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/dynamic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/evaluation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/hash_table_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/image_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/logical_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/matrices_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/normalization_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/reduction_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/slice_join_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/sparse_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/spectral_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/transformation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/execution_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/model_analysis.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/resource_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_model.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.5.0_@tensorflow+tfjs-core@3.5.0/node_modules/@tensorflow/tfjs-converter/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/datasource.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/readers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.5.0_772551b77c0a70c6ba27fa6944bf3b1a/node_modules/@tensorflow/tfjs-data/src/version.ts", "../src/tfjs/tf-browser.ts", "../src/tfjs/backend.ts", "../src/emotion/emotion.ts", "../src/faceres/faceres.ts", "../src/faceall.ts", "../src/blazeface/facemesh.ts", "../src/blazeface/blazeface.ts", "../src/blazeface/box.ts", "../src/blazeface/util.ts", "../src/blazeface/coords.ts", "../src/blazeface/facepipeline.ts", "../src/posenet/posenet.ts", "../src/posenet/keypoints.ts", "../src/posenet/utils.ts", "../src/posenet/poses.ts", "../src/handpose/handpose.ts", "../src/handpose/box.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/handpose/anchors.ts", "../src/blazepose/blazepose.ts", "../src/blazepose/annotations.ts", "../src/nanodet/nanodet.ts", "../src/nanodet/labels.ts", "../src/gesture/gesture.ts", "../src/image/image.ts", "../src/image/imagefx.js", "../src/draw/draw.ts", "../src/config.ts", "../src/sample.ts"], - "sourcesContent": ["import { log, now, mergeDeep } from './helpers';\nimport * as sysinfo from './sysinfo';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as backend from './tfjs/backend';\nimport * as faceall from './faceall';\nimport * as facemesh from './blazeface/facemesh';\nimport * as faceres from './faceres/faceres';\nimport * as emotion from './emotion/emotion';\nimport * as posenet from './posenet/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as blazepose from './blazepose/blazepose';\nimport * as nanodet from './nanodet/nanodet';\nimport * as gesture from './gesture/gesture';\nimport * as image from './image/image';\nimport * as draw from './draw/draw';\nimport { Config, defaults } from './config';\nimport { Result } from './result';\nimport * as sample from './sample';\nimport * as app from '../package.json';\n\n/** Generic Tensor object type */\nexport type Tensor = typeof tf.Tensor;\n\nexport type { Config } from './config';\nexport type { Result } from './result';\nexport type { DrawOptions } from './draw/draw';\n\n/** Defines all possible input types for **Human** detection */\nexport type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;\n\n/** Error message */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS */\nexport type TensorFlow = typeof tf;\n\n/** Generic Model object type, holds instance of individual models */\ntype Model = Object;\n\n/**\n * **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n */\nexport class Human {\n /** Current version of Human library in semver format */\n version: string;\n /** Current configuration\n * - Details: {@link Config}\n */\n config: Config;\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n */\n state: string;\n /** Internal: Instance of current image being processed */\n image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n /** Internal: Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n */\n tf: TensorFlow;\n /** Draw helper classes that can draw detected objects on canvas using specified draw styles\n * - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: {\n options: draw.DrawOptions,\n gesture: typeof draw.gesture,\n face: typeof draw.face,\n body: typeof draw.body,\n hand: typeof draw.hand,\n canvas: typeof draw.canvas,\n all: typeof draw.all,\n };\n /** Internal: Currently loaded models */\n models: {\n face: facemesh.MediaPipeFaceMesh | Model | null,\n posenet: Model | null,\n blazepose: Model | null,\n efficientpose: Model | null,\n handpose: handpose.HandPose | null,\n iris: Model | null,\n age: Model | null,\n gender: Model | null,\n emotion: Model | null,\n embedding: Model | null,\n nanodet: Model | null,\n faceres: Model | null,\n };\n /** Internal: Currently loaded classes */\n classes: {\n facemesh: typeof facemesh;\n emotion: typeof emotion;\n body: typeof posenet | typeof blazepose;\n hand: typeof handpose;\n nanodet: typeof nanodet;\n faceres: typeof faceres;\n };\n /** Face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Platform and agent information detected by Human */\n sysinfo: { platform: string, agent: string };\n /** Performance object that contains values for all recently performed operations */\n perf: any;\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n #firstRun: boolean;\n\n // definition end\n\n /**\n * Creates instance of Human library that is futher used for all operations\n * - @param userConfig: {@link Config}\n */\n constructor(userConfig: Config | Object = {}) {\n this.tf = tf;\n this.draw = draw;\n this.version = app.version;\n this.config = mergeDeep(defaults, userConfig);\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.#firstRun = true;\n this.perf = {};\n // object that contains all initialized models\n this.models = {\n face: null,\n posenet: null,\n blazepose: null,\n efficientpose: null,\n handpose: null,\n iris: null,\n age: null,\n gender: null,\n emotion: null,\n embedding: null,\n nanodet: null,\n faceres: null,\n };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.image = (input: Input) => image.process(input, this.config);\n // export raw access to underlying models\n this.classes = {\n facemesh,\n emotion,\n faceres,\n body: this.config.body.modelPath.includes('posenet') ? posenet : blazepose,\n hand: handpose,\n nanodet,\n };\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // include platform info\n this.sysinfo = sysinfo.info();\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg) => {\n if (!this.#analyzeMemoryLeaks) return;\n const current = this.tf.engine().state.numTensors;\n const previous = this.#numTensors;\n this.#numTensors = current;\n const leaked = current - previous;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.tf.ENV.flags.IS_NODE && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)\n * - Calculation is based on normalized Minkowski distance between\n */\n // eslint-disable-next-line class-methods-use-this\n similarity(embedding1: Array, embedding2: Array): number {\n return faceres.similarity(embedding1, embedding2);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n * @param input Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n return faceres.enhance(input);\n }\n\n /**\n * Math method find best match between provided face descriptor and predefined database of known descriptors\n * @param faceEmbedding: face descriptor previsouly calculated on any face\n * @param db: array of mapping of face descriptors to known values\n * @param threshold: minimum score for matching to be considered in the result\n * @returns best match\n */\n // eslint-disable-next-line class-methods-use-this\n match(faceEmbedding: Array, db: Array<{ name: string, source: string, embedding: number[] }>, threshold = 0): { name: string, source: string, similarity: number, embedding: number[] } {\n return faceres.match(faceEmbedding, db, threshold);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n */\n async load(userConfig: Config | Object = {}) {\n this.state = 'load';\n const timeStamp = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n\n if (this.#firstRun) {\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (this.config.debug) log('platform:', this.sysinfo.platform);\n if (this.config.debug) log('agent:', this.sysinfo.agent);\n\n await this.#checkBackend(true);\n if (this.tf.ENV.flags.IS_BROWSER) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n if (this.config.async) {\n [\n this.models.face,\n this.models.emotion,\n this.models.handpose,\n this.models.posenet,\n this.models.blazepose,\n this.models.nanodet,\n this.models.faceres,\n ] = await Promise.all([\n this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),\n this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),\n this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),\n this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),\n this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),\n this.models.nanodet || (this.config.object.enabled ? nanodet.load(this.config) : null),\n this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),\n ]);\n } else {\n if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);\n if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);\n if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);\n if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);\n if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);\n if (this.config.object.enabled && !this.models.nanodet) this.models.nanodet = await nanodet.load(this.config);\n if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);\n }\n\n if (this.#firstRun) {\n if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');\n this.#firstRun = false;\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.perf.load || 0)) this.perf.load = current;\n }\n\n // check if backend needs initialization if it changed\n /** @hidden */\n #checkBackend = async (force = false) => {\n if (this.config.backend && (this.config.backend.length > 0) && force || (this.tf.getBackend() !== this.config.backend)) {\n const timeStamp = now();\n this.state = 'backend';\n /* force backend reload\n if (this.config.backend in tf.engine().registry) {\n const backendFactory = tf.findBackendFactory(this.config.backend);\n tf.removeBackend(this.config.backend);\n tf.registerBackend(this.config.backend, backendFactory);\n } else {\n log('Backend not registred:', this.config.backend);\n }\n */\n\n if (this.config.backend && this.config.backend.length > 0) {\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && this.config.debug) log('running inside web worker');\n\n // force browser vs node backend\n if (this.tf.ENV.flags.IS_BROWSER && this.config.backend === 'tensorflow') this.config.backend = 'webgl';\n if (this.tf.ENV.flags.IS_NODE && (this.config.backend === 'webgl' || this.config.backend === 'humangl')) this.config.backend = 'tensorflow';\n\n if (this.config.debug) log('setting backend:', this.config.backend);\n\n if (this.config.backend === 'wasm') {\n if (this.config.debug) log('wasm path:', this.config.wasmPath);\n if (typeof this.tf?.setWasmPaths !== 'undefined') this.tf.setWasmPaths(this.config.wasmPath);\n else throw new Error('Human: WASM backend is not loaded');\n const simd = await this.tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await this.tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (this.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (this.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n if (this.config.backend === 'humangl') backend.register();\n try {\n await this.tf.setBackend(this.config.backend);\n } catch (err) {\n log('error: cannot set backend:', this.config.backend, err);\n }\n }\n this.tf.enableProdMode();\n // this.tf.enableDebugMode();\n if (this.tf.getBackend() === 'webgl' || this.tf.getBackend() === 'humangl') {\n this.tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n this.tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', true);\n if (typeof this.config['deallocate'] !== 'undefined') {\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n this.tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n const gl = await this.tf.backend().getGPGPUContext().gl;\n if (this.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n await this.tf.ready();\n this.perf.backend = Math.trunc(now() - timeStamp);\n }\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n */\n async detect(input: Input, userConfig: Config | Object = {}): Promise {\n // detection happens inside a promise\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig);\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend\n await this.#checkBackend();\n\n // load models if enabled\n await this.load();\n\n // disable video optimization for inputs of type image, but skip if inside worker thread\n let previousVideoOptimized;\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (input && this.config.videoOptimized && (typeof window !== 'undefined') && (typeof WorkerGlobalScope !== 'undefined') && (\n (typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n || (typeof Image !== 'undefined' && input instanceof Image)\n || (typeof ImageData !== 'undefined' && input instanceof ImageData)\n || (typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap))\n ) {\n log('disabling video optimization');\n previousVideoOptimized = this.config.videoOptimized;\n this.config.videoOptimized = false;\n }\n\n timeStamp = now();\n const process = image.process(input, this.config);\n if (!process || !process.tensor) {\n log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.perf.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n // prepare where to store model results\n let bodyRes;\n let handRes;\n let faceRes;\n let objectRes;\n let current;\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n if (this.config.async) {\n faceRes = this.config.face.enabled ? faceall.detectFace(this, process.tensor) : [];\n if (this.perf.face) delete this.perf.face;\n } else {\n this.state = 'run:face';\n timeStamp = now();\n faceRes = this.config.face.enabled ? await faceall.detectFace(this, process.tensor) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.face = current;\n }\n\n // run body: can be posenet or blazepose\n this.analyze('Start Body:');\n if (this.config.async) {\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(process.tensor, this.config) : [];\n if (this.perf.body) delete this.perf.body;\n } else {\n this.state = 'run:body';\n timeStamp = now();\n if (this.config.body.modelPath.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(process.tensor, this.config) : [];\n else if (this.config.body.modelPath.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.body = current;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n if (this.config.async) {\n handRes = this.config.hand.enabled ? this.models.handpose?.estimateHands(process.tensor, this.config) : [];\n if (this.perf.hand) delete this.perf.hand;\n } else {\n this.state = 'run:hand';\n timeStamp = now();\n handRes = this.config.hand.enabled ? await this.models.handpose?.estimateHands(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.hand = current;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n if (this.config.async) {\n objectRes = this.config.object.enabled ? nanodet.predict(process.tensor, this.config) : [];\n if (this.perf.object) delete this.perf.object;\n } else {\n this.state = 'run:object';\n timeStamp = now();\n objectRes = this.config.object.enabled ? await nanodet.predict(process.tensor, this.config) : [];\n current = Math.trunc(now() - timeStamp);\n if (current > 0) this.perf.object = current;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n if (this.config.async) {\n [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n }\n tf.dispose(process.tensor);\n\n // run gesture analysis last\n let gestureRes: any[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.perf.gesture = Math.trunc(now() - timeStamp);\n else if (this.perf.gesture) delete this.perf.gesture;\n }\n\n // restore video optimizations if previously disabled\n if (previousVideoOptimized) this.config.videoOptimized = previousVideoOptimized;\n\n this.perf.total = Math.trunc(now() - timeStart);\n this.state = 'idle';\n const result = {\n face: faceRes,\n body: bodyRes,\n hand: handRes,\n gesture: gestureRes,\n object: objectRes,\n performance: this.perf,\n canvas: process.canvas,\n };\n // log('Result:', result);\n resolve(result);\n });\n }\n\n /** @hidden */\n #warmupBitmap = async () => {\n const b64toBlob = (base64, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (this.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await this.detect(bitmap, this.config);\n bitmap.close();\n }\n return res;\n }\n\n /** @hidden */\n #warmupCanvas = async () => new Promise((resolve) => {\n let src;\n let size = 0;\n switch (this.config.warmup) {\n case 'face':\n size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n const img = new Image();\n img.onload = async () => {\n const canvas = (typeof OffscreenCanvas !== 'undefined') ? new OffscreenCanvas(size, size) : document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx?.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const res = await this.detect(canvas, this.config);\n resolve(res);\n };\n if (src) img.src = src;\n else resolve(null);\n });\n\n /** @hidden */\n #warmupNode = async () => {\n const atob = (str) => Buffer.from(str, 'base64');\n let img;\n if (this.config.warmup === 'face') img = atob(sample.face);\n if (this.config.warmup === 'body' || this.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n this.tf.dispose(data);\n // log('Input:', expanded);\n res = await this.detect(expanded, this.config);\n this.tf.dispose(expanded);\n } else {\n if (this.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await this.detect(input, this.config);\n */\n }\n return res;\n }\n\n /** Warmup metho pre-initializes all models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n */\n async warmup(userConfig: Config | Object = {}): Promise {\n const t0 = now();\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n if (!this.config.warmup || this.config.warmup === 'none') return { error: 'null' };\n const save = this.config.videoOptimized;\n this.config.videoOptimized = false;\n let res;\n if (typeof createImageBitmap === 'function') res = await this.#warmupBitmap();\n else if (typeof Image !== 'undefined') res = await this.#warmupCanvas();\n else res = await this.#warmupNode();\n this.config.videoOptimized = save;\n const t1 = now();\n if (this.config.debug) log('Warmup', this.config.warmup, Math.round(t1 - t0), 'ms', res);\n return res;\n }\n}\n\n/**\n * Class Human is also available as default export\n */\nexport { Human as default };\n", "// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`Human: ModelPath Error: ${path} Expecting JSON file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg) {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n", "export function info(): { platform: string, agent: string } {\n let platform;\n let agent;\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n platform = platformMatch ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n agent = navigator.userAgent.replace(raw[0], '');\n if (platform[1]) agent = agent.replace(raw[1], '');\n agent = agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n platform = `${process.platform} ${process.arch}`;\n agent = `NodeJS ${process.version}`;\n }\n return { platform, agent };\n}\n", "", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "", "/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "", "", "\nvar WasmBackendModuleThreadedSimd = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModuleThreadedSimd) {\n WasmBackendModuleThreadedSimd = WasmBackendModuleThreadedSimd || {};\n\nfunction GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModuleThreadedSimd!==\"undefined\"?WasmBackendModuleThreadedSimd:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module[\"ENVIRONMENT_IS_PTHREAD\"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module[\"buffer\"]}var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"};var nodeWorkerThreads;try{nodeWorkerThreads=require(\"worker_threads\")}catch(e){console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(typeof _scriptDir !== \"undefined\" && _scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance===\"undefined\"){global.performance=require(\"perf_hooks\").performance}}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){GROWABLE_HEAP_I8().set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module[\"wasmMemory\"];buffer=Module[\"buffer\"]}else{if(Module[\"wasmMemory\"]){wasmMemory=Module[\"wasmMemory\"]}else{wasmMemory=new WebAssembly.Memory({\"initial\":INITIAL_MEMORY/65536,\"maximum\":2147483648/65536,\"shared\":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\");if(ENVIRONMENT_IS_NODE){console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\")}throw Error(\"bad memory\")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,\"addRunDependency cannot be used in a pthread worker\");runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error(\"Pthread aborting at \"+(new Error).stack);what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm-threaded-simd.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmTable=Module[\"asm\"][\"F\"];wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency(\"wasm-instantiate\")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency(\"wasm-instantiate\")}function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"],output[\"module\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var ASM_CONSTS={9816:function(){throw\"Canceled!\"},9834:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw\"Atomics.notify returned an unexpected value \"+ret}Module[\"_emscripten_futex_wake\"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! killThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in killThread!\";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cancelThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cancelThread!\";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({\"cmd\":\"cancel\"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cleanupThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cleanupThread!\";var pthread=PThread.pthreads[pthread_ptr];if(pthread){GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){var pthreadPoolSize=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2));for(var i=0;i>2]=tb;var headPtr=tb+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),tb+100>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(GROWABLE_HEAP_U32(),tb+56>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,0);PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exit\"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({\"cmd\":\"cancelDone\"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e[\"data\"];var cmd=d[\"cmd\"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d[\"targetThread\"]&&d[\"targetThread\"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d[\"transferList\"])}else{console.error('Internal error! Worker sent a message \"'+cmd+'\" to target pthread '+d[\"targetThread\"]+\", but that thread no longer exists!\")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd===\"processQueuedMainThreadWork\"){_emscripten_main_thread_process_queued_calls()}else if(cmd===\"spawnThread\"){spawnThread(e.data)}else if(cmd===\"cleanupThread\"){cleanupThread(d[\"thread\"])}else if(cmd===\"killThread\"){killThread(d[\"thread\"])}else if(cmd===\"cancelThread\"){cancelThread(d[\"thread\"])}else if(cmd===\"loaded\"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd===\"print\"){out(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"printErr\"){err(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"alert\"){alert(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"exit\"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd===\"exitProcess\"){try{exit(d[\"returnCode\"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd===\"cancelDone\"){PThread.returnWorkerToPool(worker)}else if(cmd===\"objectTransfer\"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target===\"setimmediate\"){worker.postMessage(e.data)}else{err(\"worker sent an unknown command \"+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err(\"pthread sent an error! \"+e.filename+\":\"+e.lineno+\": \"+e.message)};if(ENVIRONMENT_IS_NODE){worker.on(\"message\",function(data){worker.onmessage({data:data})});worker.on(\"error\",function(data){worker.onerror(data)});worker.on(\"exit\",function(data){})}worker.postMessage({\"cmd\":\"load\",\"urlOrBlob\":Module[\"mainScriptUrlOrBlob\"]||_scriptDir,\"wasmMemory\":wasmMemory,\"wasmModule\":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile(\"tfjs-backend-wasm-threaded-simd.worker.js\");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({\"cmd\":\"processQueuedMainThreadWork\"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({\"targetThread\":targetThreadId,\"cmd\":\"processThreadQueue\"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({\"cmd\":\"processThreadQueue\"})}return 1}function _abort(){abort()}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret===\"timed-out\")return-73;if(ret===\"not-equal\")return-6;if(ret===\"ok\")return 0;throw\"Atomics.wait returned an unexpected value \"+ret}else{if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_num_logical_cores(){if(ENVIRONMENT_IS_NODE)return require(\"os\").cpus().length;return navigator[\"hardwareConcurrency\"]}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?GROWABLE_HEAP_F64()[buf++>>1]:GROWABLE_HEAP_I32()[buf]);++buf}return readAsmConstArgsArray}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return\"\";if(target==window)return\"#window\";if(target==screen)return\"#screen\";return target&&target.nodeName?target.nodeName:\"\"},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):\"\";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!==\"undefined\"?document:0,typeof window!==\"undefined\"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!==\"undefined\"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension(\"ANGLE_instanced_arrays\");if(ext){ctx[\"vertexAttribDivisor\"]=function(index,divisor){ext[\"vertexAttribDivisorANGLE\"](index,divisor)};ctx[\"drawArraysInstanced\"]=function(mode,first,count,primcount){ext[\"drawArraysInstancedANGLE\"](mode,first,count,primcount)};ctx[\"drawElementsInstanced\"]=function(mode,count,type,indices,primcount){ext[\"drawElementsInstancedANGLE\"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension(\"OES_vertex_array_object\");if(ext){ctx[\"createVertexArray\"]=function(){return ext[\"createVertexArrayOES\"]()};ctx[\"deleteVertexArray\"]=function(vao){ext[\"deleteVertexArrayOES\"](vao)};ctx[\"bindVertexArray\"]=function(vao){ext[\"bindVertexArrayOES\"](vao)};ctx[\"isVertexArray\"]=function(vao){return ext[\"isVertexArrayOES\"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension(\"WEBGL_draw_buffers\");if(ext){ctx[\"drawBuffers\"]=function(n,bufs){ext[\"drawBuffersWEBGL\"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension(\"WEBGL_multi_draw\"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext(\"webgl\",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault===\"undefined\"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents===\"object\")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);GLctx.disjointTimerQueryExt=GLctx.getExtension(\"EXT_disjoint_timer_query\");__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(ext.indexOf(\"lose_context\")<0&&ext.indexOf(\"debug\")<0){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];var contextAttributes={\"alpha\":!!GROWABLE_HEAP_I32()[a+(0>>2)],\"depth\":!!GROWABLE_HEAP_I32()[a+(4>>2)],\"stencil\":!!GROWABLE_HEAP_I32()[a+(8>>2)],\"antialias\":!!GROWABLE_HEAP_I32()[a+(12>>2)],\"premultipliedAlpha\":!!GROWABLE_HEAP_I32()[a+(16>>2)],\"preserveDrawingBuffer\":!!GROWABLE_HEAP_I32()[a+(20>>2)],\"powerPreference\":__emscripten_webgl_power_preferences[powerPreference],\"failIfMajorPerformanceCaveat\":!!GROWABLE_HEAP_I32()[a+(28>>2)],majorVersion:GROWABLE_HEAP_I32()[a+(32>>2)],minorVersion:GROWABLE_HEAP_I32()[a+(36>>2)],enableExtensionsByDefault:GROWABLE_HEAP_I32()[a+(40>>2)],explicitSwapControl:GROWABLE_HEAP_I32()[a+(44>>2)],proxyContextToMainThread:GROWABLE_HEAP_I32()[a+(48>>2)],renderViaOffscreenBackBuffer:GROWABLE_HEAP_I32()[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset)}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.threadExitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! spawnThread() can only ever be called from main application thread!\";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw\"Internal error!\";if(!threadParams.pthread_ptr)throw\"Internal error, no pthread ptr!\";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(64>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(100>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(76>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(172>>2),global_locale);worker.pthread=pthread;var msg={\"cmd\":\"run\",\"start_routine\":threadParams.startRoutine,\"arg\":threadParams.arg,\"threadInfoStruct\":threadParams.pthread_ptr,\"stackBase\":threadParams.stackBase,\"stackSize\":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer===\"undefined\"){err(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\");return 6}if(!pthread_ptr){err(\"pthread_create called with a null thread pointer!\");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd=\"spawnThread\";postMessage(threadParams,transferList)}else{spawnThread(threadParams)}return 0}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={\"e\":___assert_fail,\"r\":___call_main,\"x\":__emscripten_notify_thread_queue,\"b\":_abort,\"y\":_emscripten_asm_const_int,\"j\":_emscripten_conditional_set_current_thread_status,\"c\":_emscripten_futex_wait,\"d\":_emscripten_futex_wake,\"f\":_emscripten_get_now,\"p\":_emscripten_memcpy_big,\"z\":_emscripten_num_logical_cores,\"u\":_emscripten_receive_on_main_thread_js,\"q\":_emscripten_resize_heap,\"v\":_emscripten_set_canvas_element_size,\"i\":_emscripten_set_current_thread_status,\"t\":_emscripten_set_thread_name,\"w\":_emscripten_webgl_create_context,\"m\":_fd_close,\"n\":_fd_seek,\"g\":_fd_write,\"o\":initPthreadsJS,\"a\":wasmMemory||Module[\"wasmMemory\"],\"k\":_pthread_cleanup_pop,\"l\":_pthread_cleanup_push,\"h\":_pthread_create,\"s\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Ua\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Va\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Wa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Xa\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ya\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Za\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"_a\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"$a\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"ab\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"bb\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"cb\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"db\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"eb\"]).apply(null,arguments)};var _emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=function(){return(_emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=Module[\"asm\"][\"fb\"]).apply(null,arguments)};var _pthread_self=Module[\"_pthread_self\"]=function(){return(_pthread_self=Module[\"_pthread_self\"]=Module[\"asm\"][\"gb\"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=function(){return(___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=Module[\"asm\"][\"hb\"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=function(){return(_emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=Module[\"asm\"][\"ib\"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=function(){return(_emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=Module[\"asm\"][\"jb\"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=function(){return(_emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=Module[\"asm\"][\"kb\"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=function(){return(__emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=Module[\"asm\"][\"lb\"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=Module[\"asm\"][\"mb\"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=Module[\"asm\"][\"nb\"]).apply(null,arguments)};var __emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=function(){return(__emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=Module[\"asm\"][\"ob\"]).apply(null,arguments)};var _emscripten_tls_init=Module[\"_emscripten_tls_init\"]=function(){return(_emscripten_tls_init=Module[\"_emscripten_tls_init\"]=Module[\"asm\"][\"pb\"]).apply(null,arguments)};var __emscripten_thread_init=Module[\"__emscripten_thread_init\"]=function(){return(__emscripten_thread_init=Module[\"__emscripten_thread_init\"]=Module[\"asm\"][\"qb\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"rb\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"sb\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"tb\"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=function(){return(_emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=Module[\"asm\"][\"ub\"]).apply(null,arguments)};var _memalign=Module[\"_memalign\"]=function(){return(_memalign=Module[\"_memalign\"]=Module[\"asm\"][\"vb\"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module[\"__emscripten_allow_main_runtime_queued_calls\"]=9808;var __emscripten_main_thread_futex=Module[\"__emscripten_main_thread_futex\"]=11432;Module[\"cwrap\"]=cwrap;Module[\"PThread\"]=PThread;Module[\"PThread\"]=PThread;Module[\"wasmMemory\"]=wasmMemory;Module[\"ExitStatus\"]=ExitStatus;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({\"cmd\":\"loaded\"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exitProcess\",\"returnCode\":status});throw new ExitStatus(status)}else{}}if(noExitRuntime){}else{PThread.terminateAllThreads();EXITSTATUS=status;exitRuntime();if(Module[\"onExit\"])Module[\"onExit\"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run();\n\n\n return WasmBackendModuleThreadedSimd.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModuleThreadedSimd;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModuleThreadedSimd; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModuleThreadedSimd\"] = WasmBackendModuleThreadedSimd;\n", "\nvar WasmBackendModule = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModule) {\n WasmBackendModule = WasmBackendModule || {};\n\nvar Module=typeof WasmBackendModule!==\"undefined\"?WasmBackendModule:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str=\"\";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmMemory=Module[\"asm\"][\"i\"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module[\"asm\"][\"o\"];removeRunDependency(\"wasm-instantiate\")}addRunDependency(\"wasm-instantiate\");function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _abort(){abort()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_create(){return 6}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _sysconf(name){switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}var asmLibraryArg={\"a\":_abort,\"d\":_emscripten_memcpy_big,\"e\":_emscripten_resize_heap,\"f\":_fd_close,\"c\":_fd_seek,\"b\":_fd_write,\"g\":_pthread_create,\"h\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"j\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"k\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"l\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"m\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"n\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"p\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"q\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"r\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"s\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"t\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"u\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"v\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"w\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"x\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"y\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"z\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"F\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};Module[\"cwrap\"]=cwrap;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();\n\n\n return WasmBackendModule.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModule;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModule; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModule\"] = WasmBackendModule;\n", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Backend, DataId} from '../tensor';\nimport {BackendValues, DataType} from '../types';\n\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n\n// Required information for all backends.\nexport interface BackendTimingInfo {\n kernelMs: number|{error: string};\n getExtraProfileInfo?(): string; // a field for additional timing information\n // e.g. packing / unpacking for WebGL backend\n}\n\nexport interface TensorStorage {\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n disposeData(dataId: DataId, force?: boolean): boolean;\n write(values: BackendValues, shape: number[], dtype: DataType): DataId;\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void;\n memory(): {unreliable: boolean;}; // Backend-specific information.\n /** Returns number of data ids currently in the storage. */\n numDataIds(): number;\n refCount(dataId: DataId): number;\n}\n\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n private data = new WeakMap();\n private dataIdsCount = 0;\n\n constructor(private backend: KernelBackend, private dataMover: DataMover) {}\n\n get(dataId: DataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n\n set(dataId: DataId, value: T): void {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n\n has(dataId: DataId): boolean {\n return this.data.has(dataId);\n }\n\n delete(dataId: DataId): boolean {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n\n numDataIds(): number {\n return this.dataIdsCount;\n }\n}\n\nexport interface DataMover {\n /**\n * To be called by backends whenever they see a dataId that they don't own.\n * Upon calling this method, the mover will fetch the tensor from another\n * backend and register it with the current active backend.\n */\n moveData(backend: KernelBackend, dataId: DataId): void;\n}\n\nexport interface BackendTimer {\n // check if backend timer is available\n timerAvailable(): boolean;\n time(f: () => void): Promise;\n}\n\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend implements TensorStorage, Backend, BackendTimer {\n refCount(dataId: DataId): number {\n return notYetImplemented('refCount');\n }\n incRef(dataId: DataId): void {\n return notYetImplemented('incRef');\n }\n timerAvailable(): boolean {\n return true;\n }\n time(f: () => void): Promise {\n return notYetImplemented('time');\n }\n read(dataId: object): Promise {\n return notYetImplemented('read');\n }\n readSync(dataId: object): BackendValues {\n return notYetImplemented('readSync');\n }\n numDataIds(): number {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId: object, force?: boolean): boolean {\n return notYetImplemented('disposeData');\n }\n write(values: BackendValues, shape: number[], dtype: DataType): DataId {\n return notYetImplemented('write');\n }\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void {\n return notYetImplemented('move');\n }\n memory(): {unreliable: boolean; reasons?: string[]} {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision(): 16|32 {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon(): number {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose(): void {\n return notYetImplemented('dispose');\n }\n}\n\nfunction notYetImplemented(kernelName: string): never {\n throw new Error(\n `'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap, FlatVector, NumericDataType, RecursiveArray, TensorLike, TypedArray} from './types';\n\n/**\n * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n // tslint:disable-next-line:no-any\n array: any[]|Uint32Array|Int32Array|Float32Array,\n // tslint:disable-next-line:no-any\n array2: any[]|Uint32Array|Int32Array|Float32Array): void {\n if (array.length !== array2.length) {\n throw new Error(\n `Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let temp, temp2;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n temp = array[counter];\n temp2 = array2[counter];\n array[counter] = array[index];\n array2[counter] = array2[index];\n array[index] = temp;\n array2[index] = temp2;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\nexport function nearestLargerEven(val: number): number {\n return val % 2 === 0 ? val : val + 1;\n}\n\nexport function sum(arr: number[]): number {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a: number, b: number) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n () => `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function\nflatten|TypedArray>(\n arr: T|RecursiveArray, result: T[] = [], skipTypedArray = false): T[] {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n } else {\n result.push(arr as T);\n }\n return result;\n}\n\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (shapeProd === 0) {\n throw Error(\n `Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () =>\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(ax => isInt(ax)),\n () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function getArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else if (dtype === 'string') {\n values = new Array<'string'>(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function checkConversionForErrors(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype: DataType): boolean {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nexport function isTypedArray(a: {}): a is Float32Array|Int32Array|Uint8Array {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'complex64') {\n return 8;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr: Uint8Array[]): number {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n\n/** Returns true if the value is a string. */\nexport function isString(value: {}): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport function isBoolean(value: {}): boolean {\n return typeof value === 'boolean';\n}\n\nexport function isNumber(value: {}): boolean {\n return typeof value === 'number';\n}\n\nexport function inferDtype(values: TensorLike): DataType {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n } else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n } else if (isNumber(values)) {\n return 'float32';\n } else if (isString(values)) {\n return 'string';\n } else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nfunction createNestedArray(\n offset: number, shape: number[], a: TypedArray, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n } else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(\n shape: number[], a: TypedArray, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${\n isComplex ? ' for a complex tensor' : ''}.`);\n }\n\n return createNestedArray(0, shape, a, isComplex);\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size) as DataTypeMap[D];\n } else if (dtype === 'int32') {\n return new Int32Array(size) as DataTypeMap[D];\n } else if (dtype === 'bool') {\n return new Uint8Array(size) as DataTypeMap[D];\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(\n shape: number[], dtype: D) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n } else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n } else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function assertNonNegativeIntegerDimensions(shape: number[]) {\n shape.forEach(dimSize => {\n assert(\n Number.isInteger(dimSize) && dimSize >= 0,\n () =>\n `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(\n locs: number[], rank: number, strides: number[]): number {\n if (rank === 0) {\n return 0;\n } else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(\n index: number, rank: number, strides: number[]): number[] {\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object: any) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Platform} from './platforms/platform';\nimport {isPromise} from './util_base';\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n\ntype FlagValue = number|boolean;\ntype FlagEvaluationFn = (() => FlagValue)|(() => Promise);\nexport type Flags = {\n [featureName: string]: FlagValue\n};\nexport type FlagRegistryEntry = {\n evaluationFn: FlagEvaluationFn;\n setHook?: (value: FlagValue) => void;\n};\n\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n private flags: Flags = {};\n private flagRegistry: {[flagName: string]: FlagRegistryEntry} = {};\n\n private urlFlags: Flags = {};\n\n platformName: string;\n platform: Platform;\n\n // Jasmine spies on this in 'environment_test.ts'\n getQueryParams = getQueryParams;\n\n // tslint:disable-next-line: no-any\n constructor(public global: any) {\n this.populateURLFlags();\n }\n\n setPlatform(platformName: string, platform: Platform) {\n if (this.platform != null) {\n console.warn(\n `Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n\n registerFlag(\n flagName: string, evaluationFn: FlagEvaluationFn,\n setHook?: (value: FlagValue) => void) {\n this.flagRegistry[flagName] = {evaluationFn, setHook};\n\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n console.warn(\n `Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n\n async getAsync(flagName: string): Promise {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n\n get(flagName: string): FlagValue {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(\n `Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n\n this.flags[flagName] = flagValue as number | boolean;\n\n return this.flags[flagName];\n }\n\n getNumber(flagName: string): number {\n return this.get(flagName) as number;\n }\n\n getBool(flagName: string): boolean {\n return this.get(flagName) as boolean;\n }\n\n getFlags(): Flags {\n return this.flags;\n }\n // For backwards compatibility.\n get features(): Flags {\n return this.flags;\n }\n\n set(flagName: string, value: FlagValue): void {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n\n private evaluateFlag(flagName: string): FlagValue|Promise {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n\n setFlags(flags: Flags) {\n this.flags = Object.assign({}, flags);\n }\n\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n\n private populateURLFlags(): void {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n\nfunction parseValue(flagName: string, value: string): FlagValue {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n } else if (`${+ value}` === value) {\n return +value;\n }\n throw new Error(\n `Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\n\nexport let ENV: Environment = null;\nexport function setEnvironmentGlobal(environment: Environment) {\n ENV = environment;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace: {_tfGlobals: Map};\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace(): {_tfGlobals: Map} {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (global) !== 'undefined') {\n ns = global;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else if (typeof (self) !== 'undefined') {\n ns = self;\n } else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n\n// tslint:disable-next-line:no-any\nfunction getGlobalMap(): Map {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key: string, init: () => T): T {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n } else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Allow UpperCamelCase variable names\n// tslint:disable: variable-name\n// Unfortunately just enabling PascalCase per file (tslint:enable:\n// allow-pascal-case) doesn't work.\nimport {NamedTensorInfoMap, TensorInfo} from './kernel_registry';\nimport {ExplicitPadding} from './ops/conv_util';\nimport {Activation} from './ops/fused_types';\nimport {DataType, PixelData} from './types';\n\nexport const Abs = 'Abs';\nexport type AbsInputs = UnaryInputs;\n\nexport const Acos = 'Acos';\nexport type AcosInputs = UnaryInputs;\n\nexport const Acosh = 'Acosh';\nexport type AcoshInputs = UnaryInputs;\n\nexport const Add = 'Add';\nexport type AddInputs = BinaryInputs;\n\nexport const AddN = 'AddN';\nexport type AddNInputs = TensorInfo[];\n\nexport const All = 'All';\nexport type AllInputs = Pick;\nexport interface AllAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Any = 'Any';\nexport type AnyInputs = Pick;\nexport interface AnyAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const ArgMax = 'ArgMax';\nexport type ArgMaxInputs = Pick;\nexport interface ArgMaxAttrs {\n axis: number;\n}\n\nexport const ArgMin = 'ArgMin';\nexport type ArgMinInputs = Pick;\nexport interface ArgMinAttrs {\n axis: number;\n}\n\nexport const Asin = 'Asin';\nexport type AsinInputs = UnaryInputs;\n\nexport const Asinh = 'Asinh';\nexport type AsinhInputs = UnaryInputs;\n\nexport const Atan = 'Atan';\nexport type AtanInputs = UnaryInputs;\n\nexport const Atanh = 'Atanh';\nexport type AtanhInputs = UnaryInputs;\n\nexport const Atan2 = 'Atan2';\nexport type Atan2Inputs = BinaryInputs;\n\nexport const AvgPool = 'AvgPool';\nexport type AvgPoolInputs = Pick;\nexport interface AvgPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport type AvgPoolGradInputs = Pick;\nexport interface AvgPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n}\n\nexport const AvgPool3D = 'AvgPool3D';\nexport type AvgPool3DInputs = Pick;\nexport interface AvgPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n dataFormat: 'NDHWC'|'NCDHW';\n}\n\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport type AvgPool3DGradInputs = Pick;\nexport interface AvgPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const BatchMatMul = 'BatchMatMul';\nexport type BatchMatMulInputs = Pick;\nexport interface BatchMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n}\n\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport type BatchToSpaceNDInputs = Pick;\nexport interface BatchToSpaceNDAttrs {\n blockShape: number[];\n crops: number[][];\n}\n\nexport type BinaryInputs = Pick;\n\nexport const Bincount = 'Bincount';\nexport type BincountInputs = Pick;\nexport interface BincountAttrs {\n size: number;\n}\n\nexport const BroadcastTo = 'BroadcastTo';\nexport type BroadcastToInputs = Pick;\nexport interface BroadCastToAttrs {\n shape: number[];\n inputShape: number[]; // for gradient\n}\n\nexport const Cast = 'Cast';\nexport type CastInputs = UnaryInputs;\nexport interface CastAttrs {\n dtype: DataType;\n}\n\nexport const Ceil = 'Ceil';\nexport type CeilInputs = UnaryInputs;\n\nexport const ClipByValue = 'ClipByValue';\nexport type ClipByValueInputs = UnaryInputs;\nexport interface ClipByValueAttrs {\n clipValueMin: number;\n clipValueMax: number;\n}\n\nexport const Complex = 'Complex';\nexport type ComplexInputs = Pick;\n\nexport const ComplexAbs = 'ComplexAbs';\nexport type ComplexAbsInputs = UnaryInputs;\n\nexport const Concat = 'Concat';\nexport type ConcatInputs = TensorInfo[];\nexport interface ConcatAttrs {\n axis: number;\n}\n\nexport const Conv2D = 'Conv2D';\nexport type Conv2DInputs = Pick;\nexport interface Conv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport type Conv2DBackpropFilterInputs = Pick;\nexport interface Conv2DBackpropFilterAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport type Conv2DBackpropInputInputs = Pick;\nexport interface Conv2DBackpropInputAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Conv3D = 'Conv3D';\nexport type Conv3DInputs = Pick;\nexport interface Conv3DAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations: [number, number, number]|number;\n}\n\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport type Conv3DBackpropFilterV2Inputs = Pick;\n\nexport interface Conv3DBackpropFilterV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n filterShape: [number, number, number, number, number];\n}\n\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport type Conv3DBackpropInputV2Inputs =\n Pick;\nexport interface Conv3DBackpropInputV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n inputShape: [number, number, number, number, number];\n}\n\nexport const Cos = 'Cos';\nexport type CosInputs = UnaryInputs;\n\nexport const Cosh = 'Cosh';\nexport type CoshInputs = UnaryInputs;\n\nexport const Cumsum = 'Cumsum';\nexport type CumsumInputs = Pick;\nexport interface CumsumAttrs {\n axis: number;\n exclusive: boolean;\n reverse: boolean;\n}\n\nexport const CropAndResize = 'CropAndResize';\nexport type CropAndResizeInputs =\n Pick;\nexport interface CropAndResizeAttrs {\n cropSize: [number, number];\n method: 'bilinear'|'nearest';\n extrapolationValue: number;\n}\n\nexport const DenseBincount = 'DenseBincount';\nexport type DenseBincountInputs = Pick;\nexport interface DenseBincountAttrs {\n size: number;\n binaryOutput?: boolean;\n}\n\nexport const DepthToSpace = 'DepthToSpace';\nexport type DepthToSpaceInputs = Pick;\nexport interface DepthToSpaceAttrs {\n blockSize: number;\n dataFormat: 'NHWC'|'NCHW';\n}\n\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport type DepthwiseConv2dNativeInputs =\n Pick;\nexport interface DepthwiseConv2dNativeAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const DepthwiseConv2dNativeBackpropFilter =\n 'DepthwiseConv2dNativeBackpropFilter';\nexport type DepthwiseConv2dNativeBackpropFilterInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropFilterAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const DepthwiseConv2dNativeBackpropInput =\n 'DepthwiseConv2dNativeBackpropInput';\nexport type DepthwiseConv2dNativeBackpropInputInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropInputAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Diag = 'Diag';\nexport type DiagInputs = Pick;\n\nexport const Dilation2D = 'Dilation2D';\nexport type Dilation2DInputs = Pick;\nexport interface Dilation2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number]|number;\n}\n\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport type Dilation2DBackpropInputInputs =\n Pick;\n\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport type Dilation2DBackpropFilterInputs =\n Pick;\n\nexport const RealDiv = 'RealDiv';\nexport type RealDivInputs = BinaryInputs;\n\nexport const Einsum = 'Einsum';\nexport type EinsumInputs = TensorInfo[];\nexport interface EinsumAttrs {\n equation: string;\n}\n\nexport const Elu = 'Elu';\nexport type EluInputs = Pick;\n\nexport const EluGrad = 'EluGrad';\nexport type EluGradInputs = Pick;\n\nexport const Erf = 'Erf';\nexport type ErfInputs = UnaryInputs;\n\nexport const Equal = 'Equal';\nexport type EqualInputs = BinaryInputs;\n\nexport const Exp = 'Exp';\nexport type ExpInputs = UnaryInputs;\n\nexport const ExpandDims = 'ExpandDims';\nexport type ExpandDimsInputs = Pick;\nexport interface ExpandDimsAttrs {\n dim: number;\n}\n\nexport const Expm1 = 'Expm1';\nexport type Expm1Inputs = UnaryInputs;\n\nexport const FFT = 'FFT';\nexport type FFTInputs = Pick;\n\nexport const Fill = 'Fill';\nexport interface FillAttrs {\n shape: number[];\n value: number|string;\n dtype: DataType;\n}\n\nexport const FlipLeftRight = 'FlipLeftRight';\nexport type FlipLeftRightInputs = Pick;\n\nexport const Floor = 'Floor';\nexport type FloorInputs = UnaryInputs;\n\nexport const FloorDiv = 'FloorDiv';\nexport type FloorDivInputs = BinaryInputs;\n\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport type FusedBatchNormInputs =\n Pick;\nexport interface FusedBatchNormAttrs {\n varianceEpsilon: number;\n}\n\nexport const GatherV2 = 'GatherV2';\nexport type GatherV2Inputs = Pick;\nexport interface GatherV2Attrs {\n axis: number;\n batchDims: number;\n}\n\nexport const GatherNd = 'GatherNd';\nexport type GatherNdInputs = Pick;\n\nexport const Greater = 'Greater';\nexport type GreaterInputs = BinaryInputs;\n\nexport const GreaterEqual = 'GreaterEqual';\nexport type GreaterEqualInputs = BinaryInputs;\n\nexport const Identity = 'Identity';\nexport type IdentityInputs = Pick;\n\nexport const IFFT = 'IFFT';\nexport type IFFTInputs = Pick;\n\nexport const Imag = 'Imag';\nexport type ImagInputs = Pick;\n\nexport const IsFinite = 'IsFinite';\nexport type IsFiniteInputs = UnaryInputs;\n\nexport const IsInf = 'IsInf';\nexport type IsInfInputs = UnaryInputs;\n\nexport const IsNan = 'IsNan';\nexport type IsNanInputs = UnaryInputs;\n\nexport const LeakyRelu = 'LeakyRelu';\nexport type LeakyReluInputs = Pick;\nexport interface LeakyReluAttrs {\n alpha: number;\n}\n\nexport const Less = 'Less';\nexport type LessInputs = BinaryInputs;\n\nexport const LessEqual = 'LessEqual';\nexport type LessEqualInputs = BinaryInputs;\n\nexport const LinSpace = 'LinSpace';\nexport interface LinSpaceAttrs {\n start: number;\n stop: number;\n num: number;\n}\nexport const Log = 'Log';\nexport type LogInputs = UnaryInputs;\n\nexport const Log1p = 'Log1p';\nexport type Log1pInputs = UnaryInputs;\n\nexport const LogicalAnd = 'LogicalAnd';\nexport type LogicalAndInputs = BinaryInputs;\n\nexport const LogicalNot = 'LogicalNot';\nexport type LogicalNotInputs = Pick;\n\nexport const LogicalOr = 'LogicalOr';\nexport type LogicalOrInputs = BinaryInputs;\n\nexport const LogSoftmax = 'LogSoftmax';\nexport type LogSoftmaxInputs = Pick;\nexport interface LogSoftmaxAttrs {\n axis: number;\n}\n\nexport const LRN = 'LRN';\nexport type LRNInputs = Pick;\nexport interface LRNAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const LRNGrad = 'LRNGrad';\nexport type LRNGradInputs = Pick;\nexport interface LRNGradAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const Max = 'Max';\nexport type MaxInputs = Pick;\nexport interface MaxAttrs {\n reductionIndices: number|number[];\n keepDims: boolean;\n}\n\nexport const Maximum = 'Maximum';\nexport type MaximumInputs = BinaryInputs;\n\nexport const MaxPool = 'MaxPool';\nexport type MaxPoolInputs = Pick;\nexport interface MaxPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport type MaxPoolGradInputs = Pick;\nexport interface MaxPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3D = 'MaxPool3D';\nexport type MaxPool3DInputs = Pick;\nexport interface MaxPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NDHWC'|'NCDHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport type MaxPool3DGradInputs =\n Pick;\nexport interface MaxPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport type MaxPoolWithArgmaxInputs = Pick;\nexport interface MaxPoolWithArgmaxAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n includeBatchInIndex: boolean;\n}\n\nexport const Mean = 'Mean';\nexport type MeanInputs = Pick;\nexport interface MeanAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Min = 'Min';\nexport type MinInputs = Pick;\nexport interface MinAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Minimum = 'Minimum';\nexport type MinimumInputs = BinaryInputs;\n\nexport const MirrorPad = 'MirrorPad';\nexport type MirrorPadInputs = Pick;\nexport interface MirrorPadAttrs {\n paddings: Array<[number, number]>;\n mode: 'reflect'|'symmetric';\n}\n\nexport const Mod = 'Mod';\nexport type ModInputs = BinaryInputs;\n\nexport const Multinomial = 'Multinomial';\nexport type MultinomialInputs = Pick;\nexport interface MultinomialAttrs {\n numSamples: number;\n seed: number;\n normalized: boolean;\n}\n\nexport const Multiply = 'Multiply';\nexport type MultiplyInputs = BinaryInputs;\n\nexport const Neg = 'Neg';\nexport type NegInputs = UnaryInputs;\n\nexport const NotEqual = 'NotEqual';\nexport type NotEqualInputs = BinaryInputs;\n\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport type NonMaxSuppressionV3Inputs =\n Pick;\nexport interface NonMaxSuppressionV3Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n}\n\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport type NonMaxSuppressionV4Inputs =\n Pick;\nexport interface NonMaxSuppressionV4Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n padToMaxOutputSize: boolean;\n}\n\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport type NonMaxSuppressionV5Inputs =\n Pick;\nexport interface NonMaxSuppressionV5Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n softNmsSigma: number;\n}\n\nexport const OnesLike = 'OnesLike';\nexport type OnesLikeInputs = UnaryInputs;\n\nexport const OneHot = 'OneHot';\nexport type OneHotInputs = Pick;\nexport interface OneHotAttrs {\n depth: number;\n onValue: number;\n offValue: number;\n}\n\nexport const Pack = 'Pack';\nexport type PackInputs = TensorInfo[];\nexport interface PackAttrs {\n axis: number;\n}\n\nexport const PadV2 = 'PadV2';\nexport type PadV2Inputs = Pick;\nexport interface PadV2Attrs {\n paddings: Array<[number, number]>;\n constantValue: number;\n}\n\nexport const Pool = 'Pool';\nexport type PoolInputs = Pick;\n\nexport const Pow = 'Pow';\nexport type PowInputs = BinaryInputs;\n\nexport const Prelu = 'Prelu';\nexport type PreluInputs = Pick;\n\nexport const Prod = 'Prod';\nexport type ProdInputs = Pick;\nexport interface ProdAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Range = 'Range';\nexport interface RangeAttrs {\n start: number;\n stop: number;\n step: number;\n dtype: 'float32'|'int32';\n}\n\nexport const Real = 'Real';\nexport type RealInputs = Pick;\n\nexport const Reciprocal = 'Reciprocal';\nexport type ReciprocalInputs = UnaryInputs;\n\nexport const Relu = 'Relu';\nexport type ReluInputs = Pick;\n\nexport const Reshape = 'Reshape';\nexport type ReshapeInputs = Pick;\nexport interface ReshapeAttrs {\n shape: number[];\n}\n\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport type ResizeNearestNeighborInputs = Pick;\nexport interface ResizeNearestNeighborAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport type ResizeNearestNeighborGradInputs =\n Pick;\nexport type ResizeNearestNeighborGradAttrs = ResizeNearestNeighborAttrs;\n\nexport const ResizeBilinear = 'ResizeBilinear';\nexport type ResizeBilinearInputs = Pick;\nexport interface ResizeBilinearAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport type ResizeBilinearGradInputs = Pick;\nexport type ResizeBilinearGradAttrs = ResizeBilinearAttrs;\n\nexport const Relu6 = 'Relu6';\nexport type Relu6Inputs = Pick;\n\nexport const Reverse = 'Reverse';\nexport type ReverseInputs = Pick;\nexport interface ReverseAttrs {\n dims: number|number[];\n}\n\nexport const Round = 'Round';\nexport type RoundInputs = UnaryInputs;\n\nexport const Rsqrt = 'Rsqrt';\nexport type RsqrtInputs = UnaryInputs;\n\nexport const ScatterNd = 'ScatterNd';\nexport type ScatterNdInputs = Pick;\nexport interface ScatterNdAttrs {\n shape: number[];\n}\n\nexport const Select = 'Select';\nexport type SelectInputs = Pick;\n\nexport const Selu = 'Selu';\nexport type SeluInputs = Pick;\n\nexport const Slice = 'Slice';\nexport type SliceInputs = Pick;\nexport interface SliceAttrs {\n begin: number|number[];\n size: number|number[];\n}\nexport const Sin = 'Sin';\nexport type SinInputs = UnaryInputs;\n\nexport const Sinh = 'Sinh';\nexport type SinhInputs = UnaryInputs;\n\nexport const Sign = 'Sign';\nexport type SignInputs = UnaryInputs;\n\nexport const Sigmoid = 'Sigmoid';\nexport type SigmoidInputs = UnaryInputs;\n\nexport const Softplus = 'Softplus';\nexport type SoftplusInputs = UnaryInputs;\n\nexport const Sqrt = 'Sqrt';\nexport type SqrtInputs = UnaryInputs;\n\nexport const Sum = 'Sum';\nexport type SumInputs = Pick;\nexport interface SumAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport type SpaceToBatchNDInputs = Pick;\nexport interface SpaceToBatchNDAttrs {\n blockShape: number[];\n paddings: number[][];\n}\n\nexport const SplitV = 'SplitV';\nexport type SplitVInputs = Pick;\nexport interface SplitVAttrs {\n numOrSizeSplits: number[]|number;\n axis: number;\n}\n\nexport const Softmax = 'Softmax';\nexport type SoftmaxInputs = Pick;\nexport interface SoftmaxAttrs {\n dim: number;\n}\n\nexport const SparseReshape = 'SparseReshape';\nexport type SparseReshapeInputs =\n Pick;\n\nexport const SparseToDense = 'SparseToDense';\nexport type SparseToDenseInputs =\n Pick;\nexport interface SparseToDenseAttrs {\n outputShape: number[];\n}\n\nexport const SquaredDifference = 'SquaredDifference';\nexport type SquaredDifferenceInputs = BinaryInputs;\n\nexport const Square = 'Square';\nexport type SquareInputs = Pick;\n\nexport const StridedSlice = 'StridedSlice';\nexport type StridedSliceInputs = Pick;\nexport interface StridedSliceAttrs {\n begin: number[];\n end: number[];\n strides: number[];\n beginMask: number;\n endMask: number;\n ellipsisMask: number;\n newAxisMask: number;\n shrinkAxisMask: number;\n}\n\nexport const Sub = 'Sub';\nexport type SubInputs = BinaryInputs;\n\nexport const Tan = 'Tan';\nexport type TanInputs = UnaryInputs;\n\nexport const Tanh = 'Tanh';\nexport type TanhInputs = UnaryInputs;\n\nexport const Tile = 'Tile';\nexport type TileInputs = Pick;\nexport interface TileAttrs {\n reps: number[];\n}\n\nexport const TopK = 'TopK';\nexport type TopKInputs = Pick;\nexport interface TopKAttrs {\n k: number;\n sorted: boolean;\n}\n\nexport const Transform = 'Transform';\nexport type TransformInputs = Pick;\nexport interface TransformAttrs {\n interpolation: 'nearest'|'bilinear';\n fillMode: 'constant'|'reflect'|'wrap'|'nearest';\n fillValue: number;\n outputShape?: [number, number];\n}\n\nexport const Transpose = 'Transpose';\nexport type TransposeInputs = Pick;\nexport interface TransposeAttrs {\n perm: number[];\n}\n\nexport const Unique = 'Unique';\nexport type UniqueInputs = Pick;\nexport interface UniqueAttrs {\n axis: number;\n}\n\nexport type UnaryInputs = Pick;\n\nexport const Unpack = 'Unpack';\nexport type UnpackInputs = Pick;\nexport interface UnpackAttrs {\n axis: number;\n}\n\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport type UnsortedSegmentSumInputs =\n Pick;\nexport interface UnsortedSegmentSumAttrs {\n numSegments: number;\n}\n\nexport const ZerosLike = 'ZerosLike';\nexport type ZerosLikeInputs = UnaryInputs;\n\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport type StepInputs = UnaryInputs;\nexport interface StepAttrs {\n alpha: number;\n}\n\nexport const FromPixels = 'FromPixels';\nexport interface FromPixelsInputs {\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap;\n}\nexport interface FromPixelsAttrs {\n numChannels: number;\n}\n\nexport const RotateWithOffset = 'RotateWithOffset';\nexport type RotateWithOffsetInputs = Pick;\nexport interface RotateWithOffsetAttrs {\n radians: number;\n fillValue: number|[number, number, number];\n center: number|[number, number];\n}\n\nexport const _FusedMatMul = '_FusedMatMul';\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulInputs extends NamedTensorInfoMap {\n a: TensorInfo;\n b: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedConv2D = 'FusedConv2D';\nexport interface FusedConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\nexport interface FusedDepthwiseConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedDepthwiseConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from './environment';\n\nimport {getGlobal} from './global_util';\nimport {NamedGradientMap} from './tape';\nimport {Tensor} from './tensor';\nimport {DataType, RecursiveArray} from './types';\n\nconst kernelRegistry =\n getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry =\n getGlobal('gradRegistry', () => new Map());\n\nexport type DataId = object;\n\ntype AttributeValue =\n number|number[]|boolean|boolean[]|string|string[]|NamedAttrMap;\n\n/** These are extra non-tensor/primitive params passed to kernel functions. */\nexport type Attribute = AttributeValue|RecursiveArray;\n\n/** Specifies the code to run when executing a kernel. */\nexport type KernelFunc = (params: {\n inputs: NamedTensorInfoMap,\n backend: {},\n attrs?: NamedAttrMap,\n}) => TensorInfo|TensorInfo[];\n\n/** The function to run when computing a gradient during backprop. */\nexport type GradFunc =\n (dy: Tensor|Tensor[], saved: Tensor[], attrs: NamedAttrMap) =>\n NamedGradientMap;\n\n/** Function that gets called after the backend initializes. */\nexport type KernelSetupFunc = (backend: {}) => void;\n/** Function that gets called right before the backend is disposed. */\nexport type KernelDisposeFunc = KernelSetupFunc;\n\n/** Config object for registering a kernel in the global registry. */\nexport interface KernelConfig {\n kernelName: string;\n backendName: string;\n kernelFunc: KernelFunc;\n setupFunc?: KernelSetupFunc;\n disposeFunc?: KernelDisposeFunc;\n}\n\n/** Config object for registering a gradient in the global registry. */\nexport interface GradConfig {\n kernelName: string;\n inputsToSave?: string[];\n // When saveAllInputs is true, all inputs will be saved. Only use this flag\n // if inputs is an array of Tensors.\n saveAllInputs?: boolean;\n outputsToSave?: boolean[];\n gradFunc: GradFunc;\n}\n\n/** Holds metadata for a given tensor. */\nexport interface TensorInfo {\n dataId: DataId;\n shape: number[];\n dtype: DataType;\n}\n\nexport interface NamedTensorInfoMap {\n [name: string]: TensorInfo;\n}\n\nexport interface NamedAttrMap {\n [name: string]: Attribute;\n}\n\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(\n kernelName: string, backendName: string): KernelConfig {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName: string): GradConfig {\n return gradRegistry.get(kernelName);\n}\n\nexport function getKernelsForBackend(backendName: string): KernelConfig[] {\n const it = kernelRegistry.entries();\n const result: KernelConfig[] = [];\n\n while (true) {\n const {done, value} = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend, ] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config: KernelConfig) {\n const {kernelName, backendName} = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n console.warn(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config: GradConfig) {\n const {kernelName} = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(\n kernelName: string, backendName: string): void {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName: string): void {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(\n `The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(\n registeredBackendName: string, newBackendName: string): void {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig =\n Object.assign({}, kernelConfig, {backendName: newBackendName});\n registerKernel(newKernelConfig);\n });\n}\n\nfunction makeKey(kernelName: string, backendName: string) {\n return `${backendName}_${kernelName}`;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\nimport {BackendValues, DataType, TensorLike, TypedArray} from './types';\nimport * as base from './util_base';\nexport * from './util_base';\n\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(\n value: DataType, dtype: DataType): BackendValues {\n if (dtype === 'string') {\n return encodeString(value);\n }\n\n return toTypedArray([value], dtype);\n}\n\nfunction noConversionNeeded(a: TensorLike, dtype: DataType): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function toTypedArray(a: TensorLike, dtype: DataType): TypedArray {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a as number[], dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a as TypedArray;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a as number[]);\n } else if (dtype === 'int32') {\n return new Int32Array(a as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array((a as number[]).length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round((a as number[])[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now(): number {\n return env().platform.now();\n}\n\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(\n path: string, requestInits?: RequestInit): Promise {\n return env().platform.fetch(path, requestInits);\n}\n\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s: string, encoding = 'utf-8'): Uint8Array {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes: Uint8Array, encoding = 'utf-8'): string {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer, BackendTimingInfo} from './backends/backend';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport {DataType, DataTypeMap, TypedArray} from './types';\nimport * as util from './util';\n\nexport type KernelProfile = {\n kernelName: string,\n outputs: Tensor[],\n inputs: NamedTensorMap,\n timeMs: Promise,\n extraInfo: Promise\n};\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(kernelName: string, inputs: NamedTensorMap, f: () => Tensor[]):\n KernelProfile {\n let outputs: Tensor[];\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer: Promise;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n } else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({kernelMs: util.now() - start});\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(\n timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n\n logKernelProfile(kernelProfile: KernelProfile): void {\n const {kernelName, outputs, timeMs, inputs, extraInfo} = kernelProfile;\n\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(\n kernelName, result, valueContainer[0], valueContainer[1], inputs,\n valueContainer[2]);\n });\n });\n }\n}\n\nexport function checkComputationForErrors(\n vals: DataTypeMap[D], dtype: D, kernelName: string): boolean {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray,\n timeMs: number|{error: string}, inputs: NamedTensorMap,\n extraInfo?: string) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${\n inputShapesDescription}\\t%c${extraInfo}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange',\n 'color: green', 'color: steelblue');\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n kernelName: string;\n outputs: Tensor[];\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dys: Tensor[]) => NamedGradientMap;\n saved?: Tensor[];\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[], tidy: (f: Function) => Tensor,\n add: (a: Tensor, b: Tensor) => Tensor) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dys: Tensor[] = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n } else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, isString, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples =\n dtype === 'complex64' ? createComplexTuples(vals) : vals;\n\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(\n padPerCol[j],\n valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(\n val: number|string|[number, number], pad: number, dtype: DataType) {\n let valStr: string;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n } else if (isString(val)) {\n valStr = `'${val}'`;\n } else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n } else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n\n return rightPad(valStr, pad);\n}\n\nfunction boolNumToString(v: number): string {\n return v === 0 ? 'false' : 'true';\n}\n\nfunction subTensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[], padPerCol: number[], isLast = true): string[] {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0] as number)];\n }\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n\n let firstVals = Array.from(\n vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice(\n (size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement,\n size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals: Array =\n dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n\nfunction createComplexTuples(vals: Array<{}>|\n TypedArray): Array<[number, number]> {\n const complexTuples: Array<[number, number]> = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]] as [number, number]);\n }\n return complexTuples;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {getGlobal} from './global_util';\nimport {tensorToString} from './tensor_format';\nimport {ArrayMap, BackendValues, DataType, DataTypeMap, DataValues, NumericDataType, Rank, ShapeMap, SingleValueMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides, toNestedArray} from './util';\n\nexport interface TensorData {\n dataId?: DataId;\n values?: DataTypeMap[D];\n}\n\n// This interface mimics KernelBackend (in backend.ts), which would create a\n// circular dependency if imported.\nexport interface Backend {}\n\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: DataTypeMap[D];\n\n constructor(shape: ShapeMap[R], public dtype: D, values?: DataTypeMap[D]) {\n this.shape = shape.slice() as ShapeMap[R];\n this.size = util.sizeFromShape(shape);\n\n if (values != null) {\n const n = values.length;\n util.assert(\n n === this.size,\n () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value: SingleValueMap[D], ...locs: number[]): void {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n\n const index = this.locToIndex(locs);\n this.values[index] = value as number;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs: number[]): SingleValueMap[D] {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index] as SingleValueMap[D];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor(): Tensor {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype) as\n Tensor;\n }\n}\n\nexport interface TensorTracker {\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: Backend): Tensor;\n makeVariable(\n initialValue: Tensor, trainable?: boolean, name?: string,\n dtype?: DataType): Variable;\n incRef(a: Tensor, backend: Backend): void;\n disposeTensor(t: Tensor): void;\n disposeVariable(v: Variable): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: D,\n values?: DataTypeMap[D]): TensorBuffer;\n print(x: T, verbose: boolean): void;\n clone(x: T): T;\n // TODO(yassogba) bring reshape back?\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn: (msg: string) => void = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn: (msg: string) => void) {\n deprecationWarningFn = fn;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n// Declare this namespace to make Tensor class augmentation work in google3.\nexport declare namespace Tensor {}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /** Whether this tensor has been globally kept. */\n kept = false;\n /** The id of the scope this tensor is being tracked in. */\n scopeId: number;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {\n this.shape = shape.slice() as ShapeMap[R];\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer(): Promise> {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype as D, vals);\n }\n\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype as D, this.dataSync());\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array(): Promise {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync(): ArrayMap[R] {\n return toNestedArray(\n this.shape, this.dataSync(), this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data(): Promise {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data as Uint8Array[];\n try {\n return bytes.map(b => util.decodeString(b)) as DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as Promise;\n }\n\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync(): DataTypeMap[D] {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return (data as Uint8Array[]).map(b => util.decodeString(b)) as\n DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as DataTypeMap[D];\n }\n\n /** Returns the underlying bytes of the tensor's data. */\n async bytes(): Promise {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data as Uint8Array[];\n } else {\n return new Uint8Array((data as TypedArray).buffer);\n }\n }\n\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n protected isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype);\n }\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype) as\n Variable;\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\n\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n\nexport interface NumericTensor extends Tensor {\n dtype: NumericDataType;\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\nexport interface StringTensor extends Tensor {\n dtype: 'string';\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n name: string;\n\n constructor(\n initialValue: Tensor, public trainable: boolean, name: string,\n tensorId: number) {\n super(\n initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.name = name;\n }\n\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n\n dispose(): void {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\n\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {TensorContainer, TensorContainerArray} from './tensor_types';\nimport {upcastType} from './types';\nimport {assert} from './util';\n\nexport function makeTypesMatch(a: T, b: T): [T, T] {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n return tensorList.some(x => x.id === tensor.id);\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @docalias number[] */\nexport interface ArrayMap {\n R0: number;\n R1: number[];\n R2: number[][];\n R3: number[][][];\n R4: number[][][][];\n R5: number[][][][][];\n R6: number[][][][][][];\n}\n\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n complex64: Float32Array;\n string: string[];\n}\n\nexport interface SingleValueMap {\n bool: boolean;\n int32: number;\n float32: number;\n complex64: number;\n string: string;\n}\n\n/** @docalias 'float32'|'int32'|'bool'|'complex64'|'string' */\nexport type DataType = keyof DataTypeMap;\nexport type NumericDataType = 'float32'|'int32'|'bool'|'complex64';\nexport type TypedArray = Float32Array|Int32Array|Uint8Array;\n/** Tensor data used in tensor creation and user-facing API. */\nexport type DataValues = DataTypeMap[DataType];\n/** The underlying tensor data that gets stored in a backend. */\nexport type BackendValues = Float32Array|Int32Array|Uint8Array|Uint8Array[];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool',\n 'complex64' = 'complex64'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastComplex64AndMap {\n 'float32' = 'complex64',\n 'int32' = 'complex64',\n 'bool' = 'complex64',\n 'complex64' = 'complex64'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType): DataType {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|string|RecursiveArray|\n RecursiveArray|RecursiveArray|Uint8Array[];\nexport type ScalarLike = number|boolean|string|Uint8Array;\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[]|string[]|Uint8Array[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][]|\n string[]|string[][]|Uint8Array[]|Uint8Array[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D = TypedArray|number[]|number[][][]|boolean[]|\n boolean[][][]|string[]|string[][][]|Uint8Array[]|Uint8Array[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D = TypedArray|number[]|number[][][][]|boolean[]|\n boolean[][][][]|string[]|string[][][][]|Uint8Array[]|Uint8Array[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][]|string[]|\n string[][][][][]|Uint8Array[]|Uint8Array[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][]|\n string[]|string[][][][][][]|Uint8Array[]|Uint8Array[][][][][];\n\n/** Type for representing image data in Uint8Array type. */\nexport interface PixelData {\n width: number;\n height: number;\n data: Uint8Array;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, DataMover, KernelBackend} from './backends/backend';\nimport {Environment, setEnvironmentGlobal} from './environment';\nimport {getGlobalNamespace} from './global_util';\nimport {Add, Cast, Identity} from './kernel_names';\nimport {getGradient, getKernel, getKernelsForBackend, GradFunc, NamedAttrMap, TensorInfo} from './kernel_registry';\nimport {KernelProfile, Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, TapeNode} from './tape';\nimport {DataId, setTensorTracker, Tensor, TensorTracker, Variable} from './tensor';\nimport {GradSaveFunc, NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\nimport {BackendValues, DataType, DataValues} from './types';\nimport * as util from './util';\nimport {bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backward pass.\n */\nexport type ForwardFunc = (backend: KernelBackend, save?: GradSaveFunc) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,..., save?: Function) => {\n * value: Tensor,\n * gradFunc: (dy: Tensor, saved?: NamedTensorMap) => Tensor | Tensor[]\n * }\n */\nexport type CustomGradientFunc =\n (...inputs: Array) => {\n value: T;\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[];\n };\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean; reasons: string[];\n};\n\ntype KernelInfo = {\n name: string; bytesAdded: number; totalBytesSnapshot: number;\n tensorsAdded: number;\n totalTensorsSnapshot: number;\n inputShapes: number[][];\n outputShapes: number[][];\n kernelTimeMs: number | {error: string} | Promise;\n extraInfo: string | Promise;\n};\n\nexport type ProfileInfo = {\n newBytes: number; newTensors: number; peakBytes: number;\n kernels: KernelInfo[];\n result: TensorContainer;\n kernelNames: string[];\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n id: number;\n}\n\ninterface RegisteredKernelInvocation {\n kernelName: string;\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\ninterface CustomGradKernelInvocation {\n forwardFunc: ForwardFunc;\n backwardsFunc: (dy: T, saved: Tensor[]) => {\n [P in keyof I]: () => I[P]\n };\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\nfunction isRegisteredKernelInvocation(\n kernelInvocation: RegisteredKernelInvocation|\n CustomGradKernelInvocation):\n kernelInvocation is RegisteredKernelInvocation {\n return (kernelInvocation as RegisteredKernelInvocation).kernelName != null;\n}\n\nclass EngineState {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n nextTapeNodeId = 0;\n numBytes = 0;\n numTensors = 0;\n numStringTensors = 0;\n numDataBuffers = 0;\n\n activeTape: TapeNode[];\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n kernelDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n activeScope: ScopeState;\n scopeStack: ScopeState[] = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n numDataMovesStack: number[] = [];\n nextScopeId = 0;\n\n tensorInfo = new WeakMap();\n\n profiling = false;\n activeProfile: ProfileInfo = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames():\n string[] {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\n\nexport class Engine implements TensorTracker, DataMover {\n state: EngineState;\n backendName: string;\n registry: {[id: string]: KernelBackend} = {};\n registryFactory: {\n [id: string]: {\n factory: () => KernelBackend | Promise,\n priority: number\n }\n } = {};\n\n private profiler: Profiler;\n private backendInstance: KernelBackend;\n private pendingBackendInit: Promise;\n private pendingBackendInitId = 0;\n\n constructor(public ENV: Environment) {\n this.state = new EngineState();\n }\n\n async ready(): Promise {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => {});\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n get backend(): KernelBackend {\n if (this.pendingBackendInit != null) {\n throw new Error(\n `Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const {name, asyncInit} = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(\n `The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n\n backendNames(): string[] {\n return Object.keys(this.registryFactory);\n }\n\n findBackend(backendName: string): KernelBackend {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const {asyncInit} = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n } else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n\n findBackendFactory(backendName: string):\n () => KernelBackend | Promise {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n\n registerBackend(\n backendName: string,\n factory: () => KernelBackend | Promise,\n priority = 1): boolean {\n if (backendName in this.registryFactory) {\n console.warn(\n `${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = {factory, priority};\n return true;\n }\n\n async setBackend(backendName: string): Promise {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const {success, asyncInit} = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n\n return true;\n }\n\n private setupRegisteredKernels(): void {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n\n private disposeRegisteredKernels(backendName: string): void {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n private initializeBackend(backendName: string):\n {success: boolean|Promise, asyncInit: boolean} {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(\n `Cannot initialize backend ${backendName}, no registration found.`);\n }\n\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success =\n backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n console.warn(\n `Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return {success, asyncInit: true};\n } else {\n this.registry[backendName] = backend as KernelBackend;\n return {success: true, asyncInit: false};\n }\n } catch (err) {\n console.warn(`Initialization of backend ${backendName} failed`);\n console.warn(err.stack || err.message);\n return {success: false, asyncInit: false};\n }\n }\n\n removeBackend(backendName: string): void {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n\n delete this.registryFactory[backendName];\n\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n\n private getSortedBackends(): string[] {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a: string, b: string) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n\n private initializeBackendsAndReturnBest():\n {name: string, asyncInit: boolean} {\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const {success, asyncInit} = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return {name: backendName, asyncInit};\n }\n }\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n moveData(backend: KernelBackend, dataId: DataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n\n tidy(nameOrFn: string|ScopeFn, fn?: ScopeFn):\n T {\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n private static nextTensorId = 0;\n private nextTensorId(): number {\n return Engine.nextTensorId++;\n }\n\n private static nextVariableId = 0;\n private nextVariableId(): number {\n return Engine.nextVariableId++;\n }\n\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n private clone(x: Tensor): Tensor {\n const y: Tensor = ENGINE.runKernel(Identity, {x} as {} as NamedTensorMap);\n const inputs = {x};\n const grad = (dy: Tensor) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {x: dy};\n const attrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, gradInputs as {} as NamedTensorMap,\n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs as {} as NamedAttrMap) as Tensor;\n }\n });\n const saved: Tensor[] = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(\n kernelName: string, inputs: NamedTensorMap, attrs?: NamedAttrMap): T {\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${\n this.backendName}'`);\n }\n return this.runKernelFunc({kernelName, inputs, attrs});\n }\n\n private shouldCheckForMemLeaks(): boolean {\n return this.ENV.getBool('IS_TEST');\n }\n\n private checkKernelForMemLeak(\n kernelName: string, numDataIdsBefore: number,\n outInfos: TensorInfo[]): void {\n const numDataIdsAfter = this.backend.numDataIds();\n\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves =\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked =\n numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(\n `Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n private runKernelFunc(\n kernelParams: RegisteredKernelInvocation|\n CustomGradKernelInvocation): T {\n let outputs: Tensor[];\n let saved: Tensor[] = [];\n const isTapeOn = this.isTapeOn();\n\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n\n let kernelFunc: () => Tensor[];\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n\n let out: TensorInfo|TensorInfo[];\n\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n\n if (isRegisteredKernelInvocation(kernelParams)) {\n const {kernelName, inputs, attrs} = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(\n kernel != null,\n () => `Cannot find registered kernel '${kernelName}' for backend '${\n this.backendName}'`);\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({inputs, attrs, backend: this.backend});\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n\n const outTensors = outInfos.map((outInfo: TensorInfo|Tensor) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if ((outInfo as Tensor).rank != null) {\n return outInfo as Tensor;\n }\n const {dataId, shape, dtype} = outInfo as TensorInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n\n // Save any required inputs and outputs.\n\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave =\n this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n } else {\n const {forwardFunc} = kernelParams;\n // Running a customGrad op.\n const saveFunc: GradSaveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]) as Tensor[];\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const {inputs, attrs} = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n\n let kernelProfile: KernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n } else {\n kernelProfile = this.profiler.profileKernel(\n kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n\n if (isTapeOn) {\n this.addTapeNode(\n kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(\n key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]) as T;\n }\n\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n private saveTensorsForBackwardMode(tensors: Tensor[]): Tensor[] {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n private getTensorsForGradient(\n kernelName: string, inputs: NamedTensorMap,\n outputs: Tensor[]): Tensor[]|null {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave: string[] = gradConfig.inputsToSave || [];\n const outputsToSave: boolean[] = gradConfig.outputsToSave || [];\n\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave: Tensor[];\n if (gradConfig.saveAllInputs) {\n util.assert(\n Array.isArray(inputs),\n () => 'saveAllInputs is true, expected inputs to be an array.');\n\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n } else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n\n const outputTensorsToSave: Tensor[] =\n outputs.filter((_, i) => outputsToSave[i]);\n\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values as BackendValues;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = (values as string[]).map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals as Uint8Array[]);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(\n dataId: DataId, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n\n makeVariable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n\n trackTensor(a: Tensor, backend: KernelBackend): void {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a: Tensor, backend: KernelBackend): void {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n\n removeDataId(dataId: DataId, backend: KernelBackend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a: Tensor): void {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n\n disposeVariable(v: Variable): void {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push(\n 'Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n\n async profile(query: () => (TensorContainer | Promise)):\n Promise {\n this.state.profiling = true;\n\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n\n this.state.profiling = false;\n\n this.state.activeProfile.peakBytes = Math.max(\n ...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n\n isTapeOn(): boolean {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n\n private addTapeNode(\n kernelName: string, inputs: NamedTensorMap, outputs: Tensor[],\n gradientsFunc: GradFunc, saved: Tensor[], attrs: NamedAttrMap): void {\n const tapeNode: TapeNode =\n {id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved};\n\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys: Tensor[]) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n result.kept = true;\n return result;\n }\n\n private startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n\n private endTape() {\n this.state.gradientDepth--;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string) {\n const scopeInfo: ScopeState = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet =\n new Set(tensorsToTrackInParent.map(t => t.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(\n xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(\n () => this.startTape(), () => this.endTape(),\n () => this.tidy('forward', f));\n\n util.assert(\n y instanceof Tensor,\n () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(\n accumulatedGradientMap, filteredTape,\n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f as ScopeFn),\n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return {value: y, grads};\n });\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Array) => T {\n util.assert(\n util.isFunction(f),\n () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n\n let res: {\n value: T,\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[],\n };\n const inputMap: NamedTensorMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n\n const forwardFunc: ForwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(\n res.value instanceof Tensor,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(res.gradFunc),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n\n const backwardsFunc = (dy: T, saved: Tensor[]) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads: Tensor[] = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(\n grads.length === inputs.length,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap: {[key: string]: () => Tensor} = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n\n readSync(dataId: DataId): BackendValues {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n\n return result;\n }\n\n get registeredVariables(): NamedVariableMap {\n return this.state.registeredVariables;\n }\n\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset(): void {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\n\nexport function getOrMakeEngine(): Engine {\n const ns = getGlobalNamespace() as {} as {_tfengine: Engine};\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\n\nexport const ENGINE = getOrMakeEngine();\n\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a: Tensor, b: Tensor): Tensor {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = {a, b};\n return ENGINE.runKernel(Add, inputs as {} as NamedTensorMap);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// tslint:disable-next-line:no-any\nfunction _isNavigatorDefined(): boolean {\n return typeof navigator !== 'undefined' && navigator != null;\n}\n\nexport function isMobile(nav?: Navigator): boolean {\n if (nav || _isNavigatorDefined()) {\n if (!nav) {\n nav = navigator;\n }\n if (nav.product === 'ReactNative') {\n return true;\n }\n\n // tslint:disable-next-line:no-any\n const a = nav.userAgent || nav.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n }\n return false;\n}\n\nexport function isBrowser(): boolean {\n return (typeof window !== 'undefined' && window.document != null) ||\n //@ts-ignore\n (typeof WorkerGlobalScope !== 'undefined');\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport './engine';\n\nimport * as device_util from './device_util';\nimport {env} from './environment';\n\nconst ENV = env();\n\n/**\n * This file contains environment-related flag registrations.\n */\n\n/** Whether to enable debug mode. */\nENV.registerFlag('DEBUG', () => false, debugValue => {\n if (debugValue) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n});\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag('IS_BROWSER', () => device_util.isBrowser());\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag(\n 'IS_NODE',\n () => (typeof process !== 'undefined') &&\n (typeof process.versions !== 'undefined') &&\n (typeof process.versions.node !== 'undefined'));\n\n/** Whether this browser is Chrome. */\nENV.registerFlag(\n 'IS_CHROME',\n () => typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor));\n\n/**\n * True when the environment is \"production\" where we disable safety checks\n * to gain performance.\n */\nENV.registerFlag('PROD', () => false);\n\n/**\n * Whether to do sanity checks when inferring a shape from user-provided\n * values, used when creating a new tensor.\n */\nENV.registerFlag(\n 'TENSORLIKE_CHECK_SHAPE_CONSISTENCY', () => ENV.getBool('DEBUG'));\n\n/** Whether deprecation warnings are enabled. */\nENV.registerFlag('DEPRECATION_WARNINGS_ENABLED', () => true);\n\n/** True if running unit tests. */\nENV.registerFlag('IS_TEST', () => false);\n\n/** Whether to check computation result for errors. */\nENV.registerFlag('CHECK_COMPUTATION_FOR_ERRORS', () => true);\n\n/** Whether the backend needs to wrap input to imageBitmap. */\nENV.registerFlag('WRAP_TO_IMAGEBITMAP', () => false);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from './engine';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {DataType, TensorLike} from './types';\nimport {assert, flatten, inferDtype, isTypedArray, toTypedArray} from './util';\n\nexport function inferShape(val: TensorLike, dtype?: DataType): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: TensorLike, shape: number[], indices: number[]) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nfunction assertDtype(\n expectedDtype: DataType|'numeric'|'string_or_numeric',\n actualDType: DataType, argName: string, functionName: string) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype as DataType;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : (x as {}).constructor.name;\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype as DataType) :\n flatten(x as string[], [], skipTypedArray) as string[];\n return ENGINE.makeTensor(values, inferredShape, inferredDtype) as T;\n}\n\nexport function convertToTensorArray(\n arg: Array, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) =>\n convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {isPromise} from '../util';\n\nexport const OP_SCOPE_SUFFIX = '__op';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n } catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Complex, ComplexInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real: T|TensorLike, imag: T|TensorLike): T {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch(\n $real.shape, $imag.shape,\n `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n\n const inputs: ComplexInputs = {real: $real, imag: $imag};\n return ENGINE.runKernel(Complex, inputs as {} as NamedTensorMap);\n}\n\nexport const complex = op({complex_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Tensor} from '../tensor';\nimport {TensorLike, TypedArray} from '../types';\nimport {DataType} from '../types';\nimport {assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray} from '../util';\n\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(\n values: TensorLike, shape: number[], inferredShape: number[],\n dtype?: DataType): Tensor {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error(\n 'values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(\n providedSize === inferredSize,\n () =>\n `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(\n inferredShape[i] === shape[i] || !flatDimsDontMatch,\n () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values as string[], [], true) as string[];\n return ENGINE.makeTensor(values as TypedArray, shape, dtype);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {inferShape} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {DataType, Rank, ShapeMap} from '../types';\n\nimport {makeTensor} from './tensor_ops_util';\n\n/**\n * Creates a `tf.Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`. If the values are strings,\n * they will be encoded as utf-8 and kept as `Uint8Array[]`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function tensor(\n values: TensorLike, shape?: ShapeMap[R], dtype?: DataType): Tensor {\n const inferredShape = inferShape(values, dtype);\n return makeTensor(values, shape, inferredShape, dtype) as Tensor;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'float16': 2,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n 'complex64': 8\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * Group to which the weight belongs.\n *\n * - 'optimizer': Weight from a stateful optimizer.\n */\nexport type WeightGroup = 'model'|'optimizer';\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool'|'string'|'complex64';\n\n /**\n * Type of the weight.\n *\n * Optional.\n *\n * The value 'optimizer' indicates the weight belongs to an optimizer\n * (i.e., used only during model training and not during inference).\n */\n group?: WeightGroup;\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale?: number, // The scaling constant to multiply by.\n min?: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8'|'float16' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n * @innamespace io\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * non-trainable ones.\n */\n trainableOnly?: boolean;\n\n /**\n * Whether the optimizer will be saved (if exists).\n *\n * Default: `false`.\n */\n includeOptimizer?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * TODO (cais,yassogba) consider removing GraphDef as GraphDefs now\n * come in a JSON format and none of our IOHandlers support a non json\n * format. We could conder replacing this with 'Binary' if we want to\n * allow future handlers to save to non json formats (though they will\n * probably want more information than 'Binary').\n * Type of the model topology\n *\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocol buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/** Model training configuration. */\nexport declare interface TrainingConfig {\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n // See\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tfjs-layers/blob/master/src/keras_format/training_config.ts\n /** Optimizer used for the model training. */\n optimizer_config: {};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Loss function(s) for the model's output(s). */\n loss: string|string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Metric function(s) for the model's output(s). */\n metrics?: string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n weighted_metrics?: string[];\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n sample_weight_mode?: string;\n\n loss_weights?: number[]|{[key: string]: number};\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `trainingConfig`, `weightSpecs` and `weightData` fields\n * of this interface are optional, in order to support topology- or weights-only\n * saving and loading.\n *\n * Note this interface is used internally in IOHandlers. For the file format\n * written to disk as `model.json`, see `ModelJSON`.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Serialized configuration for the model's training.\n */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * The on-disk format of the `model.json` file.\n *\n * TF.js 1.0 always populates the optional fields when writing model.json.\n * Prior versions did not provide those fields.\n */\nexport declare interface ModelJSON {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology: {};\n\n /** Model training configuration. */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weights manifest.\n *\n * The weights manifest consists of an ordered list of weight-manifest\n * groups. Each weight-manifest group consists of a number of weight values\n * stored in a number of paths. See the documentation of\n * `WeightsManifestConfig` for more details.\n */\n weightsManifest: WeightsManifestConfig;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n\n/**\n * Callback for the progress of a long-running action such as an HTTP\n * request for a large binary object.\n *\n * `fraction` should be a number in the [0, 1] interval, indicating how\n * much of the action has completed.\n */\nexport type OnProgressCallback = (fraction: number) => void;\n\n/** @innamespace io */\nexport interface LoadOptions {\n /**\n * RequestInit (options) for HTTP requests.\n *\n * For detailed information on the supported fields, see\n * [https://developer.mozilla.org/en-US/docs/Web/API/Request/Request](\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)\n */\n requestInit?: RequestInit;\n\n /**\n * Progress callback.\n */\n onProgress?: OnProgressCallback;\n\n /**\n * A function used to override the `window.fetch` function.\n */\n fetchFunc?: Function;\n\n /**\n * Strict loading model: whether extraneous weights or missing\n * weights should trigger an `Error`.\n *\n * If `true`, require that the provided weights exactly match those\n * required by the layers. `false` means that both extra weights\n * and missing weights will be silently ignored.\n *\n * Default: `true`.\n */\n strict?: boolean;\n\n /**\n * Path prefix for weight files, by default this is calculated from the\n * path of the model JSON file.\n *\n * For instance, if the path to the model JSON file is\n * `http://localhost/foo/model.json`, then the default path prefix will be\n * `http://localhost/foo/`. If a weight file has the path value\n * `group1-shard1of2` in the weight manifest, then the weight file will be\n * loaded from `http://localhost/foo/group1-shard1of2` by default. However,\n * if you provide a `weightPathPrefix` value of\n * `http://localhost/foo/alt-weights`, then the weight file will be loaded\n * from the path `http://localhost/foo/alt-weights/group1-shard1of2` instead.\n */\n weightPathPrefix?: string;\n\n /**\n * Whether the module or model is to be loaded from TF Hub.\n *\n * Setting this to `true` allows passing a TF-Hub module URL, omitting the\n * standard model file name and the query parameters.\n *\n * Default: `false`.\n */\n fromTFHub?: boolean;\n\n /**\n * An async function to convert weight file name to URL. The weight file\n * names are stored in model.json's weightsManifest.paths field. By default we\n * consider weight files are colocated with the model.json file. For example:\n * model.json URL: https://www.google.com/models/1/model.json\n * group1-shard1of1.bin url:\n * https://www.google.com/models/1/group1-shard1of1.bin\n *\n * With this func you can convert the weight file name to any URL.\n */\n weightUrlConverter?: (weightFileName: string) => Promise;\n}\n\n/**\n * Additional options for Platform.fetch\n */\nexport interface RequestDetails {\n /**\n * Is this request for a binary file (as opposed to a json file)\n */\n isBinary?: boolean;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {complex} from '../ops/complex';\n\nimport {tensor} from '../ops/tensor';\nimport {NamedTensor, NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\n\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightGroup, WeightsManifestEntry} from './types';\n\n/** Number of bytes reserved for the length of the string. (32bit integer). */\nconst NUM_BYTES_STRING_LENGTH = 4;\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @param group Group to which the weights belong (optional).\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(\n tensors: NamedTensorMap|NamedTensor[], group?: WeightGroup):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n\n const names: string[] = Array.isArray(tensors) ?\n tensors.map(tensor => tensor.name) :\n Object.keys(tensors);\n\n for (let i = 0; i < names.length; ++i) {\n const name = names[i];\n const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name];\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool' &&\n t.dtype !== 'string' && t.dtype !== 'complex64') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n const spec: WeightsManifestEntry = {name, shape: t.shape, dtype: t.dtype};\n if (t.dtype === 'string') {\n const utf8bytes = new Promise(async resolve => {\n const vals = await t.bytes() as Uint8Array[];\n const totalNumBytes = vals.reduce((p, c) => p + c.length, 0) +\n NUM_BYTES_STRING_LENGTH * vals.length;\n const bytes = new Uint8Array(totalNumBytes);\n let offset = 0;\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n const bytesOfLength =\n new Uint8Array(new Uint32Array([val.length]).buffer);\n bytes.set(bytesOfLength, offset);\n offset += NUM_BYTES_STRING_LENGTH;\n bytes.set(val, offset);\n offset += val.length;\n }\n resolve(bytes);\n });\n dataPromises.push(utf8bytes);\n } else {\n dataPromises.push(t.data());\n }\n if (group != null) {\n spec.group = group;\n }\n specs.push(spec);\n }\n\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let float16Decode: (buffer: Uint16Array) => Float32Array | undefined;\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n const size = sizeFromShape(shape);\n let values: TypedArray|string[]|Uint8Array[];\n\n if ('quantization' in spec) {\n const quantization = spec.quantization;\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n if (!('min' in quantization && 'scale' in quantization)) {\n throw new Error(\n `Weight ${spec.name} with quantization ${quantization.dtype} ` +\n `doesn't have corresponding metadata min and scale.`);\n }\n } else if (quantization.dtype === 'float16') {\n if (dtype !== 'float32') {\n throw new Error(\n `Weight ${spec.name} is quantized with ${quantization.dtype} ` +\n `which only supports weights of type float32 not ${dtype}.`);\n }\n } else {\n throw new Error(\n `Weight ${spec.name} has unknown ` +\n `quantization dtype ${quantization.dtype}. ` +\n `Supported quantization dtypes are: ` +\n `'uint8', 'uint16', and 'float16'.`);\n }\n const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype];\n const byteBuffer =\n buffer.slice(offset, offset + size * quantizationSizeFactor);\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n values = new Float32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = v * quantization.scale + quantization.min;\n }\n } else if (quantization.dtype === 'float16') {\n if (float16Decode === undefined) {\n float16Decode = getFloat16Decoder();\n }\n values = float16Decode(quantizedArray as Uint16Array);\n } else {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type float32.`);\n }\n } else if (dtype === 'int32') {\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type int32.`);\n }\n values = new Int32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = Math.round(v * quantization.scale + quantization.min);\n }\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * quantizationSizeFactor;\n } else if (dtype === 'string') {\n const size = sizeFromShape(spec.shape);\n values = [];\n for (let i = 0; i < size; i++) {\n const byteLength = new Uint32Array(\n buffer.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0];\n offset += NUM_BYTES_STRING_LENGTH;\n const bytes = new Uint8Array(buffer.slice(offset, offset + byteLength));\n (values as Uint8Array[]).push(bytes);\n offset += byteLength;\n }\n } else {\n const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype];\n const byteBuffer = buffer.slice(offset, offset + size * dtypeFactor);\n\n if (dtype === 'float32') {\n values = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n values = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n values = new Uint8Array(byteBuffer);\n } else if (dtype === 'complex64') {\n values = new Float32Array(byteBuffer);\n const real = new Float32Array(values.length / 2);\n const image = new Float32Array(values.length / 2);\n for (let i = 0; i < real.length; i++) {\n real[i] = values[i * 2];\n image[i] = values[i * 2 + 1];\n }\n const realTensor = tensor(real, shape, 'float32');\n const imageTensor = tensor(image, shape, 'float32');\n out[name] = complex(realTensor, imageTensor);\n realTensor.dispose();\n imageTensor.dispose();\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * dtypeFactor;\n }\n if (dtype !== 'complex64') {\n out[name] = tensor(values, shape, dtype);\n }\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n const buf = new Uint8Array(buffer);\n let s = '';\n for (let i = 0, l = buf.length; i < l; i++) {\n s += String.fromCharCode(buf[i]);\n }\n return btoa(s);\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n if (buffers.length === 1) {\n return buffers[0];\n }\n\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n\n/**\n * Computes mantisa table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 2048 mantissa lookup values.\n */\nfunction computeFloat16MantisaTable(): Uint32Array {\n const convertMantissa = (i: number): number => {\n let m = i << 13;\n let e = 0;\n\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n\n return m | e;\n };\n\n const mantisaTable = new Uint32Array(2048);\n\n mantisaTable[0] = 0;\n for (let i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (let i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + ((i - 1024) << 13);\n }\n\n return mantisaTable;\n}\n\n/**\n * Computes exponent table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 64 exponent lookup values.\n */\nfunction computeFloat16ExponentTable(): Uint32Array {\n const exponentTable = new Uint32Array(64);\n\n exponentTable[0] = 0;\n exponentTable[31] = 0x47800000;\n exponentTable[32] = 0x80000000;\n exponentTable[63] = 0xc7800000;\n for (let i = 1; i < 31; i++) {\n exponentTable[i] = i << 23;\n }\n for (let i = 33; i < 63; i++) {\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\n }\n\n return exponentTable;\n}\n\n/**\n * Computes offset table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 6d offset values.\n */\nfunction computeFloat16OffsetTable(): Uint32Array {\n const offsetTable = new Uint32Array(64);\n\n for (let i = 0; i < 64; i++) {\n offsetTable[i] = 1024;\n }\n offsetTable[0] = offsetTable[32] = 0;\n\n return offsetTable;\n}\n\n/**\n * Retrieve a Float16 decoder which will decode a ByteArray of Float16 values\n * to a Float32Array.\n *\n * @returns Function (buffer: Uint16Array) => Float32Array which decodes\n * the Uint16Array of Float16 bytes to a Float32Array.\n */\nexport function getFloat16Decoder(): (buffer: Uint16Array) => Float32Array {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n\n return (quantizedArray: Uint16Array) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits =\n mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler, LoadOptions} from './types';\n\nexport type IORouter = (url: string|string[], loadOptions?: LoadOptions) =>\n IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string|string[]): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @param loadOptions Optional, custom load options.\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string|string[], loadOptions?: LoadOptions):\n IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load', loadOptions);\n }\n\n private static getHandlers(\n url: string|string[], handlerType: 'save'|'load',\n loadOptions?: LoadOptions): IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ?\n IORouterRegistry.getInstance().loadRouters :\n IORouterRegistry.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url, loadOptions);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n\nexport const registerSaveRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerSaveRouter(loudRouter);\nexport const registerLoadRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerLoadRouter(loudRouter);\nexport const getSaveHandlers = (url: string|string[]) =>\n IORouterRegistry.getSaveHandlers(url);\nexport const getLoadHandlers =\n (url: string|string[], loadOptions?: LoadOptions) =>\n IORouterRegistry.getLoadHandlers(url, loadOptions);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\n\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = typeof window === 'undefined' ? self : window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\nconst MODEL_METADATA_SUFFIX = 'model_metadata';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string): {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR),\n modelMetadata:\n [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\ndeclare type LocalStorageKeys = {\n info: string,\n topology: string,\n weightSpecs: string,\n weightData: string,\n modelMetadata: string\n};\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: LocalStorageKeys;\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n const result: ModelArtifacts = {\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy\n };\n if (modelArtifacts.signature != null) {\n result.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n result.modelInitializer = modelArtifacts.modelInitializer;\n }\n this.LS.setItem(this.keys.modelMetadata, JSON.stringify(result));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n this.LS.removeItem(this.keys.info);\n this.LS.removeItem(this.keys.topology);\n this.LS.removeItem(this.keys.weightSpecs);\n this.LS.removeItem(this.keys.weightData);\n this.LS.removeItem(this.keys.modelMetadata);\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load meta-data fields.\n const metadataString = this.LS.getItem(this.keys.modelMetadata);\n if (metadataString != null) {\n const metadata = JSON.parse(metadataString) as ModelArtifacts;\n out.format = metadata['format'];\n out.generatedBy = metadata['generatedBy'];\n out.convertedBy = metadata['convertedBy'];\n if (metadata['signature'] != null) {\n out.signature = metadata['signature'];\n }\n if (metadata['userDefinedMetadata'] != null) {\n out.userDefinedMetadata = metadata['userDefinedMetadata'];\n }\n if (metadata['modelInitializer'] != null) {\n out.modelInitializer = metadata['modelInitializer'];\n }\n }\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(\n env().getBool('IS_BROWSER'),\n () => 'Current environment is not a web browser');\n assert(\n typeof window === 'undefined' ||\n typeof window.localStorage !== 'undefined',\n () => 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, () => 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, () => 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n () => `A model store manager is already registered for scheme '${\n scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n () => `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n () => `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n () => `Copying failed because no save handler is found for destination ` +\n `URL ${destURL}.`);\n assert(\n saveHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\nimport {BrowserIndexedDB, BrowserIndexedDBManager} from '../io/indexed_db';\nimport {BrowserLocalStorage, BrowserLocalStorageManager} from '../io/local_storage';\nimport {ModelStoreManagerRegistry} from '../io/model_management';\n\nimport {Platform} from './platform';\n\nexport class PlatformBrowser implements Platform {\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n private textEncoder: TextEncoder;\n\n fetch(path: string, init?: RequestInit): Promise {\n return fetch(path, init);\n }\n\n now(): number {\n return performance.now();\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Browser's encoder only supports utf-8, but got ${encoding}`);\n }\n if (this.textEncoder == null) {\n this.textEncoder = new TextEncoder();\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n return new TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_BROWSER')) {\n env().setPlatform('browser', new PlatformBrowser());\n\n // Register LocalStorage IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n\n // Register IndexedDB IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from '../environment';\n\nimport {Platform} from './platform';\n\n// We are wrapping this within an object so it can be stubbed by Jasmine.\nexport const getNodeFetch = {\n // tslint:disable-next-line:no-require-imports\n importFetch: () => require('node-fetch')\n};\n\ntype FetchFn = (url: string, init?: RequestInit) => Promise;\nlet systemFetch: FetchFn;\n// These getters and setters are for testing so we don't export a mutable\n// variable.\nexport function resetSystemFetch() {\n systemFetch = null;\n}\nexport function setSystemFetch(fetchFn: FetchFn) {\n systemFetch = fetchFn;\n}\nexport function getSystemFetch(): FetchFn {\n return systemFetch;\n}\n\nexport class PlatformNode implements Platform {\n private textEncoder: TextEncoder;\n // tslint:disable-next-line:no-any\n util: any;\n\n constructor() {\n // tslint:disable-next-line:no-require-imports\n this.util = require('util');\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n this.textEncoder = new this.util.TextEncoder();\n }\n\n fetch(path: string, requestInits?: RequestInit): Promise {\n if (env().global.fetch != null) {\n return env().global.fetch(path, requestInits);\n }\n\n if (systemFetch == null) {\n systemFetch = getNodeFetch.importFetch();\n }\n return systemFetch(path, requestInits);\n }\n\n now(): number {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Node built-in encoder only supports utf-8, but got ${encoding}`);\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n if (bytes.length === 0) {\n return '';\n }\n return new this.util.TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_NODE')) {\n env().setPlatform('node', new PlatformNode());\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {TensorBuffer} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap} from '../types';\nimport * as util from '../util';\n\n/**\n * Creates an empty `tf.TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in CPU as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `tf.Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function buffer(\n shape: ShapeMap[R], dtype: D = 'float32' as D,\n values?: DataTypeMap[D]): TensorBuffer {\n dtype = dtype || 'float32' as D;\n util.assertNonNegativeIntegerDimensions(shape);\n return new TensorBuffer(shape, dtype, values);\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Cast, CastAttrs, CastInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {DataType, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n\n const inputs: CastInputs = {x: $x};\n const attrs: CastAttrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const cast = op({cast_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Identity, IdentityInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs: IdentityInputs = {x: $x};\n\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs as {} as NamedTensorMap);\n}\n\nexport const clone = op({clone_});\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\n\n/**\n * Prints information about the `tf.Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Required side effectful code for tfjs-core\n\n// Set up Engine and ENV\nimport {getOrMakeEngine} from './engine';\ngetOrMakeEngine();\n\n// Register backend-agnostic flags.\nimport './flags';\n// Register platforms\nimport './platforms/platform_browser';\nimport './platforms/platform_node';\n\n// Set up OpHandler\nimport {buffer} from './ops/buffer';\nimport {cast} from './ops/cast';\nimport {clone} from './ops/clone';\nimport {print} from './ops/print';\nimport {OpHandler, setOpHandler} from './tensor';\nconst opHandler: OpHandler = {\n buffer,\n cast,\n clone,\n print\n};\nsetOpHandler(opHandler);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest, http, isHTTPScheme} from './http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {getLoadHandlers, getSaveHandlers, registerLoadRouter, registerSaveRouter} from './router_registry';\nimport {IOHandler, LoadHandler, LoadOptions, ModelArtifacts, ModelArtifactsInfo, ModelJSON, ModelStoreManager, OnProgressCallback, RequestDetails, SaveConfig, SaveHandler, SaveResult, WeightGroup, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights, weightsLoaderFactory} from './weights_loader';\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n http,\n IOHandler,\n isHTTPScheme,\n LoadHandler,\n LoadOptions,\n loadWeights,\n ModelArtifacts,\n ModelArtifactsInfo,\n ModelJSON,\n ModelStoreManager,\n OnProgressCallback,\n registerLoadRouter,\n registerSaveRouter,\n RequestDetails,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightGroup,\n weightsLoaderFactory,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelJSON, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nfunction defer(f: () => T): Promise {\n return new Promise(resolve => setTimeout(resolve)).then(f);\n}\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'browserDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (typeof (document) === 'undefined') {\n throw new Error(\n 'Browser downloads are not supported in ' +\n 'this environment since `document` is not present');\n }\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserDownloads.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by evoking a click event on the download anchors.\n // When multiple downloads are started synchronously, Firefox will only\n // save the last one.\n await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click')));\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n await defer(\n () => weightDataAnchor.dispatchEvent(new MouseEvent('click')));\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result) as ModelJSON;\n const modelTopology = modelJSON.modelTopology;\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest = modelJSON.weightsManifest;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n const result: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n format: modelJSON.format,\n generatedBy: modelJSON.generatedBy,\n convertedBy: modelJSON.convertedBy\n };\n if (modelJSON.signature != null) {\n result.signature = modelJSON.signature;\n }\n if (modelJSON.userDefinedMetadata != null) {\n result.userDefinedMetadata = modelJSON.userDefinedMetadata;\n }\n if (modelJSON.modelInitializer != null) {\n result.modelInitializer = modelJSON.modelInitializer;\n }\n resolve(result);\n }\n };\n weightFileReader.onerror = error =>\n reject(`Failed to weights data from file of path '${path}'.`);\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = error => reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel');\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `BrowserDownloads` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tf.loadLayersModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {assert} from '../util';\n\nimport {OnProgressCallback} from './types';\n\n/**\n * Monitor Promise.all progress, fire onProgress callback function.\n *\n * @param promises Promise list going to be monitored\n * @param onProgress Callback function. Fired when a promise resolved.\n * @param startFraction Optional fraction start. Default to 0.\n * @param endFraction Optional fraction end. Default to 1.\n */\nexport function monitorPromisesProgress(\n promises: Array>, onProgress: OnProgressCallback,\n startFraction?: number, endFraction?: number) {\n checkPromises(promises);\n startFraction = startFraction == null ? 0 : startFraction;\n endFraction = endFraction == null ? 1 : endFraction;\n checkFraction(startFraction, endFraction);\n let resolvedPromise = 0;\n\n const registerMonitor = (promise: Promise<{}>) => {\n promise.then(value => {\n const fraction = startFraction +\n ++resolvedPromise / promises.length * (endFraction - startFraction);\n // pass fraction as parameter to callback function.\n onProgress(fraction);\n return value;\n });\n return promise;\n };\n\n function checkPromises(promises: Array>): void {\n assert(\n promises != null && Array.isArray(promises) && promises.length > 0,\n () => 'promises must be a none empty array');\n }\n\n function checkFraction(startFraction: number, endFraction: number): void {\n assert(\n startFraction >= 0 && startFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got startFraction ${startFraction}`);\n assert(\n endFraction >= 0 && endFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got endFraction ${endFraction}`);\n assert(\n endFraction >= startFraction,\n () => `startFraction must be no more than endFraction, but ` +\n `got startFraction ${startFraction} and endFraction ` +\n `${endFraction}`);\n }\n\n return Promise.all(promises.map(registerMonitor));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from '../environment';\n\nimport {NamedTensorMap} from '../tensor_types';\nimport * as util from '../util';\nimport {decodeWeights} from './io_utils';\nimport {monitorPromisesProgress} from './progress';\nimport {DTYPE_VALUE_SIZE_MAP, LoadOptions, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @param fetchFunc Optional overriding value for the `window.fetch` function.\n * @param onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], loadOptions?: LoadOptions): Promise {\n if (loadOptions == null) {\n loadOptions = {};\n }\n\n const fetchFunc = loadOptions.fetchFunc == null ? env().platform.fetch :\n loadOptions.fetchFunc;\n\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(\n fetchURL =>\n fetchFunc(fetchURL, loadOptions.requestInit, {isBinary: true}));\n\n const fetchStartFraction = 0;\n const fetchEndFraction = 0.5;\n\n const responses = loadOptions.onProgress == null ?\n await Promise.all(requests) :\n await monitorPromisesProgress(\n requests, loadOptions.onProgress, fetchStartFraction,\n fetchEndFraction);\n\n const bufferPromises = responses.map(response => response.arrayBuffer());\n\n const bufferStartFraction = 0.5;\n const bufferEndFraction = 1;\n\n const buffers = loadOptions.onProgress == null ?\n await Promise.all(bufferPromises) :\n await monitorPromisesProgress(\n bufferPromises, loadOptions.onProgress, bufferStartFraction,\n bufferEndFraction);\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestInit?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n const fetchWeights = (fetchUrls: string[]) =>\n loadWeightsAsArrayBuffer(fetchUrls, {requestInit});\n const loadWeights = weightsLoaderFactory(fetchWeights);\n\n return loadWeights(manifest, filePathPrefix, weightNames);\n}\n\n/**\n * Creates a function, which reads a weights manifest JSON configuration,\n * fetches the weight files using the specified function and returns them as\n * `Tensor`s.\n *\n * ```js\n * // example for creating a nodejs weight loader, which reads the weight files\n * // from disk using fs.readFileSync\n *\n * import * as fs from 'fs'\n *\n * const fetchWeightsFromDisk = (filePaths: string[]) =>\n * filePaths.map(filePath => fs.readFileSync(filePath).buffer)\n *\n * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk)\n *\n * const manifest = JSON.parse(\n * fs.readFileSync('./my_model-weights_manifest').toString()\n * )\n * const weightMap = await loadWeights(manifest, './')\n * ```\n * @param fetchWeightsFunction The function used for fetching the weight files.\n * @returns Weight loading function.\n */\nexport function weightsLoaderFactory(\n fetchWeightsFunction: (fetchUrls: string[]) => Promise):\n (manifest: WeightsManifestConfig, filePathPrefix?: string,\n weightNames?: string[]) => Promise {\n return async(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[]): Promise => {\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound =\n weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await fetchWeightsFunction(fetchUrls);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n const nameToTensorMap =\n decodeWeights(byteBuffer, [weightsEntry.manifestEntry]);\n for (const name in nameToTensorMap) {\n weightsTensorMap[name] = nameToTensorMap[name];\n }\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadOptions, ModelArtifacts, ModelJSON, OnProgressCallback, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nconst OCTET_STREAM_MIME_TYPE = 'application/octet-stream';\nconst JSON_TYPE = 'application/json';\nexport class HTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n private readonly fetch: Function;\n private readonly weightUrlConverter: (weightName: string) => Promise;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEME_REGEX = /^https?:\\/\\//;\n\n private readonly weightPathPrefix: string;\n private readonly onProgress: OnProgressCallback;\n\n constructor(path: string, loadOptions?: LoadOptions) {\n if (loadOptions == null) {\n loadOptions = {};\n }\n this.weightPathPrefix = loadOptions.weightPathPrefix;\n this.onProgress = loadOptions.onProgress;\n this.weightUrlConverter = loadOptions.weightUrlConverter;\n\n if (loadOptions.fetchFunc != null) {\n assert(\n typeof loadOptions.fetchFunc === 'function',\n () => 'Must pass a function that matches the signature of ' +\n '`fetch` (see ' +\n 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)');\n this.fetch = loadOptions.fetchFunc;\n } else {\n this.fetch = env().platform.fetch;\n }\n\n assert(\n path != null && path.length > 0,\n () => 'URL path for http must not be null, undefined or ' +\n 'empty.');\n\n if (Array.isArray(path)) {\n assert(\n path.length === 2,\n () => 'URL paths for http must have a length of 2, ' +\n `(actual length is ${path.length}).`);\n }\n this.path = path;\n\n if (loadOptions.requestInit != null &&\n loadOptions.requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = loadOptions.requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest: ModelJSON = {\n modelTopology: modelArtifacts.modelTopology,\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n weightsManifest\n };\n if (modelArtifacts.signature != null) {\n modelTopologyAndWeightManifest.signature = modelArtifacts.signature;\n }\n if (modelArtifacts.userDefinedMetadata != null) {\n modelTopologyAndWeightManifest.userDefinedMetadata =\n modelArtifacts.userDefinedMetadata;\n }\n if (modelArtifacts.modelInitializer != null) {\n modelTopologyAndWeightManifest.modelInitializer =\n modelArtifacts.modelInitializer;\n }\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: JSON_TYPE}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob([modelArtifacts.weightData], {type: OCTET_STREAM_MIME_TYPE}),\n 'model.weights.bin');\n }\n\n const response = await this.fetch(this.path, init);\n\n if (response.ok) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `tf.io.http` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await this.fetch(this.path, this.requestInit);\n\n if (!modelConfigRequest.ok) {\n throw new Error(\n `Request to ${this.path} failed with status code ` +\n `${modelConfigRequest.status}. Please verify this URL points to ` +\n `the model JSON of the model to load.`);\n }\n let modelConfig: ModelJSON;\n try {\n modelConfig = await modelConfigRequest.json();\n } catch (e) {\n let message = `Failed to parse model JSON of response from ${this.path}.`;\n // TODO(nsthorat): Remove this after some time when we're comfortable that\n // .pb files are mostly gone.\n if (this.path.endsWith('.pb')) {\n message += ' Your path contains a .pb file extension. ' +\n 'Support for .pb models have been removed in TensorFlow.js 1.0 ' +\n 'in favor of .json models. You can re-convert your Python ' +\n 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' +\n 'or you can convert your.pb models with the \\'pb2json\\'' +\n 'NPM script in the tensorflow/tfjs-converter repository.';\n } else {\n message += ' Please make sure the server is serving valid ' +\n 'JSON for this request.';\n }\n throw new Error(message);\n }\n const modelTopology = modelConfig.modelTopology;\n const weightsManifest = modelConfig.weightsManifest;\n const generatedBy = modelConfig.generatedBy;\n const convertedBy = modelConfig.convertedBy;\n const format = modelConfig.format;\n const signature = modelConfig.signature;\n const userDefinedMetadata = modelConfig.userDefinedMetadata;\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const results = await this.loadWeights(weightsManifest);\n [weightSpecs, weightData] = results;\n }\n\n const artifacts: ModelArtifacts = {\n modelTopology,\n weightSpecs,\n weightData,\n generatedBy,\n convertedBy,\n format\n };\n\n if (signature != null) {\n artifacts.signature = signature;\n }\n if (userDefinedMetadata != null) {\n artifacts.userDefinedMetadata = userDefinedMetadata;\n }\n\n const initializer = modelConfig.modelInitializer;\n if (initializer) {\n artifacts.modelInitializer = initializer;\n }\n\n return artifacts;\n }\n\n private async loadWeights(weightsManifest: WeightsManifestConfig):\n Promise<[WeightsManifestEntry[], ArrayBuffer]> {\n const weightPath = Array.isArray(this.path) ? this.path[1] : this.path;\n const [prefix, suffix] = parseUrl(weightPath);\n const pathPrefix = this.weightPathPrefix || prefix;\n\n const weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n const fetchURLs: string[] = [];\n const urlPromises: Array> = [];\n for (const weightsGroup of weightsManifest) {\n for (const path of weightsGroup.paths) {\n if (this.weightUrlConverter != null) {\n urlPromises.push(this.weightUrlConverter(path));\n } else {\n fetchURLs.push(pathPrefix + path + suffix);\n }\n }\n }\n\n if (this.weightUrlConverter) {\n fetchURLs.push(...await Promise.all(urlPromises));\n }\n\n const buffers = await loadWeightsAsArrayBuffer(fetchURLs, {\n requestInit: this.requestInit,\n fetchFunc: this.fetch,\n onProgress: this.onProgress\n });\n return [weightSpecs, concatenateArrayBuffers(buffers)];\n }\n}\n\n/**\n * Extract the prefix and suffix of the url, where the prefix is the path before\n * the last file, and suffix is the search params after the last file.\n * ```\n * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file'\n * [prefix, suffix] = parseUrl(url)\n * // prefix = 'http://tfhub.dev/model/1/'\n * // suffix = '?tfjs-format=file'\n * ```\n * @param url the model url to be parsed.\n */\nexport function parseUrl(url: string): [string, string] {\n const lastSlash = url.lastIndexOf('/');\n const lastSearchParam = url.lastIndexOf('?');\n const prefix = url.substring(0, lastSlash);\n const suffix =\n lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}\n\nexport function isHTTPScheme(url: string): boolean {\n return url.match(HTTPRequest.URL_SCHEME_REGEX) != null;\n}\n\nexport const httpRouter: IORouter =\n (url: string, loadOptions?: LoadOptions) => {\n if (typeof fetch === 'undefined' &&\n (loadOptions == null || loadOptions.fetchFunc == null)) {\n // `http` uses `fetch` or `node-fetch`, if one wants to use it in\n // an environment that is not the browser or node they have to setup a\n // global fetch polyfill.\n return null;\n } else {\n let isHTTP = true;\n if (Array.isArray(url)) {\n isHTTP = url.every(urlItem => isHTTPScheme(urlItem));\n } else {\n isHTTP = isHTTPScheme(url);\n }\n if (isHTTP) {\n return http(url, loadOptions);\n }\n }\n return null;\n };\nIORouterRegistry.registerSaveRouter(httpRouter);\nIORouterRegistry.registerLoadRouter(httpRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.http(\n * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following GitHub Gist\n * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864\n * implements a server based on [flask](https://github.com/pallets/flask) that\n * can receive the request. Upon receiving the model artifacts via the requst,\n * this particular server reconsistutes instances of [Keras\n * Models](https://keras.io/models/model/) in memory.\n *\n *\n * @param path A URL path to the model.\n * Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the\n * body will be set by TensorFlow.js. File blobs representing the model\n * topology (filename: 'model.json') and the weights of the model (filename:\n * 'model.weights.bin') will be appended to the body. If `requestInit` has a\n * `body`, an Error will be thrown.\n * @param loadOptions Optional configuration for the loading. It includes the\n * following fields:\n * - weightPathPrefix Optional, this specifies the path prefix for weight\n * files, by default this is calculated from the path param.\n * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js,\n * the `fetch` from node-fetch can be used here.\n * - onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns An instance of `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function http(path: string, loadOptions?: LoadOptions): IOHandler {\n return new HTTPRequest(path, loadOptions);\n}\n\n/**\n * Deprecated. Use `tf.io.http`.\n * @param path\n * @param loadOptions\n */\nexport function browserHTTPRequest(\n path: string, loadOptions?: LoadOptions): IOHandler {\n return http(path, loadOptions);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, TrainingConfig, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(private readonly modelArtifacts?: ModelArtifacts) {}\n\n async load(): Promise {\n return this.modelArtifacts;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler:\n (artifacts: ModelArtifacts) => Promise) {}\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadLayersModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelArtifacts a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n * @param trainingConfig Model training configuration. Optional.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelArtifacts: {}|ModelArtifacts, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer, trainingConfig?: TrainingConfig): IOHandler {\n if (arguments.length === 1) {\n const isModelArtifacts =\n (modelArtifacts as ModelArtifacts).modelTopology != null ||\n (modelArtifacts as ModelArtifacts).weightSpecs != null;\n if (isModelArtifacts) {\n return new PassthroughLoader(modelArtifacts as ModelArtifacts);\n } else {\n // Legacy support: with only modelTopology.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({modelTopology: modelArtifacts as {}});\n }\n } else {\n // Legacy support.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({\n modelTopology: modelArtifacts as {},\n weightSpecs,\n weightData,\n trainingConfig\n });\n }\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) =>\n Promise): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Exports under the tf.math.* namespace.\n */\n\nimport {confusionMatrix} from './ops/confusion_matrix';\n\nexport {confusionMatrix};\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {makeTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(\n a: Tensor|TensorLike, b: Tensor|TensorLike, transposeA = false,\n transposeB = false): T {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n\n const inputs: BatchMatMulInputs = {a: $a, b: $b};\n const attrs: BatchMatMulAttrs = {transposeA, transposeB};\n\n return ENGINE.runKernel(\n BatchMatMul, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const matMul = op({matMul_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {OneHot, OneHotAttrs, OneHotInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(\n indices: Tensor|TensorLike, depth: number, onValue = 1,\n offValue = 0): Tensor {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n\n const inputs: OneHotInputs = {indices: $indices};\n const attrs: OneHotAttrs = {depth, onValue, offValue};\n\n return ENGINE.runKernel(\n OneHot, inputs as unknown as NamedTensorMap,\n attrs as unknown as NamedAttrMap);\n}\n\nexport const oneHot = op({oneHot_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Transpose, TransposeAttrs, TransposeInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const inputs: TransposeInputs = {x: $x};\n const attrs: TransposeAttrs = {perm};\n\n return ENGINE.runKernel(\n Transpose, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const transpose = op({transpose_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {cast} from './cast';\nimport {matMul} from './mat_mul';\nimport {oneHot} from './one_hot';\nimport {op} from './operation';\nimport {transpose} from './transpose';\n\n/**\n * Computes the confusion matrix from true labels and predicted labels.\n *\n * ```js\n * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32');\n * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32');\n * const numClasses = 3;\n * const out = tf.math.confusionMatrix(labels, predictions, numClasses);\n * out.print();\n * // Expected output matrix:\n * // [[2, 0, 0],\n * // [0, 1, 1],\n * // [0, 0, 1]]\n * ```\n *\n * @param labels The target labels, assumed to be 0-based integers\n * for the classes. The shape is `[numExamples]`, where\n * `numExamples` is the number of examples included.\n * @param predictions The predicted classes, assumed to be\n * 0-based integers for the classes. Must have the same shape as `labels`.\n * @param numClasses Number of all classes, as an integer.\n * Its value must be larger than the largest element in `labels` and\n * `predictions`.\n * @returns The confusion matrix as a int32-type 2D tensor. The value at\n * row `r` and column `c` is the number of times examples of actual class\n * `r` were predicted as class `c`.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nexport function confusionMatrix_(\n labels: Tensor1D|TensorLike, predictions: Tensor1D|TensorLike,\n numClasses: number): Tensor2D {\n const $labels = convertToTensor(labels, 'labels', 'confusionMatrix');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'confusionMatrix');\n\n util.assert(\n numClasses == null || numClasses > 0 && Number.isInteger(numClasses),\n () => `If provided, numClasses must be a positive integer, ` +\n `but got ${numClasses}`);\n util.assert(\n $labels.rank === 1,\n () => `Expected the rank of labels to be 1, but got ${$labels.rank}`);\n util.assert(\n $predictions.rank === 1,\n () => `Expected the rank of predictions to be 1, ` +\n `but got ${$predictions.rank}`);\n util.assert(\n $labels.shape[0] === $predictions.shape[0],\n () => `Mismatch in the number of examples: ` +\n `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` +\n `Labels and predictions should have the same number of elements.`);\n util.assert(\n numClasses > 0 && Number.isInteger(numClasses),\n () => `numClasses is required to be a positive integer, but got ` +\n `${numClasses}`);\n // TODO(cais): In the future, if oneHot supports tensors inputs for\n // `numClasses`, `confusionMatrix` can make `numClasses` optional.\n\n const oneHotLabels = oneHot(cast($labels, 'int32'), numClasses) as Tensor2D;\n const oneHotPredictions =\n oneHot(cast($predictions, 'int32'), numClasses) as Tensor2D;\n const oneHotLabelsT: Tensor2D = transpose(oneHotLabels);\n const product: Tensor2D = matMul(oneHotLabelsT, oneHotPredictions);\n return cast(product, 'int32');\n}\n\nexport const confusionMatrix = op({confusionMatrix_});\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {env} from '../environment';\nimport {FromPixels, FromPixelsAttrs, FromPixelsInputs} from '../kernel_names';\nimport {getKernel, NamedAttrMap} from '../kernel_registry';\nimport {Tensor, Tensor2D, Tensor3D} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {PixelData, TensorLike} from '../types';\n\nimport {cast} from './cast';\nimport {op} from './operation';\nimport {tensor3d} from './tensor3d';\n\nlet fromPixels2DContext: CanvasRenderingContext2D;\n\n/**\n * Creates a `tf.Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.browser.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel. You can also pass in an image\n * object with following attributes:\n * `{data: Uint8Array; width: number; height: number}`\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n *\n * @returns A Tensor3D with the shape `[height, width, numChannels]`.\n *\n * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true}\n */\nfunction fromPixels_(\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap,\n numChannels = 3): Tensor3D {\n // Sanity checks.\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n if (pixels == null) {\n throw new Error('pixels passed to tf.browser.fromPixels() can not be null');\n }\n let isPixelData = false;\n let isImageData = false;\n let isVideo = false;\n let isImage = false;\n let isCanvasLike = false;\n let isImageBitmap = false;\n if ((pixels as PixelData).data instanceof Uint8Array) {\n isPixelData = true;\n } else if (\n typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) {\n isImageData = true;\n } else if (\n typeof (HTMLVideoElement) !== 'undefined' &&\n pixels instanceof HTMLVideoElement) {\n isVideo = true;\n } else if (\n typeof (HTMLImageElement) !== 'undefined' &&\n pixels instanceof HTMLImageElement) {\n isImage = true;\n // tslint:disable-next-line: no-any\n } else if ((pixels as any).getContext != null) {\n isCanvasLike = true;\n } else if (\n typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) {\n isImageBitmap = true;\n } else {\n throw new Error(\n 'pixels passed to tf.browser.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` +\n `in browser, or OffscreenCanvas, ImageData in webworker` +\n ` or {data: Uint32Array, width: number, height: number}, ` +\n `but was ${(pixels as {}).constructor.name}`);\n }\n if (isVideo) {\n const HAVE_CURRENT_DATA_READY_STATE = 2;\n if (isVideo &&\n (pixels as HTMLVideoElement).readyState <\n HAVE_CURRENT_DATA_READY_STATE) {\n throw new Error(\n 'The video element has not loaded data yet. Please wait for ' +\n '`loadeddata` event on the

models

-
models: { age: null | Object; blazepose: null | Object; efficientpose: null | Object; embedding: null | Object; emotion: null | Object; face: null | Object | MediaPipeFaceMesh; faceres: null | Object; gender: null | Object; handpose: null | HandPose; iris: null | Object; nanodet: null | Object; posenet: null | Object }
+
models: { age: null | Object; blazepose: null | Object; efficientpose: null | Object; embedding: null | Object; emotion: null | Object; face: null | [Object, Object, Object]; faceres: null | Object; gender: null | Object; handpose: null | [Object, Object]; iris: null | Object; nanodet: null | Object; posenet: null | Object }
@@ -472,7 +472,7 @@
emotion: null | Object
  • -
    face: null | Object | MediaPipeFaceMesh
    +
    face: null | [Object, Object, Object]
  • faceres: null | Object
    @@ -481,7 +481,7 @@
    gender: null | Object
  • -
    handpose: null | HandPose
    +
    handpose: null | [Object, Object]
  • iris: null | Object
    diff --git a/types/blazeface/blazeface.d.ts b/types/blazeface/blazeface.d.ts index f13293ef..d9051bac 100644 --- a/types/blazeface/blazeface.d.ts +++ b/types/blazeface/blazeface.d.ts @@ -1,4 +1,3 @@ -export declare const disposeBox: (box: any) => void; export declare class BlazeFaceModel { model: any; anchorsData: any; diff --git a/types/blazeface/box.d.ts b/types/blazeface/box.d.ts index 9b3def45..706de1cf 100644 --- a/types/blazeface/box.d.ts +++ b/types/blazeface/box.d.ts @@ -15,3 +15,14 @@ export declare function squarifyBox(box: any): { endPoint: any[]; landmarks: any; }; +export declare function calculateLandmarksBoundingBox(landmarks: any): { + startPoint: number[]; + endPoint: number[]; + landmarks: any; +}; +export declare const disposeBox: (t: any) => void; +export declare const createBox: (startEndTensor: any) => { + startEndTensor: any; + startPoint: any; + endPoint: any; +}; diff --git a/types/blazeface/facemesh.d.ts b/types/blazeface/facemesh.d.ts index 30b09639..5f74aa5d 100644 --- a/types/blazeface/facemesh.d.ts +++ b/types/blazeface/facemesh.d.ts @@ -1,19 +1,14 @@ -export declare class MediaPipeFaceMesh { - facePipeline: any; - config: any; - constructor(blazeFace: any, blazeMeshModel: any, irisModel: any, config: any); - estimateFaces(input: any, config: any): Promise<{ - confidence: any; - boxConfidence: any; - faceConfidence: any; - box: any; - mesh: any; - boxRaw: any; - meshRaw: any; - annotations: any; - image: any; - }[]>; -} -export declare function load(config: any): Promise; +export declare function predict(input: any, config: any): Promise<{ + confidence: any; + boxConfidence: any; + faceConfidence: any; + box: any; + mesh: any; + boxRaw: any; + meshRaw: any; + annotations: any; + image: any; +}[]>; +export declare function load(config: any): Promise<[Object, Object, Object]>; export declare const triangulation: number[]; export declare const uvmap: number[][]; diff --git a/types/blazeface/facepipeline.d.ts b/types/blazeface/facepipeline.d.ts index 075363ae..1b8adbd3 100644 --- a/types/blazeface/facepipeline.d.ts +++ b/types/blazeface/facepipeline.d.ts @@ -27,9 +27,4 @@ export declare class Pipeline { }; getAdjustedIrisCoords(rawCoords: any, irisCoords: any, direction: any): any; predict(input: any, config: any): Promise; - calculateLandmarksBoundingBox(landmarks: any): { - startPoint: number[]; - endPoint: number[]; - landmarks: any; - }; } diff --git a/types/blazeface/util.d.ts b/types/blazeface/util.d.ts index 51b62a3c..6a04540f 100644 --- a/types/blazeface/util.d.ts +++ b/types/blazeface/util.d.ts @@ -19,3 +19,4 @@ export declare function buildRotationMatrix(rotation: any, center: any): number[ export declare function invertTransformMatrix(matrix: any): any[][]; export declare function rotatePoint(homogeneousCoordinate: any, rotationMatrix: any): number[]; export declare function xyDistanceBetweenPoints(a: any, b: any): number; +export declare function generateAnchors(inputSize: any): [number, number][]; diff --git a/types/handpose/anchors.d.ts b/types/handpose/anchors.d.ts index 4c180cec..4f6b43be 100644 --- a/types/handpose/anchors.d.ts +++ b/types/handpose/anchors.d.ts @@ -1,6 +1,4 @@ export declare const anchors: { - w: number; - h: number; - x_center: number; - y_center: number; + x: number; + y: number; }[]; diff --git a/types/handpose/handdetector.d.ts b/types/handpose/handdetector.d.ts index 9c65ee20..8e93961c 100644 --- a/types/handpose/handdetector.d.ts +++ b/types/handpose/handdetector.d.ts @@ -5,7 +5,7 @@ export declare class HandDetector { inputSize: number; inputSizeTensor: any; doubleInputSizeTensor: any; - constructor(model: any, inputSize: any, anchorsAnnotated: any); + constructor(model: any); normalizeBoxes(boxes: any): any; normalizeLandmarks(rawPalmLandmarks: any, index: any): any; getBoxes(input: any, config: any): Promise<{ diff --git a/types/handpose/handpipeline.d.ts b/types/handpose/handpipeline.d.ts index dcf86c05..4fbfe526 100644 --- a/types/handpose/handpipeline.d.ts +++ b/types/handpose/handpipeline.d.ts @@ -5,7 +5,7 @@ export declare class HandPipeline { storedBoxes: any; skipped: number; detectedHands: number; - constructor(handDetector: any, landmarkDetector: any, inputSize: any); + constructor(handDetector: any, landmarkDetector: any); getBoxForPalmLandmarks(palmLandmarks: any, rotationMatrix: any): { startPoint: number[]; endPoint: any[]; diff --git a/types/handpose/handpose.d.ts b/types/handpose/handpose.d.ts index ffbdd1f5..a3e47dde 100644 --- a/types/handpose/handpose.d.ts +++ b/types/handpose/handpose.d.ts @@ -1,20 +1,8 @@ -export declare class HandPose { - handPipeline: any; - constructor(handPipeline: any); - static getAnnotations(): { - thumb: number[]; - indexFinger: number[]; - middleFinger: number[]; - ringFinger: number[]; - pinky: number[]; - palmBase: number[]; - }; - estimateHands(input: any, config: any): Promise<{ - confidence: number; - box: any; - boxRaw: any; - landmarks: any; - annotations: any; - }[]>; -} -export declare function load(config: any): Promise; +export declare function predict(input: any, config: any): Promise<{ + confidence: number; + box: any; + boxRaw: any; + landmarks: any; + annotations: any; +}[]>; +export declare function load(config: any): Promise<[Object, Object]>; diff --git a/types/human.d.ts b/types/human.d.ts index 3c6bcc12..5d3b8c9e 100644 --- a/types/human.d.ts +++ b/types/human.d.ts @@ -73,11 +73,11 @@ export declare class Human { }; /** Internal: Currently loaded models */ models: { - face: facemesh.MediaPipeFaceMesh | Model | null; + face: [Model, Model, Model] | null; posenet: Model | null; blazepose: Model | null; efficientpose: Model | null; - handpose: handpose.HandPose | null; + handpose: [Model, Model] | null; iris: Model | null; age: Model | null; gender: Model | null;